jatin_sanghi
15th November 2005, 09:18
Dear All,

I 'am trying to upload PO in SSA erp6.1. I have been using session tdpur4100m000( multi- occ. display session) where i press the insert button to move to tdpur4100m900 ( single occ).
I'am using the stpapi.synchronize.dialog option and getting a return value of 1, but at the insert command it gives the error ' editable syn. dialog not started'..
I have gone through the baanboard regarding same error...but that didn't help.

Also there is a point in AFS doc. that for syn. dialog, insert command should be issued to the multi-occ. session while, put command should be issued to the single-occ session. But this also doen't help .

Plz, suggest what can be done in this case.Plz find the attached part of the script.

ret = stpapi.synchronize.dialog("tdpur4100m000", "add", error.msg)
if ret then
stpapi.put.field("tdpur4100m900", "tdpur400.otbp", "S"& tmp40.suno)
stpapi.put.field("tdpur4100m900", "tdpur400.cotp", "P01")
stpapi.put.field("tdpur4100m900", "tdpur400.orno", str$(10))
stpapi.put.field("tdpur4100m900", "tdpur400.cofc", "P01")
|stpapi.put.field("tdpur4100m900", "tdpur400.ddat.segment.1", string.set$("0", 8-len(trim$((str$(tmp40.ddat)))))& trim$(str$(tmp40.ddat)))
| stpapi.put.field("tdpur4100m900", "tdpur400.ddat.segment.2", "0")
| stpapi.put.field("tdpur4100m900", "tdpur400.ddtc.segment.1", string.set$("0", 8-len(trim$((str$(tmp40.ddtc)))))& trim$(str$(tmp40.ddtc)))
| stpapi.put.field("tdpur4100m900", "tdpur400.ddtc.segment.2", "0")

ret = stpapi.insert("tdpur4100m000", true, error.msg)
if not ret then
ret = stpapi.recover("tdpur4100m900", error.msg)
endif
endif
stpapi.get.field("tdpur4100m900", "tdpur400.orno", m.orno)
stpapi.end.session("tdpur4100m900", error.msg)
stpapi.end.session("tdpur4100m000", error.msg)

darpan
14th December 2005, 14:56
Dear Sir

pl'z check that wether your AFS Codes support that BaaN Version

and if all fine then pl'z clarify me the problem

Darpan

Evert-Jan Bosch
14th December 2005, 16:19
Why are you using AFS for purchase orders?

The most simple way to create PO is this (to my opinion):

function create.purchase.order(
domain tccom.bpid i.buy.from.bp,
domain tccotp i.order.type,
domain tcitem i.item,
domain tccwar i.warehouse,
domain tcqrd1 i.ordered.quantity,
domain tccuni i.order.unit)
{
long ret.val

db.retry.point()

|* Create PO Header
dal.new.object("tdpur400")
dal.set.field("tdpur400.otbp", i.buy.from.bp)
dal.set.field("tdpur400.cotp", i.order.type)
...
ret.val = dal.save.object("tdpur400")

|* Create PO Line
dal.new.object("tdpur401")
dal.set.field("tdpur401.orno", tdpur400.orno)
dal.set.field("tdpur401.item", i.item)
dal.set.field("tdpur401.qoor", i.ordered.quantity)
dal.set.field("tdpur401.cuqp", i.order.unit)
...
ret.val = dal.save.object("tdpur401")

commit.transaction()
}
Above example is may be too simple. Error handling is not in place. But that can be handled very easily.

Too my opinion AFS is only used to overcome the problem that user interface scripts contains lot of logic. However, since ERP LN 6.1, more and more logic is moved to the dals. Defaulting and disabling / enabling of fields is all part of DAL2. Purchase Orders is completely handled via DAL2. This is enough to generate and/or edit a purchase order.

The things that remain in the user interface are things that are really user interface related as for example: displaying form fields, import fields from other sessions, applying filters, handle zooming to sessions, handling form commands.

george7a
23rd January 2006, 16:16
Why do you think DAL is better than AFS?

Isn't AFS "safer" ?

- George

Evert-Jan Bosch
23rd January 2006, 16:36
When it is not needed anymore to use AFS, why still using it? That's the question.

When a dal is completely DAL2, AFS is not safer. Instead, in that situation an AFS is more complex to use, because you have to skip the user interactions, such as ask.enum, etc., that are (of course) still in the UI.

Holger R
23rd January 2006, 17:22
The session for the "insert" must be "...m900", not "...m000". May be, that ist the reason.

Holger

henkvdh
12th April 2007, 10:27
The sentence more and more functionality is moved to the dal have to be taken serious! It is very depending on the programmer if this is really the case, and for sure it is not yet trustable done!

_Ralph_
13th April 2007, 19:06
As you're on LN you can search for a dll wich creates an PO

tdpurdll1234 - Gernerate Purchase Order

Afs does not work on MMT Sessions

regards

ulrich.fuchs
22nd May 2007, 16:51
Try using the DAL. I don't know how it's with purchase, but in ERP LN 6.1 you can generate sales orders and sales order lines with less and safer code when you use the DAL instead of the AFS.

Uli

Evert-Jan Bosch
23rd May 2007, 11:00
You can use dal2 functions also for purchase orders!

kathuria
30th May 2007, 22:32
Hi,

AFS will not work with Multi Main Table Session. That's why we have to use DALconcept.

Regards,
Sanjay Kathuria

yashwant
6th July 2007, 12:30
can any body have any documents on DAL script.

yashwant

Evert-Jan Bosch
6th July 2007, 12:36
http://www.baanboard.com/programmers_manual_baanerp_help_functions_dal_overview

it's not the latest one.
DAL 2 functions are not (yet?) described.

kathuria
6th July 2007, 14:32
Hi,

All functions related to DAL & DAL2 are available in Use SSA ERP LN 6.1 Programming Guide.

Regards,
Sanjay

nileshsamsonite
4th December 2012, 12:08
Hi ,
Is there any solution to upload sales Orders ? This is needed to avoid the entry. User can upload a sales order details with minimum information like BP code ,Order Type , Item code , Quantity .

How to achieve this through DAL ? Has anyone tried this before ?

Thanks
Nilesh

patwanirav
19th February 2013, 10:45
hi...
Can anybody give me the code of the dll tdpurdll1234 or tdslsdll1234 ?

mark_h
19th February 2013, 15:25
I recommend contacting infor for the code. Any such code posted here will have to be removed.

Thanks