cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of po in srm

Former Member
0 Kudos

Hi friends,

I am facing problem with PO creation in srm

data: poe_header like bbp_pds_po_header_ic.

data: poe_att type bbpt_pds_att_t with header line.

data: poi_header like bbp_pds_po_header_d.

data: poi_att type bbpt_pds_att_t with header line.

data: poe_item like bbp_pds_po_item_icu occurs 0 with header line.

data: poe_acct like bbp_pds_acc occurs 0 with header line.

data: poe_partner like bbp_pds_partner occurs 0 with header line.

data: poe_text like bbp_pds_longtext occurs 0 with header line.

data: poe_org like bbp_pds_org occurs 0 with header line.

data: poe_org like bbp_pds_org occurs 0 with header line.

data: poi_item like bbp_pds_po_item_d occurs 0 with header line.

data: poi_item like bbp_pds_po_item_d occurs 0 with header line.

data: poi_acct like bbp_pds_acc occurs 0 with header line.

data: poi_att type bbpt_pds_att_t with header line.

data: poi_limit like bbp_pds_limit occurs 0 with header line.

data: poi_messages like bbp_pds_messages occurs 0 with header line.

data: guid_counter_item like bbp_pds_po_header_ic-guid.

data: guid_counter_sub like bbp_pds_po_header_ic-guid.

  • header

poe_header-guid = 1.

poe_header-posting_date = sy-datlo.

poe_header-currency = reqheaders-currency.

poe_header-description = reqheaders-doc_name.

poe_att-guid = att_guid.

att_guid = att_guid + 1.

poe_att-p_guid = guid_counter_item.

append poe_att.

poe_item-guid = guid_counter_item.

poe_item-parent = 1.

poe_item-manu_prod = reqlinemas-manu_mat.

poe_item-description = reqlinemas-short_text.

poe_item-ordered_prod = reqlinemas-material.

poe_item-dp_stge_loc = reqlinemas-store_loc.

poe_item-product_type = '01'.

poe_item-number_int = item_no.

item_no = item_no + 10.

append poe_item.

poe_acct-guid = guid_counter_sub.

poe_acct-p_guid = guid_counter_item.

poe_acct-acc_no = reqaccts-serial_no.

append poe_acct.

poe_text-tdspras = sy-langu.

poe_text-counter = reqtexts-counter.

poe_text-tdformat = reqtexts-text_form.

poe_text-tdline = reqtexts-text_line.

append poe_text.

call function 'BBP_PD_PO_CREATE'

exporting

i_header = poe_header

i_save = 'X'

it_attach = poe_att[]

importing

e_header = poi_header

et_attach = poi_att[]

tables

i_item = poe_item

i_account = poe_acct

i_partner = poe_partner

i_longtext = poe_text

i_orgdata = poe_org

e_item = poi_item

e_account = poi_acct

e_messages = poi_messages.

call function 'BBP_PD_PO_SAVE'.

Thanks,

Asha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can you try using 'COMMIT WORK' or 'COMMIT WORK AND WAIT' after BBP_PD_PO_SAVE.

Former Member
0 Kudos

Hi,

You have used numbers such 1 as guid which is worng and system will not accept it.

In SAP GUID is RAW data type with 16 bit or 32 bit.

It is created with function module "GUID_CREATE".

Assignment of guids and parent guid at item level need to be taken care....

Regards

kalandi