on 01-17-2008 3:28 PM
Hi all,
I'm using BBP_DOC_CHANGE_BADI badi, in particular BBP_PO_CHANGE method.
I have to fill a custom field in the header from a OrgData.
this is the code
METHOD if_ex_bbp_doc_change_badi~bbp_po_change.
DATA: ls_partner TYPE bbp_pds_partner,
ls_item TYPE bbp_po_item_badi,
ls_acc TYPE bbps_acc_badi,
ls_hcf TYPE bbp_pds_hcf_po,
ls_icf TYPE bbp_pds_icf_po,
ls_sdln TYPE bbp_pds_sdln,
ls_item_i TYPE bbp_pds_po_item_icu,
fm_header type BBP_PDS_PO_HEADER_D,
ls_orgdata type BBP_PDS_ORG.
DEFINE fill_str.
loop at &1 into &2.
append &2 to &3.
clear &2.
endloop.
END-OF-DEFINITION.
MOVE-CORRESPONDING is_header TO es_header.
fill_str it_acc ls_acc et_acc.
fill_str it_hcf ls_hcf et_hcf.
fill_str it_icf ls_icf et_icf.
fill_str it_sdln ls_sdln et_sdln.
fill_str it_orgdata ls_orgdata et_orgdata.
fill_Str it_partner ls_partner et_partner.
LOOP AT it_item INTO ls_item_i.
MOVE-CORRESPONDING ls_item_i TO ls_item.
APPEND ls_item TO et_item.
CLEAR: ls_item, ls_item_i.
ENDLOOP.
read table it_orgdata into ls_orgdata index 1.
es_header-zz_tipotr = ls_orgdata-PROC_GROUP_ID.
ENDMETHOD.
In the badi all works fine but in the browser the value doesn't appear.
I debug some code, and the customer fields was losen out the the function module BBP_PD_PO_UPDATE.
Any Idea? is there any note to implement or it's my mistake?
regards
enzo
Hi Enzo
Pl check note 1106386
Best rgds
Ramki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please go through the details of the Related OSS Notes given below ->
*Note 1123502 Unable to change the orgdata in BADI BBPDOC_CHANGE_BADI*_
Other useful notes ->
Note 1127459 BBP_PD_CONF_CREATE: Tabellenartige Kundenfelder vom BADI
Note 857459 CUF. User-defined fields for AUC in BBP_DOC_CHANGE_BADI
Note 797971 Customer-defined fields for BID in BBP_DOC_CHANGE_BADI
Note 807287 CUF user-defined field for QUOT in BBP_DOC_CHANGE_BADI BADI
Note 458591 User-defined fields: Preparation and use
Note 672960 Customer fields
Do let me know.
Regards
- Atul
Hi,
Missing part...
etorgdata[] = it_orgdata[]._
etitem [] = it_item[]._
You can use various Business Add-Ins provided by SRM system to meet your requirements.
Technically, it's possible using the BADIs
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
Here is the sample code for changing the already determined Purchasing groups in SRM System.
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.
Refer the foll thread for more details:
Regards
- Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.