Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in creating purchase order Using BAPI

Former Member
0 Likes
441

Dear ABAPers,

I am working on creating the purchase order using BAPI.In that i am facing the Problem while giving the condition type.If anybody have done the program creating the Purchase order with condtion types help me to solve this problem.

Thanks & Regard,

Ashok.

3 REPLIES 3
Read only

Former Member
0 Likes
384

Hi,

First you creat a PO using BAPI_PO_CREATE , once PO is created then you use the FM BAPI_PO_CHANGE and update the condtions in PO. See the code below given.

Fm lt_cond-condition_no = lvc_knumv.
lt_cond-itm_number = gt_output-ebelp.
lt_cond-cond_type = 'FRB1'.
lt_cond-cond_st_no = '020'.
lt_condx-condition_no = lvc_knumv.
lt_condx-itm_number = gt_output-ebelp.
lt_condx-itm_numberx = 'X'.
lt_condx-cond_st_no = lt_cond-cond_st_no.
lt_condx-cond_st_nox = 'X'.
lt_condx-cond_type = 'X'.

lt_cond-cond_value = gt_output-frcst.
lt_condx-cond_value = 'X'.
lt_cond-currency = p_cndcur.
lt_condx-currency = 'X'.
lt_cond-vendor_no = gt_output-frvndr.
lt_condx-vendor_no = 'X'.
lt_cond-change_id = 'I'.
lt_condx-change_id = 'X'.

APPEND lt_cond.
APPEND lt_condx.


CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = gt_output-ebeln
TABLES
return = lt_return
* poitem = lt_poitem
* poitemx = lt_poitemx
pocond = lt_cond
pocondx = lt_condx.

Thanks.

Read only

0 Likes
384

Hi,

Thank you very much for your valuable reply.

Thanks & Regards,

Ashok.

Read only

0 Likes
384

This message was moderated.