cancel
Showing results for 
Search instead for 
Did you mean: 

How to set system status 'ACPT','FNBL' of a WBS ?

Former Member
0 Kudos

Hi Group,

I have a requirement to set system status 'ACPT', 'FNBL'  programatically. But I didn't get any BAPI or FM to update set/unset these two statuses.

We have a BAPi to set the system and user status i.e. BAPI_BUS2054_SET_STATUS. But his does not support mentioned status.

Please let me know if you have any solution for this.

Thanks,

AJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try FM STATUS_UPDATE or STATUS_CHANGE_INTERN

Regards

Shrikant

Former Member
0 Kudos

Hello Shrikant,

Thanks for your reply. Updating the table does not solve the problem. We need to set and undo based on our requirement. And FM STATUS_UPDATE only update the JEST and JSTO table where as STATUS_CHANGE_INTERN also does the same thing for system status only.

Former Member
0 Kudos

Hi abhishek,

Take the F-code from the transaction cj20n for the given Status type.

Since later in this program the fcode is pass to some standard table to get the perform name and program name for futher process in the transaction.

ACPT
*_________________________
*STAK Set
*STAL Undo
*
*FNBL
*_________________________
*STEF Set
*STER Undo

Former Member
0 Kudos

Hello Rohan,

Thanks for the Idea.

It works. But we need to incorporate some more updated to make this work.

Here it goes...

        CALL FUNCTION 'CJWI_INIT'.          ------------------> Mandatory

* SY-SUBRC always '0' for call function with no Exception.

* 'CJWI_INIT' does not clear all the global tables. So we need to clear

* this table explicitely.

        PERFORM cjdi_table_reset IN PROGRAM saplcjwb .------------------> Mandatory

 

* Select Basic data for Project ID

        CALL FUNCTION 'CJDW_SELECT_BASIC_DATA'     ------------------> Mandatory

             EXPORTING

                  enqueue       = 'X'

                  project       = pspid

             EXCEPTIONS

                  error_message = 1

                  OTHERS        = 2.

 

        IF sy-subrc NE 0.

" Error

          EXIT.

        ENDIF.

* WBS: Basic data maintenance ( This FM will take the FCODE and perform the operation for status set.)

        CALL FUNCTION 'CJWB_STATUS_MAINTAIN'

             EXPORTING

                  i_objnr       =objnr     " Object number of the WBS element (Important)

                  vrgng         = lfd_fcode     " FCODE for system status (SET/RELEASE)

                  no_check      = 'X'          " Pass 'X' to avoid unwanted popups if check fails

             EXCEPTIONS

                  error_message = 1

                  not_found     = 2

                  wrong_input   = 3

                  not_possible  = 4

                  OTHERS        = 5.

         IF sy-subrc NE 0.

          " Error

          EXIT.

        ENDIF.

After this do      CALL FUNCTION 'BAPI_PS_PRECOMMIT' and

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

             EXPORTING

                  wait   = c_flag_x

             IMPORTING

                  return = lwa_bapireturn.

* sy-subrc not checked as there are no exceptions

This piece of code will ensure the system status set/Release for a WBS.

Answers (0)