justknowledge
20th March 2007, 05:53
Hi everybody,

I am creating sales order through AFS by calling tdsls4101m000 and related session,

However when i try to insert Sales order header localization it throws error "Extension to customer not present".

Eventhough i am fatching data through tdind019 for excise as well as sale tax and service tax applicable .

and then sending it to AFS .

Please look into my attached script and let me know if i am taking any wrong step .

Thanks in adv.

Regards

kysersoze12
20th March 2007, 09:02
I can't tell about the error man .But your script looks really wrong to me .How can one create localization record before creating sales order .Try creating localization record after creating the header i.e. after 4101.insert and 4101.save .If your localized session pops up from a field during insertion then you will have to specify handle.subprocess with kill option before 4101.insert using .
Give me screen shots of your 4101 and localization session with stepwise order creation along with localized data manually i.e. using gui directly .

justknowledge
21st March 2007, 06:55
Hi,

When i inserting item localization in sales order lines AFS throwing message "Extension to Sales Order header not exists".

I think at the time of inserting it checks sales order header table tdind013 but in afs i am opening sales order session and header localization session and closing as well.

but same prob is comming.

Can somebody help me in this regards ,i will be very thankful

mark_h
21st March 2007, 13:08
(1) This is the second post on the same topic you posted yesterday - lets stick to one thread from now on. I will close the other thread.
(2) Always search this forum for the session in question - see this thread (http://www.baanboard.com/baanboard/showthread.php?t=15329&highlight=tdslsl101s002). There are multiple threads on tdsls4101m000 and tdslsl101s002 where code has been posted that would help.

Anytime you have a problem with some AFS code I recommend searching this forum - several of us have already posted code that works for us. Just keep in mind that because of patch updates, portingsets, etc. what is posted may not work for you. This should give you a good starting point.

mark_h
21st March 2007, 13:10
I decided to just merge the threads.

justknowledge
22nd March 2007, 05:48
Hi mark,

Thanks for your valuable suggestion i'll adopt the same in future, however i have already search the forum for same problem and found zero satisfaction
my query is when you open session tdslsl102s002 through special zoom menu.
It opens "Maintain Extension to sales order lines" with all blank field and once you click on add.set button it carries the marked order no and position from session tdsls4105s000 and then we can maintain base date and all other fields

now if i maintain base date as back date and want calculation on back date then according to my AFS i am unable to pick order no and pono automatically through
stpapi.handle.subproc( "tdsls4105s000", "tdslsl102s002", "add")
stpapi.zoom.option ("tdsls4102s000",1,"tdslsl102s002",error.in.tdslsl102s002)

and i think becasue order no and position is comming blank on tdslsl102s002 AFS is throwing error "Extension to Sales Order header not exists."

Or in other words if sombody can suggest me how can i carry order no and position from tdsls4105s000 to tdslsl102s002

Thanks
Regards

justknowledge
22nd March 2007, 07:08
sorry for such a bold and big fonts

in other words if sombody can suggest me how can i carry order no and position from tdsls4105s000 to tdslsl102s002

Thanks
Regards

mark_h
22nd March 2007, 21:31
Bold does not bother me(and being a moderator I can make it go away if I want :) ) - what I see in several of the threads is something like this:

stpapi.put.field( "tdsls4101m000", "tdsls040.cotp", "S07")
stpapi.put.field( "tdsls4101m000", "tdsls040.cpay", cpay.f)
ret = stpapi.insert( "tdsls4101m000", 1, error )

if ret = 0 then
message(error)
message("Insert Fail in Header, Session tdsls4101m000")
return
endif

stpapi.get.field( "tdsls4101m000", "tdsls040.orno", value )
orno=lval(value)
display("orno")
tdsls040.orno = orno
stpapi.get.field( "tdsls4101m000", "tdsls040.cuno", tdsls040.cuno )
stpapi.get.field( "tdsls4101m000", "tdsls040.cotp", sls40.cotp)

stpapi.end.session("tdsls4101m000")

| Insert into Extension to Header
stpapi.put.field( "tdslsl101s002", "tdind013.exci", "2")
stpapi.put.field( "tdslsl101s002", "tdind013.svyn", "2")
stpapi.put.field( "tdslsl101s002", "tdind013.srtx", "2")
ret = stpapi.insert( "tdslsl101s002", 1, error )
if ret = 0 then
message(error)
message("Insert Fail in Header Extensions, Session tdslsl101s002")
return
endif

stpapi.end.session("tdslsl101s002")

They do an insert and an end on 4101 - with no handle on tdslsl101s002. Your code looks different and I do not know if that is the difference or not. We do not use these sessions so this is a shot. This code came from this post (http://www.baanboard.com/baanboard/showthread.php?t=15329&highlight=tdslsl101s002)(from SriksAdi). I noticed several others also ended the 4101 session also before calling the tdslsl101s002 session. Again there are no promises that this will work on your system - patches, service packs, etc. You can review the rest of the code in the post on how he handles the 4105s000 session.