Problem in BAPI_PO_CREATE

Hi
I am using BAPI_PO_CREAT1 for creation of PO
but i am getting these errors
PO could not be creating using the Enjoy-BAPI 
Please enter material number or account assignment category
Purchase order still contains faulty items 
kindly somone help me in solving this, and if possible provide me with code.
thanks
mannu

Hello Munish,
I see that there could be a problem with the flat file(Mat no in flat file format) or the source structure(Internal Table) that you have created according to the flat file structure.
However, I will provide you with a code that I had worked on    'BAPI_REQUISITION_CREATE' , I will alos provide you with a flat file.  So that, It would be helpful for you to work with any other BAPI function mosules.
*& Report  ZBAPI_chaitu
*& AUthor : Krishna Chaitanya
REPORT  ZBAPI_chaitu.
DATA: PRN LIKE BAPIEBANC-PREQ_NO.
DATA: ITEMBAPIEBANC LIKE BAPIEBANC OCCURS 0 WITH HEADER LINE.
DATA: RETURN1 LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF RECORD OCCURS 0,
       STR(200),
      END OF RECORD.
DATA: BEGIN OF HEAD,
       DOC_TYPE(04),
      END OF HEAD.
DATA: BEGIN OF ITEM,
       DOC_TYPE(04),
       MATERIAL(18),
       QUANTITY(13),
       PUR_GROUP(03),
       PLANT(04),
       DEL_DATCAT(1), " LIKE ITAB_BAPIEBANC-DEL_DATCAT,
       DELIV_DATE(8)," LIKE ITAB_BAPIEBANC-DELIV_DATE,
     END  OF ITEM.
DATA: HEAD_COUNT TYPE I,
      ITEM_COUNT TYPE I.
PERFORM UPLOAD.
loop at record.
IF RECORD+0(1) = 'H'.
  IF HEAD_COUNT > 0.
   PERFORM PROCESS_BAPI TABLES ITEMBAPIEBANC.
   REFRESH ITEMBAPIEBANC.
  ENDIF.
  ITEM_COUNT = 0.
  ADD 1 TO HEAD_COUNT.
  HEAD = RECORD+1.
  MOVE-CORRESPONDING  HEAD TO ITEMBAPIEBANC.
   ELSEIF RECORD+0(1) = 'I'.
   ITEM_COUNT = 1.
   ITEM = HEAD.
   ITEM4 = RECORD1.
  MOVE-CORRESPONDING ITEM TO ITEMBAPIEBANC.
  APPEND ITEMBAPIEBANC.
  CLEAR ITEMBAPIEBANC.
  CLEAR ITEM.
  ENDIF.
endloop.
sy-index = sy-index + 1.
if SY-INDEX <> 0.
PERFORM PROCESS_BAPI TABLES ITEMBAPIEBANC.
REFRESH ITEMBAPIEBANC.
  ENDIF.
*enddo.
*CLOSE DATASET DATASET.
*&      Form  UPLOAD
      text
-->  p1        text
<--  p2        text
FORM UPLOAD.
CALL FUNCTION 'UPLOAD'
EXPORTING
   FILENAME                      = 'C:\WINDOWS\Desktop\CNU4.txt'
   FILETYPE                      = 'ASC'
  TABLES
    DATA_TAB                      = RECORD.
ENDFORM.                    " UPLOAD
*&      Form  PROCESS_BAPI
      text
-->  p1        text
<--  p2        text
FORM PROCESS_BAPI TABLES i_item like ITEMBAPIEBANC[].
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
EXPORTING
  SKIP_ITEMS_WITH_ERROR                =
IMPORTING
   NUMBER                               = PRN
  TABLES
    REQUISITION_ITEMS                    = i_item
  REQUISITION_ACCOUNT_ASSIGNMENT       =
  REQUISITION_ITEM_TEXT                =
  REQUISITION_LIMITS                   =
  REQUISITION_CONTRACT_LIMITS          =
  REQUISITION_SERVICES                 =
  REQUISITION_SRV_ACCASS_VALUES        =
   RETURN                               =  RETURN1.
  REQUISITION_SERVICES_TEXT            =
if return1-type <> 'E'.
   write:/ 'requisation created', PRN.
LOOP AT i_item.
MOVE-CORRESPONDING i_item to ITEM.
  WRITE:/ ITEM.
  CLEAR ITEM.
