prashant
25th February 2008, 10:53
How to do debugging of AFS.??
what settings do we have to do.....???

thanks
Regards

mark_h
25th February 2008, 16:03
Debugging in what way? If you have source code then put that session in debug mode. Then debug the AFS code. This way you can watch what happens with each command of the AFS code. So no real settings to use so I am not sure I understand your question.

prashant
26th February 2008, 05:31
thanks for ur concern...
i no we can debugg by doin in debugg mode....but somwhere i hv red that by debugging afs through normal debugging mode you will not get the appropriate result sometimes....
so we got another method which include AFSLOG (log file) or somthing similar to that but i dont know it completly how to do it.....
actually i am facin a problem with (end.session).
i am ending my child session first and then my parent session...
but in result my session got hang...i dont no how to get over with it..
Is ther any other syntax to end my session?????

regards

mark_h
26th February 2008, 14:28
You set this -set AFSLOG=1 in the bwc on the command line. Typically what stops sessions from ending is "waiting" for something. So in this case what I would do is use my option dialogs, then start shell, then using ps I watch the processes. So when you end the child session does another session pop-up? Remember running a session with AFS code does not mean it always acts the same doing it manually - usually it does, but not always. Also you might want to check that no questions pop up when returning from the child session.

You might also want to post your code, someone might see something that is wrong.

prashant
27th February 2008, 05:46
i took your word as advice and again run my session looking for some pop up and messages...but unfortunately.no message appears..this is the code , kindly refers to it


stpapi.put.field( "tdsls4101m000", "tdsls040.orno", str$(96))
stpapi.put.field( "tdsls4101m000", "tdsls040.cuno","930")
stpapi.put.field( "tdsls4101m000", "tdsls040.cotp", "EDS")
stpapi.put.field( "tdsls4101m000", "tdsls040.odat", str$(currentdate))
stpapi.put.field( "tdsls4101m000", "tdsls040.prdt", str$(currentdate))
stpapi.put.field( "tdsls4101m000", "tdsls040.ddat", str$(currentdate))

ret_val = stpapi.insert( "tdsls4101m000", true, error.msg )

stpapi.get.field( "tdsls4101m000", "tdsls040.orno", str.orno)

stpapi.handle.subproc("tdsls4101m000", "tdsls4102s000", "add")
stpapi.zoom.option("tdsls4101m000", 1, "tdsls4102s000", error.msg)
stpapi.continue.process("tdsls4102s000", error.msg)

gen.so.line(str.orno,"23CSSX004",1.0,0.00,0.0,"010",date.num())


commit.transaction()

if isspace(error.msg) then
message("SO number %s generated " , str.orno)

else
message("%s",error.msg)

endif


stpapi.end.session("tdsls4102s000", error.msg)
stpapi.end.session("tdsls4101m000", error.msg)




function extern void gen.so.line(string p.orno(6) , domain tcitem p.item , domain tcqsl1 p.oqua, domain tcpric p.pric, domain tcdiam p.ldam, domain tccwar p.cwar, domain tcdate p.pddt)
{
string error(100) , x.pono(4)

error = ""

stpapi.put.field( "tdsls4102s000", "tdsls041.citt", "GEN")
stpapi.put.field( "tdsls4102s000", "tdsls041.item", p.item)
stpapi.put.field( "tdsls4102s000", "tdsls041.opol", str$(1))
if not(isspace(p.cwar)) then
stpapi.put.field( "tdsls4102s000", "tdsls041.cwar", p.cwar)
endif
if p.pddt > 0 then
stpapi.put.field( "tdsls4102s000", "tdsls041.ddta", str$(p.pddt))
endif
stpapi.put.field( "tdsls4102s000", "tdsls041.oqua", str$(p.oqua))
stpapi.put.field( "tdsls4102s000", "tdsls041.pric", str$(p.pric))
stpapi.put.field( "tdsls4102s000", "tdsls041.ldam", str$(p.ldam))
stpapi.put.field( "tdsls4102s000", "tdsls041.isss", str$(1))
stpapi.put.field( "tdsls4102s000", "tdsls041.lsel", str$(1))
stpapi.put.field( "tdsls4102s000", "tdsls041.sdsc", str$(1))
stpapi.put.field( "tdsls4102s000", "tdsls041.scom", str$(2))
stpapi.put.field( "tdsls4102s000", "tdsls041.odat", str$(date.num()))
stpapi.put.field( "tdsls4102s000", "tdsls041.ddat", str$(date.num()))
stpapi.put.field( "tdsls4102s000", "tdsls041.prdt", str$(date.num()))

ret_val = stpapi.insert( "tdsls4102s000", 1, error.msg )
}

