bahwesh.bharti
12th March 2007, 14:17
Hi..
we are facing problem while creating sales order in another company. The actual requirement is like say we are in company A and using some session we have to create sales order in company B. I had used AFS to create the sales order and switch.to.company() to switch between companies. But it is giving error that the "session is not available".
The same AFS is working fine while creating sales order in the same company (A).
Need input from u ppls. It's urgent.

Thanx.......
Bhawesh

george7a
12th March 2007, 14:20
Hi,

What does switch.to.company() return?

From the manual:
1 Success.
-1 Company not available.
-2 No permission to change to this company.
-3 Package combination does not correspond with new company number.
-4 First day of the week does not correspond to first day of the week of original company

- George

bahwesh.bharti
13th March 2007, 04:33
switch.to.company returns 1.

george7a
13th March 2007, 07:51
Hi,

In what command do yo get the error? Can you please post your code?

- George

bahwesh.bharti
13th March 2007, 12:52
switch.to.company() returns 1 that is it is successful but when i use stpapi.put.field("tdsls4101m000","tdsls040.orno",str$(b.orno))
and see the process i see this session (tdsls4101m000) is not opened. at
ret.val = stpapi.insert("tdsls4101m000",true,err.msg)
the err.msg is filled with "Session not available"

thieuf
14th March 2007, 08:45
Hello,

a possible way to handle this is starting in the company where you want to create the sales orders and getting the information from the purchasing company. It is easy to select data from another company using standard select statements on the tables in another company.
Get the information you need, put them in an array or textfile and start
reading the array or textfile and inserting the sales orders.

Another way is using standard EDI within Baan. The default setup from baan should enable you to make a quick and dirty setup.

Third way is inserting the salesorders as quotaions in baan (directly inserting them in the quotation tables) and then generating the salesorders form the quotations.

Hope this helps in any way.

best regards,

thieuf

bahwesh.bharti
15th March 2007, 05:14
Thanx alot !!! the problem was with our setup itself.. switch.to.company() is working perfectly fine with AFS.