Problem in populating userfields in PO using BAPI_PO_CREATE1

DATA: lw_poheader type BAPIMEPOHEADER,
      lw_poheaderx type BAPIMEPOHEADERX,
      lw_poitem type BAPIMEPOITEM,
      lt_poitem type standard table of BAPIMEPOITEM,
      lw_poitemx type BAPIMEPOITEMX,
      lt_poitemx type standard table of BAPIMEPOITEMX,
      lw_posched type BAPIMEPOSCHEDULE,
      lt_poshced type standard table of BAPIMEPOSCHEDULE,
      lw_poschedx type BAPIMEPOSCHEDULX,
      lt_poschedx type standard table of BAPIMEPOSCHEDULX,
      lw_extensionin type BAPIPAREX,
      lt_extensionin type standard table of BAPIPAREX,
      lt_return type standard table of bapiret2,
      lw_return type bapiret2,
      lw_mepoheader type bapi_te_mepoheader,
      lw_mepoheaderx type bapi_te_mepoheaderx,
      lw_mepoitem type bapi_te_mepoitem,
      lw_mepoitemx type bapi_te_mepoitemx,
      lw_hdr type BAPIMEPOHEADER-PO_NUMBER,
      lv_err type c.
*xad
data: begin of w_char_struc,
      po_item(5),
      ZINDVOGN(10),
      ZKATMIN(10),
      ZKATENH(30),
      ZKATNET(13),
      ZKATBNET(30),
      ZKATMGD(45),
      ZKATBME(30),
      ZKATVB(10),
      ZKAT(3),
      ZKATEAN(18),
      ZZYMOD_NRK(2),
      ZZYMOD_NR(15),
      ZZOMOD_NRK(2),
      ZZOMOD_NR(15),
      ZZOPLKODE(1),
      ZKATINDISC(3),
      ZZINIEND_DT(8),
      ZZINI_LGORT(4),
      CONS_ORDER(1),
      end   of w_char_struc.
*xad
data: begin of w_mepox,
        po_item(5),
        ZZINIEND_DT(1),
      ZZINI_LGORT(1),
      end of w_mepox.
lw_poheader-comp_code = '0010'.
lw_poheader-doc_type = 'NB'.
lw_poheader-vendor = '000000030'.
lw_poheader-purch_org = '0010'.
lw_poheader-pur_group = '002'.
lw_poheaderx-comp_code = c_x.
lw_poheaderx-doc_type = c_x.
lw_poheaderx-vendor = c_x.
lw_poheaderx-purch_org = c_x.
lw_poheaderx-pur_group =     c_x.
lw_poitem-po_item = '00010'.
lw_poitem-material = '000000000001000400'.
lw_poitem-plant = '0020'.
lw_poitem-stge_loc = '0011'.
lw_poitem-quantity = '2.000'.
append lw_poitem to lt_poitem.
lw_poitemx-po_item = '00010'.
lw_poitemx-material = c_x.
lw_poitemx-plant = c_x.
lw_poitemx-stge_loc = c_x.
lw_poitemx-quantity = c_x.
append lw_poitemx to lt_poitemx.
lw_posched-po_item = '00010'.
lw_posched-delivery_date = '02.10.2007'.
lw_posched-quantity = '2.000'.
append lw_posched to lt_poshced.
lw_poschedx-po_item = '00010'.
lw_poschedx-delivery_date = c_x.
lw_poschedx-quantity = c_x.
append lw_poschedx to lt_poschedx.
lw_mepoheader-ZINIKUNAG = '0000000010'.
lw_mepoheader-ZINIKUNWE = '1010004855'.
lw_mepoheader-ZINIAUART = 'ZOTL'.
lw_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
lw_extensionin-valuepart1 = lw_mepoheader.
append lw_extensionin to lt_extensionin.
lw_mepoheaderx-ZINIKUNAG = c_x.
lw_mepoheaderx-ZINIKUNWE = c_x.
lw_mepoheaderx-ZINIAUART = c_x.
lw_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
lw_extensionin-valuepart1 = lw_mepoheaderx.
append lw_extensionin to lt_extensionin.
clear lw_extensionin.
lw_mepoitem-po_item = '00010'.
*lw_mepoitem-ZZINIEND_DT = '21.07.2007'.
lw_mepoitem-ZZINI_LGORT = '0011'.
lw_extensionin-structure = 'BAPI_TE_MEPOITEM'.
*lw_extensionin-valuepart1 = lw_mepoitem.
*move-corresponding LW_MEPOITEM to w_char_struc.
w_char_struc-po_item = '00010'.
*w_char_struc-zziniend_dt = '20070707'.
w_char_struc-zzini_lgort = '0011'.
*MOVE '00010' TO LW_EXTENSIONIN-VALUEPART1.
lw_extensionin+30 = w_char_struc.
append lw_extensionin to lt_extensionin.
clear lw_extensionin.
lw_mepoitemx-po_item = '00010'.
*lw_mepoitemx-ZZINIEND_DT = 'X'.
lw_mepoitemx-ZZINI_LGORT = 'X'.
lw_extensionin-structure = 'BAPI_TE_MEPOITEMX'.
lw_extensionin-valuepart1 = lw_mepoitemx.
append lw_extensionin to lt_extensionin.
CALL FUNCTION 'BAPI_PO_CREATE1'
  EXPORTING
    poheader                     = lw_poheader
   POHEADERX                    = lw_poheaderx
  POADDRVENDOR                 =
  TESTRUN                      =
  MEMORY_UNCOMPLETE            =
  MEMORY_COMPLETE              =
  POEXPIMPHEADER               =
  POEXPIMPHEADERX              =
  VERSIONS                     =
  NO_MESSAGING                 =
  NO_MESSAGE_REQ               =
  NO_AUTHORITY                 =
  NO_PRICE_FROM_PO             =
