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

CO_SE_PRODORD_CHANGE-The COMMIT WORK processing must not be interrupted

Arun_Prabhu_K
Active Contributor
0 Likes
5,224

Hi guys.

I am using this function to change the storage location (Goods Recipient Tab) and work center in the operations of a Production Order.

We are looping an itab and calling this FM for each record in itab.

Working fine for most of the cases.

At times, this function throws the dump as shown below.

I would like to know the reason for this error.

Code:

     gs_loc-storage_location = itab-lgpro1.

     gs_loc-storage_location_x = 'X'.

     new_wc-operation  = oprno.

     new_wc-control_key  = itab2-steus.

     new_wc-work_center  = arbpl.

     new_wc-work_center_x  = 'X'.

     APPEND new_wc TO new_wc1.

     CLEAR new_wc.

     CALL FUNCTION 'CO_SE_PRODORD_CHANGE'

          EXPORTING

            iv_order_number    = itab-aufnr

            is_header          = gs_loc

            it_operation       = new_wc1

            iv_commit          = 'X' "Commit Work

          IMPORTING

            es_return          = main_bapi_ret.

     IF main_bapi_ret-type = 'E'.

       MESSAGE main_bapi_ret-message TYPE 'S'.

     ENDIF.

     CLEAR : gs_loc, new_wc, new_wc1[], new_wc1.

Run-time error:

Sample Production Order for which such error occurs:

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,311

The dump says it all ..When a COMMIT WORK is executed all the FM s registered with CALL FM IN UPDATE TASK, PERFORM ON COMMIT etc are executed...no error message or exception should be thrown in the LUW Update.... Try to understand in the dump why the error meesage is raised ??? you need to back track from there ..... probably ur sending some incorrect data in this case.....

Hi guys.

I am using this function to change the storage location (Goods Recipient Tab) and work center in the operations of a Production Order.

We are looping an itab and calling this FM for each record in itab.

Working fine for most of the cases.

At times, this function throws the dump as shown below.

I would like to know the reason for this error.

Code:

     gs_loc-storage_location = itab-lgpro1.

     gs_loc-storage_location_x = 'X'.

     new_wc-operation  = oprno.

     new_wc-control_key  = itab2-steus.

     new_wc-work_center  = arbpl.

     new_wc-work_center_x  = 'X'.

     APPEND new_wc TO new_wc1.

     CLEAR new_wc.

     CALL FUNCTION 'CO_SE_PRODORD_CHANGE'

          EXPORTING

            iv_order_number    = itab-aufnr

            is_header          = gs_loc

            it_operation       = new_wc1

            iv_commit          = 'X' "Commit Work

          IMPORTING

            es_return          = main_bapi_ret.

     IF main_bapi_ret-type = 'E'.

       MESSAGE main_bapi_ret-message TYPE 'S'.

     ENDIF.

     CLEAR : gs_loc, new_wc, new_wc1[], new_wc1.

Run-time error:

Sample Production Order for which such error occurs:

5 REPLIES 5
Read only

Former Member
0 Likes
3,312

The dump says it all ..When a COMMIT WORK is executed all the FM s registered with CALL FM IN UPDATE TASK, PERFORM ON COMMIT etc are executed...no error message or exception should be thrown in the LUW Update.... Try to understand in the dump why the error meesage is raised ??? you need to back track from there ..... probably ur sending some incorrect data in this case.....

Read only

0 Likes
3,311

Thank you for the valuable input.

The error is arising because of wrong data.

How to catch such run time error ?

I want to capture such cases in an internal table and continue processing with the next data in itab and finally display erroneous records as a report to the user.

Read only

0 Likes
3,311

Good you were able to track it...can you check whether any parametere are provided in the FM for  a simualation /test run ..Also try by not  passing the  flag in COMMIT WORK parameter  and see if you get error messages ...if there are no error messages you make a explicit  commit work......

Take a look at BAPIS, usually they have an option for a test run ,one is BAPI_PRODORD_CHANGE(couldnt chk whether test run parameter is provided ,as am not having access to SAP now)

Read only

0 Likes
3,311

I changed the iv_commit from 'X' to space and tried to commit by using BAPI_TRANSACTION_COMMIT externally.

Now I am getting the error message thrown from user exit and on pressing F3, I am getting the error "The commit work processing must not be interrupted".

Now I want to know the way to capture a type 'E' message thrown from some program.

Currently this is interrupting (characteristic of type 'E' msg) the processing of other valid records in itab.

Read only

0 Likes
3,311

I presume the error message is thrown from a user exit and u want to capture it..???

.First question,  what is the User exit in which the error message is thrown ?

If the User exit is called as a part of the Update Task,never ever throw an error message in it....

Last, see the User exit Documentation (if it exists) whether  it is allowed to throw error messages