09-23-2008 10:17 AM
Hello Experts,
I am trying to set the user status RCOG in WBS Element.
My requirement is calculation of POC and automatic setting the user status RCOG in WBS Element.
Please suggest me the solution. IF BAPI is helpful, then which one and in which sequence to be used.
I tried to use the following mentioned BAPIs but not getting the proper output.
Is it necessary to initialize the BAPI before using BAPI's
BAPI_BUS2054_GET_STATUS
BAPI_BUS2054_SET_STATUS
Thanks.
Swati.
09-25-2008 10:22 AM
Hello Swati,
Please try these in the following sequence.
IF NOT it_wbs_user_status[] IS INITIAL.
CLEAR l_return.
REFRESH lt_e_result.
call BAPI
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 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
EXPORTING
WAIT =
IMPORTING
RETURN =
Regards,
Rajat
09-23-2008 3:19 PM
Hi,
Use BAPI_BUS2054_SET_STATUS. Refer documentation in SE37, it says:
You can call up the BAPI as often as you like until a Logical Unit of Work (LUW) is closed with the BAPI BAPI_PS_PRECOMMIT and BAPI COMMIT WORK.
Regards
09-25-2008 10:22 AM
Hello Swati,
Please try these in the following sequence.
IF NOT it_wbs_user_status[] IS INITIAL.
CLEAR l_return.
REFRESH lt_e_result.
call BAPI
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 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
EXPORTING
WAIT =
IMPORTING
RETURN =
Regards,
Rajat
09-25-2008 10:31 AM
Thanks Rajat. It helped a lot.
I got where the problem was. I was not using
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
Thanks.