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: 

Error in BAPI_BUS2054_SET_STATUS

Former Member
0 Kudos

Hi!!!

I trying to update system status for WBS elements using BAPI_BUS2054_SET_STATUS but i can't do it. (In CJ02). I need change status CRTD ( Created ) for status REL ( Released )

I'm call :

CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'

TABLES

i_wbs_system_status = it_status

e_result = it_result.

CALL FUNCTION 'BAPI_PS_PRECOMMIT' .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

In the table it_status i'm harcoding the following data ( only for my test 😞

WBS_ELEMENT UNDO_SYSTEM_STATUS SET_SYSTEM_STATUS

ECE33999-XXXX-PRUEBA1 |CRTD |REL

and then returns the following error.

MESSAGE_ID: CNIF_STATUS

MESSAGE_NUMBER: 001

MESSAGE_TEXT: Resetting status CRTD for object ECE33999-XXXX-PRUEBA1 not supported

What am I doing wrong?

Regards.

3 REPLIES 3

Former Member
0 Kudos

Try this code out

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.

0 Kudos

Hi!!!

I modified the code. I inserted function before and after of the function BAPI_BUS2054_SET_STATUS.

CALL FUNCTION 'BAPI_PS_PRECOMMIT'

TABLES

et_return = it_bapiret.

And now I have another error (more)

I do not know if it's necessary (put the function BAPI_PS_PRECOMMIT before).

New Error in it_bapiret:

ID NUMBER MESSAGE

NIF_PI 032 |No data has been changed, precommit will not be executed.

I think maybe.... I'm wrong uploading the data. But I do not know what the error.

Thanks again.

Former Member
0 Kudos

Hi all!!!

I found the problem!!!

I was going the wrong information!

MOVE 'LIBD' TO wa_status-set_system_status.

when it should be

MOVE 'REL' TO wa_status-set_system_status.

Regards!

MRosa