IMPORTING
   EXPPURCHASEORDER             = lw_hdr
  EXPHEADER                    =
  EXPPOEXPIMPHEADER            =
TABLES
   RETURN                       = lt_return
   POITEM                       = lt_poitem
   POITEMX                      = lt_poitemx
  POADDRDELIVERY               =
   POSCHEDULE                   = lt_poshced
   POSCHEDULEX                  = lt_poschedx
  POACCOUNT                    =
  POACCOUNTPROFITSEGMENT       =
  POACCOUNTX                   =
  POCONDHEADER                 =
  POCONDHEADERX                =
  POCOND                       =
  POCONDX                      =
  POLIMITS                     =
  POCONTRACTLIMITS             =
  POSERVICES                   =
  POSRVACCESSVALUES            =
  POSERVICESTEXT               =
   EXTENSIONIN                  =  lt_extensionin
  EXTENSIONOUT                 =
  POEXPIMPITEM                 =
  POEXPIMPITEMX                =
  POTEXTHEADER                 =
  POTEXTITEM                   =
  ALLVERSIONS                  =
  POPARTNER                    =
  POCOMPONENTS                 =
  POCOMPONENTSX                =
  POSHIPPING                   =
  POSHIPPINGX                  =
  POSHIPPINGEXP                =

Hi Sree,
You can create Item level texts using BAPI_SALESORDER_CHANGE.
Just ensure that you pass correctly : Document number i.e. Sales order number , Item number , text ID and language  in tables parameter ORDER_TEXT of this BAPI.
You will have to call BAPI_TRANSACTION_COMMIT after call to BAPI_SALESORDER_CHANGE.
Hope it helps.
Regards,
Akshay Bhagwat
Note: Some points will be fine if that helped you:)

