CONDITIONS IN BAPI_PO_CREATE1
Hi, dear experts.
Does anybody know how to fill correctly conditions in BAPI interface? I`d successfully use a field named "Condition amount" (POCOND-COND_VALUE in TABLES interface), but I need to use "Condition value". How can I fill it? In ME21N ("Conditions" tab) we are able to fill both a left field ("Condition amount" POCOND-COND_VALUE in TABLES interface) and a right field ("Condition value"), but in BAPI I can`t fill a right field.
Hi
If you see the Function module documentation of BAPI_PO_CREATE1, you can see a example
Regards
Madhan D
Similar Messages
-
Validating vendors in PO item conditions of BAPI_PO_CREATE1
Hai friends,
BAPI_PO_CREATE1 is not validating the vendors of item level conditions(BAPIMEPOCOND-VENDOR_NO).
But I have to validate those vendors existed in SAP or not. please help me.
regards,
Eswar.before passing the data to any screen using bdc(session method or call transaction) or bapi methods you need to validate the data from its check tables say you asked the vendors is not validating u should check the data from lfa1 table whether the vendors are available or not this is nothing but data clensing.
and each record entered in the bapi function module should be fully data validated i.e the data should 99.99% save in the data base table of concerned tables like ekko,ekpo in this case ie. this is nothing but data prusing.
write select statements to lfa1 table & delete the records if in flat file given there is no vendors matched to database tables before passing the vendors to bapi_po_create functionmodule -
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,
JeffreyHai
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 -
Problem in conditions pricing updation using BAPI_PO_CREATE1
hi,
I am creating PO using BAPI_PO_CREATE1 however when i am passing the data to the bapi for conditions at item level the price value is not changing and throwing error as ( NET PRICE FOR ITEM 00010 adopted from last document ) so for all the items its throwing the same information and when i am chekin the PO the value is not the changing. and while creating the PO manually also the net price is coming automatically and we need to backspace the value and re enter the new value. So wht should i do in order to input the data into the PO.
Thanks in advanceThanks
-
BAPI_PO_CREATE1 Condition pricing problem
Hi Experts,
I created the PO through BAPI_PO_CREAE1 according to the below code. In that PO which i created default condition type "PBXX".But i want condition Type "PB00".so in my BAPI condtion table POCOND i gave "U" [ POCOND-change_id = 'U' (update) ].But the default "PBXX" is again coming.
when i give POCOND-change_id = 'I' (insert) two condition types are coming(PB00 & PBXX).
I referred our forum(sdn) throughly.I won't get solution.
data: del_date type sy-datum.
data: ORDER_HEADERS_OUT like BAPISDHD OCCURS 0 WITH HEADER LINE.
data: ORDER_ITEMS_OUT like BAPISDIT OCCURS 0 WITH HEADER LINE.
data: ORDER_SCHEDULES_OUT like BAPISDHEDU OCCURS 0 WITH HEADER LINE.
data: ORDER_PARTNERS_OUT like BAPISDPART OCCURS 0 WITH HEADER LINE.
data: ORDER_COND_HEAD like BAPICONDHD OCCURS 0 WITH HEADER LINE.
data: ORDER_COND_ITEM like BAPICONDIT OCCURS 0 WITH HEADER LINE.
data: ORDER_TEXTHEADERS_OUT like BAPISDTEHD OCCURS 0 WITH HEADER LINE.
datA: ORDER_TEXTLINES_OUT like BAPITEXTLI OCCURS 0 WITH HEADER LINE.
data: I_BAPI_VIEW like ORDER_VIEW OCCURS 0 WITH HEADER LINE.
data: pohead type bapimepoheader.
data: poheadx type bapimepoheaderx.
data: exp_head type bapimepoheader.
data: return type table of bapiret2 with header line.
data: poitem type table of bapimepoitem with header line.
data: poitemx type table of bapimepoitemx with header line.
data: posched type table of bapimeposchedule with header line.
data: poschedx type table of bapimeposchedulx with header line.
data : POTEXTHEADER type table of BAPIMEPOTEXTHEADER with header line .
data: POTEXTITEM type table of BAPIMEPOTEXT with header line.
*data: POTEXTITEMx type table of BAPIMEPOTEXTx with header line.
DATA: POCOND TYPE table of BAPIMEPOCOND with header line.
DATA: POCONDX TYPE TABLE OF BAPIMEPOCONDX WITH HEADER LINE.
data: ex_po_number type bapimepoheader-po_number.
data: itno type i.
i_bapi_view-HEADER = 'X'.
i_bapi_view-ITEM = 'X'.
i_bapi_view-SDSCHEDULE = 'X'.
i_bapi_view-PARTNER = 'X'.
i_bapi_view-SDCOND = 'X'.
i_bapi_view-SDCOND_ADD = 'X'.
i_bapi_view-TEXT = 'X'.
*i_bapi_view- = 'X'.
APPEND I_BAPI_VIEW.
DATA: SONO LIKE SALES_KEY OCCURS 0 WITH HEADER LINE..
SONO-VBELN = '0001014145'.
APPEND SONO.
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
i_bapi_view = I_BAPI_VIEW
I_MEMORY_READ =
tables
sales_documents = SONO
ORDER_HEADERS_OUT = ORDER_HEADERS_OUT
ORDER_ITEMS_OUT = ORDER_ITEMS_OUT
ORDER_SCHEDULES_OUT = ORDER_SCHEDULES_OUT
ORDER_BUSINESS_OUT =
ORDER_PARTNERS_OUT = ORDER_PARTNERS_OUT
ORDER_ADDRESS_OUT =
ORDER_STATUSHEADERS_OUT =
ORDER_STATUSITEMS_OUT =
ORDER_CONDITIONS_OUT =
ORDER_COND_HEAD = ORDER_COND_HEAD
ORDER_COND_ITEM = ORDER_COND_ITEM
ORDER_COND_QTY_SCALE =
ORDER_COND_VAL_SCALE =
ORDER_CONTRACTS_OUT =
ORDER_TEXTHEADERS_OUT = ORDER_TEXTHEADERS_OUT
ORDER_TEXTLINES_OUT = ORDER_TEXTLINES_OUT
BREAK-POINT.
pohead-comp_code = 'SG20'.
pohead-doc_type = 'NB' .
pohead-creat_date = sy-datum .
pohead-vendor = '0000100040'.
pohead-purch_org = 'SG20'.
pohead-pur_group = '001'.
pohead-langu = sy-langu .
pohead-doc_date = sy-datum.
poheadx-comp_code = c_x.
poheadx-doc_type = c_x.
poheadx-creat_date = c_x.
poheadx-vendor = c_x.
poheadx-langu = c_x.
poheadx-purch_org = c_x.
poheadx-pur_group = c_x.
poheadx-doc_date = c_x.
*POTEXTITEM-PO_ITEM = itno.
*POTEXTITEM-TEXT_ID =
*POTEXTITEM-TEXT_FORM
POTEXTHEADER-TEXT_LINE = SONO.
append POTEXTHEADER.
Item Level Data
itno = 10.
loop at ORDER_ITEMS_OUT.
poitem-po_item = itno.
poitem-material = ORDER_ITEMS_OUT-material.
poitem-plant = 'SG20'.
poitem-stge_loc = 'SA01'.
poitem-quantity = ORDER_ITEMS_OUT-REQ_QTY .
POITEM-NET_PRICE = ORDER_ITEMS_OUT-NET_PRICE.
append poitem.
poitemx-po_item = itno.
poitemx-po_itemx = c_x.
poitemx-material = c_x.
poitemx-plant = c_x .
poitemx-stge_loc = c_x .
poitemx-quantity = c_x .
poitemx-tax_code = c_x .
poitemx-item_cat = c_x .
poitemx-acctasscat = c_x .
POITEMX-NET_PRICE = C_X.
append poitemx.
POTEXTITEM-PO_NUMBER =
POTEXTITEM-PO_ITEM = itno.
POTEXTITEM-TEXT_ID = 'F01'.
*POTEXTITEM-TEXT_FORM
POTEXTITEM-TEXT_LINE = SONO.
append POTEXTITEM.
POCOND-itm_number = ITNO.
POCOND-cond_st_no = '001'.
POCOND-COND_COUNT = '01'.
POCOND-cond_type = 'PB00'.
POCOND-cond_value = ORDER_ITEMS_OUT-REQ_QTY.
POCOND-currency = ORDER_ITEMS_OUT-CURRENCY.
POCOND-CONDISACTI = ' '.
POCOND-COND_UPDAT = 'X'.
POCOND-change_id = 'U'.
APPEND pocond.
POCONDX-itm_number = ITNO.
POCONDX-cond_st_no = '001'.
POCONDX-cond_st_nox = 'X'.
POCONDX-itm_numberx = 'X'.
POCONDX-COND_COUNT = 'X'.
POCONDX-cond_type = 'X'.
POCONDX-cond_value = 'X'.
POCONDX-currency = 'X'.
POCONDX-CONDISACTI = 'X'.
POCONDX-change_id = 'X'.
POCONDX-COND_UPDAT = 'X'.
APPEND POCONDX.
itno = itno + 10.
endloop.
call function 'BAPI_PO_CREATE1'
EXPORTING
poheader = pohead
poheaderx = poheadx
testrun = ' '
IMPORTING
exppurchaseorder = ex_po_number
expheader = exp_head
TABLES
return = return
poitem = poitem
poitemx = poitemx
poschedule = posched
poschedulex = poschedx
POTEXTHEADER = POTEXTHEADER
POTEXTITEM = POTEXTITEM
POCOND = POCOND
POCONDX = POCONDX .
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
if not ex_po_number is initial.
call function 'DEQUEUE_ALL'.
else.
call function 'DEQUEUE_ALL'.
message i036.
endif.
WRITE: / EX_PO_NUMBER.Hi Vioth,
Did you got solution for thsi i am also facing the same problem.If you konw the solution kindly suggest the solution for this
Thanks in Adavce,
Regards...............Kishore -
Hello together,
i have the following problem. I used the BAPI BAPI_PO_CREATE1 to create Purchase Orders with reference to a purchase requsition. I have 2 different types of purchase requsitions. One with normal items and one with services.
So for both the creation of the purchase order works but if i add Conditions on Serivce Item Level to the purchase requsition they are not transfered to the purchase order.
To eliminate misunderstandings in a purchase order there are 3 diffent typs of conditions possible. First on header Level of the purchase order which can easly be filled with BAPI. The second on item level of the purchase order with can also easily be filled with BAPI and the last on service level which i doesn't found in BAPI. May be someone has an idea how to fill these conditions.
Here is my code:
header-doc_date = wa_eban-erdat.
value = 10.
Set COMP_CODE
select single bwkey from t001w into lv_bwkey
where werks = wa_eban-werks.
select single bukrs from t001k into header-comp_code
where bwkey = lv_bwkey.
header-doc_type = wa_eban-bsart.
header-vendor = wa_eban-flief.
header-created_by = sy-uname.
header-purch_org = wa_eban-ekorg.
header-pur_group = wa_eban-ekgrp.
header-langu = sy-langu.
header-status = 'B'.
header-indx = header-indx + 1.
append header.
headerx-doc_type = 'X'.
headerx-comp_code = 'X'.
headerx-vendor = 'X'.
headerx-purch_org = 'X'.
headerx-created_by = 'X'.
headerx-pur_group = 'X'.
headerx-created_by = 'X'.
headerx-langu = 'X'.
headerx-status = 'X'.
headerx-indx = header-indx.
append headerx.
*!-- Populating the BAPI for PO Item data
poitems-po_item = value.
poitems-material = wa_eban-matnr.
poitems-stge_loc = wa_eban-lgort.
poitems-plant = wa_eban-werks.
poitems-item_cat = wa_eban-pstyp.
poitems-po_unit = wa_eban-meins.
poitems-quantity = wa_eban-menge - wa_eban-bsmng.
poitems-preq_no = wa_eban-banfn.
poitems-preq_item = wa_eban-bnfpo.
poitems-tax_code = wa_eban-yy_mwskz.
poitems-indx = header-indx.
poitemsx-po_item = value.
poitemsx-material = 'X'.
poitemsx-stge_loc = 'X'.
poitemsx-plant = 'X'.
poitemsx-item_cat = 'X'.
poitemsx-preq_no = 'X'.
poitemsx-preq_item = 'X'.
poitemsx-po_unit = 'X'.
poitemsx-quantity = 'X'.
poitemsx-tax_code = 'X'.
poitemsx-indx = header-indx.
Create Construction with Services
if wa_eban-bsart eq 'ZXXXX.
poitemsx-pckg_no = 'X'.
poitems-pckg_no = wa_eban-packno.
endif.
append poitems.
append poitemsx.
*!-- Populating the BAPI for PO Item Schedule data
scd-po_item = value.
scd-sched_line = value1.
scd-delivery_date = wa_eban-lfdat.
scd-quantity = wa_eban-menge - wa_eban-bsmng.
scd-indx = header-indx.
append scd.
scdx-po_item = value.
scdx-sched_line = value1.
scdx-delivery_date = 'X'.
scdx-quantity = 'X'.
scdx-indx = header-indx.
append scdx.
*!-- Populating the BAPI for PO Item data for Accounting
account-po_item = value.
account-quantity = wa_eban-menge - wa_eban-bsmng.
account-indx = header-indx.
accountx-po_item = value.
accountx-quantity = 'X'.
accountx-indx = header-indx.
Create Construction with Services
if wa_eban-bsart eq 'ZXXX.
account-costcenter = wa_ebkn-kostl.
account-gl_account = wa_ebkn-sakto.
account-orderid = wa_ebkn-aufnr.
select single posid from prps into account-wbs_element where pspnr = wa_ebkn-ps_psp_pnr .
account-serial_no = wa_ebkn-zebkn.
accountx-costcenter = 'X'.
accountx-gl_account = 'X'.
accountx-orderid = 'X'.
accountx-wbs_element = 'X'.
accountx-serial_no = 'X'.
endif.
append account.
append accountx.https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/rfc%2bpurchase%2border%2bcreation%2bfm%2bfrom%2bariba
cheers
Aveek -
Problem in Conditions while using BAPI_PO_CREATE1
Hi All
I am using BAPI_PO_CREATE1 to create purchase Order. When I am changing calculation type for condition type's system not picking the correct amount through BAPI.
For e.g. for condition type 'FRB1' (Freight Value) I have maintain the amount 10.00 in condition value for calculation type 'B' (fixed amount). But when I pass calculation type 'A' i.e. Percentage, BAPI overwrites the amount to 1.00%.
I Want to pass the amount 10.00 as it is with calculation type '%'. Kindly suggest how to do it.
Regards,
PradipHi All
I am using BAPI_PO_CREATE1 to create purchase Order. When I am changing calculation type for condition type's system not picking the correct amount through BAPI.
For e.g. for condition type 'FRB1' (Freight Value) I have maintain the amount 10.00 in condition value for calculation type 'B' (fixed amount). But when I pass calculation type 'A' i.e. Percentage, BAPI overwrites the amount to 1.00%.
I Want to pass the amount 10.00 as it is with calculation type '%'. Kindly suggest how to do it.
Regards,
Pradip -
How to pass the condition vallues in bapi BAPI_PO_CREATE1 for items as well
HI,
where to pass the condition value table in bapi BAPI_PO_CREATE1 item level as well as header level
Like Frieght charges,discounts, basic price ,VAT,CST etc.
Is there any BAPI for GR tcode MIGO.
Pl send along with simple examples .
Your answeres will be rewarded.Pass the condition value to the following parameters.
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
For GR u case use the following BAPI.
GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
02 - MB31 - Goods Receipts for Prod Order
03 - MB1A - Goods Issue
04 - MB1B - Transfer Posting
05 - MB1C - Enter Other Goods Receipt
06 - MB11
Domain: KZBEW - Movement Indicator
Goods movement w/o reference
B - Goods movement for purchase order
F - Goods movement for production order
L - Goods movement for delivery note
K - Goods movement for kanban requirement (WM - internal only)
O - Subsequent adjustment of "material-provided" consumption
W - Subsequent adjustment of proportion/product unit material
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
* TESTRUN = ' '
IMPORTING
goodsmvt_headret = mthead
* MATERIALDOCUMENT =
MATDOCUMENTYEAR =
tables
goodsmvt_item = itab
GOODSMVT_SERIALNUMBER =
return = errmsg. -
BAPI_PO_CREATE1 condition type are creating duplicate records
Hello Experts,
Currently I am creating Purchase orders using BAPI_PO_CREATE1 . When I am passing Condition related records to the same BAPI , second line item onwards , it creates multiple records of same condition type .
I have also looked into threads in SDN for the same , and they have suggested to create PO using BAPI_PO_CREATE and later use BAPI_PO_CHANGE to pass condition records. I have tried the same , but still second line item onwards it creates multiple records. Please tell me how do I resolve this issue.
Thanks
TrishnaHello All,
This duplicate condition record creation may happen due to a setting in the MM configuration, where the system tries to pull in the history condition records ,based on the same set of condition record determination parameters.
Please contact the MM functional consultant in your team for settings change in detrmination of condition records under " MM-Purchasing " section.
Best Regards,
Kumaar.S -
Submit new Item Conditions via Function Module BAPI_PO_CREATE1
Hi all,
I have problems using FM BAPI_PO_CREATE1.
I want to transfer Item conditions via FM, but I am not able to change the netprice via FM, my Conditions are not displayed within the Item (only netprice of Item is displayed).
I create POs out of a SRM System via FM BBP_PO_INBOUND (which calls BAPI_PO_CREATE1).
My question:
Has anyone an example how to fill in data within table POCOND so that my PO item contains for example a gross price and a rebate.
I am stucked, I can´t find the solution to create item conditions via FM BAPI_PO_CREATE1.
Any examples?
Thanks a lot
Regards
AndreasProblem resolved
I used the FBGENDAT param in R/3 system to generate test data automatically, compare the data and finally I found my error.
--> OSS note 539978
Regards
Andreas -
Problem with condition type in BAPI_PO_CREATE1
Hi All,
I am uploading the data for txn ME21N through BAPI_PO_CREATE1.
Whenever i m testing this bapi it is giving PO no. but Codition types are not getting update neither on header level nor on item level.
Header Condition type and Condition value ,I am giving in Structures POCONDHEADER, POCONDHEADERX and Item Condition type and Condition value , i am giving in structures POCOND,POCONDX.
Thanx in Advance.
Regards,
Shiv KantTake a look in this example:
ADD 10 TO v_item.
e_poheader-comp_code = t_cabec-bukrs.
e_poheader-doc_type = 'EC'.
e_poheader-vendor = t_cabec-lifnr.
e_poheader-creat_date = sy-datum.
e_poheader-created_by = sy-uname.
e_poheader-item_intvl = '0010'.
e_poheader-langu = sy-langu.
e_poheader-langu_iso = sy-langu.
e_poheader-incoterms1 = t_cabec-inco1.
e_poheader-incoterms2 = t_cabec-inco2.
e_poheader-currency = t_cabec-waers.
e_poheader-purch_org = v_ekorg.
e_poheader-pur_group = t_saida3-ekgrp.
e_poheader-pmnttrms = t_cabec-zterm.
e_poheader-telephone = t_cabec-telf1.
e_poheader-sales_pers = t_cabec-verkf.
e_poheaderx-comp_code = 'X'.
e_poheaderx-doc_type = 'X'.
e_poheaderx-vendor = 'X'.
e_poheaderx-creat_date = 'X'.
e_poheaderx-created_by = 'X'.
e_poheaderx-item_intvl = 'X'.
e_poheaderx-langu = 'X'.
e_poheaderx-langu_iso = 'X'.
e_poheaderx-incoterms1 = 'X'.
e_poheaderx-incoterms2 = 'X'.
e_poheaderx-currency = 'X'.
e_poheaderx-purch_org = 'X'.
e_poheaderx-pur_group = 'X'.
e_poheaderx-pmnttrms = 'X'.
e_poheaderx-telephone = 'X'.
e_poheaderx-sales_pers = 'X'.
IF t_saida3-elem_pep IS NOT INITIAL.
MOVE 'P' TO t_saida3-knttp.
ELSEIF t_saida3-aufnr IS NOT INITIAL.
MOVE 'F' TO t_saida3-knttp.
ELSEIF t_saida3-kostl IS NOT INITIAL.
MOVE 'K' TO t_saida3-knttp.
ENDIF.
t_poitem-po_item = v_item.
t_poitem-plant = s_werks.
t_poitem-short_text = t_saida3-txz01.
t_poitem-quantity = t_saida3-menge.
t_poitem-po_unit = t_saida3-meins.
t_poitem-acctasscat = t_saida3-knttp.
t_poitem-matl_group = t_saida3-matkl.
t_poitem-tax_code = t_saida3-mwskz.
t_poitem-order_reason = t_saida3-bsgru.
t_poitem-indus3 = t_saida3-j_1bindus3.
t_poitem-matl_usage = t_saida3-j_1bmatuse.
t_poitem-mat_origin = t_saida-j_1bmatorg.
t_poitem-item_cat = t_saida-epstp.
t_poitem-net_price = t_saida3-netpr.
t_poitem-price_unit = t_saida3-peinh.
t_poitem-bras_nbm = t_saida3-j_1bnbmco1.
t_poitem-PREQ_NAME = t_saida3-requisitante.
APPEND t_poitem.
t_poitemx-po_item = v_item.
t_poitemx-plant = 'X'.
t_poitemx-short_text = 'X'.
t_poitemx-quantity = 'X'.
t_poitemx-po_unit = 'X'.
t_poitemx-acctasscat = 'X'.
t_poitemx-matl_group = 'X'.
t_poitemx-tax_code = 'X'.
t_poitemx-order_reason = 'X'.
t_poitemx-indus3 = 'X'.
t_poitemx-matl_usage = 'X'.
t_poitemx-mat_origin = 'X'.
t_poitemx-item_cat = 'X'.
t_poitemx-net_price = 'X'.
t_poitemx-price_unit = 'X'.
t_poitemx-bras_nbm = 'X'.
t_poitemx-preq_name = 'X'.
APPEND t_poitemx.
t_schedule-po_item = v_item.
t_schedule-del_datcat_ext = '1'.
t_schedule-delivery_date = v_data.
t_schedule-del_datcat_ext = 'D'.
t_schedule-quantity = t_saida3-menge.
APPEND t_schedule.
t_schedulx-po_item = v_item.
t_schedulx-del_datcat_ext = 'X'.
t_schedulx-delivery_date = 'X'.
t_schedulx-del_datcat_ext = 'X'.
t_schedulx-quantity = 'X'.
APPEND t_schedulx.
t_account-po_item = v_item.
t_account-gl_account = t_saida3-saknr.
t_account-wbs_element = t_saida3-elem_pep.
t_account-costcenter = t_saida3-kostl.
t_account-orderid = t_saida3-aufnr.
t_account-gr_rcpt = t_saida3-recebedor.
t_account-unload_pt = t_saida3-pdescarga.
APPEND t_account.
t_accountx-po_item = v_item.
t_accountx-gl_account = 'X'.
t_accountx-wbs_element = 'X'.
t_accountx-costcenter = 'X'.
t_accountx-orderid = 'X'.
t_accountx-gr_rcpt = 'X'.
t_accountx-unload_pt = 'X'.
APPEND t_accountx.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = e_poheader
poheaderx = e_poheaderx
testrun = ' '
IMPORTING
exppurchaseorder = v_pedido
TABLES
return = t_bapiret2
poitem = t_poitem
poitemx = t_poitemx
poschedule = t_schedule
poschedulex = t_schedulx
poaccount = t_account
poaccountx = t_accountx
potextitem = t_textitem
potextheader = t_textheader. -
What values to pass in BAPI BAPI_PO_CREATE1 for conditions
Hi,
what necessary values to be passed to conditions tables in bapi BAPI_PO_CREATE1
tables are :
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
I am just paassing item number, condition type ,condition value they are reflecting in created PO.
Helpfull answeres will be rewarded.Check this code u will get some idea of how to create a PO
REPORT zvk_bapi_po .
DATA: s_poheader LIKE bapimepoheader,
f_pono LIKE bapimepoheader-po_number,
s_poheaderx LIKE bapimepoheaderx,
s_versions LIKE bapimedcm,
t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,
t_addr LIKE bapimepoaddrdelivery OCCURS 0 WITH HEADER LINE,
t_schedule LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE,
t_schedulex LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE,
t_account LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE,
t_accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE,
t_return like BAPIRET2 OCCURS 0 WITH HEADER LINE.
Fill data
*__ Header
s_poheader-comp_code = '1000'.
s_poheader-doc_type = 'ZIPS'.
s_poheader-created_by = 'XXX'.
s_poheader-vendor = '0001000441'.
s_poheader-purch_org = 'EC01'.
s_poheader-pur_group = '569'.
s_poheader-currency = 'USD'.
s_poheaderx-comp_code = 'X'.
s_poheaderx-doc_type = 'X'.
s_poheaderx-created_by = 'X'.
s_poheaderx-vendor = 'X'.
s_poheaderx-purch_org = 'X'.
s_poheaderx-pur_group = 'X'.
s_poheaderx-currency = 'X'.
s_versions-post_date = '06/05/2006' .
s_versions-completed = 'X' .
s_versions-reason = '0001' .
s_versions-description = 'APPROVED BY KRISH' .
s_versions-req_by = 'HBE8328'.
t_poitem-short_text = '0005-000721'.
t_poitem-plant = '5002'.
t_poitem-trackingno = '1000002151'.
t_poitem-matl_group = 'MG0001'.
t_poitem-quantity = '8.000'.
t_poitem-po_unit = 'EA'.
t_poitem-orderpr_un = 'EA'.
t_poitem-net_price = '109.880000000'.
t_poitem-price_unit = '1'.
t_poitem-acctasscat = 'K'.
t_poitem-preq_name = 'ABC'.
t_poitemx-po_itemx = 'X'.
t_poitemx-short_text = 'X'.
t_poitemx-plant = 'X'.
t_poitemx-trackingno = 'X'.
t_poitemx-matl_group = 'X'.
t_poitemx-quantity = 'X'.
t_poitemx-po_unit = 'X'.
t_poitemx-orderpr_un = 'X'.
t_poitemx-net_price = 'X'.
t_poitemx-price_unit = 'X'.
t_poitemx-acctasscat = 'X'.
t_poitemx-preq_name = 'X'.
t_addr-name = 'CoCode 1000'.
t_addr-name_2 = 'Company Code 1000'.
t_addr-city = 'Houston'.
t_addr-postl_cod1 = '77020-6237'.
t_addr-street = '4100 Clinton Dr'.
t_addr-country = 'US'.
t_addr-langu = 'EN'.
t_addr-region = 'TX'.
t_addr-sort1 = 'COCODE 1000'.
t_addr-sort2 = 'COMPANY CODE 1000'.
t_addr-time_zone = 'CST'.
t_addr-comm_type = 'INT'.
t_addr-tel1_numbr = '7137534000'.
t_addr-e_mail = '[email protected]'.
t_addr-countryiso = 'US'.
t_addr-langu_iso = 'EN'.
t_schedule-sched_line = '0001'.
t_schedule-delivery_date = '04/17/2006'.
t_schedule-quantity = '8.000'.
t_schedule-preq_no = '5000000050'.
t_schedule-preq_item = '00010'.
t_schedulex-sched_line = '0001'.
t_schedulex-delivery_date = 'X'.
t_schedulex-quantity = 'X'.
t_schedulex-preq_no = 'X'.
t_schedulex-preq_item = 'X'.
t_account-serial_no = '01'.
t_account-gl_account = '0000500200'.
t_account-costcenter = '1000000297'.
t_account-gr_rcpt = '3227'.
t_account-co_area = 'CNTC'.
t_account-profit_ctr = '1000000297'.
t_accountx-serial_no = '01'.
t_accountx-gl_account = 'X'.
t_accountx-costcenter = 'X'.
t_accountx-gr_rcpt = 'X'.
t_accountx-co_area = 'X'.
t_accountx-profit_ctr = 'X'.
t_poitem-po_item = '00000'.
t_poitemx-po_item = '00000'.
t_addr-po_item = '00000'.
t_schedule-po_item = '00000'.
t_account-po_item = '00000'.
t_accountx-po_item = '00000'.
DO 50 TIMES.
t_poitem-po_item = t_poitem-po_item + 1.
APPEND t_poitem.
t_poitemx-po_item = t_poitemx-po_item + 1.
APPEND t_poitemx.
t_addr-po_item = t_addr-po_item + 1.
APPEND t_addr.
t_schedule-po_item = t_schedule-po_item + 1.
APPEND t_schedule.
t_schedulex-po_item = t_schedulex-po_item + 1.
APPEND t_schedulex.
t_account-po_item = t_account-po_item + 1.
APPEND t_account.
t_accountx-po_item = t_accountx-po_item + 1.
APPEND t_accountx.
ENDDO.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = s_poheader
poheaderx = s_poheaderx
versions = s_versions
IMPORTING
exppurchaseorder = f_pono
TABLES
RETURN = t_return
poitem = t_poitem
poitemx = t_poitemx
poaddrdelivery = t_addr
poschedule = t_schedule
poschedulex = t_schedulex
poaccount = t_account
poaccountx = t_accountx .
WRITE: 'PO No:', f_pono. -
BAPI_PO_CREATE1 -- Condition Record filling
Hi,
In this BAPI how to insert the Condition records to be filled ...
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = G_BAPIMEPOHEADER
POHEADERX = G_BAPIMEPOHEADERX
IMPORTING
EXPPURCHASEORDER = G_EBELN
EXPHEADER = GSTEST
TABLES
RETURN = G_BAPIRET2
POITEM = G_BAPIMEPOITEM
POITEMX = G_POITEMX
POSCHEDULE = G_BAPIMEPOSCHEDULE
POSCHEDULEX = G_POSCHEDULEX
POCOND = G_BAPIMEPOCOND
POCONDX = G_BAPIMEPOCONDX.
what are the mandatory fields,..
Any helpful inputs on this will be rewarded points
Rgs
Lakshmiraj.APls help,
Any useful inputs on this will be rewarded points. -
BAPI_PO_CREATE1 Prcicing Conditions
Hi,
By using BAPI_PO_CREATE1 i can create Purchase orders successfully i am trying to update with pricing condtions by using this function module. Pricing details are maintained in Purchase order.But the problem same pricing condition is appending while generating another PO. for example if i created 10 purchase orders successively in 10 th purchase order same pricing conditions appear 10 times in condition record.
Can any one suggest the solution for this,
Thanks in Advance
Regards..........KIshore.{ LOOP AT ITAB.
MOVE-CORRESPONDING ITAB TO T_POSPLIT.
APPEND T_POSPLIT.
ENDLOOP.
SORT T_POSPLIT BY SNO.
DELETE ADJACENT DUPLICATES FROM T_POSPLIT COMPARING SNO.
LOOP AT ITAB.
MOVE-CORRESPONDING ITAB TO ITAB2.
APPEND ITAB2.
ENDLOOP.
SORT ITAB2 BY SNO.
DELETE ADJACENT DUPLICATES FROM ITAB2 COMPARING SNO.
CLEAR : T_POSPLIT, ITAB ,T_POHEADER.
LOOP AT T_POSPLIT.
LOOP AT ITAB.
IF ITAB-SNO = T_POSPLIT-SNO.
IF ITAB-DOC_TYPE = T_POSPLIT-DOC_TYPE.
*SCHEDULE
*LOOP AT ITAB.
T_POSCHEDULE-PO_ITEM = ITAB-PO_ITEM.
T_POSCHEDULE-DELIVERY_DATE = ITAB-DELIVERY_DATE.
APPEND T_POSCHEDULE.
*SCHEDULE X
T_POSCHEDULEX-PO_ITEM = ITAB-PO_ITEM.
T_POSCHEDULEX-PO_ITEMX = 'X'.
T_POSCHEDULEX-DELIVERY_DATE = 'X'.
APPEND T_POSCHEDULEX.
*ITEM X
T_POITEMX-PO_ITEM = ITAB-PO_ITEM.
T_POITEMX-PO_ITEMX = 'X'.
T_POITEMX-PLANT = 'X'.
T_POITEMX-STGE_LOC = 'X'.
T_POITEMX-TRACKINGNO = 'X'.
T_POITEMX-MATERIAL = 'X'.
T_POITEMX-QUANTITY = 'X'.
T_POITEMX-NET_PRICE = 'X'.
T_POITEMX-VAL_TYPE = 'X'.
T_POITEMX-TAX_CODE = 'X'.
APPEND T_POITEMX.
*Condition
T_POCOND-ITM_NUMBER = ITAB-PO_ITEM.
T_POCOND-COND_TYPE = ITAB-COND_TYPE.
T_POCOND-COND_VALUE = ITAB-COND_VALUE.
T_POCOND-CURRENCY = '%'.
T_POCOND-CHANGE_ID = 'I'.
T_POCOND-COND_ST_NO = '001'.
T_POCOND-COND_COUNT = '01'.
APPEND T_POCOND.
T_POCONDX-ITM_NUMBER = ITAB-PO_ITEM.
T_POCONDX-ITM_NUMBER = 'X'.
T_POCONDX-COND_TYPE = 'X'.
T_POCONDX-COND_VALUE = 'X'.
T_POCOND-CURRENCY = 'X'.
T_POCONDX-CHANGE_ID = 'X'.
T_POCONDX-COND_ST_NO = 'X'.
T_POCONDX-COND_COUNT = 'X'.
APPEND T_POCOND.
ITEM
*converting material into BAPI acceptbale format
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = ITAB-MATERIAL
IMPORTING
OUTPUT = ITAB-MATERIAL
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE-CORRESPONDING ITAB TO T_POITEM.
T_POITEM-EMATERIAL = ' '.
APPEND T_POITEM.
*ITEM TEXT
CLEAR W_LNGTXT.
W_LNGTXT = ITAB-ITMTXT.
IF ITEM HAS LONG TEXT
CALL FUNCTION 'G_SPLIT_LINE'
EXPORTING
INPUT_LINE = W_LNGTXT
TABLES
EXPORT_LINES = T_SPLTITMTXT.
LOOP AT T_SPLTITMTXT.
T_POTEXTITEM-PO_ITEM = ITAB-PO_ITEM.
T_POTEXTITEM-TEXT_FORM = 'ST'.
T_POTEXTITEM-TEXT_ID = 'F01'.
MOVE T_SPLTITMTXT-ITMLNGTXT TO T_POTEXTITEM-TEXT_LINE.
APPEND T_POTEXTITEM.
CLEAR ITAB.
ENDLOOP .
ENDIF.
ENDIF.
CLEAR ITAB.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT ITAB WHERE SNO = T_POSPLIT-SNO AND
DOC_TYPE = T_POSPLIT-DOC_TYPE.
*IF ITAB-SNO = T_POSPLIT-SNO.
Add leading zeros to VENDOR
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ITAB-VENDOR
IMPORTING
OUTPUT = ITAB-VENDOR.
Add leading zeros to MATERIAL
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ITAB-MATERIAL
IMPORTING
OUTPUT = ITAB-MATERIAL.
HEADER
MOVE-CORRESPONDING ITAB TO T_POHEADER.
T_POHEADER-PO_NUMBER = ITAB-PONO.
T_POHEADER-DOC_TYPE = ITAB-DOC_TYPE.
T_POHEADER-GR_MESSAGE = 'X'.
APPEND T_POHEADER.
ENDIF.
ENDLOOP.
CLEAR T_POHEADER.
SORT T_POHEADER BY DOC_TYPE.
DELETE ADJACENT DUPLICATES FROM T_POHEADER COMPARING DOC_TYPE.
DESCRIBE TABLE T_POHEADER LINES LNS.
*HEADERX
DO LNS TIMES.
T_POHEADERX-PO_NUMBER = 'X'.
T_POHEADERX-VENDOR = 'X'.
T_POHEADERX-DOC_TYPE = 'X'.
T_POHEADERX-CREAT_DATE = 'X'.
T_POHEADERX-PURCH_ORG = 'X'.
T_POHEADERX-PUR_GROUP = 'X'.
T_POHEADERX-COMP_CODE = 'X'.
T_POHEADERX-GR_MESSAGE = 'X'.
T_POHEADERX-PMNTTRMS = 'X'.
T_POHEADERX-INCOTERMS1 = 'X'.
T_POHEADERX-INCOTERMS2 = 'X'.
T_POHEADERX-QUOT_DATE = 'X'.
T_POHEADERX-QUOTATION = 'X'.
T_POHEADERX-REF_1 = 'X'.
T_POHEADERX-SALES_PERS = 'X'.
T_POHEADERX-OUR_REF = 'X'.
T_POHEADERX-TELEPHONE = 'X'.
APPEND T_POHEADERX.
ENDDO.
CALL BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = T_POHEADER
POHEADERX = T_POHEADERX
IMPORTING
EXPPURCHASEORDER = PO_NUMBER
TABLES
RETURN = T_RETURN
POITEM = T_POITEM
POITEMX = T_POITEMX
POSCHEDULE = T_POSCHEDULE
POSCHEDULEX = T_POSCHEDULEX
POCOND = T_POCOND
POCONDX = T_POCONDX
POTEXTITEM = T_POTEXTITEM. " ITEM TEXT
**commit WORK and WAIT.
CALL BAPI COMMIT vivek
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
****EXPORTING
****WAIT =
IMPORTING
RETURN = T_RETURN
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = WAIT
IMPORTING
RETURN = T_RETURN.
HEADER TEXT UPLOADING
LOOP AT ITAB2[] INTO ITAB2.
IF CNTR = ITAB2-SNO.
READ TABLE ITAB2[] INTO ITAB2 WITH KEY SNO = CNTR.
T_LINE-TDFORMAT = 'ST'.
T_LINE-TDLINE = ITAB2-HDRTXT.
APPEND T_LINE.
INSERT PO HEADER TEXT.
PERFORM UPLOAD_HDR_TXT USING PO_NUMBER P_HTXT.
ENDIF.
ENDLOOP.
DELETE ITAB2 WHERE SNO = CNTR.
CNTR = CNTR + 1.
COLLECT GENERATED POs.
T_PONUMS-PO_NUMBER = PO_NUMBER.
APPEND T_PONUMS.
REFRESH T_POHEADER.
CLEAR T_POHEADER.
REFRESH T_POHEADERX.
CLEAR T_POHEADERX.
REFRESH T_POITEM.
REFRESH T_POITEMX.
REFRESH T_POSCHEDULE.
REFRESH T_POSCHEDULEX.
REFRESH T_POTEXTITEM.
REFRESH T_POCOND.
REFRESH T_POCONDX.
refresh T_SPLTITMTXT.
***REFRESH T_POTEXTHEADER.
REFRESH T_POTEXTITEM.
REFRESH T_LINE.
ENDAT.
ENDLOOP. -
BAPI_PO_CREATE1- pricing conditions
Hi,
In general if a info record exists, price will be determined based on that.
But I need the price to be determined from condition records. Please help me to do that.
BAPI_PO_CREATE1 consists of parameter POCOND. Can any body tell me in detail what this parameter does?
Pls get me code if possible.
regards,
Ravi
points will be awardedHi
<b>Conditions</b>
Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.
<b>Parameter: POCOND</b>
ITM_NUMBER = 000001
COND_ST_NO = 001
COND_TYPE = PB00
COND_VALUE = 79.900000000
CURRENCY = EUR
CURRENCY_ISO = EUR
COND_UNIT = KG
COND_P_UNT = 1
CHANGE_ID = U
<b>Parameter: POCONDX</b>
ITM_NUMBER = 000001
COND_ST_NO = 000
ITM_NUMBERX = X
COND_TYPE = X
COND_VALUE = X
CURRENCY = X
CHANGE_ID = X
Thanks
Vijay
<b>PLZ Reward points if helpful</b>
Maybe you are looking for
-
Hello. I just set up weblogs for the first time. I enabled weblogs in server admin and chose a theme. I left the default folder for storing files as it was, but I can't access weblogs from the web. I have several sites on my server. I have tried all
-
Can't open an InDesign file off of an SMB share in Yosemite.
Anyone else having this issue? When I go to open a file off of our file server it tells me the file is in use, or that I don't have the correct permissions. If I force SMB1 or CIFS, then I can open the file again. Seems to only happen with InDesign
-
I have a problem wit youtube in both ipad 2 and iphone 4s runing on IOS 5.0.1 non-jailbreaked. I sometime search for a clip and i find it, when i click to start it plays another clip. the same occur when I get youtube link in safari,mail or imassage
-
Is the charger covered by warranty?
My charger stopped working yesterday for no apparent reason. Is the charger covered by the warranty? And how would I go about getting a replacement charger? Thanks for your help
-
Received an email that my Apple ID was disabled for security reasons. Now I have to verify by login in AND provide my creditcard nmb. Afraid that this is NOT from Apple. How can I sent this email to Apple? Can't find an address. <Edited by Host>