cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering content in the SRM confirmation worklist

Former Member
0 Kudos

Hi

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
    CALL FUNCTION 'BBP_OM_DETERMINE_RESP_PGRP'
     EXPORTING
*   IS_OBJECT               =
       iv_user                 = sy-uname
*   IV_ORGUNIT              =
*   IS_CTLG_PORG            =
*   IS_RESP_ITEM_DATA       =
*   IV_PREFETCH_ID          =
     IMPORTING
       es_purch_data           = w_es_purch_data
*   ET_PURCH_DATA           =
     EXCEPTIONS
       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.
    ENDIF.

* 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.

        ENDIF.

      ENDIF.

    ENDLOOP.

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

  ENDIF.

ENDMETHOD.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

<u>Welcome to World of SRM !!!</u>

Which SRM version are you using ?

<b>Please go through the following links for more details and sample code as well.</b>

<u>

Let me know incase you face any issues.

Regards

- Atul

Former Member
0 Kudos

Thanks for the welcome Atul!

We're currently running SRM 4.0, and ERP 2004 (amongst other things like BW).

I have had a look at the previous posts as well as some sample code on SDN and an OSS note from SAP themselves - I'm just a little stuck now.

When I debug the BAdI, i_pdlist contains a lot of other information (such as object ID, object type, changed by info, date created, created by etc), but the fields PROC_ORG and PROC_GROUP are blank. And these are the fields I need to check against the users own values...

Any ideas how I can go about retrieving this info?

Thanks for your help.

Former Member
0 Kudos

Hi

<u>Inside the BBP_WFL_LIST for business object tupe - BUS2012 / BUS2201</u>

<b>At Header level of Confirmations, you can not have the fields PROC_ORG (Puchasing Org) and PROC_GRP (Purchasing Group) having any values. This is standard SRM functionality.</b>

<u>As I referred in the sample code in the earlier thread, you first need to find the Shopping cart details, based on the GUIDs and based on that Shopping cart, you need to drill-down to find out the relevant Item details (Puchasing Group and Purchasing Org) in this case. You need to make the logic accordingly. Take help of some ABAP Resource in your team to help you out.</u>

Let me know incase you still face any issue.

Regards

- Atul

Former Member
0 Kudos

I'm afraid I am the ABAP resource! Hehe. I've just no experience of SRM at all, but now you have pointed out that the header doesn't contain the data, I understand it a bit better. That's a great help!