Skip to Content
0
Former Member
Apr 01, 2011 at 12:14 PM

PO created though BAPI 'BAPI_PO_CREATE1' not visible in WPOHF4D

267 Views

Hi Experts,

As per the client requirement, I am using BAPI 'BAPI_PO_CREATE1' to create PO. My client is using retail transactions majorly and wants to see the created PO in tcode WPOHF4D. The PO created using this BAPI are visbible in Me22n, but not in WPOHF4D.

Can you please let me know what has to be done to see the generated POs in WPOHF4D?

Below is the part of code where I am filling the stuctures to be passed to BAPI:

*Filling header

lwa_poheader-SALES_PERS = lwa_datatab-ihrez.

lwa_poheader-doc_type = lwa_datatab-bsart.

lwa_poheader-doc_date = lwa_datatab-bedat.

lwa_poheader-comp_code = lwa_datatab-bukrs.

lwa_poheader-purch_org = lwa_datatab-ekorg.

lwa_poheader-pur_group = lwa_datatab-ekgrp.

lwa_poheader-vendor = lwa_datatab-lifnr.

lwa_poheader-currency = lwa_datatab-waers.

lwa_poheader-pmnttrms = lwa_datatab-zterm.

lwa_poheader-exch_rate = lwa_datatab-wkurs.

lwa_poheader-ex_rate_fx = lwa_datatab-kufix.

lwa_poheader-incoterms1 = lwa_datatab-inco1.

lwa_poheader-incoterms2 = lwa_datatab-inco2.

*Filling Purchase Order Header Data (Change Parameter)

lwa_poheaderx-SALES_PERS = v_true.

lwa_poheaderx-doc_type = v_true.

lwa_poheaderx-doc_date = v_true.

lwa_poheaderx-comp_code = v_true.

lwa_poheaderx-purch_org = v_true.

lwa_poheaderx-pur_group = v_true.

lwa_poheaderx-vendor = v_true.

lwa_poheaderx-currency = v_true.

lwa_poheaderx-pmnttrms = v_true.

lwa_poheaderx-exch_rate = v_true.

lwa_poheaderx-ex_rate_fx = v_true.

lwa_poheaderx-incoterms1 = v_true.

lwa_poheaderx-incoterms2 = v_true.

*Filling Item

lwa_poitem-po_item = lv_po_index.

lwa_poitem-material = lwa_datatab-matnr.

lwa_poitem-quantity = lwa_datatab-menge.

lwa_poitem-po_unit = lwa_datatab-meins.

lwa_poitem-net_price = lwa_datatab-netpr.

lwa_poitem-trackingno = lwa_datatab-bednr.

lwa_poitem-preq_name = lwa_datatab-afnam.

lwa_poitem-plant = lwa_datatab-werks.

lwa_poitem-tax_code = lwa_datatab-mwskz.

lwa_poitem-ret_item = lwa_datatab-ret_item.

lwa_poitem-po_price = '2'.

APPEND lwa_poitem TO lt_poitem.

*Filling Item Data (Change Parameter)

lwa_poitemx-po_item = lv_po_index.

lwa_poitemx-material = v_true.

lwa_poitemx-quantity = v_true.

lwa_poitemx-po_unit = v_true.

lwa_poitemx-net_price = v_true.

lwa_poitemx-trackingno = v_true.

lwa_poitemx-preq_name = v_true.

lwa_poitemx-plant = v_true.

lwa_poitemx-tax_code = v_true.

lwa_poitemx-ret_item = v_true.

lwa_poitemx-po_price = v_true.

APPEND lwa_poitemx TO lt_poitemx.

*Filling schedule line

lwa_poschedule-po_item = lv_po_index.

lwa_poschedule-delivery_date = lwa_datatab-eindt.

APPEND lwa_poschedule TO lt_poschedule.

*Filling Delivery Schedule (Change Parameter)

lwa_poschedulex-po_item = lv_po_index.

lwa_poschedulex-delivery_date = v_true.

APPEND lwa_poschedulex TO lt_poschedulex.

  • Filling Partner

IF lwa_datatab-lifn2 IS NOT INITIAL.

lwa_popartner-partnerdesc = v_partner_desc.

lwa_popartner-langu = 'EN'.

lwa_popartner-buspartno = lwa_datatab-lifn2.

APPEND lwa_popartner TO lt_popartner.

ENDIF.

  • Filling Conditions in Purchase Order

IF lwa_datatab-kbetr1 IS NOT INITIAL.

lwa_pocond-itm_number = lv_po_index.

lwa_pocond-cond_type = v_cond1_zvol.

lwa_pocond-cond_value = lwa_datatab-kbetr1.

lwa_pocond-currency = lwa_datatab-waers.

lwa_pocond-change_id = c_insert_flg.

APPEND lwa_pocond TO lt_pocond.

ENDIF.

IF lwa_datatab-kbetr2 IS NOT INITIAL.

lwa_pocond-itm_number = lv_po_index.

lwa_pocond-cond_type = v_cond2_zcdq.

lwa_pocond-cond_value = lwa_datatab-kbetr2.

lwa_pocond-currency = lwa_datatab-waers.

lwa_pocond-change_id = c_insert_flg.

APPEND lwa_pocond TO lt_pocond.

ENDIF.

  • Filling Conditions (Items, Change Parameter)

IF lwa_datatab-kbetr1 IS NOT INITIAL.

lwa_pocondx-itm_number = lv_po_index.

lwa_pocondx-cond_type = v_true.

lwa_pocondx-cond_value = v_true.

lwa_pocondx-currency = v_true.

lwa_pocondx-change_id = v_true.

APPEND lwa_pocondx TO lt_pocondx.

ENDIF.

IF lwa_datatab-kbetr2 IS NOT INITIAL.

lwa_pocondx-itm_number = lv_po_index.

lwa_pocondx-cond_type = v_true.

lwa_pocondx-cond_value = v_true.

lwa_pocondx-currency = v_true.

lwa_pocondx-change_id = v_true.

APPEND lwa_pocondx TO lt_pocondx.

ENDIF.

<removed by moderator>. Would really appreciate if someone helps.

Thanks,

Priyanka

Edited by: Thomas Zloch on Apr 1, 2011 2:16 PM - standard priority