cancel
Showing results for 
Search instead for 
Did you mean: 

"Proc_Group" assignment to shopping cart from transferred requisitions

Former Member
0 Kudos

Scenario is as follows :

Purchase requsitions are created in R/3 and 3 distinct purchase groups are used in Requsitions (in R/3) based on the departments which originate the requisitions.

e.g. Engineering - 001

Medicines - 002

Projects - 003

In SRM organisation plan we need to categorise the shopping carts created after transfer under three purchasing groups. (Proc_Group)

Engineering - O 50000127

Medicines - O 50000128

Projects - O 50000129

We need to write a logic whereby the purchase requisitions tranferred with PGrp 001 from R/3 will get Proc_Org as O 50000127

Effective suggestions along with line of development - Points for sure

Thanks & regards,

Avinash

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

<b>You can use various Business Add-Ins provided by SRM system to meet your requirements.</b>

<u>Technically, it's possible using the BADIs</u>

BBP_DOC_CHANGE_BADI         BAdI for Changing EBP Purchasing Documents  

BBP_PGRP_ASSIGN_BADI        EBP Purchasing Documents: Assign Purchasing Group(s)    

BBP_PGRP_FIND                      Shopping Cart: Determine Responsible Purchasing Group(s)

BBP_CREATE_BE_RQ_NEW     Exit while creating a purchase requisition in backend system

BBP_CREATE_REQ_BACK  OLD  Exit while creating a purch. req. in backend system

<u>Here is the sample code for changing the already determined Purchasing groups in SRM System.</u>

METHOD if_ex_bbp_doc_change_badi~bbp_sc_change.

data:          
         ls_header            TYPE bbp_pds_sc_header_d,        
         ls_item              TYPE bbps_sc_item_badi,
         ls_orgdata           TYPE bbp_pds_org,
         ls_purch_grps        TYPE bbps_om_pgr_light,
         lt_purch_grps         TYPE TABLE OF bbps_om_pgr_light INITIAL
                                             SIZE 5.

*--- Get the shopping cart header details
  CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
    EXPORTING
      i_guid   = is_header-guid
    IMPORTING
      e_header = ls_header.


* Map header data
  MOVE-CORRESPONDING is_header TO es_header.

* Map Item data
  LOOP AT it_item INTO ls_item. 
    APPEND ls_item TO et_item.
  ENDLOOP.

  et_orgdata[] = it_orgdata[].


* For every purchasing organization, get the corresponding
* purchasing group assigned in the Organization structure
  CALL FUNCTION 'BBP_OM_FIND_PURCH_GRPS_BEI'
    EXPORTING
      read_purch_org = 'X'
    IMPORTING
      pgrp_tab_ext   = lt_purch_grps.


* change the purch org id and purch grp id in et_orgdata
  LOOP AT it_orgdata INTO ls_orgdata.
    CLEAR: ls_item.
    READ TABLE et_item INTO ls_item WITH KEY guid = ls_orgdata-p_guid.
    IF sy-subrc EQ 0.
      CLEAR: ls_purch_grps.
* Use ls_purch_grps to update org data based on changed purch org
      LOOP AT lt_purch_grps INTO ls_purch_grps.
        IF ls_purch_grps-purch_orgx+10(4) EQ ls_item-be_pur_org AND
           ls_purch_grps-purch_grpx+10(3) EQ ls_item-be_pur_group.
           ls_orgdata-proc_group_ot    = ls_purch_grps-purch_grp-otype.
           ls_orgdata-proc_group_id    = ls_purch_grps-purch_grp-objid.
           ls_orgdata-proc_org_resp_ot = ls_purch_grps-purch_org-otype.
           ls_orgdata-proc_org_resp_id = ls_purch_grps-purch_org-objid.
           ls_orgdata-proc_org_ot      = ls_purch_grps-purch_org-otype.
           ls_orgdata-proc_org_id      = ls_purch_grps-purch_org-objid.
          MODIFY et_orgdata FROM ls_orgdata TRANSPORTING proc_group_ot
                                                         proc_group_id
                                                       proc_org_resp_ot
                                                       proc_org_resp_id
                                                         proc_org_ot
                                                         proc_org_id
                                 WHERE guid = ls_orgdata-guid.
          EXIT.
        ENDIF.
      ENDLOOP.
    ENDIF.   " if sy-subrc eq 0 --> read table et_item
  ENDLOOP.   " loop at it_orgdata into ls_orgdata

************************************************************************

Hope this will help.

Regards

- Atul

Former Member
0 Kudos

Hi,

We are Working in SRM 3.0 classical scenario and we had a problem how we can assign a One Buyer to multiple PO groups.

Though we are doing the SAP Code modification, we are not able to see the functionality of Assign to me or Work List functionality once we are claering the Purchasing Orgs.

If you have any idea which part of SAP code we can change to achieve this.

Thanks on Advance.

Murali

Answers (3)

Answers (3)

Former Member
0 Kudos

We have created a custom BADI '/BGT/DOC_CHANGE_BADI' for standard BADI-

'BBP_DOC_CHANGE_BADI' as we have multiple implementation for this custom badi.

In this BADI,code is written to determine the Purchasing organisation

based upon certain logics. While changing the values for Puchasing

Organisation(EKORG),PROC_ORG_OT and PROC_ORG_ID ,values are getting

modified as required.I can find the correct values updated in all the

tables after shopping cart gets created.In BBP_PD im getting all

desired values but on SRM Portal screen I can see purchasing Group

field's drop down list with three values in which one value is

initial.Hence on SRM portalt, I am not seeing the default value for

Purchasing Group field.Please advice.

Former Member
0 Kudos

Hello Atul,

Thanks for the piece of code.

Helpful clue for our development.

Thanks & regards,

Avinash

Former Member
0 Kudos

Hi Avinash,

Maintain the responsibility tab under Purchasing Gruoup in the Organisation strucuture.

Assign the respective PGroup 001 from the R/3 to POrg 50000127.

with regards,

mahesh