ENDLOOP.
ELSE.
WRITE:/ RETURN1-MESSAGE.
LOOP AT i_item.
MOVE-CORRESPONDING i_item to ITEM.
  WRITE:/ ITEM.
  CLEAR ITEM.
ENDLOOP.
endif.
ENDFORM.                    " PROCESS_BAPI
Flat file for 'BAPI_REQUISITION_CREATE'
HNB 
IMAT700-700        200          0010001120040111
IMAT700-700        300          0010001120040205
IMAT700-700        400          0010001120040110
IMAT700-700        500          0010001120040108
HNB 
IMAT700-700        200          0010001120040111
IMAT700-700        300          0010001120040211
IMAT700-700        400          0010001120040311
IMAT700-700        500          0010001120040411
This would be helpful information for you Munish!
All the Best!
Regards
Krishna Chaitanya

Similar Messages

  • Problem creating Purchase Order with Bapi_po_create  Return Message is ""

    Hello everybody
    When I get to create PO with bapi_po_create . I get this message in the return parameter :"Enter the PURCH_ORG".
    I think that I have implemented it very well but I don´t get the results that I was expected : No PO was created.
    Please see the following codes and let me know if something is wrong. Thanks .
    =====================================
    *& Report  Z_PED_TRAS                                                  *
    REPORT  z_ped_tras  .
    Definición de la tabla asociada la tabla interna bdcdata
    *DATA :in_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    Definición de la estructura que contendrá los pedidos
    DATA : s_cabeceras_pedidos LIKE bapiekkoc,
           s_pos_pedidos LIKE bapiekpoc.
    DATA : t_cabeceras_pedidos LIKE  bapiekkoc OCCURS 0 WITH HEADER LINE,
           t_pos_pedidos LIKE  bapiekpoc OCCURS 0 WITH HEADER LINE,
           t_final_cabeceras_pedidos LIKE  bapiekkoc OCCURS 0 WITH HEADER
    LINE,
           t_final_pos_pedidos LIKE  bapiekpoc OCCURS 0 WITH HEADER LINE.
    Data : item_schedule like BAPIEKET occurs 0 with header line.
    *DATA : BEGIN OF pedidos,
          ematn TYPE mepo1211-ematn, "Número de material
          menge TYPE mepo1211-menge, "Cantidad de pedido
          name1 TYPE mepo1211-name1," Centro destino
          lgobe TYPE mepo1211-lgobe, "Almacén
         END OF pedidos.
    *DATA: s_pedidos  LIKE pedidos,
         wa_pedidos LIKE pedidos,
         t_pedidos LIKE pedidos OCCURS 0 .
    Variables  auxiliaires
    Variables para la ejecución del explorador de archivos
    DATA: l_temp_dir TYPE string.
    DATA: l_filter TYPE string.
    DATA: l_files TYPE filetable.
    DATA: l_rc TYPE i.
    DATA: l_file TYPE filename.
    DATA: l_filename TYPE string.
    DATA: excel TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA: s_excel TYPE alsmex_tabline.
    DATA: qid LIKE apqi-qid.
    Declaración de parametros de selección
    PARAMETERS :
       p_center LIKE bapiekkoc-suppl_plnt OBLIGATORY,"" Proveedor/Centro
       p_ekorg LIKE bapiekkoc-purch_org OBLIGATORY , " Organización compras
       p_ekgrp LIKE bapiekkoc-pur_group OBLIGATORY, " Grupo de compras
       p_bukrs LIKE bapiekkoc-co_code OBLIGATORY,"Sociedad"
       p_date LIKE sy-datum DEFAULT sy-datum OBLIGATORY,  "fecha
       test AS CHECKBOX DEFAULT 'X'.
      p_center LIKE mepo_topline-superfield, " Proveedor/Centro
      p_ekorg LIKE mepo1222-ekorg, " Organización de compras
      p_ekgrp LIKE mepo1222-ekgrp, " Grupo de compras
      p_bukrs LIKE mepo1222-bukrs,"Sociedad"
      p_date LIKE sy-datum," Fecha
      test AS CHECKBOX DEFAULT 'X'.
    PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:PEDIDOS.XLS'. " Ruta
    Carga del explorador de ficheros **
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      l_temp_dir = 'C:A'.
      l_filter = '.'.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          default_extension       = '*.xls'
          file_filter             = l_filter
          initial_directory       = l_temp_dir
        CHANGING
          file_table              = l_files
          rc                      = l_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF NOT l_files[] IS INITIAL.
        READ TABLE l_files INTO l_file INDEX 1.
        p_file = l_file.
        TRANSLATE p_file TO UPPER CASE.
      ENDIF.
    START-OF-SELECTION.
      IF p_file NE space.
        PERFORM upload_data.
        PERFORM fill_data.
        PERFORM llamar_bapi.
      ENDIF.
    END-OF-SELECTION.
    *&      Form  Upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM upload_data .
      IF excel IS INITIAL .
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            filename                = p_file
            i_begin_col             = 1
            i_begin_row             = 2
            i_end_col               = 4
            i_end_row               = 50000
          TABLES
            intern                  = excel
          EXCEPTIONS
            inconsistent_parameters = 1
            upload_ole              = 2
            OTHERS                  = 3.
        IF sy-subrc <> 0.
          WRITE :/'Hay un problema al cargar los datos delfichero excell'.
        ENDIF.
        SORT excel DESCENDING BY row col.
      ENDIF.
    ENDFORM.                    " Upload_data
    *&      Form  fill_excell
          text
    -->  p1        text
    <--  p2        text
    FORM fill_data .
      DATA :  cant TYPE i ,
              value_row TYPE i VALUE 1,
              data_aux TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    Leer las filas del fichero excell.
      IF test NE 'X'.
        s_cabeceras_pedidos-suppl_plnt = p_center.
        s_cabeceras_pedidos-purch_org = p_ekorg.
        s_cabeceras_pedidos-pur_group = p_ekgrp .
        s_cabeceras_pedidos-co_code = p_bukrs .
        s_cabeceras_pedidos-doc_date = p_date.
        APPEND  s_cabeceras_pedidos TO t_cabeceras_pedidos.
        cant = excel-row.
        DO cant TIMES.
          LOOP AT excel WHERE row EQ value_row.
            APPEND excel TO data_aux.
          ENDLOOP.
          SORT data_aux BY col.
          LOOP AT data_aux.
            CASE data_aux-col.
              WHEN '1'.
                s_pos_pedidos-pur_mat = data_aux-value.
              WHEN '2'.
                s_pos_pedidos-DISP_QUAN = data_aux-value.
              WHEN '3'.
                s_pos_pedidos-plant = data_aux-value.
              WHEN '4'.
                s_pos_pedidos-store_loc = data_aux-value.
            ENDCASE.
          ENDLOOP.
          APPEND s_pos_pedidos TO t_pos_pedidos.
        ENDDO.
      ENDIF.
    ENDFORM.                    " fill_data
    *&      Form  llamar_Bapi
          text
    -->  p1        text
    <--  p2        text
    FORM llamar_bapi .
    data : T_RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE,
           PORDER LIKE BAPIEKKOC-PO_NUMBER.
    t_final_cabeceras_pedidos[] = t_cabeceras_pedidos[].
    t_final_pos_pedidos[] = t_pos_pedidos[].
      CALL FUNCTION 'BAPI_PO_CREATE'
        EXPORTING
          po_header                        = t_final_cabeceras_pedidos
    IMPORTING
       PURCHASEORDER                     = PORDER
        TABLES
          po_items                       = t_final_pos_pedidos
          po_item_schedules                = item_schedule
          RETURN                           = T_RETURN
      IF sy-subrc EQ 0 .
        WRITE :/ 'P O created well'.
      ELSE .
        WRITE :/ 'P .O was not created  well'.
        endif.
      ENDFORM.                    " llamar_Bapi

    Hi,
    When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
    a) POITEM
    b) POITEMX
    c) POACCOUNT
    d) POACCOUNTX
    e) POSERVICES
    f) POSRVACCESSVALUES
    For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
    Set PCKG_NO flag in POITEMX table as u2018Xu2019.
    Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
    Set POACCOUNT-SERIAL_NO to u201801u2019.
    Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
    WA_POSERVICES-PCKG_NO = u20180000000001u2019.
    WA_POSERVICES-LINE_NO = u20180000000001u2019.
    WA_POSERVICES-OUTL_IND = u2018Xu2019.
    WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
    WA_POSERVICES-QUANTITY = u2018100.000u2019.
    WA_POSERVICES-BASE_UOM = u2018EAu2019.
    WA_POSERVICES-PRICE_UNIT = u20181u2019.
    WA_POSERVICES-GR_PRICE = u2018100.000u2019.
    WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
    APPEND WA_POSERVICES TO IT_POSERVICES.
    WA_POSERVICES- PCKG_NO = u20180000000003u2019.
    WA_POSERVICES- LINE_NO = u20180000000002u2019.
    WA_POSERVICES-QUANTITY = u201810.000u2019.
    WA_POSERVICES- BASE_UOM = u2018EAu2019.
    WA_POSERVICES--PRICE_UNIT = u20181u2019.
    WA_POSERVICES-GR_PRICE = u2018100.000u2019.
    WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
    WA_POSERVICES-MATL_GROUP = u20180012u2019.
    APPEND WA_POSERVICES TO IT_POSERVICES.
    Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
    WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
    WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
    WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
    WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
    WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
    APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
    This logic will work definitely and PO Service Items will be created.
    Thanks & Regards.
    Dhina..

  • Problem in bapi   BAPI_PO_CREATE

    Hi,
    I am using Bapi BAPI_PO_CREATE To upload data in ME21.
    Please send me the Sample code if possible along with the Data.
    Regards
    AJay

    Hi,
    *& Report  ZDS_BAPI_PO
    REPORT  ZDS_BAPI_PO.
    DATA: PO_NUM TYPE BAPIMEPOHEADER-PO_NUMBER.
    DATA :WA_HEADER TYPE BAPIMEPOHEADER,
          WA_HEADERX TYPE BAPIMEPOHEADERX.
    DATA: IT_ITEM TYPE TABLE OF BAPIMEPOITEM,
          IT_ITEMX TYPE TABLE OF BAPIMEPOITEMX,
          WA_ITEM TYPE  BAPIMEPOITEM,
          WA_ITEMX TYPE BAPIMEPOITEMX,
          IT_RETURN TYPE TABLE OF BAPIRET2,
          WA_RETURN TYPE BAPIRET2.
    WA_HEADER-COMP_CODE = '1000 '.
    WA_HEADER-DOC_TYPE = 'NB'.
    WA_HEADER-ITEM_INTVL = '00001'.
    WA_HEADER-VENDOR = '0000001000' .
    WA_HEADER-PMNTTRMS = '0001' .
    WA_HEADER-PURCH_ORG = '1000' .
    WA_HEADER-PUR_GROUP = '001' .
    WA_HEADER-CURRENCY = 'EUR '.
    WA_HEADERX-COMP_CODE = 'X'.
    WA_HEADERX-DOC_TYPE = 'X'.
    WA_HEADERX-ITEM_INTVL = 'X'.
    WA_HEADERX-VENDOR = 'X' .
    WA_HEADERX-PMNTTRMS = 'X' .
    WA_HEADERX-PURCH_ORG = 'X' .
    WA_HEADERX-PUR_GROUP = 'X' .
    WA_ITEM-PO_ITEM = '00001' .
    WA_ITEM-MATERIAL = '100-100'.
    WA_ITEM-PLANT = '1000'.
    WA_ITEM-STGE_LOC = '0001'.
    WA_ITEM-QUANTITY = '15.000'.
    WA_ITEM-TAX_CODE = 'V0'.
    WA_ITEM-ITEM_CAT = '0'.
    *WA_ITEM-ACCTASSCAT = 'K'.
    APPEND WA_ITEM TO IT_ITEM.
    WA_ITEMX-PO_ITEM = '00001' .
    WA_ITEMX-MATERIAL = 'X'.
    WA_ITEMX-PLANT = 'X'.
    WA_ITEMX-STGE_LOC = 'X'.
    WA_ITEMX-QUANTITY = 'X'.
    WA_ITEMX-TAX_CODE = 'X'.
    WA_ITEMX-ITEM_CAT = 'X'.
    WA_ITEMX-ACCTASSCAT = 'X'.
    APPEND WA_ITEMX TO IT_ITEMX.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        POHEADER                     = WA_HEADER
        POHEADERX                    = WA_HEADERX
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    IMPORTING
        EXPPURCHASEORDER             = PO_NUM
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
    TABLES
        RETURN                       = IT_RETURN
        POITEM                       = IT_ITEM
        POITEMX                      = IT_ITEMX
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    IF PO_NUM IS NOT INITIAL.
      WRITE:/ 'Po is generated :::::::-',PO_NUM.
    ELSE.
    LOOP AT IT_RETURN INTO WA_RETURN.
      write: / WA_RETURN-MESSAGE.
    ENDLOOP.
    endif.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    * IMPORTING
    *   RETURN        =
    Regards,
    Dhruv Shah

  • In BAPI_PO_CREATE - Error- Purchase Order No. is not importing

    Hi,
    I have a Report for PO creation - Where records get entered from Excel.
    FM - ALSM_EXCEL_TO_INTERNAL_TABLE, BAPI_PO_CREATE
    Problem -
    Excel has app. 100 similar records out of them 7 to 8 records are giving Error.                                  
    In RETURN - Itab -  Error msg -  " Document No. 45... not within defined interval ".
    But same record get entered using ME21N.
    Number Range is same for all excel records. even doc. type & plant is same.
    When debugg - In BAPI_PO_CREATE -  IMPORTING - It's giving Purchaseorder 'Blank'.

    If you're using external numbering (number supplied in incoming data), fix the contents of the Excel file....it appears to contain blanks....file error in data content or in importing the file?

  • Purchase order create problem

    Hi Reiner,
    I am testing out a scenario with BAPI_PO_CREATE, encountered a few problems:
    1. Errors with Date field in some structures.
    --> I changed the date field name to ZDATE and that
        fixed it, I remember this was also a problem in
        Connector 1.0. I can only imagine that the Date
        name used clashes with some reserved system date
        field in VB.Net
    2. Purchase order schedule lines are being populated
       via structure BAPIEKET and into a table. I have
       declared a BAPIEKET structure and a table but i seem
       to have errors trying to even populate the first field
       of the BAPIEKET structure. The error is as follows:
    An unhandled exception of type 'System.NullReferenceException' occurred in <application>
    Additional information: Object reference not set to an instance of an object.
    The code is:
            Dim strPoItem_Schedules As BAPIEKET
            Dim tblPoItem_Schedules As New BAPIEKETTable
            'schedule lines
            strPoItem_Schedules.Po_Item = "00001"
            strPoItem_Schedules.Serial_No = "0001"
            strPoItem_Schedules.Deliv_Date = "20040407"
            strPoItem_Schedules.Quantity = CLng(1.0)
            tblPoItem_Schedules.Add(strPoItem_Schedules)
    Hope you can help coz I did the same with the PO line items table and it is fine...not sure why it is behaving like this for the PO SChedule lines.
    Cheers

    Reiner, no worries. I fixed it. My bad....careless, I  declared the BAPIEKET structure wrongly.
    Cheers

  • Problem while displaying Purchase order using me9f

    Hi All,
    I have copied ME9F as ZME9F, and SAPFM06P as ZSAPFM06P (print program of purchase order). Now when I display the PO using ME23n, there is no problem and PO is getting displayed absolutely fine. But When I display the same PO using ZME9F, the vendor address in the PO is getting printed at the item level instead of header level.
    The vendor address should be displayed at the top and not at the item level.
    When I analysed the code, I found in case of ZME9F AND ME23N, the values of NAST structure and ENT_SCREEN are different. These values are passed as input values to the Function Module ME_READ_PO_FOR_PRINTING.
    Please let me know how do I fix this issue, such that vendor address is displayed at the header level instaed of item level.
    Thanks !!!

    Hi,
    First you creat a PO using BAPI_PO_CREATE , once PO is created then you use the FM BAPI_PO_CHANGE and update the condtions in PO. See the code below given.
    Fm lt_cond-condition_no = lvc_knumv.
    lt_cond-itm_number = gt_output-ebelp.
    lt_cond-cond_type = 'FRB1'.
    lt_cond-cond_st_no = '020'.
    lt_condx-condition_no = lvc_knumv.
    lt_condx-itm_number = gt_output-ebelp.
    lt_condx-itm_numberx = 'X'.
    lt_condx-cond_st_no = lt_cond-cond_st_no.
    lt_condx-cond_st_nox = 'X'.
    lt_condx-cond_type = 'X'.
    lt_cond-cond_value = gt_output-frcst.
    lt_condx-cond_value = 'X'.
    lt_cond-currency = p_cndcur.
    lt_condx-currency = 'X'.
    lt_cond-vendor_no = gt_output-frvndr.
    lt_condx-vendor_no = 'X'.
    lt_cond-change_id = 'I'.
    lt_condx-change_id = 'X'.
    APPEND lt_cond.
    APPEND lt_condx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
    purchaseorder = gt_output-ebeln
    TABLES
    return = lt_return
    * poitem = lt_poitem
    * poitemx = lt_poitemx
    pocond = lt_cond
    pocondx = lt_condx.
    Thanks.

  • Problem to print Purchase Order created in RFC module function

    Hi
    I created a specific RFC function module for using in a BSP application. In this specific function module, I have created a Purchase Order (PO) thanks to the standard module "BAPI_PO_CREATE". The PO is well created but I don't manage to print immediately this PO but the spool is queued. Whereas using SE37, the PO is well created and printed.
    But the customer wants to find the PO immediately in the printer
    Do you know a simply way to solve my problem? I have the feeling that something is lost using RFC module function and the standard module function.
    Thank a lot of for your reply
    Regards
    Francois

    The issue may be because, its used in BSP application.
    may be you need to implement whats explained in this weblog.
    /people/thomas.jung3/blog/2005/08/23/bsp-server-side-printing-for-tableviews
    Regards
    Raja

  • Multiple Line items in BAPI_PO_CREATE

    Hi Everyone,
    I am trying to create a webdynpro application for Creating a Purchase Order using "BAPI_PO_CREATE". Could you help in getting the code for adding a new line item while creating a purchase order using the above BAPI. Adding a new line item means similar to that of in the Transaction "ME21N". I need a table where each row is for a line item. Let me know if my question is not clear.
    Please help me resolve this issue. I would appreciate your help.
    Regards,
    Gopal.

    Hi Raghu,
    Thanks a lot for your reply. I tried your method. Now, I have got a different problem. I managed to combine the two model nodes "A" and "B" into one Value node "C". Now, I binded my table to Value node "C". I have also created two tables and binded them to node A and node B. Now, once the user inputs the values in to the table of Node "C" before executing the BAPI, I should copy the values of the table "C" to the tables of Node "A" and Node "B".
    So, for copying the values from one table to another, I followed the following code.
    IPrivate<Name>View.ISourceValueNode iSourceValueNode= wdContext.nodeSourceValueNode();
    IPrivate<Name>View.ISourceValueElement iSourceValueElement;
    IPrivate<Name>View.ITargetRFC Element iTargetRFCElement;
    for(int i=0;i<wdContext.nodeTargetRFC().size();i++){
    iTargetRFCElement = wdContext.nodeTargetRFC().getTargetRFCElementAt(i);
    iSourceValueElement = iSourceValueNode.createSourceValueNodeElement();
    iSourceValueElement.set<attribute name>(iTargetRFCElement.get<Attribute name>());
    iSourceValueNode.addElement(iSourceValueElement);
    iSourceValueNode.moveNext();
    But, the values are copying in to the second rows of tables "A" and "B" and leaving the first row as Blank. How can I avoid this? Do you understand what I mean?
    My explanation might a bit confusing. Let me know if you need more clarification. Thanks a lot for your help and support.
    Regards,
    Gopal.

  • Problem in executing BAPI

    Hi all
    I am executing the bapi BAPI_PO_CREATE. I have initialized the BAPI input fields and populated with necessary inputs. But when i execute the bapi, i get no output. Output should be available in Model node Return. But i get nothing. The bapi is fine and the model input nodes also gets populated. Any help will be appreciated.
    Thanks in Advance,
    Regards
    Rakesh ;>)

    Hi All
    Sorry for the late response. Actually the problem was with assigning inputs to the model data. Its solved now and the bapi is executing. But it shows an abort message in return structure.
        Msg Type A
        Msg.no   000000
        Code     ME159
        Message  Function modules invoked in wrong sequence
    Any help will be useful.
    Thanks in Advance ;>)
    Regards
    Rakesh

  • Vmi (vendor managed)- subcontracting problem VMI_PO_CREATE_FROM_ORDRSP_VMI

    Hi can anybody help me to find a solution for my Problem with VMI_PO_CREATE_FROM_ORDRSP_VMI ?
    I need to create an order with ORDERS05 - Ordrsp idoc,
    but we recognized that it is only supported in the way to create positiontype 0 Normal order or positiontype 2 consignation...
    for my process it is necessary to create it with positiontype 3 subcontracting ...
    i tried to implement it like with consignation, but it seems as if the problem appears in BAPI_PO_CREATE.
    Has anybody an idea ??#
    Thanks for your help

    Hi,
    For those who will have the same problem  related to passing the subcontract fields
    The solution is to fill the table EXTENSIONIN : example :
    STRUCTURE VALUEPART1 VALUEPART2
    SERRU 1 00010
    DISUB_SOBKZ "Q" 00010
    DISUB_PSPNR "00000289" 00010
    If it is not working try :
    TYPES: BEGIN OF lty_ebelp,
    ebelp TYPE ebelp,
    END OF lty_ebelp.
    TYPES BEGIN OF lty_adsub.
    include TYPE lty_ebelp.
    include TYPE disub_mepoitem_data.
    TYPES END OF lty_adsub.
    TYPES BEGIN OF lty_adsubx.
    include TYPE lty_ebelp.
    include TYPE disub_mepoitem_datax.
    TYPES END OF lty_adsubx.
    DATA: ls_extensionin TYPE bapiparex,
    lt_extensionin TYPE STANDARD TABLE OF bapiparex,
    ls_adsub TYPE lty_adsub,
    ls_adsubx TYPE lty_adsubx.
    ls_adsub-ebelp = '00010'.
    ls_adsub-serru = '1'.
    ls_adsub-disub_sobkz = 'B'.
    ls_adsub-disub_pspnr = '00000289'.
    MOVE ls_adsub TO ls_extensionin-valuepart1.
    ls_extensionin-structure = cl_adsub_constants=>extin_po_struc.
    APPEND ls_extensionin TO lt_extensionin.
    ls_adsubx-ebelp = '00010'.
    ls_adsubx-serru = 'X'.
    ls_adsubx-disub_sobkz = 'X'.
    ls_adsubx-disub_pspnr = 'X'.
    MOVE ls_adsubx TO ls_extensionin-valuepart1.
    ls_extensionin-structure = cl_adsub_constants=>extin_po_strucx.
    APPEND ls_extensionin TO lt_extensionin.
    So data structure LT_EXTENSIONIN will be used when calling BAPI_PO_CREATE1.
    Note : The solution is explained in the SAP Note 1566153.

  • Logistic minimum from BAPI_PO_CREATE

    Hi experst.
    I've got problem.
    As we know when in ME21 we want to create PO and if some supplier has got minimum logistic, ME21 can throw specified message.
    Problem is, that I am creating PO from BAPI_PO_CREATE, so how can I get same info in FM.?
    Thanks as usuall.
    Danielek.

    Yes Soumyaprakash .
    Problem is, that FM will create PO ...
    Edited by: Danielek on Sep 7, 2009 3:33 PM

  • BAPI_PO_CREATE1 account problem

    Hi!
    I'm a bit hopeless!
    I'll read a lot of message about BAPI_PO_CREATE1, but I don't find the solution to my problem.
    I have SAP_APPL 600, and before to pass the note 1477394 and his corrections notes the program was working. Now it doesn't works.
    I'll try to explain the problem:
    I have a program which create a PO program with BAPI_PO_CREATE1 bapi.
    This bapi launch the methods  of the ME_PROCESS_PO_CUST badi.
    In this method (CHECK for example) if I try to catch the accounting data, it doesn't find it. The method returns the structure with out account info.
    It doesn't works for material. For services it works fine.
    I think that it could be realted with how I'm passing the account table to the BAPI_PO_CREATE.
      i_account-po_item = p_contador.
      i_account-serial_no = 0.
      i_account-quantity = p_pos-menge.
      WRITE l_pep TO i_account-wbs_element.
    i_accountx-po_item = p_contador.
    i_accountx-po_itemx = 'X'.
    i_accountx-serial_no = 0.
    i_accountx-quantity = 'X'.
    i_accountx-wbs_element = 'X'.
    APPEND i_account.
    APPEND i_accountx.
    Any help would be appreciated!.
    Thanks.

    Hello!
    I'm using P (poject), but it fails also with cost center.
    The code of CHECK method is this.
      CALL METHOD im_header->get_items
        RECEIVING
          re_items = i_items.
           LOOP AT i_items INTO w_items.
            CALL METHOD w_items-item->get_accountings
             RECEIVING
                   re_accountings = i_input.
                 LOOP AT i_input INTO w_input.
                       CALL METHOD w_input-accounting->get_data
                       RECEIVING
                          re_data = w_item_i.
                ENDLOOP.
         ENDLOOP.
    The w_item_i  it's empty.
    Thanks.
    Edited by: Adell Boix on Sep 27, 2010 12:50 PM

  • BAPI_PO_CREATE to BAPI_PO_CREATE1; how to?

    Hello gurus,
    I'm working on an old custom interface FM (on a backend system) which substancially acts as a "wrapper" for the BAPI_PO_CREATE.
    In details, the code processes an input, does some check on some conditions, then launch the BAPI_PO_CREATE fm in order to create a Purchase order. This is used to interface a third party system with SAP backends.
    Now, the aim is to substitute the call to the BAPI_PO_CREATE (obsolete) with BAPI_PO_CREATE1. As far as I've seen, the latter allows to manage more data and also structures and types used are different from the older one.
    So I wonder and ask if there's a sort of howto or standard FM to manage data conversion in order to successfully swap the call from BAPI_PO_CREATE with a newer call of BAPI_PO_CREATE1.
    I searched a bit on the forum and web but didn't find anything related to this task
    Thanks in advance for your help.

    Hello there
    sorry for the late, I had a previous task to work to so that I had the chance to test your purposed solution only on friday..
    I have to say, Martin's suggestion goes quite fine; I used the standard EHSWA_112_PO_BAPI_CONVERT (curiosity: what are the EHSWA* FM for?) to convert some input structures from BAPI_PO_CREATE to BAPI_PO_CREATE1.
    Some other structures use the same data type on both BAPI so they don't need - apparently - specific conversion.
    And here comes the trouble: while older BAPI_PO_CREATE worked before, the newly interfaced BAPI_PO_CREATE1 doesn't work, as expected, because some little adjustments need to be done.
    The one I'm facing now is how to adapt the EXTENSIONIN structure, which contains custom field values. I noticed in debug the routine that moves extensionin to the data structure of the bapi looks for the structure name BAPI_TE_MEPOHEADER, which is different from the structure used in the older bapi (BAPI_TE_PO_HEADER).
    So, a preliminary task is to substitute in the EXTENSIONIN table the structure names, in order to adapt them to the new BAPI.
    Tried in debug, but seems there are other problems and... since I don't know specifically how this extensionin structure works and what's the correct way of converting them for the new BAPI, is there any guide/document that could help me understanding how mapping is done ? Or the only way is to debug the stuff?
    Thanks in advance for yout help

  • Regarding BAPI_PO_CREATE

    Hi,
    Pls let me know the correct OSS notes that need to  implemnt to correct the net price problems in 4.6 C when we are using BAPI_PO_CREATE?
    Thanks!!
    ram

    Hi,
    please check this note .
    Note 129006 - E06215 Please enter net price
    reward points if useful.
    thanks,
    satheesh.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