Similar Messages

  • Problem in populating PO item text using FM:SAVE_TEXT

    Hi All,
    I am having an issue with SAVE_TEXT FM,
    I need to populate the item text field:
    This FM works fine if the Item text field is blank and i am populating it with text, say "This is a test case",
    How ever if the text field is already populated say the item text field has "Testing", my requirement is i will append the new text to the previously existing, in this case it should come as "Testing This is a test case",
    For doing this i am reading the existing text using READ_TEXT FM and concatenating both the texts separated by space, and passing this to i_lines, how ever the O/P which i get in the text field is "Testing".
    Please advice.
    The cod is shown below:
    CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
        CLIENT                = SY-MANDT
         header                = t_head
         insert                = 'X'
         savemode_direct       = 'X'
        OWNER_SPECIFIED       = ' '
        LOCAL_CAT             = ' '
      IMPORTING
        FUNCTION              =
        NEWHEADER             =
        TABLES
          lines                 = i_lines
       EXCEPTIONS
         id                    = 1
         language              = 2
         name                  = 3
         object                = 4
         OTHERS                = 5.

    hi,
    once u use the save_text also
    with save_text u are updating the STXH table .
    there is one field in stxh table which is once updated shows the text in the sceen.
    or u can run a bdc put the default text where u want to put and afterwards when u use create_text and commit_text,u ll be able to see the text in the screen.
    regards
    kanishak

  • Populating CRM marketing attributes using the APD

    Hi Experts
    We are having problems with populating CRM marketing attributes using the APD. When we run our process we get the error message:
    CRMBW_ATTR_WRITE005: Error when processing function module CRMBW_UPDATE_BPMKT_5. Message no. RSAN_MDL024
    As you can see, we are using the new function module CRMBW_UPDATE_BPMKT_5 since the old CRMBW_UPDATE_BPMKT did not work either.
    Do we have to add a reference to a infoobject in transaction CRMBWTARGETS? We have not done this because the marketing attribute in CRM doesn’t have decimals and all the objects in BI have. Could this be the cause of the error?
    Kind regards
    Erik

    Hi Ramesh,
    Thanks for quick reply.
    I have already followed the procedure you have described. Since there is not common objects between ODS and Bpatner infoobject, i am not able to do mapping.
    for eg. my ZBPARTNER infoobject has attributes like zfooty, ztennis and zrugby but my ODS has char name , char value, counter for multiple values infoobjects.
    I am following the example in the demo content to work out the process but could not understand how the data is getting uploaded from ODS to Business partner.
    http://help.sap.com/saphelp_nw70/helpdata/en/bf/5df63bf9deaf09e10000000a114084/frameset.htm
    Thanks,
    Sandeep Jogde

  • Problem in posting Custom fields in Purchase Order using BAPI_PO_CREATE1

    Hi friends,
    Did any body tried populating custom fields using BAPI_PO_CREATE1?
    I am trying to populate custom fields in Header.
    I am populating EXTENSIONIN-STRUCTURE with 'BAPI_TE_MEPOHEADER' and EXTENSIONIN-VALUEPART1 with respective values of fields using the code below.
    T_CUSTDATA_IN-PROJECT_ID_NUM = '543211'.
    T_CUSTDATA_INX-PROJECT_ID_NUM = 'X'.
    MOVE 'BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-STRUCTURE.
    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.
    MOVE-CORRESPONDING T_CUSTDATA_IN TO T_BAPI_TE_MEPOHEADER.
    MOVE 'T_BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-VALUEPART1.
    APPEND T_EXTENSIONIN.
    MOVE 'BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-STRUCTURE.
    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.
    MOVE-CORRESPONDING T_CUSTDATA_INX TO T_BAPI_TE_MEPOHEADERX.
    MOVE 'T_BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-VALUEPART1.
    APPEND T_EXTENSIONIN.
    But still it is not populating the custom fields.
    Can some body help me on this?
    Thanks & Regards,
    Ramesh Kodavati

    Hi,
    You require to implement the Badi ME_BAPI_PO_CUST
                                               Method MAP2I_EXTENSIONIN or INBOUND
    for changing the parameter CH_EXTENSIONIN in method INBOUND
                                       or  CH_STRUC in method MAP2I_EXTENSIONIN.
    in addition to passing the extensionin parameters in bapi.
    implement the above said bapi and put a break point in both of the methods (exactly i don't remember)
    and check values are populating in the CH_STRUC structure.
    Regards,
    Dwaraka.S

  • Del Date not populating using bapi_po_create1

    Hi,
    I am using Bapi_po_create1 and am having a problem with delivery dates. The Po creates fine but the delivery date will not populate.
    here is the code i use to populate the Bapi
    wa_po_item_schedules1-po_item = line_c.
        wa_po_item_schedules1-delivery_date = del_date.
        wa_po_item_schedules1-quantity = scr100-qty.
        wa_po_item_schedules1-del_datcat_ext = 'D'.
        APPEND wa_po_item_schedules1 TO it_po_item_schedules1.
        wa_po_item_schedulesx-po_item = 'X'.
        wa_po_item_schedulesx-delivery_date = 'X'.
        wa_po_item_schedulesx-quantity = 'X'.
        wa_po_item_schedulesx-del_datcat_ext = 'X'.
        APPEND wa_po_item_schedulesx TO it_po_item_schedulesx.
    Any ideas?
    Kieran.

    You are passing 'Category of delivery date' as 'D'. Could you check Category of delivery date in TPRG table ? Also check in which format you are passing the schedule date.

  • 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 advance

    Thanks

  • 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,
    Pradip

    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,
    Pradip

  • Using BAPI_PO_CREATE1 : Linking service, and account assignment

    Hello,
    I have trouble when using BAPI_PO_CREATE1. When creating PO using BAPI_PO_CREATE1, I need to input service for each po item and the service itself need to have account assignment. I simplify the code below.
    **PO item
    t_poitem-po_item        = '10'. "for item 10
    t_poitem-PCKG_NO        = '20'. "link with service
    t_poitemx-po_item        = 'X'.
    t_poitemx-PCKG_NO       = 'X'.
    **Account Assignment
    t_poaccount-po_item    = '10'. "link with PO Item
    t_poaccount-SERIAL_NO  = '01'.
    t_poaccount-DISTR_PERC = 1.
    t_poaccountx-po_item    = '10'.
    t_poaccountx-SERIAL_NO  =  '01'.
    t_poaccountx-po_itemx    = 'X'.
    t_poaccountx-SERIAL_NOx  = 'X'.
    t_poaccountx-DISTR_PERC = 'X'.
    **PO Services
    **1st row
    t_poservices-PCKG_NO = '20'.
    t_poservices-LINE_NO = '0000000001'.
    t_poservices-SUBPCKG_NO  = '21'.
    APPEND t_poservices.
    clear t_poservices.
    **2nd row
    t_poservices-PCKG_NO = '21'.
    t_poservices-LINE_NO = '0000000002'.
    t_poservices-EXT_LINE = '0000000010'.
    **fill account assignment for services
    t_POSRVACCESSVALUES-pckg_no = '21'.
    t_POSRVACCESSVALUES-LINE_NO = '0000000002'.
    T_POSRVACCESSVALUES-SERNO_LINE = '01'.
    t_POSRVACCESSVALUES-SERIAL_NO = '01'. "acct. assign. link
    t_POSRVACCESSVALUES-PERCENTAGE = '100'.
    Every time i execute BAPI_PO_CREATE1 using entry similar like above, i always found error message in t_return like this:
    No account assignment exists for service line 0000000010
    I feel sure that i have fill every field needed to link services and account assignment which is using serial_no, but somehow it does not link correctly. Can anyone advise me if there is some thing missing or incorrect with my ABAP code above? Thank you in advance for your help. For sure, first helpful answer will receive my rewards point.
    Regards,
    Abraham

    Thank you for the code. Actually i have fill the required field as you told but i did not put it in my code here to focus the problem on service and account assignment. After checking out your code, i found that the different between your code and mine is in services table.
    <u><b>your code :</b></u>
    <b>POSERVICES:structure</b>
    PCKG_NO : 0000000001
    LINE_NO :0000000001
    SUBPCKG_NO : 0000000002
    SERVICE :3000000000017
    QUANTITY :5
    BASE_UOM :AU
    GR_PRICE :20000
    <b>POSRVACCESSVALUES: structure name</b>
    PCKG_NO :0000000002
    LINE_NO :0000000002
    <u><b>my code are:</b></u>
    <b>POSERVICES:structure</b>
    PCKG_NO : 0000000001
    LINE_NO :0000000001
    SUBPCKG_NO : 0000000002
    PCKG_NO : 0000000002
    LINE_NO :0000000002
    SERVICE :3000000000017
    QUANTITY :5
    BASE_UOM :AU
    GR_PRICE :20000
    <b>POSRVACCESSVALUES: structure name</b>
    PCKG_NO :0000000002
    LINE_NO :0000000002
    SERIAL_NO :0000000001
    The other difference are in account assignment table, you didn't fill SERIAL_NO field.
    my code will be like below:
    <b>POACCOUNT: structure name</b>
    PO_ITEM :10
    SERIAL_NO : 0000000001
    If using your version, the error message will be:
    <i>In case of account assignment, please enter acc. assignment data for item</i>
    If using my version, the error message will be:
    <i>No account assignment exists for service line 0000000010</i>
    Please advise what was wrong with my code. Thank you.
    Regards,
    Abraham

  • Getting errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation

    Hi sap Gurus,
      I am getting Errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation that Material (144) does not exist but it is alreardy maintained in MM01.
    I dont get how it is coming.and what are the mandatory fields in bapi BAPI_PO_CREATE1 in item level .that is too material only.
    pls let me know .
    thanks in advance.

    Hi,
    Check the sample code..
    report  zpo_test             .
    *DATA DECLARATION
    constants : c_x value 'X'.
    *Structures to hold PO header data
    data : header like bapimepoheader ,
    headerx like bapimepoheaderx .
    *Structures to hold PO account data
    data : account like bapimepoaccount occurs 0 with header line ,
    accountx like bapimepoaccountx occurs 0 with header line .
    *Internal Tables to hold PO ITEM DATA
    data : item like bapimepoitem occurs 0 with header line,
    itemx like bapimepoitemx occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    return like bapiret2 occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    pocontractlimits like bapiesucc occurs 0 with header line.
    data : w_header(40) value 'PO Header',
    purchaseorder like bapimepoheader-po_number,
    delivery_date like bapimeposchedule-delivery_date.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code default '122' ,
    doctyp like header-doc_type default 'NB' ,
    cdate like header-creat_date default sy-datum ,
    vendor like header-vendor default '2000000012' ,
    pur_org like header-purch_org default 'PU01' ,
    pur_grp like header-pur_group default '005' .
    *sociedad like HEADER-COMP_CODE default '122' ,
    *vendedor like HEADER-SALES_PERS default 'sale person'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like item-po_item default '00010',
    material like item-material default '12000000' ,
    tipo_imp like item-acctasscat default 'K' ,
    *pos_doc like ITEM-ITEM_CAT default 'F' ,
    shorttxt like item-short_text default 'PRUEBA BAPI' ,
    grup_art like item-matl_group default '817230000' ,
    plant like item-plant default '3001' ,
    mpe like item-trackingno default '9999' ,
    *contrato like ITEM-AGREEMENT default '4904000003' ,
    *quantity like ITEM-QUANTITY default 1 .
    po_unit like item-po_unit default 'EA'.
    selection-screen end of block b2.
    Par?mnetros de imputaci?n
    selection-screen begin of block b3 with frame title text-004.
    parameters : centro like account-costcenter default '1220813150',
    cuenta like account-gl_account default '6631400' ,
    num_pos like account-po_item default '10' ,
    serial like account-serial_no default '01' ,
    ind_imp like account-tax_code default 'I2' .
    selection-screen end of block b3.
    start-of-selection.
    *DATA POPULATION
      ws_langu = sy-langu. "Language variable
    *POPULATE HEADER DATA FOR PO
    *HEADER-COMP_CODE = sociedad .
      header-doc_type = doctyp .
      header-vendor = vendor .
      header-creat_date = cdate .
      header-created_by = 'TD17191' .
      header-purch_org = pur_org .
      header-pur_group = pur_grp .
      header-comp_code = company .
      header-langu = ws_langu .
    *HEADER-SALES_PERS = vendedor .
    *HEADER-CURRENCY = 'DOP' .
    *HEADER-ITEM_INTVL = 10 .
    *HEADER-PMNTTRMS = 'N30' .
    *HEADER-EXCH_RATE = 1 .
    *POPULATE HEADER FLAG.
      headerx-comp_code = c_x.
      headerx-doc_type = c_x.
      headerx-vendor = c_x.
      headerx-creat_date = c_x.
      headerx-created_by = c_x.
      headerx-purch_org = c_x.
      headerx-pur_group = c_x.
      headerx-langu = c_x.
    *HEADERX-sales_pers = c_x.
    *HEADERX-CURRENCY = c_x.
    *HEADER-ITEM_INTVL = c_x.
    *HEADER-PMNTTRMS = c_x.
    *HEADER-EXCH_RATE = c_x.
    *HEADER-EXCH_RATE = c_x.
    *POPULATE ITEM DATA.
      item-po_item = item_num.
      item-quantity = '1'.
    *ITEM-MATERIAL = material .
      item-short_text = 'prueba bapi_po_create1'.
    *ITEM-TAX_CODE = ''.
      item-acctasscat = 'K' .
    *ITEM-ITEM_CAT = 'D' .
      item-matl_group = '817230000' .
      item-plant = '3001' .
      item-trackingno = '99999'.
      item-preq_name = 'test'.
    *ITEM-AGREEMENT = '' .
    *ITEM-AGMT_ITEM = ''.
      item-quantity = '1' .
      item-po_unit = 'EA'.
    *ITEM-ORDERPR_UN = 'EA'.
      item-conv_num1 = '1'.
      item-conv_den1 = '1'.
      item-net_price = '1000000' .
      item-price_unit = '1'.
      item-gr_pr_time = '0'.
      item-prnt_price = 'X'.
      item-unlimited_dlv = 'X'.
      item-gr_ind = 'X' .
      item-ir_ind = 'X' .
      item-gr_basediv = 'X'.
    *ITEM-PCKG_NO = '' .
      append item. clear item.
    *POPULATE ITEM FLAG TABLE
      itemx-po_item = item_num.
      itemx-po_itemx = c_x.
    *ITEMX-MATERIAL = C_X.
      itemx-short_text = c_x.
      itemx-quantity = c_x.
    *ITEMX-TAX_CODE = C_X.
      itemx-acctasscat = c_x.
    *ITEMX-ITEM_CAT = c_x.
      itemx-matl_group = c_x.
      itemx-plant = c_x.
      itemx-trackingno = c_x.
      itemx-preq_name = c_x.
    *ITEMX-AGREEMENT = C_X.
    *ITEMX-AGMT_ITEM = c_x.
      itemx-stge_loc = c_x.
      itemx-quantity = c_x.
      itemx-po_unit = c_x.
    *ITEMX-ORDERPR_UN = C_X.
      itemx-conv_num1 = c_x.
      itemx-conv_den1 = c_x.
      itemx-net_price = c_x.
      itemx-price_unit = c_x.
      itemx-gr_pr_time = c_x.
      itemx-prnt_price = c_x.
      itemx-unlimited_dlv = c_x.
      itemx-gr_ind = c_x .
      itemx-ir_ind = c_x .
      itemx-gr_basediv = c_x .
      append itemx. clear itemx.
    *POPULATE ACCOUNT DATA.
      account-po_item = item_num.
      account-serial_no = serial .
      account-creat_date = sy-datum .
      account-costcenter = centro .
      account-gl_account = cuenta .
      account-gr_rcpt = 'tester'.
      append account. clear account.
    *POPULATE ACCOUNT FLAG TABLE.
      accountx-po_item = item_num .
      accountx-po_itemx = c_x .
      accountx-serial_no = serial .
      accountx-serial_nox = c_x .
      accountx-creat_date = c_x .
      accountx-costcenter = c_x .
      accountx-gl_account = c_x .
      account-gr_rcpt = c_x.
      append accountx. clear accountx.
    *BAPI CALL
      call function 'DIALOG_SET_NO_DIALOG'.
      call function 'BAPI_PO_CREATE1'
        exporting
          poheader         = header
          poheaderx        = headerx
        importing
          exppurchaseorder = purchaseorder
        tables
          return           = return
          poitem           = item
          poitemx          = itemx
          poaccount        = account
          poaccountx       = accountx.
    *Confirm the document creation by calling database COMMIT
      call function 'BAPI_TRANSACTION_COMMIT'
      exporting
      wait = 'X'
    IMPORTING
    RETURN =
    end-of-selection.
    *Output the messages returned from BAPI call
      loop at return.
        write / return-message.
      endloop.
    Regards
    Sudheer

  • Net Price showing zero while using BAPI_PO_CREATE1 for me21n

    Dear All,
    I am using BAPI_PO_CREATE1 for ME21N. The problem is, after execution of the program the error msg it shows-
    No instance of object type PurchaseOrder has been created. External reference:
    Purchase order still contains faulty items
    Net price must be greater than 0
    The values are coming from excel file.
    Please tell me where I am doing wrong.
    With regards,
    Rosaline.

    Hi,
    Symptom
    You create a purchase order with BAPI_PO_CREATE1 or you add an item to an existing purchase order with BAPI_PO_CHANGE. You assign a value in field POITEM-NET_PRICE. However, this value is not transferred. If it was not possible for you to determine any conditions, the system generated the error message 06218 'Net price must be greater than 0'.
    Other terms
    BAPI_PO_CREATE1, BAPI_PO_CHANGE, price, net price, gross price, conditions, price determination, condition type, 06218, EKPO-NETPR, NETPR, POITEM-NET_PRICE, NET_PRICE, PO_PRICE, BAPI_PO_PRICE, BUS2012, PurchaseOrder.CreateFromData1, CreateFromData1, PurchaeOrder.Change
    Reason and Prerequisites
    This function has not been available up to now. You could also assign conditions via the condition tables.
    Read also Notes 399791, 428621, 529287, 578253 and 539950 for this.
    Solution
    The present note adds field PO_PRICE to table POITEM. PO_PRICE can have the values ' ', '1' or '2' with the following meaning:
        PO_PRICE = ' ': The price determination is carried out as before.
        PO_PRICE = '1': The value assigned in field NET_PRICE is transferred as a gross price, that is it is set in the condition type that is defined as a base price in the calculation schema. All other condition types remain unchanged. No conditions are copied from the last document.
        PO_PRICE = '2': The value assigned in field NET_PRICE is transferred as a net price, that is it is set in the condition type that is defined as base price in the calculation scheme. All other condition types are deleted.
    Note the following
    The following restrictions apply to field PO_PRICE:
        If you assign conditions via the BAPI interface, these are always transferred. This is carried out independently of the value that you assign in field PO_PRICE.
        If you add a new item to a purchase order with BAPI_PO_CHANGE, it does not suffice to fill field POITEM-NET_PRICE on item level. The corresponding currency must be specified explicitly on header level.
        You can only use field PO_PRICE during the creation of a purchase order item. If you want to change the price of an already existing item, you can only do this via the conditions.
        If you fill field POITEM-PO_PRICE, you must enter an 'X' in POITEMX-PO_PRICE so that the value is transferred.
    Correction
    The correction is made available via R/3 support package. If you want to implement the note manually, proceed as follows:
        1. Make sure that your system contains Notes 494759, 552189 and 578253.
        2. Create data type BAPI_PO_PRICE with the following attributes:
                        Short text:
                           Price transfer indicator: 1  = gross, 2 = net
                        Package: ME
                        Domain: BPUEB
        3. Extend structure BAPIMEPOITEM (directly after NO_ROUNDING):
                        Component: PO_PRICE
                        Component type: BAPI_PO_PRICE
        4. Extend structure BAPIMEPOITEMX (directly after NO_ROUNDING):
                        Component: PO_PRICE
                        Component type: BAPIUPDATE
        5. Extend structure MEPOITEM_DATA (directly after NO_ROUNDING):
                        Component: PO_PRICE
                        Component type: BAPI_PO_PRICE
        6. Extend structure MEPOITEM_DATAX (directly after NO_ROUNDING):
                        Component: PO_PRICE
                        Component type: BAPIUPDATE
        7. Implement the correction instructions in your system.
    regards,
    Ravi
    Edited by: Parupelly on Dec 14, 2011 1:30 PM

  • Hi Experts, a questions about using BAPI_PO_CREATE1(BAPI_PO_CREATE obsolet)

    Hi Experts,
    I use BAPI_PO_CREATE1 to create a purchase order(stock transfer order - UD), but does anyone know how to assign parameters to the interface of the BAPI? but when I go to transaction ME21N I enter the purchase org, group, material number, quantity, plant, and supplying plant and I click save, then a purchase order is generated but how can I use this BAPI to generate purchase order? can anyone tell me in detail?
    thank you in advance.
    Kind regards
    Dawson

    Hi,
    Please find the code below in order to create a PO from BAPI_PO_CREATE1
    Example of population of BAPI interface in the Function Builder
    Parameter: POHEADER
    COMP_CODE = 1000
    DOC_TYPE = UB
    ITEM_INTVL = 00001
    VENDOR = 0000001000
    PMNTTRMS = 0001
    PURCH_ORG = 1000
    PUR_GROUP = 001
    CURRENCY = EUR
    Parameter: POHEADERX
    COMP_CODE = X
    DOC_TYPE = X
    ITEM_INTVL = X
    VENDOR = X
    PMNTTRMS = X
    PURCH_ORG = X
    PUR_GROUP = X
    Parameter: POITEM
    PO_ITEM = 00001
    MATERIAL = 100-100
    PLANT = 1000
    STGE_LOC = 0001
    QUANTITY = 15.000
    TAX_CODE = V0
    ITEM_CAT = 0
    ACCTASSCAT = K
    Parameter: POITEMX
    PO_ITEM = 00001
    MATERIAL = X
    PLANT = X
    STGE_LOC = X
    QUANTITY = X
    TAX_CODE = X
    ITEM_CAT = X
    ACCTASSCAT = X
    Parameter: POSCHEDULE
    PO_ITEM = 00001
    SCHED_LINE = 0001
    DELIVERY_DATE = 02.12.2002
    QUANTITY = 6.000
    PO_ITEM = 00001
    SCHED_LINE = 0002
    DELIVERY_DATE = 03.12.2002
    QUANTITY = 5.000
    PO_ITEM = 00001
    SCHED_LINE = 0003
    DELIVERY_DATE = 04.12.2002
    QUANTITY = 4.000
    Parameter: POSCHEDULEX
    PO_ITEM = 00001
    SCHED_LINE = 0001
    PO_ITEMX = X
    SCHED_LINEX = X
    DELIVERY_DATE = X
    QUANTITY = X
    PO_ITEM = 00001
    SCHED_LINE = 0002
    PO_ITEMX = X
    SCHED_LINEX = X
    DELIVERY_DATE = X
    QUANTITY = X
    PO_ITEM = 00001
    SCHED_LINE = 0003
    PO_ITEMX = X
    SCHED_LINEX = X
    DELIVERY_DATE = X
    QUANTITY = X
    Parameter: POACCOUNT
    PO_ITEM = 00001
    SERIAL_NO = 01
    QUANTITY = 15.000
    GL_ACCOUNT = 0000400000
    COSTCENTER = 0000001000
    CO_AREA = 1000
    Parameter: POACCOUNTX
    PO_ITEM = 00001
    SERIAL_NO = 01
    QUANTITY = X
    GL_ACCOUNT = X
    COSTCENTER = X
    CO_AREA = X
    Parameter: POCOND
    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
    Parameter: POCONDX
    ITM_NUMBER = 000001
    COND_ST_NO = 000
    ITM_NUMBERX = X
    COND_TYPE = X
    COND_VALUE = X
    CURRENCY = X
    CHANGE_ID = X
    Parameter: POPARTNER
    PARTNERDESC = OA
    LANGU = EN
    BUSPARTNO = 0000001100
    PARTNERDESC = GS
    LANGU = EN
    BUSPARTNO = 0000001200
    PARTNERDESC = PI
    LANGU = EN
    BUSPARTNO = 0000001000
    Do not forget to call BAPI_TRANSACTION_COMMIT after bapi call.
    KR Jaideep,

  • Problem in populating lookup values based on the lookup query from database

    HI all
    I have problem of population look-up values based on look-up query
    I am giving the details what i am trying
    I need to populate the values from the UD_LDAP_USR table into the field of UD_USRGRPC_NisNetTriple of type lookup
    i planned to set the properties of lookup as like this
    look up query as select UD_LDAP_USR_COMMON_NAME as NisNetTriple from UD_LDAP_USR
    ColumnNames as UD_LDAP_USR_COMMON_NAME
    Column captions as UD_LDAP_USR_COMMON_NAME
    Column width as 30
    Lookup Column Name as UD_LDAP_USR_COMMON_NAME
    But when i try to add ColumnName as wht i mentioned above i m getting invalid property exception,update failed
    I am not sure about that are we able to use other Connector table prefix with UD into the another processFrom
    Let me give update on this issue
    Urgent,struck my work here
    thanks
    Nagaraj

    Thanks for the reply raghav
    I tried but it was not working
    I gave like what u specified but no use
    It is throwing exception like set look-up query for the field
    Any one help me out on this issue
    Edited by: Nagaraju Chowdary on Jan 21, 2013 3:41 AM
    Edited by: Nagaraju Chowdary on Jan 21, 2013 3:42 AM

  • Printing Purchase Orders after they have been created using BAPI_PO_CREATE1

    Hi
    We have a requirement to develop a Z program to to alloow certain users to create and print "special" dummy Purchase Orders (PO).
    Using BAPI_PO_CREATE1 I have been able to create the PO no problem.  But how on earth do you get them to physically print out ?
    BAPI_PO_CREATE1 is meant to be an alternative to ME21N. In ME21N you can create a "PO message" which is actually a print output of the PO) and have it sent to the spool, depending on config. However, you can't use BDC with ME21N.
    I expected the BAPI to have some sort of table/structure to pass print parameters that emulated ME21N's  PO message, but there is none.
    Anybody done this ?
    cheers Hugh

    Well, if you had your PO output configured to print immediately when the PO is created, then the BAPI call would result in a printout.
    But if you don't want to always print a PO when a new document is created, you could set up a new output type for 'print immediately' and then attach a condition in the output configuration that checks if a certain criterion is met (so for instance if the PO was created via the BAPI), and only if this condition is met would the processing continue.
    That way, you could keep the current PO output process (on request only), and have a conditional output that'd only be processed for POs created by the BAPI.

  • Problem pre-populating a combo box

    Hello,
    I am having problems pre-populating a combo box from a process.
    This combo box field exists in the OIM User Form and in another process form.
    Both combo box fields are populated from the same Lookup Definition: Lookup.Jazztel.TipoDeDocumento which looks like this:
    Code Key Decode
    1      DNI (NIF)
    2     Pasaporte
    4     Visado
    6     Nº Identificación de Extranjero
    9     C.I.F.
    I've tried these methods to pre-populate the combo box:
    * Using an adapter with a SET VARIABLE Logic Task (this adapter returns the code key that is selected in the OIM User form).
    * Using an adapter that returns the decode field from the code key and pass it to the Process combo box.
    In these cases, the process form combo box is not pre-populated correctly. It always shows C.I.F.
    I tried modifying the combo box in the following way:
    Code Key Decode
    DNI (NIF)      DNI (NIF)
    Pasaporte      Pasaporte
    Visado     Visado
    Nº Identificación de Extranjero Nº Identificación de Extranjero
    C.I.F. C.I.F.
    and it get pre-populated correctly.
    I need the code keys to be numbers. Does anyone know how can a combo like this be pre-populated?
    Moreover and curiously, the process form combo box appears ordered alphabetically (according to the decode fields):
    Code Key Decode
    9     C.I.F.
    1      DNI (NIF)
    6     Nº Identificación de Extranjero
    2     Pasaporte
    4     Visado
    and the OIM User Form Combo box, appears ordered numerically (according to the code key numerical order):
    Code Key Decode
    1      DNI (NIF)
    2     Pasaporte
    4     Visado
    6     Nº Identificación de Extranjero
    9     C.I.F.
    Does anyone know why?
    Thank you very much

    Try prepopulate combobox by lookup code.
    But it must displayed as decode.

  • Proble in Creating Multiple Item PO using BAPI_PO_CREATE1

    Hi All..
          I am creating PO using BAPI_PO_CREATE1. I have successfully created with single line item but when i tried to create with multiple line items it gives me error in partners(vendors) which i have used in table POPARTNER.
          One more thing, I have created using BAPI with same partner roles with single line item but it gives me error in 2 or more line items.
          So, Can Anybody help me in this..
    Regards,
    Meet Gohel
    [email protected]

    Hi ,
    U can use this code n check
    *& Report  ZPOBAPITRIAL
    REPORT  ZPOBAPITRIAL.
    *DATA DECLARATION
    CONSTANTS : C_X VALUE 'X'.
    *Structures to hold PO header data
    DATA : HEADER LIKE  BAPIMEPOHEADER   ,
           HEADERX LIKE  BAPIMEPOHEADERX .
    *Internal Tables to hold PO ITEM DATA
    DATA : ITEM   LIKE BAPIMEPOITEM  OCCURS 0 WITH HEADER LINE,
           ITEMX  LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
    *Internal table to hold messages from BAPI call
           RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    data : w_header(40) value 'PO Header'.
    DATA : it_item type standard table of BAPIMEPOITEM.
    DATA : wa_item like BAPIMEPOITEM occurs 0 with header line.
    DATA : it_itemx type standard table of BAPIMEPOITEMX.
    DATA : wa_itemx like BAPIMEPOITEMX occurs 0 with header line.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code  default '0103'      ,
                 doctyp  like HEADER-DOC_TYPE   default 'NB'        ,
                 item_int like header-item_intvl default '10'     ,
                 cdate   like HEADER-CREAT_DATE default sy-datum    ,
                 vendor  like HEADER-VENDOR     default '0000500001',
                 pmnttrms like header-pmnttrms default '0007'       ,
                 pur_org like HEADER-PURCH_ORG  default '9000'      ,
                 pur_grp like HEADER-PUR_GROUP  default '401'       ,
                 currency like header-currency  default 'INR'       .
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like ITEM-PO_ITEM  default '10',
                 material like ITEM-MATERIAL default '000000000300000014'   ,
                 plant    like ITEM-PLANT    default '7640' ,
                 quantity like ITEM-QUANTITY default 10.
    selection-screen end of block b2.
    START-OF-SELECTION.
    *DATA POPULATION
    ws_langu = sy-langu.   "Language variable
    *POPULATE HEADER DATA FOR PO
    HEADER-COMP_CODE  = company    .
    HEADER-DOC_TYPE   = doctyp     .
    *HEADER-CREAT_DATE = cdate      .
    header-item_intvl = item_int .
    HEADER-VENDOR     = vendor     .
    HEADER-LANGU      = ws_langu   .
    header-pmnttrms   = pmnttrms   .
    HEADER-PURCH_ORG  = pur_org    .
    HEADER-PUR_GROUP  = pur_grp    .
    header-currency   = currency   .
    *POPULATE HEADER FLAG.
    HEADERX-comp_code  = c_x.
    HEADERX-doc_type   = c_x.
    *HEADERX-creat_date = c_x.
    headerx-item_intvl = c_x .
    HEADERX-vendor     = c_x.
    HEADERX-langu      = c_x.
    headerx-pmnttrms   = c_x   .
    HEADERX-purch_org  = c_x.
    HEADERX-pur_group  = c_x.
    *HEADERX-doc_date   = c_x.
    *POPULATE ITEM DATA.
    wa_ITEM-PO_ITEM  = item_num.
    wa_ITEM-MATERIAL = material.
    wa_ITEM-PLANT    = plant.
    wa_ITEM-QUANTITY = quantity.
    append wa_item to it_item.
    wa_ITEM-PO_ITEM  = '20'.
    wa_ITEM-MATERIAL = '000000000300000020'.
    wa_ITEM-PLANT    = plant.
    wa_ITEM-QUANTITY = quantity.
    append wa_item to it_item.
    *APPEND ITEM.
    *POPULATE ITEM FLAG TABLE
    wa_ITEMX-PO_ITEM    = item_num.
    wa_itEMX-MATERIAL   = C_X.
    wa_ITEMX-PLANT      = C_X .
    wa_ITEMX-STGE_LOC   = C_X .
    wa_ITEMX-QUANTITY   = C_X .
    wa_ITEMX-TAX_CODE   = C_X .
    wa_ITEMX-ITEM_CAT   = C_X .
    wa_ITEMX-ACCTASSCAT = C_X .
    append wa_itemx to it_itemx.
    *APPEND ITEMX.
    wa_ITEMX-PO_ITEM    = '20'.
    wa_itEMX-MATERIAL   = C_X.
    wa_ITEMX-PLANT      = C_X .
    wa_ITEMX-STGE_LOC   = C_X .
    wa_ITEMX-QUANTITY   = C_X .
    wa_ITEMX-TAX_CODE   = C_X .
    wa_ITEMX-ITEM_CAT   = C_X .
    wa_ITEMX-ACCTASSCAT = C_X .
    append wa_itemx to it_itemx.
    *BAPI CALL
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER                     = HEADER
        POHEADERX                    = HEADERX
      POADDRVENDOR                 =
      TESTRUN                      =
    IMPORTING
      EXPPURCHASEORDER             =
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = RETURN
       POITEM                       = it_ITEM
       POITEMX                      = it_ITEMX.
    *Confirm the document creation by calling database COMMIT
    *CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          = 'X'
    IMPORTING
      RETURN        =
    end-of-selection.
    *Output the messages returned from BAPI call
    LOOP AT RETURN.
    WRITE: /001 return-type,
      /001 return-message.
    ENDLOOP.
    award points if helpfull

