‎2012 Jun 08 5:59 AM
During the Storage location change, I'm using the BAPI 'BAPI_PRODORD_CHANGE'. After execute, this error is coming 'The COMMIT WORK processing must not be interrupted' and the program is getting dump.when i'm running separately, it is working fine. but when i;m using in another program, it is getting dump. Please help.
I'm writing my code here.
DATA: P_NUMBER LIKE BAPI_ORDER_KEY OCCURS 0 WITH HEADER LINE,
P_ORDERDATA LIKE BAPI_PP_ORDER_CHANGE OCCURS 0 WITH HEADER LINE,
P_ORDERDATAX LIKE BAPI_PP_ORDER_CHANGEX OCCURS 0 WITH HEADER LINE,
MAIN_BAPI_RET LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
COMMIT_BAPI_RET LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
ITAB-AUFNR = '4100000007'.
ITAB-LGORT1 = '110'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ITAB-AUFNR
IMPORTING
OUTPUT = ITAB-AUFNR
.
P_NUMBER-ORDER_NUMBER = ITAB-AUFNR.
APPEND P_NUMBER.
P_ORDERDATA-STORAGE_LOCATION = ITAB-LGPRO1.
APPEND P_ORDERDATA.
P_ORDERDATAX-STORAGE_LOCATION = 'X'.
APPEND P_ORDERDATAX.
CALL FUNCTION 'BAPI_PRODORD_CHANGE'
EXPORTING
NUMBER = P_NUMBER
ORDERDATA = P_ORDERDATA
ORDERDATAX = P_ORDERDATAX
IMPORTING
RETURN = MAIN_BAPI_RET.
IF MAIN_BAPI_RET-TYPE = 'E'.
MESSAGE MAIN_BAPI_RET-MESSAGE TYPE 'E'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
RETURN = COMMIT_BAPI_RET.
ENDIF.
‎2012 Jun 08 6:08 AM
Are you getting this error when you are processing just one record?
Where exactly are you getting the dump?
Thanks,
Shambu
‎2012 Jun 08 6:46 AM
I'm trying it in Development server. It is processing one record.
The error is coming while it is in the BAPI
call function 'bapi_prodord_change'
‎2012 Jun 08 7:20 AM
Hi Kingshuk Barua,
your passing the Order number :
ITAB-AUFNR = '4100000007'.
ITAB-LGORT1 = '110'.
Is the AUFNR = '4100000007' avialbule in AFKO table ?
The Bapi only do change the existing record. If the order number is not avilable in the data base table.
Bapi through the error return parameter.
Thanks & Regards,
Suresh M
‎2012 Jun 08 8:53 AM
‎2012 Jun 08 7:27 AM
Hello Kingshuk,
It's clearly mentioned in the BAPI documentation not to issue a COMMIT WORK after the BAPI call.
Update Control
The method independently triggers the update to the database. After the method has been called you must not execute a COMMIT WORK again.
Please make it a habit to read the BAPI documentation (if available ) before using it!
BR,
Suhas
‎2012 Jun 08 8:58 AM
Hello Suhas,
Already tried with or without commit work. when i'm using this bapi independently, it is working for both the cases....while using in another program, it is not working (with or without).
‎2012 Jun 08 9:04 AM
Runtime Error SYSTEM_ON_COMMIT_INTERRUPTED
ABAP PROGRAM SAPLCOZV
Application Component PP-SFC