cancel
Showing results for 
Search instead for 
Did you mean: 

how to assign a sinle pur grp to two company codes.

Former Member
0 Kudos

Hi,

I have problem while assigning the same porchasing group to 2 different company codes which are of the same backend system i.e is of the same logical system?\

system throws me a message this Pur grp is already assgined to that logical system.how should i resolve this please help?

Best Regards,

sairam.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

<u>Also please go through this -></u>

<b><u>SRM / EBP is more restrictive than R/3 on this point. You cannot share Pgroups to more than one Porg. If you have some issue mapping EBP Pgroups to R/3 groups, you can use badi to implement this behaviour.</u></b>

<b>I believe you should be implementing badi BBP_PGRP_FIND to change the purchase group as the standard logic would continue to conflict with the code you are attempting to use in the change badi. See the documentation provided in the badi definitions.</b>

<b>Incase nothing helps, Try using BBP_DOC_CHANGE_BADI to code your logic acordingly..</b>

<b><u>Try this sample code.</u></b>


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

ENDMETHOD.

<u>Other related links -></u>

Hope this will help.

Regards

- Atul

Former Member
0 Kudos

Hi

<u>Incase i understood you correctly, then, Please check the following SAP OSS Notes for more details -></u>

<b>Note 1017211 - Hierarchical purchasing organizations</b>

<u>Note 1016292 - Hierarchical purchasing organizations are not allowed</u>

Hope this will help. Do let me know.

Regards

- Atul