rochus
20th October 2005, 18:14
does anybody already used afs for tfgld1103m000

my problem:

form 1 has only header data,
positions are inserted via form 2,

how can i perform the command to.form(2) via AFS

thanks a lot for hints

mark_h
20th October 2005, 20:15
In theory you do not have to use the a to.form() statement to get to form two fields. I have never run into a session like what you describe. We do not have a tfgld1103m000 on our 4c4 system, but I wonder if you would use a stpapi.change.view() on the header and then use stapapi.insert for the child records. Something like how I do sub-items and build items for project pegging data - of course my fields are all on 1 form. Of course this is assuming that this is not one of those synchronized sessions or something like that.

rochus
21st October 2005, 23:51
it's baan5, and on form 1 the insert button is disabled,
so i got the afs-errormessage "option disabled"

it's a strange session, i know.

lbencic
22nd October 2005, 00:01
Just my 2 afs cents, I have not worked with that session.

If just the form commands are holding you up, in the past I have just copied the session to an 'API friendly' version, copied and made that option available on the form, then call my api against that session. No need for the source code or other changes to the standard.

Example:
Copy tfgld1103m000 to a new session: tfgld1103mapi
Copy form tfgld1103m0001 to a new name: tfgld1101mapi1
- make your change to make that option available on form 1 (if this is possible!).
- Change your session to call tfgld1101mapi1 form instead of m0001 version.
- Still call the standard form 2, script, whatever reports.

Make your API calls against tfgld1103mapi. This session never needs to hit the standard menus to confuse the user, just for your API's to run against.

Hope that helps.

rochus
30th October 2005, 15:24
i tried that already, but there's a logic behind this session,
you insert header data in form 1,
and pos. lines in form 2.
so it's not only the button on form 1, because
there's a programmed logic behind each form.

manual:
i have to insert master data in form 1, jump to form 2,
and insert purch-inv-line by line.

thanks

mark_h
31st October 2005, 18:26
Do you have one of the wrapper programs?