2008 Nov 23 10:41 PM
I am trying to set status of wbs element and have the following sequence of calls based on the
CALL FUNCTION 'BAPI_PS_INITIALIZATION' .
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = it_bapiret.
CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'
IMPORTING
return = l_return
TABLES
i_wbs_user_status = it_wbs_user_status
e_result = lt_e_result.
IF l_return-type EQ 'E'.
gv_flg_error = 'X'.
ENDIF.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = it_bapiret.
READ TABLE it_bapiret INTO it_bapiret WITH KEY type = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
I am still getting the short dump :
Error analysis
Short text of error message:
Precommit did not run successfully
Information on where terminated
Termination occurred in the ABAP program "SAPLPS_BAPI" - in "CHK_PRECOMMIT".
The main program was "RS_TESTFRAME_CALL ".
In the source code you have the termination point in line 24
of the (Include) program "LPS_BAPIF01".
Any help to make this work is appreciated.
2008 Dec 23 6:58 AM
U need to use RollBack option. use the BAPI "call function 'BAPI_TRANSACTION_ROLLBACK'." as below.
call function 'BAPI_PS_INITIALIZATION'.
call function 'BAPI_BUS2002_SET_STATUS'
exporting
number = network
tables
i_activity_system_status = it
e_result = itet.
read table itet into wa_itet with key message_type = 'E'.
if sy-subrc ne 0.
call function 'BAPI_PS_PRECOMMIT'
tables
et_return = etit.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
else.
call function 'BAPI_TRANSACTION_ROLLBACK'.
endif.
2008 Nov 24 4:30 AM
suzzie
you are always calling precommit after set_status.you should call only if set_status is successfull.
This is how we are calling for network status.
call function 'BAPI_PS_INITIALIZATION'.
call function 'BAPI_BUS2002_SET_STATUS'
exporting
number = network
tables
i_activity_system_status = it
e_result = itet.
read table itet into wa_itet with key message_type = 'E'.
if sy-subrc ne 0.
call function 'BAPI_PS_PRECOMMIT'
tables
et_return = etit.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
else.
MOVE wa_itet-message_text TO wa_error_tab-message_text.
*
wa_error_tab-key1 = network.
wa_error_tab-key2 = wa_itet-objectkey+12(4).
wa_error_tab-object_type = c_activity.
APPEND wa_error_tab TO e_error_tab.
endif.
2008 Nov 24 8:25 PM
Thank you Vievek,
I added thet code to check message type for E, A, X as my message type returned was 'X' after "set status" and if it is not any of these only then I am precommitting. Unfortunately, I could not still resolve the issue.
2008 Nov 27 9:05 AM
Message type "X" means Short Dump.
So you are getting error in "BAPI_BUS2054_SET_STATUS" itself.
try using CONVERSION_EXIT_ABPSN_INPUT on WBS ID before passing to WBS_ELEMENT
2008 Dec 23 6:58 AM
U need to use RollBack option. use the BAPI "call function 'BAPI_TRANSACTION_ROLLBACK'." as below.
call function 'BAPI_PS_INITIALIZATION'.
call function 'BAPI_BUS2002_SET_STATUS'
exporting
number = network
tables
i_activity_system_status = it
e_result = itet.
read table itet into wa_itet with key message_type = 'E'.
if sy-subrc ne 0.
call function 'BAPI_PS_PRECOMMIT'
tables
et_return = etit.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
else.
call function 'BAPI_TRANSACTION_ROLLBACK'.
endif.