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

Problems with BAPI_TRANSACTION_COMMIT

Former Member
0 Likes
1,392

Hi,

We have a Program calling custom transaction in wihich a BAPI for Quotation Creating is called and after the BAPI call we are executing BAPI_TRANSACTION_COMMIT and after this we have some more calculations to do with the created Quote in that Custom Transaction. But the Problem is as soon as the FM BAPI_TRANSACTION_COMMIT is executed, it is coming out of that Custom transaction to the Calling Program.

We are using ECC6 System...

Pls Help... Points Guranteed....:-)

Regards

Sreedhar

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,118

Hi,

Direct commit work will be same as BAPI_TRANSACTION_COMMIT

Please find the code inside Bapi_transaction_commit

if wait eq space.

commit work.

else.

commit work and wait.

if sy-subrc ne 0.

call function 'BALW_BAPIRETURN_GET2'

exporting

type = 'E'

cl = 'S&'

number = '150'

importing

return = return.

endif.

endif.

call function 'BUFFER_REFRESH_ALL'.

endfunction.

RAVI:--> I think Sreedhar wants to edit the created quotation details once it created, by giving the commit work in the last not possible to edit the created Quotation,

Sreedhar:--> you try with created a wrapper function module for the bapi call and call in the separate LUW.

Thanks

aRs

7 REPLIES 7
Read only

Former Member
0 Likes
1,118

Ideally that shouldn't happen, did you debug to see why was it doing that.

Also, as a work around, why don't you move the COMMIT to the end of the called program.

Regards,

Ravi

Read only

Former Member
0 Likes
1,118

instead of BAPI_TRANSACTION_COMMIT just use commit...it will stay in the code itself and u can execute the below code.

Read only

Former Member
0 Likes
1,118

hi,

try using this give a value for wait in the importing parameters.

IMPORTING

*" VALUE(WAIT) LIKE BAPITA-WAIT OPTIONAL

*" EXPORTING

*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2

santhosh

Read only

Former Member
0 Likes
1,118

During Call Transaction, set the parameter RACOMMIT to X.

Then use OPTIONS FROM params during call transaction. See sample code below.

params-racommit = 'X'.

params-defsize = 'X'.

params-dismode = 'N'.

params-updmode = 'S'.

call transaction <tcode>

using bdcdata

options from params

messages into messtab.

Read only

Former Member
0 Likes
1,118

This is to Ramesh will the regular commit work when a BAPI is called?

Read only

former_member194669
Active Contributor
0 Likes
1,119

Hi,

Direct commit work will be same as BAPI_TRANSACTION_COMMIT

Please find the code inside Bapi_transaction_commit

if wait eq space.

commit work.

else.

commit work and wait.

if sy-subrc ne 0.

call function 'BALW_BAPIRETURN_GET2'

exporting

type = 'E'

cl = 'S&'

number = '150'

importing

return = return.

endif.

endif.

call function 'BUFFER_REFRESH_ALL'.

endfunction.

RAVI:--> I think Sreedhar wants to edit the created quotation details once it created, by giving the commit work in the last not possible to edit the created Quotation,

Sreedhar:--> you try with created a wrapper function module for the bapi call and call in the separate LUW.

Thanks

aRs

Read only

0 Likes
1,118

Hi,

I think the problem is the control comes back to the calling program from the called transaction as soon as a commit work is executed in the called transaction. In order to avoid this, the RACOMMIT parameter needs to set to 'X' during calling the transaction from the main program.

Thanks.