Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_TRANSACTION_COMMIT

Former Member
0 Likes
922

Hello everyone,

I seem to be having a problem committing records I am posting through a BAPI. I have 3 records

held in an internal table and only the first record is being posted i.e. being saved

The following pseudo code explains:

LOOP through internal table.

populate header.

populate line items.

populate currency amounts.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST' .......

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .......

ENDLOOP

I have tried using COMMIT WORK AND WAIT and the function DEQUEUE.

There must be something I am missing in the code after the first record is committed. The question

is does anybody know.

I would appreciate any help. This is driving me bonkers !!!

Cheers

Andy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
874

Hi,

Are you checking the return table parameter for any errors? from the first fm? Please check it first. If it is having error then there is no problem.

Else put COMMIT WORK AND WAIT for the BAPI_transaction_COMMIT. Then in order to find wheter if it is a posting problem, Just put the statement WAIT UPTO 2 SECONDS.

and try if there is some posting proble then the above WAIT will find it for you. You need then to code accordingly.

Hope this helps.,

Harikrishna.

Edited by: harikrishna indugu on Feb 22, 2008 12:27 PM

6 REPLIES 6
Read only

Former Member
0 Likes
874

Hi Andy

Check that you are clearing work areas/internal tables after each loop pass.

Kind Regards

Eswar

Read only

0 Likes
874

Thanks for the suggestion Eswar bit I am already doing that.

i.e. CLEAR: documentheader,

accountgl,

currencyamount.

Read only

Former Member
0 Likes
876

Hi,

Are you checking the return table parameter for any errors? from the first fm? Please check it first. If it is having error then there is no problem.

Else put COMMIT WORK AND WAIT for the BAPI_transaction_COMMIT. Then in order to find wheter if it is a posting problem, Just put the statement WAIT UPTO 2 SECONDS.

and try if there is some posting proble then the above WAIT will find it for you. You need then to code accordingly.

Hope this helps.,

Harikrishna.

Edited by: harikrishna indugu on Feb 22, 2008 12:27 PM

Read only

Former Member
0 Likes
874

Hi Andy,

After calling 'BAPI_ACC_GL_POSTING_POST' check the RETURN table for any error message TYPE = 'E'. It looks like message type is 'E' for other two records. this may be the reason for not getting posted. Check this once.

Regards,

Yellappa.

Read only

0 Likes
874

Thanks guys for all suggestions.

I think I may have found the problem.

I am using : documentheader-obj_key = '$'.

to generate the document number, which works ok for the first record. However, it does

not seem to be generating a new document number for the second record.

Is there a function to generate or find the next document number sequence???

Cheers

Andy

Read only

0 Likes
874

Use FM : GET_NEXT_FI_DOCUMENT_NUMBER