mark_h
27th February 2008, 14:01
I am confused by this code:

stpapi.handle.subproc("tdsls4101m000", "tdsls4102s000", "add")
stpapi.zoom.option("tdsls4101m000", 1, "tdsls4102s000", error.msg)
stpapi.continue.process("tdsls4102s000", error.msg)
gen.so.line(str.orno,"23CSSX004",1.0,0.00,0.0,"010",date.num())
commit.transaction()

First and second line are okay. The stpapi.zoom should activate the 4102s000 session. At this point you should have control of the 4102s000 session. The continue should not be necessary. Next you update the 4102s000 session and that is okay. What is the commit transaction for?

My next question is that the only way to activate the 4102s000 session?

prashant
27th February 2008, 14:20
hey mark..
commit.transaction is not creating any trouble..with and without this my header and lines are created successfully.....but the problem is my session is hanging after bieng processed....how to handle this problem?

mark_h
27th February 2008, 15:11
Did some searching - see this post here (http://www.baanboard.com/baanboard/showthread.php?t=22949&highlight=tdsls4102s000). Seems others have had this problem - at this point I recommend contacting support. A new session object or new stpapi libraries might fix the problem.

Thomasm
27th February 2008, 21:38
Sales order lines are not easy to work in afs via the standard sub session. I therefore recommend to access the lines via a main session instead. The session is not normally known by the users but still exists. I have a couple of functions sucessfully working with sales order lines, all using the main session.

For maintaining sales order lines the session would be tdsls4102m000.

Good luck,
/Thomas

prashant
28th February 2008, 05:53
thanks mark and thomas,
mark i verify for post and then checked mine....from my end it is all fine...i dont see any unsequentially written code and about the library you told me..i m not able to find any SOLUTION any where,please put some more light on the same..
and thomas, i didnt get what you are trying to let me understood.i am tackling my subsession through main session only and the sub session which i am handling is the same tdsls4102s000..please elaborate your post to make me understood easily...

Juergen
28th February 2008, 08:36
Hi Prashant,

what is your actual service pack?

Thomasm
28th February 2008, 09:00
What I mean is that you should not use the sub session at all but instead use the main session. So go to tdsls4101m000 to create the order head and don't control the sub session and don't 'zoom' to it. But instead go to tdsls4102m000 to insert the line. And if ou want to edit a sales order line go directly to the line via the main session tdsls4102m000, don't go via the order head.

Hope this clarifies,
/Thomas

prashant
28th February 2008, 09:10
my latest service pack is --(stb40c4_17)service pack 17 for tools
(spb40c4_17)service pack 17

prashant
28th February 2008, 09:17
What I mean is that you should not use the sub session at all but instead use the main session. So go to tdsls4101m000 to create the order head and don't control the sub session and don't 'zoom' to it. But instead go to tdsls4102m000 to insert the line. And if ou want to edit a sales order line go directly to the line via the main session tdsls4102m000, don't go via the order head.

Hope this clarifies,
/Thomas


thanks thomas,
i think this will work....but i have tried to do it in different way by capturing the process ID and killing them explicitly and it worksand found no error and no hanging procedure....but i dont know this is the right way to do....
i will definitely try out your way...

Juergen
28th February 2008, 09:39
Please have a look to solution 203966 " Maintain Sales Order Lines hangs in case of running from an external application".

Regards,
Juergen

rrocks23
16th March 2008, 15:28
can v debug ccdll library also ?? HOW??
its used for webbaan