kingsley143
4th April 2008, 07:22
For the session maintain sales order lines(tdsls4101m000) when i am tring to maintain using afs i am not able to use the line discounts afs-tdpcg0200m200.
The error that i get is "command disabled" .
stpapi.handle.subproc( "tdsls4101m000", "tdpcg0200m200", "add" )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc), 1 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc1), 2 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc2), 3 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc3), 4 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc4), 5 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc5), 6 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc6), 7 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc7), 8 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc8), 9 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc9), 10 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc10), 11 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 1 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 2 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 3 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 4 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 5 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 6 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 7 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 8 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 9 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 10 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 11 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 1 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 2 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 3 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 4 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 5 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 6 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 7 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 8 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 9 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 10 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 11 )
stpapi.update( "tdpcg0200m200", 1, error )
stpapi.save( "tdpcg0200m200", error )
stpapi.end.session( "tdpcg0200m200" , error )
george7a
4th April 2008, 08:01
Hi,
Two advices:
1) Post your code. The others might help you more when you do.
2) Search this forum (AFS Forum) for the session tdsls4101m000.
I hope it helps,
- George
kingsley143
4th April 2008, 10:55
I have added the code in the inital post.
One more thing ,Can i use dal for updating the values of discount.
For ex: dal.start.business.method ()
Can this function be used to call the external function .
If yes ,how do i use it.
pconde
4th April 2008, 11:55
Hi,
if you want to update an existing record you must first retrieve the record via stpapi.find
process should be
fill key fields with stpapi.put.field
find via stpapi.find ==> test if find successful
fill fields via stapi.put.field
save via stpapi.update/stpapi.save
if you want to insert a new record then
fill fields with stpapi.put.field
insert record via stpapi.insert
regards
Philippe
kingsley143
4th April 2008, 14:02
Thanks for ur reply but i am creating a sales order line and then before ending the session(tdsls4101m000) i am calling the afs of tdpcg0200m200.
And the dll generated for the session tdpcg0200m200 does not create the function stpapi.insert() . And for finding a record i need to put in the search parameters but the search parameters ie; Item code or order number ,Pos. no are not getting generated as dll functions.
mark_h
4th April 2008, 14:18
I see this in the code:
stpapi.handle.subproc( "tdsls4101m000", "tdpcg0200m200", "add" )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc), 1 )
What I do not see is something to activate the tdpcg0200m200 program. Yes the first put.field would activate it, but there is no control over it from tdsls4101m000. So how
do you activate the session from tdsls4101m000? Is it a menu option? Does it happen on a save or update? So when inserting these discounts manually how do you activate the tdpcg0200m200 program?
Last, but not least, just because the stpcreatdll does not generate a command does not mean it is not available. The command may not be available, but the stpcreatdll is not perfect. I have had issues with it before.
kingsley143
5th April 2008, 06:12
There is a form command on the session tdsls4101m000 ie;Line discounds.
This commands logic is in the code of the session tdsls4101m000 .
In the above code i am calling the afs of tdpcg0200m200 after inserting a line using the afs of sales order lines and before
stpapi.end.session("tdsls4101m000", error)
Here i have tried calling the session tdpcg0200m200 from a different session but still i am getting the same error.
The code is as follows:
stpapi.put.field("tdsls4101m000", "tdsls401.orno",sales.order)
stpapi.put.field( "tdsls4101m000", "tdsls401.pono", str$(pono1) )
hh = stpapi.find( "tdsls4101m000" , error )
stpapi.mark( "tdsls4101m000" , error )
stpapi.get.field( "tdsls4101m000", "tdsls401.item", item.code )
stpapi.form.command( "tdsls4101m000", 5, "price.inquiry", error )
stpapi.form.command( "tdpcg0250m000", 5, "price.calculator", error )
stpapi.get.field( "tdpcg0200m100", "item.code", item.code )
stpapi.form.command( "tdpcg0200m100", 5, "exec.user.1", error )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc), 1 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc1), 2 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc2), 3 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc3), 4 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc4), 5 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc5), 6 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc6), 7 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc7), 8 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc8), 9 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc9), 10 )
stpapi.put.field( "tdpcg0200m200", "disc.percentage", str$(disc10), 11 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 1 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 2 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 3 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 4 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 5 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 6 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 7 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 8 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 9 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 10 )
stpapi.put.field( "tdpcg0200m200", "disc.code", "", 11 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 1 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 2 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 3 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 4 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 5 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 6 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 7 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 8 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 9 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 10 )
stpapi.put.field( "tdpcg0200m200", "disc.method", str$(1), 11 )
stpapi.insert( "tdpcg0200m200", 1, error )
stpapi.save( "tdpcg0200m200", error )
stpapi.end.session( "tdpcg0200m200" , error )
stpapi.end.session( "tdpcg0200m100" , error )
stpapi.end.session( "tdpcg0250m000" , error )
stpapi.end.session( "tdsls4101m000" , error )
mark_h
5th April 2008, 14:09
Which command actually gives the error "command disabled"? I am wondering if all you need is the save command.
kingsley143
7th April 2008, 06:12
I get command disabled on Save......
""stpapi.save( "tdpcg0200m200", error )""
I have tried using
continue.process() but nothing seems to work.
I have tried updating the record using dal but the logic for calculating discount on amount is not available on the table (tdsls401).
Can i some how call the internal function of the session tdsls4101m000,the function which is getting called from the form of the session tdsls4101m000 has to be declared as function extern name().Is there a way ?
pconde
7th April 2008, 09:05
Hi,
I think that the sub-session tdpcg0200m200 accept input and then for each fields starts the calculation: this is done in the sub-sections "when.field.changes". so the stpapi.insert and stpapi.save should not work: they can even not been defined on the form
continue .process is only valid for baanIV and not valid in LN.
this session is a case where the stpapi has problem to simulate the manual job.
stpapi.put.field help says
"Note that no field sections in the script are executed during the put.field call, so no validation is performed. These sections are called when all fields are processed for an insert or update call"
I'm not sure that the when.field.changes is activated via AFS.
Regards
Philippe
kingsley143
7th April 2008, 10:36
Thanks for ur reply.
But this does not solve the problem....????
pconde
7th April 2008, 13:19
Hi,
No this doesn't solve your problem but I know that some session cannot be handle via AFS
In ERP LN6.1 the support for AFS is now minimal because Infor ask using DAL and DAL2.
Maybe you should look at the different DLL present in package tdpcg: you can may be find therein a function that does the work (use bic_info6.x)
Regards
Philippe
kingsley143
8th April 2008, 06:27
I have tried using bic_info on the Ln server(windows2003) but i am getting an error that shared memory not attached.
What can be the reason?
pconde
8th April 2008, 11:28
Hi,
Windows is every time painful compared to Unix.:mad:
My 5 cent advice : environment problem
the user that you use must have the $BSE defined, the correct path ($BSE/bin) , and must be known in baan ==> he must have a valid package combination
Regards
Philippe