Issue in condition table passing in BAPI BAPI_PO_CREATE1 when uploading PO
hi everyone,
I am trying to upload PO data (header, item, conditions)from file. Some of my main code as follows:
i have pasted the code for assigning values to condition table and passing in bapi..once i execute the bapi in debug mode..PO not created, no values in condition tables. rest of the table values are fine..
W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
W_BAPIMEPOCOND-COND_ST_NO = '001'.
W_BAPIMEPOCOND-COND_TYPE = 'PB00'.
W_BAPIMEPOCOND-COND_VALUE = '1000'.
W_BAPIMEPOCOND-CURRENCY = 'KES'.
APPEND W_BAPIMEPOCOND TO I_BAPIMEPOCOND.
CLEAR W_BAPIMEPOCOND.
W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
W_BAPIMEPOCOND-COND_ST_NO = '000'.
W_BAPIMEPOCONDX-COND_TYPE = 'X'.
W_BAPIMEPOCONDX-COND_VALUE = 'X'.
W_BAPIMEPOCONDX-CURRENCY = 'X'.
APPEND W_BAPIMEPOCONDX TO I_BAPIMEPOCONDX.
CLEAR W_BAPIMEPOCONDX.
ENDLOOP.
LOOP AT I_BAPIMEPOHEADER INTO W_BAPIMEPOHEADER.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = W_BAPIMEPOHEADER
POHEADERX = W_BAPIMEPOHEADERx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
PARK_COMPLETE =
PARK_UNCOMPLETE =
IMPORTING
EXPPURCHASEORDER = EXPPURCHASEORDER
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN = RETURN
POITEM = I_BAPIMEPOITEM
POITEMX = I_BAPIMEPOITEMX
POADDRDELIVERY =
POSCHEDULE = I_BAPIMEPOSCHEDULE
POSCHEDULEX = I_BAPIMEPOSCHEDULEX
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND = I_BAPIMEPOCOND
POCONDX = I_BAPIMEPOCONDX
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
POCOMPONENTS =
POCOMPONENTSX =
POSHIPPING =
POSHIPPINGX =
POSHIPPINGEXP =
SERIALNUMBER =
SERIALNUMBERX =
INVPLANHEADER =
INVPLANHEADERX =
INVPLANITEM =
INVPLANITEMX =
NFMETALLITMS =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Thanks in advance!!
Hi Balaji,
I suppose it's a simple copy paste error. Refer the code higlighted below:
W_BAPIMEPOCOND-ITM_NUMBER = '000001'.
W_BAPIMEPOCOND-COND_ST_NO = '001'.
W_BAPIMEPOCOND-COND_TYPE = 'PB00'.
W_BAPIMEPOCOND-COND_VALUE = '1000'.
W_BAPIMEPOCOND-CURRENCY = 'KES'.
APPEND W_BAPIMEPOCOND TO I_BAPIMEPOCOND.
CLEAR W_BAPIMEPOCOND.
W_BAPIMEPOCONDX-ITM_NUMBER = '000001'.
W_BAPIMEPOCONDX-COND_ST_NO = '000'.
W_BAPIMEPOCONDX-COND_TYPE = 'X'.
W_BAPIMEPOCONDX-COND_VALUE = 'X'.
W_BAPIMEPOCONDX-CURRENCY = 'X'.
Regards,
Pranav.
Edited by: Pranav Mandelia on Sep 30, 2011 1:52 PM
Similar Messages
-
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. -
When I am using Tcode-V/77 to edit condition table I am getting error message
Table 901 can only be accessed by application Inbound Delivery (E1)
Kindly inform how to resolve the issueHi,
I am setting up RDS for trucking where some settings needs to be done in ECC as speciifed below.
Transaction Code
V/77
Customizing Path
Logistics Execution → Transportation → Basic Transportation Functions → Output Control → Maintain Output Determination for Shipments → Maintain Condition Tables (continue with step 7)
1. If you are using the transaction code, continue with step 4. If you are using the Customizing menu path, a Choose Activity dialog box appears. Select the Maintain Output Condition Table for Shipments line and choose the Choose (F2) button.
2. Choose menu command Condition → Create and Enter.
3. On the Create Condition Table (Output Transport) screen, enter the following:
Field Name
Input Value
Table
901
4. The Create Condition Table (Output Transport): field Overview screen appears
5. On this screen, transfer Shipment type (technical name: SHTYP) and Ov. Transport status (technical name: STTRG) from the FieldCatlg list on the right-hand side to the Selected fields list double-click each field. As a result, the text ShipmntTyp/OverallSta should be shown on left-hand side next to table number 901.
Sinc ethe table already exist hence need to edit the table to add teh required fields. -
How to change currency in PO item by using BAPI 'BAPI_PO_CREATE1'
Hi. i want to change currency in PO item.i just find this field in condition table in this BAPI. code is as below
*POPULATE condition data
CLEAR t_po_condition.
t_po_condition-ITM_NUMBER = v_poitem * 10. " Item No.
t_po_condition-COND_TYPE = 'PBXX'. " Condition type
t_po_condition-CALCTYPCON = C_B. " Calculation type
t_po_condition-COND_VALUE = SEQ_FILEH-NETPR. " Condition value
t_po_condition-CURRENCY = SEQ_FILEH-WAERS.
t_po_condition-COND_P_UNT = SEQ_FILEH-PEINH.
t_po_condition-CONDCHAMAN = c_x.
t_po_condition-COND_UPDAT = c_x.
APPEND t_po_condition.
*POPULATE condition data flags
CLEAR t_po_conditionX.
t_po_conditionX-ITM_NUMBER = v_poitem * 10.
t_po_conditionX-ITM_NUMBERX = C_X.
t_po_conditionX-COND_TYPE = C_X.
t_po_conditionX-CALCTYPCON = C_X.
t_po_conditionX-COND_VALUE = C_X.
t_po_conditionx-CURRENCY = C_X.
t_po_conditionX-COND_P_UNT = C_X.
t_po_conditionx-CONDCHAMAN = c_x.
t_po_conditionx-COND_UPDAT = c_x.
APPEND t_po_conditionX.
any advice?Just Select The Total Column, then Drag & Drop accordingly..
whereever you want..
Alternatively you can do by
in the top right corner of the item overview you have a button for table control (above the vertical scroll bar).
If you click that button, you get a pop-up from where you can customize the layout.
Press the blue info button there and read how this is to be done. -
Condition Table Functioning Query !!
Dear All
EG:
If I take standard condition table 5 , customer/ material.
When I see fields in access Sequence it shows KUNNR, MATNR, VKORG and VTWEG.
but When i create own customized condition table say 620, customer / master
then The fields in access sequence show only KUNNR, MATNR.
Can anyone highlight why system behaves differently in customization ?
Regards
Pavan Kumardear friend,
i would use the following steps:
-create a new cond. table (say, 620) by copying from '005'
-maintain a new access sequence (say, ZXXX) by copying from standard one (select which one you need) and confirming "copy all"
-setup a new cond.table 620 in this new access sequence (and remove other cond. tables if you do not need them)
-perform other relevant config steps and test your price procedure with new sales order
good luck!
i can't answer your question because it is not clear which access sequence you took and how did you try to change it...
did you also check out the setting for your new cond. table? -
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. -
HELP!! WebDynpro don't pass Tables parameters to BAPI.
hello everyone
I am in trouble.I use a bapi with Tables parameter in my wedDynpro,and bind some data to this Tables model structure.Unfortunately,these data aren't be passed to bapi,and in my bapi the Tables paremeterTable is initial state.
Could some to help me ?
My wedDynpro programme follows:
public void execute_Test( )
//@@begin execute_Test()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
Zzshibin_Test5_Input input = new Zzshibin_Test5_Input();
wdContext.nodeZzshibin_Test5_Input().bind(input);
Zzbsctmydsub_Score score = new Zzbsctmydsub_Score();
score.setZzmydkey("1");
score.setZzrltkey("2");
score.setZzsubdes("3");
score.setZzsubwgtrst("4");
AbstractList list = new Zzbsctmydsub_Score.Zzbsctmydsub_Score_List();
list.add(score);
input.setTable(list);
try
wdContext.currentZzshibin_Test5_InputElement().modelObject().execute();
catch(Exception e)
manager.reportException("error",true);
return;
I am wating for answer.Hi Bin,
Please try the follwoing code.
public void execute_Test( )
//@@begin execute_Test()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
Zzshibin_Test5_Input input = new Zzshibin_Test5_Input();
wdContext.nodeZzshibin_Test5_Input().bind(input);
Zzbsctmydsub_Score score = new Zzbsctmydsub_Score();
score.setZzmydkey("1");
score.setZzrltkey("2");
score.setZzsubdes("3");
score.setZzsubwgtrst("4");
<b>input.add<tablename>(score);</b>
try
wdContext.currentZzshibin_Test5_InputElement().modelObject().execute();
catch(Exception e)
manager.reportException("error",true);
return;
With Regards
Balaram Naidu Bankuru -
Hi Experts,
My problem is while creating the condition table A018 I missed out to tick the indicator With release status,
So how we can ticked it?
And after changing the indicator can we use this in ME11/ME12 to change the Processing Status?
Please help me on this,
Thank you very much in advance.
Thanks,
Sachin KhairnarHi Prasanna,
Thanks for your quick response,
I have created new Z condition table with indicator 'With Release Status' as checked.
As per our requirement the Processing status should get changed in ME11 / ME12 when we click on the Condition Tab.
but its giving dump when I try to change it over there.
It will be really helpful if you give some overview.
Once again thanks for your response.
Thanks
Sachin -
PO created though BAPI 'BAPI_PO_CREATE1' not visible in WPOHF4D
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 priorityhi Priyanka,
In the T-code WPOHF4D
the select query
SELECT ekkolifnr ekkoekorg ekgrp ekko~ebeln pohf_type
ekko~fixpo waers frgrl frgsx submi
ekkobsart ekkobstyp ekkobedat ekpowerks ekko~otb_status
netwr stapo menge ekpo~loekz "959448
APPENDING CORRESPONDING FIELDS OF TABLE lt_worklist_loop
FROM ekpo INNER JOIN ekko
ON ekkoebeln = ekpoebeln
WHERE ekko~ebeln IN it_ran_ebeln
AND ekgrp IN it_ran_ekgrp
AND ekko~ekorg IN it_ran_ekorg
AND ekko~bukrs IN it_ran_bukrs
AND matnr IN it_ran_matnr
AND ekpo~werks IN lt_ran_werks
AND ekko~lifnr IN it_ran_lifnr
AND bedat IN it_ran_bedat
AND ekko~fixpo IN it_ran_fixpo
AND pohf_type IN it_ran_pohf_type
AND bsart IN it_ran_bsart
AND submi IN it_ran_submi
AND ernam IN it_ran_uname
AND source_id IN it_ran_source_id
AND ekko~bstyp = c_po
AND ekko~bsakz <> c_bsakz_transfer.
is responsible for data fetching.
If u r not getting data and this query failing check it while debugging.
Thanks,
Gaurav. -
SOAP TO RFC . Issue in updating the fields in BAPI
Hi XI experts ,
This is SOAP TO RFC scenario .
THe Source is an dtd (create PO ) schema provided by external partners .
The Target is : BAPI : BAPI_PO_CREATE1 , a standard BAPI used to craete PO in SAP .
I need to map the below source fields to the BAPI Fields:
1. ReferenceTypeCodedOther>ACC_STR</ReferenceTypeCodedOther> then <RefNum>1000</RefNum> ->
2. <ReferenceTypeCodedOther>G_L_ACCT</ReferenceTypeCodedOther> then RefNum>5423100</RefNum>
3. <ReferenceTypeCodedOther>COST_CTR</ReferenceTypeCodedOther> then <RefNum>313</RefNum>
4. ReferenceTypeCoded>AccountCategory</ReferenceTypeCoded> then <RefNum>ZNCC</RefNum>
-I have changed the context of the "Ref NUm" to -ReferenceTypeCoded ( Main Node)
2. Lets take an example of 2 :"
iF <ReferenceTypeCodedOther> = G_L_ACCT , Then RefNum (5423100<) -> Leading zero function (to make it 10 digits) =GL_ACCOUNT field of BAPI
here i have used , if ReferenceTypeCodedOther <> SUBSTRING (0-7) <Equals text> G_L_ACCT then <RefNum> LeadingZero Function with constant 10 -> GL_ACCOUNT (Field of BAPI)
Similarly this logic should get applied for all the other 3 conditions
But when i used the substring , it throws an error : Error:
Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 1] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[,
I tried creating this Java function: to extract the string, but this throws an error of Java container
Does anyone hve a simple solution . Appreciate your input.
Thanks,
Vara
public String Extract_String(String a,Container container){
//write your code here
// u201Cau201D is your input that is reference field
boolean flag=false;
if ((a.contains("ACC_STR"))|| (a.contains("G_L_ACCT "))||( a.contains("COST_CTR"))||(a.contains("AccountCategory")))
flag = true;
return flag;
with Java.lang.* --- > imported , but this throws an errorHi Baskar ,
The Issue got solved , I used a java function : To exatrct the string comparing the : String value which I provide as Input .
This function inturn consolidate the value and will pass it one context (PO_ACCOUNT ) of BAPI .
I used this code by changing the CONSTANT :(VALUE ) for other 3 conditions mentioned in my query.
Java function:
For Cost Centre(COST_CTR) field of BAPI:
public void Value(String[] a,String[] b,ResultList result,Container container){
Java IMport :java.lang.String;java.lang.*;
//write your code here
int m= a.length;
int n= b.length;
String s="COST_CTR";
for (int i=0; i<m ;i++)
if(a<i>.equals(s))
result.addValue(b<i>); -
Not updating G/L account and cost center with BAPI BAPI_PO_CREATE1
Hello Friends,
The two fields G/L ACCOUNT and Cost Center is not updated using BAPI BAPI_PO_CREATE1. I am unable to understand why? This is what i am passing to account assignment structure( POACCOUNT). Filled POACCOUNTX structre as well. I have passed company code at the header level.
PO_ITEM = 00010
SERIAL_NO = 01
CREAT_DATE = sy-datum
GL_ACCOUNT = 621000
COSTCENTER = 1000
CO_AREA = 4000
Please let me know why it is not updating anything i missed while passing?
2>I need to update GR quantity but this field is not available in the BAPI ..Please let me know how to update this field.
Any help is highly appreciated.
Regards,
RajHi, I have a problem I use the bapi BAPI_PO_CREATE1, I pass the table pt_poaccount in the parameter poaccount but the bapi when register my purchase order doesn't register correctly the values KOSTL, AUFNR, PS_PSP_PNR, NPLNR of the tablepoaccount and register the default values of the contract. Please i need help with this.
CLEAR s_poaccount.
s_poaccount-po_item = <fs_datos>-ebelp.
s_poaccount-serial_no = w_serial.
s_poaccount-costcenter = <fs_datos>-kostl.
s_poaccount-orderid = <fs_datos>-aufnr.
s_poaccount-wbs_element = <fs_datos>-ps_psp_pnr.
s_poaccount-network = <fs_datos>-nplnr.
s_poaccount-activity = <fs_datos>-vornr.
s_poaccount-quantity = <fs_datos>-menge.
s_poaccount-net_value = <fs_datos>-brtwr.
s_poaccount-creat_date = sy-datum.
s_poaccount-itm_number = <fs_datos>-ebelp.
s_poaccount-co_area = '1001'.
APPEND s_poaccount TO pt_poaccount.
CLEAR s_poaccountx.
s_poaccountx-po_item = <fs_datos>-ebelp.
s_poaccountx-serial_no = w_serial.
s_poaccountx-po_itemx = 'X'.
s_poaccountx-serial_nox = 'X'.
s_poaccountx-creat_date = 'X'.
s_poaccountx-itm_number = 'X'.
s_poaccountx-co_area = 'X'.
s_poaccountx-costcenter = 'X'.
s_poaccountx-orderid = 'X'.
s_poaccountx-wbs_element = 'X'.
s_poaccountx-network = 'X'.
s_poaccountx-activity = 'X'.
s_poaccountx-quantity = 'X'.
s_poaccountx-net_value = 'X'.
APPEND s_poaccountx TO pt_poaccountx.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = pe_poheader
poheaderx = pe_poheaderx
IMPORTING
exppurchaseorder = pi_exppurchaseorder
TABLES
return = pt_return
poitem = pt_poitem
poitemx = pt_poitemx
poschedule = pt_poschedule
poschedulex = pt_poschedulex
poaccount = pt_poaccount
poaccountx = pt_poaccountx
poservices = pt_poservices
posrvaccessvalues = pt_posrvaccessvalues.
The BAPI is register with these values as default however i pass other values in table
pt_poaccount -
Adding SERVICE_ORG_RESP_SHORT field to Condition Table
Dear Experts!
We want to use the SERVICE_ORG_RESP_SHORT field in our Condition Table to define product Pricing. The problem is it doesn't exist in a Field Catalog (SPRO -> CRM -> Master Data -> Conditions and Condition Technique -> Condition Technique: Basics -> Create Field Catalog).
We see two possible ways of dealing with this issue:
1) Adding SERVICE_ORG_RESP_SHORT field into Global Field Catalog (SPRO -> CRM -> Master Data Conditions and Condition Technique -> Condition Technique: Basics -> System Configuration for Condition Technique -> Set Up Usage -> folders "Global Field Catalog: Fields" and "Global Field Catalog: Data Elements").
2) Using BAdI (SPRO -> CRM -> Basic Functions -> Pricing -> Define Settings for Pricing -> Adopt User-Defined Fields).
Please, tell us, which of these ways is correct?
Kind Regards,
Alexander Smirnyagin.Hi Alexandr,
the first step mentioned above is required to define the field, so that you can use it to create a conditon table based on it and maintain master data for that condition table. In addition, you should implement the /SAPCND/ROLLNAME BADI for the field.
The second step described above is required to integrate the field for transaction processing, e.g. in a sales or service order. You need to define which order value should get passed to your pricing attribute.
Best Regards,
Michael -
Updating Custom field in Table BUT000 using BAPI 'BAPI_ISUPARTNER_CHANGE'.
Hi,
I have added a new custom field in table BUT000. Now i want to update that field with 'X' and i have used EXTENSIONIN parameter in the BAPI 'BAPI_ISUPARTNER_CHANGE'. i have populated the field name(Custom field name) and value 'X' to that structure and passed to BAPI. But that field value was not getting updated. So can any one help me how to resolve this issue.
Thanks,
SushmaHi Ravi,
Thanks for your response.
I have passed the Structure name in parameter EXTENSIONIN, but still i am facing the same problem.
Thanks,
Sushma -
Need Help ! PO using a BAPI - BAPI_PO_CREATE1
Hi friends,
Need some help. I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
<i><b>I want the new PO to have all the characteristics of an existing PO. which is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure.</b></i>
Am i making any mistake while filling the header or item or schedule lines before BAPI_PO_CREATE1 ?
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 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 .
Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa[].
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
poitem = i_bpoi[]
poitemx = i_bpoix[]
poschedule = i_bpos[]
poschedulex = i_bposx[].
i_order = i_new_ebeln .
SHIFT i_order LEFT DELETING LEADING '0' .
i_return-errortype = c_char_i .
i_return-workarea = c_zsw .
i_return-message = '064' .
i_return-variable1 = i_order .
loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
append i_bapiretn to t_bapi_return .
endloop .
if t_bapi_return[] is initial .
i_create_order = c_char_x .
CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
EXPORTING
act_return = i_return.Hi,
Make the required settings to trigger an idoc during the creation of a PO in Me21N with multiple line items, check how the idoc is being created, This should be starting point to know how to create idoc with multiple line items.
Hope this works for you.
Rajeev -
Sales Order Unable to Use New Condition Tables for Tax Condition Type
Dear All,
I am currently working on SAP R/3 4.0. I have a new requirement for my tax where I need to create new condition tables other than the 4 standard SAP tables which are Customer/Material, Division/Customer, Departure Country/Destination Country, Domestic Taxes and Export Taxes. My new tables consists of Departure Country/Destination Country/Shipping Point/Tax Code. The requirement is that the tax code is based on the chosen destination country and shipping point. The problem I am facing now is that no matter what types of table I create or even I generate with reference to the standard table, the access sequence will only refer to the 4 standard SAP tables above. Even if I put my own table in the highest priority for the access sequence, the same thing happens. My sales order will only pick up date from the standard table.
I wonder if anyone encountered the same problem as me.
Kindly advise.
Thank you.
Regards,
YvonneHi
Yvonne
I suggest fist check a simple thing ,whether u have successfully determined shipping point for each line item ,it is possible that just adding a line item will not trigger shipping point determination . So after u update the shipping point on line level u can rerun pricing and check agian if u r getting it .
Secondly for tax purposes I suggest Try to have Customer and material tax classification approach this allows to u have long term flexibiliy and also reduces your maintenance activity . As if u change or add number of shipping points and business changes using the sequence of shipping point ,the logic of just using shipping point will not work.
In Tax classification u cna add new condition table for each new tax category and use it in different access sequences.
This information can be passed on to FI using Different Tax code for Different combination.
I hope this helps
Regards
Mandar
Maybe you are looking for
-
Possible to show current time during call (not length of call)?
when i am on a call, the lock screen shows the phone number and the length of time i have been on the call. is it possible to change this, so that the lock screen shows me the current time (like it does when i am not on the phone)? currently, the on
-
Error in running request: ORACLE error 20100 in FDPSTP
Got following error when running a concurrent manager job: ORACLE error 20100 in FDPSTP Cause: FDPSTP failed due to ORA-20100: File o0002562.tmp creation for FND_FILE failed. You will find more information on the cause of the error in request log. OR
-
What is the best way to create a diagram or space layout?
I need to create a layout of an area for an upcoming event. What is the best way to do that?
-
I have only 6 mins left of my 100 mins landlines subscription, so I'm trying to buy a bigger package, but I can't, because it's only showing me Skype Premium and Skype Credit. Where are those options for 100, 200, 300 minutes landline subscription?
-
Hi In me23n screen we hv a print preview button. When we select the button we can able to see the print preview. In that preint preview screen we hv a print icon. Here it is in active mode. So the end users are able to take print from selecting the i