Problem creating Header Condition in BAPI_PO_CREATE1

|

Hello Gurus,
I am having problems with creating a header conditions using the BAPI BAPI_PO_CREATE1. I am filling up table such as: POCONDHEADER, POCONDHEADERX.
It creates a PO document but the header conditions I supplied is not included.

How do I go about this?
Can you guys give a sample code for this?

Need your urgent response on this matter.

Thanks,
Jeffrey



Hai

Check the following Code


DATA: g_s_poheader TYPE bapimepoheader,
g_s_poheaderx TYPE bapimepoheaderx.

DATA: l_no_messaging TYPE char1.
DATA: bednr LIKE wvfb-bednr.

DATA: l_t_return LIKE bapiret2 OCCURS 0.
DATA: l_t_poitem STRUCTURE bapimepoitem,
l_t_poitemx STRUCTURE bapimepoitemx,
l_t_poschedule STRUCTURE bapimeposchedule,
l_t_poschedulex STRUCTURE bapimeposchedulx,
l_t_poaccount STRUCTURE bapimepoaccount,
l_t_poaccountx STRUCTURE bapimepoaccountx,
l_t_pocond STRUCTURE bapimepocond,
l_t_pocondx STRUCTURE bapimepocondx.

CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = g_s_poheader
poheaderx = g_s_poheaderx
no_messaging = l_no_messaging "RWI-47-20-messaging
IMPORTING
exppurchaseorder = bednr

  • EXPHEADER =
TABLES
return = l_t_return
poitem = l_t_poitem
poitemx = l_t_poitemx
  • POADDRDELIVERY =
poschedule = l_t_poschedule
poschedulex = l_t_poschedulex
poaccount = l_t_poaccount
  • POACCOUNTPROFITSEGMENT =
poaccountx = l_t_poaccountx
pocond = l_t_pocond
pocondx = l_t_pocondx.

Thanks & regards
Sreenivasulu P



Hello,

THis BAPI is used by the standard program RBUS2012

Please check that. May it will useful for u.

Regards,
Vasanth



Hello BAR,
This is what I did in populating the header conditions:


perform Get_CalculationType using 'M' header_cond-cond_type changing vKrech.

i_header_cond-calctypcon = vKrech.
i_header_cond-cond_type = header_cond-cond_type.
i_header_cond-cond_value = header_cond-cond_val.
i_header_cond-currency = header_cond-currency.
i_header_cond-cond_unit = header_cond-unit.
i_header_cond-cond_p_unt = header_cond-per.
i_header_cond-change_id = 'U'.
append i_header_cond.

i_header_condx-condition_no = header_cond-condition_key.

  • i_header_condx-itm_number = header_cond-cond_num.
i_header_condx-calctypcon = 'X'.
i_header_condx-cond_type = 'X'.
i_header_condx-cond_value = 'X'.
i_header_condx-currency = 'X'.
i_header_condx-cond_unit = 'X'.
i_header_condx-cond_p_unt = 'X'.
i_header_condx-change_id = 'X'.
append i_header_condx.
clear: i_header_cond,
i_header_condx.


Hope you could help me on this one.
Thanks,
Jeffrey

And