Skip to Content
avatar image
Former Member

Project User status update

Hello experts - I am using the following BAPI's inorder to update the project user status.

CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

CALL FUNCTION 'BAPI_BUS2001_SET_STATUS'

CALL FUNCTION 'BAPI_PS_PRECOMMIT'

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

I am getting subrc 0 after execution of CALL FUNCTION 'BAPI_BUS2001_SET_STATUS' , But getting a dump in BAPI_PS_PRECOMMIT 😔.

From ST22 , I could see the pointer is on the redline .

The termination occurred in ABAP program "SAPLPS_BAPI", in "CHK_PRECOMMIT".The main program was "RS_TESTFRAME_CALL".

FORM chk_precommit.

  DATA: chk_precommit_ok TYPE c,
        chk_error        type c.

  CALL FUNCTION 'PS_FLAG_GET_GLOBAL_FLAGS'
       IMPORTING
            e_precommit_ok = chk_precommit_ok
            e_error        = chk_error.

  IF chk_precommit_ok = space.
*   Precommit wurde noch nicht aufgerufen.
    MESSAGE x030(cnif_pi).
ELSEIF chk_precommit_ok <> 'Y'.
*   Precommit wurde nicht erfolgreich durchlaufen.
    MESSAGE x033(cnif_pi).
  elseif not chk_error is initial.
*   At least one single BAPI failed
    MESSAGE x056(cnif_pi).
  ENDIF.

Any idea on how to get rid of this ?

Thanks,

Arun.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 29, 2015 at 12:47 PM

    You are using BAPI so a

    I am getting subrc 0 after execution of CALL FUNCTION 'BAPI_BUS2001_SET_STATUS'

    is not relevant, don't check sy-subrc but analyze RETURN table for any error message (TYPE = 'E' or 'A') at each level that returns it so BAPI + PRE COMMIT + COMMIT (if WAIT) and don't execute next step in this case.


    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 29, 2015 at 01:05 PM

    Hello Arun,

    As suggested by Raymond, check the return table of all the BAPIs. It may be a configuration issue which does not allow to change the status of a project user. Also have you tried manually to change the status of a project user.

    BR.

    Add comment
    10|10000 characters needed characters exceeded

    • AFAIK, BAPIs only simulate what has been configured meaning if you can change via GUI/T-code then you can change via BAPIs also. So you may be missing out some BAPI/FM. I am not sure about exact BAPI/FM but one more check you can do is to Test all the BAPI's in sequence in SE37 and see if you are successful there.

      I still think you are missing call to some BAPI/FM in your codebase and should re-check once the entire Function Group.

      BR.