Skip to Content
0

Error in processing. Function was not executed.

Nov 07, 2017 at 06:58 AM

112

avatar image

Hi Experts,

A custom object was developed to change WBS user status. In this object, I am using this BAPI "BAPI_BUS2054_SET_STATUS".

Now, while testing this BAPI returns following error message:

"Error in processing. Function was not executed".

To Use this BAPI I fallowed below Sequence.

'BAPI_PS_INITIALIZATION'

'BAPI_BUS2054_SET_STATUS'

'PS_FLAG_SET_GLOBAL_FLAGS'

'BAPI_TRANSACTION_COMMIT'

Still while debugging found BAPI returns Error..

TYPE 'E'

ID 'CNIF_STATUS'

NUMBER '005'

MESSAGE 'Error in processing. Function was not executed'.

Does anyone has any idea how to handle this? Pls suggest.

Thanks in Advance

Sundeep.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
Nov 09, 2017 at 09:35 AM
1

You forgot the call of BAPI_PS_PRECOMMIT before BAPI_TRANSACTION_COMMIT. PS_FLAG_SET_GLOBAL_FLAGS is only one the FM executed in this BAPI which, as most BAPI, also fill a RETURN parameter that you MUST check before next call.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Raymond Giuseppi,

Thankyou it worked BAPI_PS_PRECOMMIT before BAPI_TRANSACTION_COMMIT was resolved the trouble.

0
Susan Keohan
Nov 07, 2017 at 01:32 PM
1

Sundeep, did you try searching for the error message?

https://www.google.com/search?q=CNIF_STATUS+0005&ie=utf-8&oe=utf-8&client=firefox-b

Show 6 Share
10 |10000 characters needed characters left characters exceeded

Hi Susan,

Yes I did, I found few discussions with helpful information and I did few corrections accordingly still problem was not resolved. Below was the code please take a look and let me know if i am missing anything.

begin_method process_approve changing container.
  DATA: wbs_element TYPE prps-posid.
  DATA : wbs_syst_stat TYPE TABLE OF bapi_wbs_mnt_system_status,  
         wa_syst_stat TYPE bapi_wbs_mnt_system_status,
         wa_usr_stat TYPE bapi_wbs_mnt_user_status,
         wbs_usr_stat TYPE TABLE OF bapi_wbs_mnt_user_status,
         result TYPE TABLE OF bapi_status_result,
         return TYPE bapireturn1,
         ret TYPE TABLE OF bapiret2,
         wa_ret TYPE bapiret2,
         garg TYPE seqg3-garg.
  DATA : enq TYPE TABLE OF seqg3.
  DATA : et_return TYPE TABLE OF bapiret2,
         ret_precommit TYPE TABLE OF bapiret2.

  swc_get_element container 'wbs_element' wbs_element.
  wa_usr_stat-wbs_element = wbs_element.
  wa_usr_stat-set_user_status = 'UCAP'.
  APPEND wa_usr_stat TO wbs_usr_stat.
  CLEAR wa_usr_stat.

  IF wbs_usr_stat IS NOT INITIAL.
    DATA : tname TYPE seqg3-gname VALUE 'PROJ_ENQ'.
    CALL FUNCTION 'ENQUEUE_READ'
        EXPORTING
          gclient = sy-mandt
          gname = tname        "'PROJ_ENQ'
          guname = space
          garg = garg
        TABLES
          enq = enq
        EXCEPTIONS
          communication_failure = 1
          system_failure = 2
          OTHERS = 3.
    IF sy-subrc <> 0.
    ENDIF.

    IF enq IS NOT INITIAL.
      CALL FUNCTION 'ENQUE_DELETE'
          EXPORTING
            suppress_syslog_entry = 'X'
          TABLES
             enq = enq.
    ENDIF.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
    WAIT UP TO 5 SECONDS.

    CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'
         IMPORTING
           return = return
         TABLES
* I_WBS_SYSTEM_STATUS = wbs_syst_stat
           i_wbs_user_status = wbs_usr_stat
* E_RESULT =
    .

    IF sy-subrc = 0 AND return-type <> 'E'.
      CALL FUNCTION 'PS_FLAG_SET_GLOBAL_FLAGS'
          EXPORTING
* I_WBS_DATA = '-'
* I_NETWORK_DATA = '-'
           i_precommit_ok = 'X'
* I_ERROR = '-'
* I_INITIALIZED = '-'
      .
      IF sy-subrc = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
               wait = 'X'.
      ENDIF.
    ELSE.
      swc_set_element container 'STAT_ERR' return-message.
    ENDIF.
  ENDIF.

  swc_set_element container 'wbs_element' wbs_element.
end_method.

Thanks,

Sundeep

0

Moderator note. In future if you're going to post code, please use the code button in the editor. Make sure your code is nicely indented and remove anything not directly relevant, like unnecessary comments. This makes your code easier to read, and means you're more likely to receive help. I have formatted your code for you this time.

Additionally, you have an error right at the start. You call function module ENQUEUE_READ, but you don't do anything if your get a non-zero return code,

2

Hi Matthew,

Thanks For your suggestions I will consider all of them .

0

Hi Sundeep,

That code looks pretty similar to my own call to BAPI_BUS2054_SET_STATUS - so I don't see anything there, except that in my own application (for better or for worse) I do not call:

'PS_FLAG_SET_GLOBAL_FLAGS'

'BAPI_TRANSACTION_COMMIT'

I don't know if that helps you at all. Can you test the object through the BOR and debug through the BAPI?

Sue

1

Hi Susan,

thank you.. your comments were really helped. FM 'PS_FLAG_SET_GLOBAL_FLAGS' was created all the trouble any how problem was resolved.

0

So does this mean your issue is now resolved? If so, please let future generations know how! And then mark the question as answered :-)

2