Application Development 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: 

To Set the user Status RCOG in WBS Element

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Thanks Rajat. It helped a lot.

I got where the problem was. I was not using

CALL FUNCTION 'BAPI_PS_PRECOMMIT'.

Thanks.