Skip to Content
Former Member
May 18, 2007 at 10:30 AM

Filtering content in the SRM confirmation worklist



I'm quite new to SRM and am having some trouble implementing BAdI BBP_WF_LIST. I'm hoping someone on SDN can just give me a nudge in the right direction...

I am trying to filter the content of the worklist a user sees in the transaction BBPCF03, Confirmation Goods/Services Centrally. Within the BAdI BBP_WF_LIST, I have set the object filter to BUS2203 to restrict the content filter to confirmations.

I have then written some code (see below) to get some information about the user, and I want to remove the confirmations where the purchasing organisation of the user does not match the purchasing organisation of the confirmation. However, when I debug the code, these fields within table i_pdlist are blank.

I guess I am missing something somewhere, but basically I need your help in getting the purchasing organisation for each item. Do I need to go and get the relevant purchase order for this? If anyone can point me in the right direction, you'd be a great help. I've pasted my code below so hopefully someone can see what I'm doing wrong!

Thanks again, from your SRM newbie, James.

METHOD if_ex_bbp_wf_list~bbp_wf_list.

* add details of implementation

* DATA DECLERATIONS                                                    *
  DATA: wa_pdlist TYPE bbp_pds_pdlist,
        t_pdlist TYPE bbp_pdt_doc_key_badi,
        s_pdlist TYPE bbp_pdt_doc_key_badi,
        wa_s_pdlist TYPE bbp_pds_doc_key_badi,
        wa_e_pdlist TYPE bbp_pds_doc_key_badi,
        w_es_purch_data TYPE bbps_om_purch_data.

* BEGIN OF PROCESSING                                                  *

* Check transaction code
  IF sy-tcode = 'BBPCF03'.

* Break point for debugging in DEV
* break-point.

* Call a function module to determine the users purchasing group
*   IS_OBJECT               =
       iv_user                 = sy-uname
*   IV_ORGUNIT              =
*   IS_CTLG_PORG            =
*   IS_RESP_ITEM_DATA       =
*   IV_PREFETCH_ID          =
       es_purch_data           = w_es_purch_data
*   ET_PURCH_DATA           =
       cat_not_found           = 1
       no_resp_pgrp            = 2
       no_pgrp                 = 3
       src_sys_ambiguous       = 4
       OTHERS                  = 5.

* If function module fails, raise error message
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

* Copy the contents of the table from SAP to our internal table
    t_pdlist[] = e_pdlist[].

* Loop through the POs
    LOOP AT i_pdlist INTO wa_pdlist.

* When the object type is confirmation
      IF wa_pdlist-object_type = 'BUS2203'.

* If the purchasing org of the confirmation is different to the
* users purchasing org
        IF NOT wa_pdlist-proc_org = w_es_purch_data-proc_org.

* Delete the record from our internal table
          DELETE t_pdlist WHERE guid = wa_pdlist-guid.




* Copy our modified table of confirmations ready for export
    e_pdlist[] = t_pdlist[].