yashwant
5th July 2007, 08:23
Dear all,

I am facing a problem when i m putting data in lines of the session tdsls4100m900.Sales order is created successfully.Can any body help me out.

Yashwant

george7a
5th July 2007, 10:05
Hi,

Please explain more about your problem. Are you getting any errors?
Also share your code in order to get more help.

- George

yashwant
5th July 2007, 11:51
string error(100)
long ret
string orno(10)
ret = stpapi.synchronize.dialog("tdsls4100m900", "Add", error)
stpapi.put.field("tdsls4100m900","tdsls400.ofbp",str$("BPG000001"))
stpapi.insert("tdsls4100m900",true,error)
stpapi.get.field("tdsls4100m900","tdsls400.orno",orno)
stpapi.end.session("tdsls4100m900")
stpapi.put.field("tdsls4100m900","tdsls400.orno",str$(orno))
stpapi.find("tdsls4100m900",error)
ret = stpapi.change.view("tdsls4100m900",error)
ret = stpapi.synchronize.dialog("tdsls4100m900", "Add", error)
stpapi.put.field("tdsls4100m900","tdsls401.pono",str$("10"))
stpapi.put.field("tdsls4100m900","tdsls401.item",str$("0-ITEM"))
stpapi.put.field("tdsls4100m900","tdsls401.qoor",str$("5"))
stpapi.put.field("tdsls4100m900","tdsls401.pric",str$("5"))
stpapi.insert("tdsls4100m900",true,error)
|stpapi.end.session("tdsls4101m000")
stpapi.end.session("tdsls4100m900")


Error is like "Change the Bisiness Partner"
here how can i handle one session multiple tables.

pconde
5th July 2007, 13:58
Hi,

MMT sessions cannot be used with AFS.

Regards
Philippe

yashwant
5th July 2007, 14:05
then how can i write AFS for this.

Yashwant

bigjack
5th July 2007, 14:59
HI,

AFAIK there is no way you can write afs on MMT sessions, in your case you can search for some dlls which can be used to create the lines.

This is a serious drawback in LN, perhaps some good baan guys who are reading this thread will do something for afs of MMT sessions ;)

Bye

NPRao
5th July 2007, 19:50
Refer to the latest Design Principles document:

Application Function Server
There are several ways to integrate the outside world with SSA BaanERP via Business Object Interfaces (BOI). For SSA BaanERP 5.0, SSA BaanERP 5.1, and SSA BaanERP 5.2 the preferred way to integrate from XML via a BOI DLL which calls a DAL or DLL. In Baan 4 the only method was to integrate XML with a session (4GL script) via a so called "Application Function Server" (AFS).
The Application Function Server (AFS) is used for enabling the business logic present in the Baan sessions for external applications. The AFS is used for calling Baan sessions and filling the input attributes with data (all in background).
The problem with integration with a session is:
it is slow
it sometimes does not work because user interaction is needed (choices, menu's etc pop up)
error handling is often not sufficient
However it is likely that the AFS will also be used in SSA BaanERP because of investments already made and the absence of business DLL's. Clear rules for the 4GL Script to support AFS were not in place for a very long time. This chapter, however, gives some principles to comply with the AFS in a 4GL script. It is unlikely that all 4GL Scripts support the AFS.
The following (simplified) diagram shows the role of the AFS in the BOI architecture. The diagram clearly illustrates that the BOI “talks” to the underlying Baan session by means of the AFS.
An important characteristic of the AFS is the fact that there is no user-interface component present. Session properties are set in background. As a consequence of this the handling of error messages needs special attention.
In 4GL scripts the predefined variable api.mode can be used to test if the session has been started by the AFS. When different behavior is needed for sessions running in API-mode and sessions with a normal user-interface, this variable can be used.

Instead of trying to do the old way in new versions, you have to learn doing things the new/preferred ways introduced by the vendor. Some options do work across versions for forward & backward compatibility, but when the vendor declares an option as 'depreciated' it is better to find a good sustainable solution for long term maintenance.

Evert has suggested the new way using DAL2 for your other thread - Purchase order Upload SSa LN6.1 (http://www.baanboard.com/baanboard/showthread.php?t=25634&highlight=dal2)

yashwant
6th July 2007, 08:49
can any body help on this regards.

mark_h
8th July 2007, 00:48
can any body help on this regards.
In what regards have your questions not been answered? In LN6.1 you will need to use the DAL or DAL2 functions - which sounds easier than the AFS commands. Follow the link posted by NPR to see an example. If you still think you need to use AFS you will need to call the SSA support center.

kathuria
11th July 2007, 04:04
Hi ,
I am attaching code here which is I am using to create sales order in LN.


dal.new.object("tdsls400")
dal.set.field("tdsls400.ofbp", tdcus051.bpid)
dal.set.field("tdsls400.sotp",tdcus000.sont)
dal.set.field("tdsls400.orno",tdcus000.sons)
|dal.set.field("tdsls400.orno",tdcus000.sons)
dal.set.field("tdsls400.odat",tdcus051.date)
dal.set.field("tdsls400.ddat",tdcus051.pdat)
ret = dal.save.object("tdsls400")
m.orno = tdsls400.orno
order.date = tdsls400.odat
message("%s",tdsls400.orno)
if ret< 0 then
ret=dal.get.error.message(w.err.msg )
message("Error......!%s",w.err.msg)
endif
commit.transaction()
fill.SO.lines()

}
function fill.SO.lines()
{
dal.new.object("tdsls401")
dal.set.field("tdsls401.orno", tdsls400.orno)
dal.set.field("tdsls401.ofbp", tdcus051.bpid)
dal.set.field("tdsls401.item", " "&new.item)
dal.set.field("tdsls401.qoor", tdcus051.qoor)
dal.set.field("tdsls401.cuqs", "nos")
dal.set.field("tdsls401.pric", prev.pric)
dal.set.field("tdsls401.porg",tdgen.porg.manual)
dal.set.field("tdsls401.ddta", tdcus051.pdat)
dal.set.field("tdsls401.rdta", tdsls400.odat)
|dal.set.field("tdsls401.dldt", tdsls400.odat+25)
dal.set.field("tdsls401.stbp", tdcus051.bpid)
dal.set.field("tdsls401.disc", new.disc.perc)
ret = dal.save.object("tdsls401",db.return.error)
commit.transaction()

if ret>=0 then

else
ret=dal.get.error.message(w.err.msg )
endif
}



Regards,
Sanjay