Maybe you are looking for

  • A problem with hyperlinks in my Interactive PDF on smartphones...

    I hope someone can help...  I exported both an interactive and for print PDF from inDesign.  When I view the PDFs on my pc the hyperlinks that I've made in the document work perfectly fine.  When I view the PDFs on my smartphone, the hyperlinks don't

  • Acrobat Xi Pro Opens in trial mode 32767 days of trial left

    Hello, I am a long time user of Acrobat XI Pro. I purchased it on a disk from a bona fide software shop. It has worked perfectly for many months and now upon opening a PDF it is coming up with an error message saying that I have 32767 days remaining

  • Cursor lagging when detecting networks

    My mouse cursor is very very laggy when I turn on my airport and while Leopard is detecting networks. Sometimes, if the wifi network signal is weak, when I mouse over the network with the weak signal, it lags more (during 5 sec or something). It is q

  • Complete Task

    Hi If i'm coordinator of a quality notification I assign a task to a person. This person enters data (long text)  into the task and completes the task. The data entered into the long text is printed in a 8D report. My problem is that as coordinator I

  • Flash Player 11 won't install on my new Samsung 2 7 ICS tablet.  Error 941.  Any clues?

    Flash Player 11 won't install on my new Samsung 2 7 ICS tablet.  Error 941.  Any clues?