on 05-18-2007 11:30 AM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.