2014 Mar 06 8:01 AM
Hiiii Experts,
I am coding a mass production order release program and i am using the following BAPI s but getting runtime errors with last 2. Would greatly appreciate any insights to solve my runtime errors. Thanks
BAPI_PRODORD_RELEASE (works fine)
BAPI_TRANSACTION_COMMIT (Error)
BAL_DSP_LOG_DISPLAY (Error)
this is how i coded.
data: w_line TYPE BSVX-STTXT .
data: it_commit TYPE TABLE OF BAPIRET2.
data: w_disp TYPE BAL_S_EXCM .
data: it_order TYPE TABLE OF BAPI_ORDER_KEY,
it_log TYPE TABLE OF BAPI_ORDER_APPLICATION_LOG.
CALL FUNCTION 'BAPI_PRODORD_RELEASE'
* EXPORTING
* RELEASE_CONTROL = '1'
* WORK_PROCESS_GROUP = 'COWORK_BAPI'
* WORK_PROCESS_MAX = 99
* IMPORTING
* RETURN =
TABLES
ORDERS = it_order
* DETAIL_RETURN =
APPLICATION_LOG = it_log
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 5
IMPORTING
RETURN = it_commit.
.
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
* I_S_DISPLAY_PROFILE =
I_T_LOG_HANDLE = it_log
* I_T_MSG_HANDLE =
* I_S_LOG_FILTER =
* I_S_MSG_FILTER =
* I_T_LOG_CONTEXT_FILTER =
* I_T_MSG_CONTEXT_FILTER =
* I_AMODAL = ' '
* I_SRT_BY_TIMSTMP = ' '
IMPORTING
E_S_EXIT_COMMAND = w_disp
* EXCEPTIONS
* PROFILE_INCONSISTENT = 1
* INTERNAL_ERROR = 2
* NO_DATA_AVAILABLE = 3
* NO_AUTHORITY = 4
* OTHERS = 5
.
2014 Mar 06 8:13 AM
Hi Anushka,
you can use another one bapi BAPI_PO_RELEASE to release your PO in loop
Many Thanks/ Himanshu Gupta
2014 Mar 06 8:40 AM
2014 Mar 06 8:44 AM
Hiii Raymond,
what do u mean by analyse? and do u know what i need to pass to the last bapi?
2014 Mar 06 8:56 AM
Hi Anushka
Firstly in BAPI_TRANSACTION_COMMIT it is expecting a character as 'X'. not a numeric one.
Seconldy What Raymond means is during the first call of the BAPI check the what is returned via the below mentioned parameters. If it is sucessful then call commit.
* IMPORTING
* RETURN =
Thirdly the type of IT_LOG which last FM is expecting is different from one returned by first BAPI.
Nabheet
2014 Mar 06 8:56 AM
Hi anushka,
please see this code
CALL FUNCTION 'BAPI_PRODORD_RELEASE'
* EXPORTING
* RELEASE_CONTROL = '1'
* WORK_PROCESS_GROUP = 'COWORK_BAPI'
* WORK_PROCESS_MAX = 99
* IMPORTING
RETURN = it_return (see here any data is present or not)
TABLES
ORDERS = it_order
* DETAIL_RETURN =
APPLICATION_LOG = it_log
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lt_return.
.
2014 Mar 06 8:58 AM
2014 Mar 06 9:04 AM
Hi anushka,
you should check for RETURN-TYPE <> 'E' at any line item in return internal table, then do the bapi_transaction_commit..
Many Thanks / Himanshu Gupta
2014 Mar 06 9:32 AM
Okay experts i have my first 2 BAPIs working fine now with all the useful comments.
But my last BAPI to display the log is still not working, in fact i am clueless as to what import/export fields to use. Any suggestions?
2014 Mar 06 9:38 AM
Hi Anushka,
please see this wiki help for better understandings, i think you have missed adding BAL_S_MSG_ADD
Application Log Methodology Part II - ABAP Development - SCN Wiki
2014 Mar 06 10:55 AM
2014 Mar 06 11:02 AM
Hi Anushka,
please understands, firstly you have to put your messages into application log, thats why i have told you to add your messages in BAL_S_MSG_ADD, and then you can use your BAL_DSP_LOG_DISPLAY to display your message log, have you used the previous shown wiki help or not, what is the present issues you are facing.