Maybe you are looking for

  • Video Out on iPhone 4 and iOS 6

    To watch downloaded video, I connect my iPhone 4 to my TV using an AV dock-to-component cable. Since installing iOS 6, my iPhone says it "does not support that accessory." I knew of the video out issues with iPhone 5 but didn't read anywhere that it

  • OPEN ITEMS based on  GL wise

    Hi Frenz, can any body help me in finding the standard BAPI or Function module to fetch the OPEN ITEMS based on General Ledger Acc. Thanks, Priya

  • Functionality of GL & Sub-GL in ECC 6.0

    Hi Guys, In SAP ECC6.0, is there any functionality of Sub-General Ledger (Sub-GL) within main GL? As far as master records are concerned, I understand that these are the Sub-GLs and there is one recon a/c, but what if within a GL, I wnat to see furth

  • Recommendations for a 2-Node Messaging 6.3 Cluster

    Hi all, I'm in the process of building a 2-node cluster to run Messaging Server 6.3 and would like your help. My question is in regard to the layout of the messaging software. For example, should I install the messaging binaries on each node of the c

  • Totally confused about mixing videos with different field orders.

    I have PPcs5 on the pc. I edit for many different shooters. As such I get everything: Progressive, upper field , lower field . Not to mention from a zillion different cameras & different resolutions. I output 95% so far to dvd ntsc, 5% BR. I get dv t