cancel
Showing results for 
Search instead for 
Did you mean: 

The Sample Code of BADI BBP_WFL_ADMIN_APPROV

Former Member
0 Kudos

Hi Experts,

Any one have the sample code for BBP_WFL_ADMIN_APPROV? Many thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

A sample code is attached below. Please modify it as per your requirement.

METHOD if_ex_bbp_wfl_admin_approv~admin_approver_get.
* Sample Code to get the SLA Approver as the agent
* for Invoice Documents

  DATA: ls_attr_single     TYPE  bbp_attr_list.
  DATA: ls_attr_dft_single TYPE  bbps_attr_single.
  DATA: ls_agent           TYPE swhactor.

  ls_attr_single-attr_id = 'SLAPPROVER'.

  CASE  iv_object_type.
    WHEN 'BUS2205'.
      CALL FUNCTION 'BBP_READ_ATTRIBUTES'
        EXPORTING
          iv_user                 = iv_user
          iv_scenario             = 'BBP'
          iv_attr_single          = ls_attr_single
        IMPORTING
          ev_attr_dft_single      = ls_attr_dft_single
        EXCEPTIONS
          object_id_not_found     = 1
          no_attributes_requested = 2
          attributes_read_error   = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        CLEAR ls_agent.
        ls_agent-otype = ls_attr_dft_single-value(2).
        ls_agent-objid = ls_attr_dft_single-value+2(12).
        APPEND ls_agent TO et_agent.
      ENDIF.
    WHEN OTHERS.
  ENDCASE.

ENDMETHOD.

Regards

Kathirvel

Former Member
0 Kudos

HI, in ls_attr_single ,there are another parameters : GET_LABEL .how can i set GET_LABEL ?

would you please tell me how to look for all parameters.

Former Member
0 Kudos

would you please give me the sample value of ls_attr_dft_single-value . we do not know how to set the value!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kathirvel,

Thank you very much for your answer.

Former Member
0 Kudos

Hi Kathirvel,

thanks very much for your kindly help. Now our requirements like this, first we got a certain user as the WF approver, and want to set this user to wf approval list, but we found the export parameter is only one:ev_attr_dft_single, In our senario, we do not user attributes:SLAPPROVER. So how can I set the certain user to this export parameter? By the way, could you give us some sample data of ev_attr_dft_single and the format of this table? We have hard code: OTYPE = 'US' and OBJID = '50000907', but the wf is not works correctly, it show up : agent assignment not exsit. Could anybody tell me this error ocurres from a wrong wf config or wrong BADI hard code?