Application Development 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: 

COMMIT WORK in batch fails?

Former Member
0 Kudos

Hi all,

I hope someone can help with this. If I run transaction CJ46 and fill in the selection screen and run it- no problem. I then record a BDC session to automate the process for multiple years.i.e create the same selection screen as CJ46 but have the fiscal year as a range. I run the transaction:

call transaction 'CJ46' using t_bdc
                           mode  w_mode
                           messages into t_messtab.

Basically the code runs into LKAZCF01 and reaches:

CLEAR vorher. CLEAR nachher.
*----------------------------------------------------------------------*
* 9. commit work and dequeue all
*----------------------------------------------------------------------*
     COMMIT WORK.
     PERFORM dequeue_all.
   ENDLOOP. "AT pt_objnr_group
ENDFORM.                               " PROCESS

In the standard CJ46 call, all this code gets executed. When I run my Z-batch input version, the code gets to the COMMIT WORK line and then falls back into my z program. sy-subrc is 0 and t_messtab is empty.The code in both versions seems to execute identical code but my one fails. Any ideas?

Cheers,

Russ.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Resolved myself.

call transaction 'CJ46' using t_bdc
                           options from st_params
                           messages into t_messtab.

Had to set RACOMMIT option in passing structure.

5 REPLIES 5

Former Member
0 Kudos

Resolved myself.

call transaction 'CJ46' using t_bdc
                           options from st_params
                           messages into t_messtab.

Had to set RACOMMIT option in passing structure.

I agree, as a COMMIT WORK terminates CALL TRANSACTION

For reference in COMMIT WORK on line documentation.

  • In a program executed using batch input, or if you have called the program using the USING addition of the statement CALL TRANSACTION, COMMIT WORK terminates batch input processing by default. This setting can be overwritten in the statement CALL TRANSACTION using the component RACOMMIT of the structure CTU_PARAMS, passed to the statement OPTIONS FROM.

Regards,
Raymond

0 Kudos

Thanks for the info, this solved similar issue of mine, BDC for CJ46 was not saving data

Former Member
0 Kudos

Hi Russ,

     Some of the transaction behave differently when run through a bdc background mode . I had faced similar issue in PR05 transaction. Please change the mode to foreground (mode value A) and see if it works.

     In case issue is not resolved, you may have to look for BAPIs to fulfill the requirement.

~Athreya

0 Kudos

Hi Russell,

Even I am facing the similar issue.

Can you please explain how did you get through this?

Thanks,

Vikas