arunprasath
18th November 2002, 17:08
Hi all,
I am running, Maintain Transactions through AFS.
I give the transaction category as cash in Maintain transactions and in the second session Maintain Bank Transactions(tfcmg2100s000) I am inserting values with type of transaction as "Unallocated receipts".

as I read from a file, in a while loop, I am inserting values into the subsession(tfcmg2100s000), more than one times.

the problem is in the session Maintain Bank Transactions, after I insert the first time, the second time when I put new values in document number, It always takes the old value. This happens only with this field, document number. Not with any other fields.

seeing through, I have found that it is a part of the index and when run manually, control doesnt goes to this field at all. we need to go to this field forcebly. so My AFS always has the document number which is being inserted the first time.
Anybody please help.
thanks in advance,
s.arun prasath

mark_h
18th November 2002, 23:57
During the loop are you ending and restarting the session between each insert? I had to do this in one session so I got a new transaction number each time. It slowed things up but worked.

Mark

arunprasath
19th November 2002, 12:33
Thanks mark for the reply.
If I close the session, (tfcmg2100s000), then I need to close the Maintain Transactions session also.
If I start Maintain Transactions session, I will get a new batch number each time.
Is there any other alternative? that anybody could think of .
I should be able to do the things done, with a single batch number.
please help
thanks
s.arun prasath

mark_h
20th November 2002, 15:32
Why do you have to close the maintain transactions session? I am not familiar with the session, but isn't there a way to add new documents to a batch?


Mark

arunprasath
20th November 2002, 15:45
First, I am reading a list of records from a ASCII file and for each record, I am inserting into the session Maintain Bank Transactions (tfcmg2100s000), which comes after the main session, Maintain Transactions.
O.k.
I will tell the flow.
In the Maintain Transactions session(tfgld1101m000), I will be entering the transaction type, and the fiscal year and all that.
when I use, stpapi.change.view(), this creates a new batch number.
when I use, continue() this starts the session(tfcmg2100s000).

In this session, when I first insert the values, the cursor comes to the document number. then I insert all the other values.

keeping this session opened, when I insert the next set of values, manually, the cursor doesnt comes to the field document number,automatically. It brings the old document number, which we have inserted previously, as default. we need to go to this field and only then, it allows to override the default values.

so when I use afs functionality, It always takes the first document number which I have put.

I have tried, closing the session(tfcmg2100s000) and also the Maintain Transactions(tfgld1101m000). And opening fresh the main session and finding the old record by giving the old batch number and going to the subsession. this didnt work. problem still persist.

I dont want to create a new batch number in the Maintain Transactions session for every new record.
I hope I am clear.

arun

mark_h
20th November 2002, 15:48
Do you know how document numbers are created? Can you duplicate that? And then put the document number on the form.

Mark

arunprasath
20th November 2002, 16:20
Yes mark,
using, stpapi.put.field(), I am putting new document number into the session each time.
In this document number field, there is no auto generation procedure. we need to put new values. System brings the old values by default.
I have attached the session Maintain Bank Transactions's gif here.

lbencic
20th November 2002, 23:42
Maintain Transactions has taken down more than one happy AFS programmer. One of the main things you need to realize with AFS is it does not make your job any easier, and some things are impossible due to the way the standard program is written.

Without a full debug it is difficult to find out why. But you have your clue. In the sub session tfcmg2100s000, it does not normally 'tab' to that field. Usually, that means you will have a problem filling through AFS. The insert will not stop, the number defaults and the 'attr.input' for that field is most likely set to false as you go through the sections in add mode. Similar to generated ddc code, the AFS checks that value before assigning the put.field value. (Actually, I glanced at the source code, and that is the case, but it looks like mostly for add mode)

You can try inserting the record, then coming back and modifying the document number...?

arunprasath
21st November 2002, 06:21
Thanks for your reply.
Yes, I have noticed in some fields, when we enter some values and press 'tab', that brings the defaults to some other fields and cursor dont go to those new fields, first time.

In such cases, when we execute the session through AFS, it always brings the default values.

One solution in such cases is to do the insert and after insert then in the same session, put the values again and then do stpapi.update(). This will solve the cases, where the required field is not a part of index.

Unfortunately here in tfcmg2100s000, the document number is a part of the index. so I wont be able to put the values again and then do stpapi.update().

I am still trying. If possible without the source code modification, then that will be good.

arunprasath
21st November 2002, 15:56
Hi all ,
Thank God, the problem is solved with source code customisation.
In the session tfcmg2100s000, I have commented the lines attr.input and compiled the session.
Now things work fine.
Thanks for all your queries.
regards,
s.arun prasath

tnzabo
21st February 2008, 18:16
Hello - I'm looking for some examples on AFS and tfcmg2100s000 - would you be interested sharing your code for this? Also - before I get too far, we do not have source code - am I not going to be able to successfully do this without the customization on the source code you did?

Thanks - NikkiZ