Bapi Problem

REPORT  zbapi_create_po                         .
*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 : 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 '1000'      ,
             doctyp  LIKE header-doc_type   DEFAULT 'NB'        ,
             cdate   LIKE header-creat_date DEFAULT sy-datum    ,
             vendor  LIKE header-vendor     DEFAULT '1005',
             pur_org LIKE header-purch_org  DEFAULT '1000'      ,
             pur_grp LIKE header-pur_group  DEFAULT '026'       .
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 'DPC1017'   ,
             plant    LIKE item-plant    DEFAULT '1200' ,
             quantity LIKE item-quantity DEFAULT 100.
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-vendor     = vendor     .
header-langu      = ws_langu   .
header-purch_org  = pur_org    .
header-pur_group  = pur_grp    .
*POPULATE HEADER FLAG.
headerx-comp_code  = c_x.
headerx-doc_type   = c_x.
headerx-creat_date = c_x.
headerx-vendor     = c_x.
headerx-langu      = c_x.
headerx-purch_org  = c_x.
headerx-pur_group  = c_x.
headerx-doc_date   = c_x.
*POPULATE ITEM DATA.
item-po_item  = item_num.
item-material = material.
item-plant    = plant.
item-quantity = quantity.
APPEND item.
*POPULATE ITEM FLAG TABLE
itemx-po_item    = item_num.
itemx-material   = c_x.
itemx-plant      = c_x .
itemx-stge_loc   = c_x .
itemx-quantity   = c_x .
itemx-tax_code   = c_x .
itemx-item_cat   = c_x .
itemx-acctasscat = c_x .
APPEND itemx.
*BAPI CALL
CALL FUNCTION 'BAPI_PO_CREATE1'
  EXPORTING
    poheader                     = header
    poheaderx                    = headerx
  POADDRVENDOR                 =
  TESTRUN                      =
IMPORTING
  EXPPURCHASEORDER             =
  EXPHEADER                    =
  EXPPOEXPIMPHEADER            =
TABLES
   return                       = return
   poitem                       = item
   poitemx                      = 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 / return-message.
ENDLOOP.
I am getting this message, can u give me any ideas, where is the problem in code ?
<b>Creation of PO unsuccessful
PO Header data Still faulty
Purchase Order date is in the past
For the K4 fiscal year variant, no peroid is defined for 00.00.0000</b>
points for sure
Thanks in Advance
Vijaya

Try by passign doc_date.
header-pur_group = sy-datum.

Similar Messages

  • BAPI - Problem in Sales order creation

    Hi Friends,
    I have problem in Sales order creation using BAPI ,I am getting a messsage - Error in creating document ,I have sent the code along with this mail ,can you help it out.
    Code:
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    Regards,
    Dinesh

    what messages u are gettting in RETURN ? Please check the RETURN tables data.
    [code]CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Regards
    Prabhu

  • PO BAPI Problem in condition types

    Hi,
    I am facing a strange problem in creation of PO through "BAPI_PO_CREATE1".
    In the Item condition internal table, I am passing the condition types.
    The PO is getting created successfully.
    Eg. I pass conditions and their values as follows:
    PB00 : 1000
    ZB00 : 1000
    FRB1 : 1000
    The PO is created successfully and we can check the prices updated properly.
    Now,
    When I create a second PO with the same values, the prices are taken from the last PO and the prices from
    my code(which are passed through BAPI) are added to the last value.
    If I run the program with the same values as above, the PO is created with the values 2000.
    Third time it is 3000 and so.
    The value from the last PO is coming into the new PO.
    Please advise me if anything missing.
    My code is below::
    ================
    *& Report  ZTEST_PO
    REPORT  ZTEST_PO.
    data : HEADER like BAPIMEPOHEADER .
    data : HEADERX like BAPIMEPOHEADERX .
    data : POITEM like BAPIMEPOITEM occurs 0 with header line.
    data : POITEMX like BAPIMEPOITEMX occurs 0 with header line.
    data : POSCHEDULE like BAPIMEPOSCHEDULE occurs 0 with header line.
    data : POSCHEDULEX like BAPIMEPOSCHEDULX occurs 0 with header line.
    DATA : RET LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA : ret1 like bapiret2.
    Data PO like BAPIMEPOHEADER-PO_NUMBER.
    data : pocond like BAPIMEPOCOND occurs 0 with header line.
    data : pocondx like BAPIMEPOCONDX occurs 0 with header line.
    *pocond-CONDITION_NO = '00000'.
    pocond-itm_number = '000010'.
    pocond-COND_ST_NO = '001'                                   .
    *pocond-COND_COUNT = '1'.
    pocond-COND_TYPE = 'PB00'.
    pocond-COND_value = '500'.
    pocond-CURRENCY = 'EUR'.
    pocond-CURRENCY_ISO = 'EUR'.
    pocond-CHANGE_ID =  'I'.
    APPEND POCOND.
    **pocond-CONDITION_NO = '00000'.
    *pocond-itm_number = '000010'.
    *pocond-COND_ST_NO = '10'                                   .
    *pocond-COND_COUNT = '2'.
    *pocond-COND_TYPE = 'PBXX'.
    *pocond-COND_value = '555'.
    *pocond-CURRENCY = 'EUR'.
    *pocond-CURRENCY_ISO = 'EUR'.
    *pocond-CHANGE_ID =  'U'.
    *APPEND POCOND.
    **pocond-CONDITION_NO = '00000'.
    *pocond-itm_number = '000010'.
    *pocond-COND_ST_NO = '20'                                   .
    *pocond-COND_COUNT = 0.
    *pocond-COND_TYPE = 'ZB00'.
    *pocond-COND_value = '666'.
    *pocond-CURRENCY = 'EUR'.
    *pocond-CHANGE_ID = 'U'.
    *APPEND POCOND.
    **pocond-CONDITION_NO = '00000'.
    *pocond-itm_number = '000010'.
    *pocond-COND_ST_NO = '30'                                   .
    *pocond-COND_COUNT = 0.
    *pocond-COND_TYPE = 'FRB1'.
    *pocond-COND_value = '777'.
    *pocond-CURRENCY = 'EUR'.
    *pocond-CHANGE_ID = 'U'.
    *APPEND POCOND.
    *pocondx-CONDITION_NO = '00000'.
    POCONDX-ITM_NUMBER  = '000010'.
    POCONDX-COND_ST_NO = '000'.
    *POCONDX-CONDITION_NOX = 'X'.
    *POCONDX-COND_ST_NOX = 'X'.
    POCONDX-ITM_NUMBERX = 'X'.
    *POCONDX-COND_COUNT = 'X'.
    POCONDX-COND_TYPE = 'X'.
    POCONDX-COND_value = 'X'.
    pocondX-CURRENCY = 'X'.
    *pocondX-CURRENCY_ISO = 'X'.
    pocondX-CHANGE_ID = 'X'.
    APPEND POCONDX.
    HEADER-COMP_CODE = 'TF01'.
    HEADER-DOC_TYPE = 'DMPO'.
    HEADER-VENDOR = '0000000317'.
    HEADER-LANGU = 'EN'.
    HEADER-PURCH_ORG = '1001'.
    HEADER-PUR_GROUP = '110'.
    HEADER-CURRENCY = 'EUR'.
    HEADER-DOC_DATE = '22.10.2007'.
    HEADER-REF_1 = '999999999999'.
    HEADERX-VENDOR = 'X'.
    HEADERX-PURCH_ORG = 'X'.
    HEADERX-PUR_GROUP = 'X'.
    HEADERX-REF_1 = 'X'.
    POITEM-PO_ITEM = '00010'.
    POITEM-MATERIAL = '00042199730L'.
    POITEM-PLANT = '1000'.
    POITEM-STGE_LOC = '1030'.
    POITEM-MATL_GROUP = '01'.
    POITEM-QUANTITY = '10'.
    POITEM-PRICE_UNIT = 500.
    poitem-calctype = 'C'.
    append POITEM.
    POITEMX-PO_ITEM = '00010'.
    POITEMX-MATERIAL = 'X'.
    POITEMX-PLANT = 'X'.
    POITEMX-QUANTITY = 'X'.
    POITEMX-PRICE_UNIT = 'X'.
    append POITEMX.
    POSCHEDULE-PO_ITEM = '00010'.
    POSCHEDULE-DELIVERY_DATE = '30.10.2007'.
    append POSCHEDULE.
    POSCHEDULEX-PO_ITEM = '00010'.
    POSCHEDULEX-PO_ITEMX = 'X'.
    POSCHEDULEX-DELIVERY_DATE = 'X'.
    append POSCHEDULEX.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        poheader                     = HEADER
        POHEADERX                    = HEADERX
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
    IMPORTING
       EXPPURCHASEORDER             = PO
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = RET
       POITEM                       = POITEM
       POITEMX                      = POITEMX
      POADDRDELIVERY               =
       POSCHEDULE                   = POSCHEDULE
       POSCHEDULEX                  = POSCHEDULEX
      POACCOUNT                    =
      POACCOUNTPROFITSEGMENT       =
      POACCOUNTX                   =
       POCONDHEADER                 = POCOND
       POCONDHEADERX                = POCONDX
        POCOND                       = POCOND
        POCONDX                      = POCONDX
      POLIMITS                     =
      POCONTRACTLIMITS             =
      POSERVICES                   =
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      POCOMPONENTS                 =
      POCOMPONENTSX                =
      POSHIPPING                   =
      POSHIPPINGX                  =
      POSHIPPINGEXP                =
      NFMETALLITMS                 =
    if RET-type NE 'E'.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              WAIT   = 'X'
            IMPORTING
              RETURN = ret1.
    write : ' PO Created : ', PO   .
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
            IMPORTING
              RETURN = ret1.
        ENDIF.
    ================

    Any input??

  • RFC & BAPI problem in SUP 2.0

    Hi,
    I have been using the Standard BAPI's & RFCs for my app. However i am getting the errors for all of them while actually using in workflow app.
    1] Invalid Templet for BAPI.
    2] java.io.Exception:JASON:character not standard date time type
    3] ____BAPI Return is not a standard DateTime type
    But i can see the preview of all successfully. Do we need some kind of special requirement fo BAPI & RFC's to work in SUP ?
    I am using MBS & simple workflow app concept to design. I have also searched the SDN for any SUP 2.0  & SAP BAPI example. I found My Flights but that was too old in previous 1.5.2 i think so which is of no use.
    Your help highly appreciated
    BR
    Yogesh

    Hi,
    That's the first thing i checked the version, I have the latest JCO & JAR files being used. So there is no version conflict in Backend EIS & the front UI.
    I am on digging out the infinitesimal log entries in the server to fetch the exact reason behind the problem.
    I would like to know if you have ever imported the BAPI or RFC would you normally get conflicts with SAP returning the NULL or NaN values from backend.
    Because I know Sybase Messaging Client can not handle the NaN & NULL values thats an offcial confirmation from Sybase for RESTful WS i got.
    So may be its same but i am not sure I must or someone who has encounter these errors should confirm this.
    Best Regards
    Yogesh

  • Bapi problem - again

    Sorry to all of you with probably the same problem but i can't find solution.
    Anyway i'm trying to write simple WD which will make in target system user.
    I'm using BAPI_CREATE_USER FM.
    I did everything like in ohter examples of consuming transaction FM (BAPi).
    Anyway will post some code so maybe you will finde some bugs.
    I made model with my bapi and bapi_transaction_commit of course.
    in wdDoInit of custom controler i wrote:
        Bapi_User_Create_Input input = new Bapi_User_Create_Input();
         wdContext.nodeBAPI_USER_CREATE_INPUT().bind(input);
         input.setPassword(new Bapipwd());
         input.setAddress(new Bapiaddr3());
         input.setUsername("");
            Bapi_Transaction_Commit_Input inputTrans = new Bapi_Transaction_Commit_Input();
            wdContext.nodeBAPI_TRANSACTION_COMMIT().bind(inputTrans);
         inputTrans.setWait(true);
    i wrote 2 methods for both bapi
    1st.
        try{
             wdContext.currentBAPI_USER_CREATE_INPUTElement().modelObject().execute();
              wdContext.nodeOutput().invalidate();
        catch (Exception ex){
              ex.printStackTrace();
    2nd
         try {
              wdContext.currentBAPI_TRANSACTION_COMMITElement().modelObject().execute();
              wdContext.nodeOutput().invalidate();
         } catch (Exception ex){
              ex.printStackTrace();
    View contains 4 input fields for user name, name, last name and password.
    All of them are binded to the context.
    Button create user triger code:
        try{
              wdThis.wdGetUserCreateCustController().executeBAPI_USER_CREATE_INPUT();
        catch(Exception ex){
              wdComponentAPI.getMessageManager().reportWarning(ex.toString());
        wdThis.wdGetUserCreateCustController().executeBAPI_COMMIT();
    What i'm doing wrong?
    It dosent efect target system.
    It dosen't even start fm because i try to debug it.
    PS. I'm new to WD so sorry for some stupid things.

    Hi,
    1.first check whether the BAPi is working correctly with same values which u have set it in ur web dynpro application.
    2. Check whether any exception is thrown: after executing the model use message manager to report exception.
    wdComponentAPI.getmessageManager().reportException(ex);
    or u can find the error logs in the NWA . login to NWA --> Problem management --> logs and Tracess --> log Viewer.
    Thanks and Regards

  • COMMIT BAPI Problems

    hi we have implemented VC on Ep6.0 SP2 pacth 27.
    when we try to create a model using BAPI_BANK_CREATE and BAPI_TRANSACTION_COMMIT with input forms for BANK_CTRY and BANK_KEY and also an input form for BANK ADDRESS the following is the problem we face.
    after running the preview in runtime when we enter all the details in both forms and click submit only the BANK_CTRY and BANK_KEY is being written into R/3 i am getting no errors or messages after i click submit.
    is there something wrong with the design or is it an issue with VC?
    thanks

    Hi Rahul,
    When you use more than one input form to a BAPI, you should change the action name on the connecting line between the input forms and the BAPI to *submit.
    You can also commit the work automatically by checking the "requires commit" property of BAPI_BANK_CREATE.
    Regards,
    Lisi

  • Maintainence order bapi problem - to get time of MO creation

    Hi ,
    I am using
    BAPI_ALM_ORDERHEAD_GET_LIST  to get maintainence orders from ECC
    It is giving me details like who created the order and when.
    I also need to find out at what time the order was created.
    But the return has 9 output time data and i am not able to understand which of these denote which time field returns the MO order creation time
    I also tried
    BAPI_ALM_ORDER_GET which gives back the details of any MO but
    again i face d the same problem.
    Can anyone help me to find the field which stores
    the time at which MO is created.?
    Also if possible can one please explain -
    what do all the various time fields denote?
    Thanks and Regards
    Points assured for help.

    I think it is ACTUAL_START_TIME field.
    But anyways after executing the BAPI, You will have all the Order details in the return parameter.
    Go to AUFK table give one order number to AUFNR. And check the entry date and map the value to the return parameters in the BAPI

  • BAPI Problems accessing tables

    Dear Experts,
    I'm trying to make a SAP Java Connector. My problem is that, when they are called by Java, BAPI functions don't run in the same manner as in SAP testing mode .
    I tested two BAPI functions called through my connector and I saw with the debbuger that BAPI functions don't execute the select and loop at with a WHERE clause when they are called by Java, therefore they throw errors. But in the SAP testing mode functions work just fine.
    I'm new to SAP and I don't know why this happens. Would you like to explain to me how to fix this problem?
    Thank you very much.

    Hi,
    You do not need super_admin rights.
    Ask your security admin to assign you SAP_JAVA_NWADMIN_LOCAL_READONLY, and if your server is on a cluster SAP_JAVA_NWADMIN_CENTRAL_READONLY roles in the portal.
    This will alow you to inspect the logs.
    Be aware that not all ABAP types are not supported from JAVA so your input parameters may need to be type cast and handled internally in ABAP.  Also consider handling of codesets (unicode/non-unicode ie. US/NUS system types also raise compatibility issues).
    Here is some useful info concerning BAPI's that may benefit you:
    waht is bapi and how to creating the bapi
    difference between a BAPI and function module
    Have you set an external breakpoint to see what is being triggered remotely for your BAPI? In SE37 --> Utilities --> External Breakpoints --> Set Breakpoints. This will allow you to run and debug from the system invoking the call remotely.
    You can also turn tracing on for the iView or use httptrace to track issues.
    See below excerpt from SAP Doco relating to US/NUS:
    The Remote Function Call (RFC) interface has also changed as part of the conversion to Unicode. The following remarks give a very brief outline of the general guidelines.
    So that the RFC works in both USs and NUSs, an additional attribute has been added to the destination. This attribute specifies whether the RFC is to run in a US or a NUS. If an ABAP program uses function modules that change the RFC destination, this new attribute must be filled using another required parameter.
    When text data is transferred in an RFC, the following new exceptions may occur:
    A text cannot be converted from the source code page to the target code page because the corresponding character in the target code page is not available.
    The field in the target system is shorter than the field in the source system. This may occur if data from a US is transferred to a multibyte system.
    In principle, you can assume that text data has a different length in the sending system than in the receiving system. For this reason, we recommend that you use strings wherever possible. That is, you should try to avoid specifying the length of text data. You can, however, send binary data whose length is specified, without any problems.

  • File to BAPI problem

    Hi,
    We are sending a file using sender file adapter through PI into SAP system BAPI with receiver RFC adapter.
    The input file is received in XI and we don't see any mapping done, but message mapping displaying as succefully delivered to SAP system.
    We are using asynch call, no BPM involved. Its just File to RFC.
    Any help appreciated.
    Thanks.

    Hi,
    Do you make a commit after BAPI call.
    There is a parameter in adapter which has to be set.
    From documentation:
    <i>"Commit Control for Individual BAPI Calls
    If you want to use this communication channel to call BAPIs as remote-enabled function modules that change data in the database, set the indicator.
    If executed successfully, the transaction is written to the database by calling the function module BAPI_TRANSACTION_COMMIT explicitly. If an error occurs, the transaction is rolled back by BAPI_TRANSACTION_ROLLBACK.
    The result is determined by the value of the field TYPE in parameter RETURN. If successful, the tables are empty and the values “”, “S”, “I”, and “W” are displayed. All other values are regarded as errors.
    To change this setting, set the indicator BAPI Advanced Mode.
    In the Successful RETURN-TYPE Values table, enter the values that should lead to a successful execution."</i>
    Regards,
    Wojciech
    Message was edited by: Wojciech Gasiorowski

  • Bapi problem via jco

    hi guys,
       i am using bapi via jco
       i am retrieving data,appending data  on standard funtional modules , ok, fine
      how  can i insert data into custom tables using bapi via jco...
      plz give me some steps...............
    thanks,
    tony

    Hi,
    Just to clarify (again) as far as I know yuo cannot directly access SAP tables via JCo calls from Java.  JCo only allows you to call function modules on teh SAP system.  Any database interaction (Select, Insert, etc.) has to be coded in ABAP inside the function module.  You then call the function module (which must be RFC enabled) via JCo in your Java.
    You can use standard function modules or you can create custom function modules if you need to acces custom tables or perform custom logic.
    Hope this helps,
    Gareth.

  • CA-DMS BAPI Problems

    I am trying to understand the preferred method of creating and editing Document data, when the provided Business Object methods do not contain access to all of the draw fields.  We have also created append structures, and I am finding that none of the methods (BAPIs) extend to provide access to the appended fields.
    Does anyone know the preferred way to access those fields?

    The table for DMS is DRAW. I suggest you enlist the services of an ABAP programmer. Modifying table data is not something to tread lightly on and you may be stuck with some limitations on the data based on whether the data is locked for change or not.
    Edited by: Athol Hill on Jul 24, 2010 11:31 PM

  • A bapi problem of create sales order

    hello,experts,
    when I want to try the function of bapi 'BAPI_SALESORDER_CREATEFROMDAT1', the return message is the following,
    'Material 4070111 is not defined for sales org.4050,  distr.chan.01,  language ZH',actually,the sales org.4050 is defined for the material.
    pls help me out.appreciated.
    the content of the program:
    REPORT  ZWY_SALESORDER01.
    --Data Declaration--
    Data: st_BAPISDHEAD like BAPISDHEAD, " Sales Order Header Data
    ta_BAPIITEMIN like BAPIITEMIN occurs 0 with header line, " Ln item
    ta_BAPIPARTNR like BAPIPARTNR occurs 0 with header line, " Partner
    d_BAPIRETURN1 like BAPIRETURN1, " Bapi return msg
    d_vbeln like bapivbeln-VBELN. " Sales Order Number
    *Please note in the following program, sold to party (SP) has been
    *entered as 'AG' and ship to party (SH) as 'RG'.
    *SP----
    AG
    *SH----
    RG
    *Order type 'OR' as 'TA'
    *Please use TA instead of OR
    *Also if you set the * CONVERT_PARVW_AUART = 'X' parameter to 'X' you
    *can use sold to party as SP and ship to party as SH.
    Move the data to create sales order in the repective parameters------*
    move: '4OR' to st_BAPISDHEAD-DOC_TYPE, " Sales document type
    '15493' to st_BAPISDHEAD-PURCH_NO_C,
    '4050' to st_BAPISDHEAD-SALES_ORG,
    '01' to st_BAPISDHEAD-DISTR_CHAN,
    '00' to  st_BAPISDHEAD-DIVISION,
    '00010' to ta_BAPIITEMIN-ITM_NUMBER,
    '4070111' to ta_BAPIITEMIN-MATERIAL,
    '4000' to ta_BAPIITEMIN-PLANT,
    '1' to ta_BAPIITEMIN-REQ_QTY,
    'AG' to ta_BAPIPARTNR-PARTN_ROLE, " Sold to Party
    '0000006648' to ta_BAPIPARTNR-PARTN_NUMB.
    Append the internal tables-------------------------------------------*
    append ta_BAPIPARTNR.
    clear ta_BAPIPARTNR.
    append ta_BAPIITEMIN.
    clear ta_BAPIITEMIN.
    Move ship to party---------------------------------------------------*
    move: 'RG' to ta_BAPIPARTNR-PARTN_ROLE, " Ship to party
    '0000006648' to ta_BAPIPARTNR-PARTN_NUMB.
    Append the internal tables-------------------------------------------*
    append ta_BAPIPARTNR.
    clear ta_BAPIPARTNR.
    break-point.
    Call the Bapi to create the sales order
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
    EXPORTING
    ORDER_HEADER_IN = st_BAPISDHEAD
    WITHOUT_COMMIT = ' '
    CONVERT_PARVW_AUART = ' '
    IMPORTING
    SALESDOCUMENT = d_vbeln
    SOLD_TO_PARTY =
    SHIP_TO_PARTY =
    BILLING_PARTY =
    RETURN = d_BAPIRETURN1
    TABLES
    ORDER_ITEMS_IN = ta_BAPIITEMIN
    ORDER_PARTNERS = ta_BAPIPARTNR
    ORDER_ITEMS_OUT =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CCARD =
    ORDER_CFGS_BLOB =
    ORDER_SCHEDULE_EX =
    break-point.
    if d_vbeln <> space.
    write: 'Sales order No. ', d_vbeln.
    endif.

    clear iohead.
      ihead-doc_type   = 'ordertype'.
      ihead-sales_org  = 'sales organisation'.
      ihead-distr_chan = 'distribution ch'.
      ihead-division   = 'division'.
      ihead-req_date_h = sy-datum.
      ihead-ship_cond  = 'shipping codition'.
      ihead-incoterms1 = 'incoterms'.
      ihead-pmnttrms   = 'payment terms'.
      ihead-purch_no_c = 'Purchase document'.
      ihead-purch_date = 'purchase doc date.
      ihead-accnt_asgn = 'account assignment'.
      ihead-pymt_meth = 'payment method'.
      clear ipartner.   refresh ipartner.
      ipartner-partn_role = 'AG'.
      ipartner-partn_numb = 'sold to party'.
      append ipartner.
      clear ipartner.
      ipartner-partn_role = 'WE'.
      ipartner-partn_numb = 'ship to party'.
      append ipartner.
      refresh : iitem, ibapischdl, ibapicond.
      clear   : iitem, ibapischdl, ibapicond.
      item-itm_number = '10'.
      item-material   = 'material'.
      item-plant      = 'plant'.
      item-val_type   = 'BLFG'.
      append item.
      ibapischdl-itm_number = '10'.
      ibapischdl-req_date   = sy-datum.
      ibapischdl-req_qty    = 'quantity'.
      append ibapischdl.
      call function 'BAPI_SALESORDER_CREATEFROMDAT2'
           exporting
              SALESDOCUMENT           =
                order_header_in         = ihead
              ORDER_HEADER_INX        =
              SENDER                  =
              BINARY_RELATIONSHIPTYPE =
              INT_NUMBER_ASSIGNMENT   =
              BEHAVE_WHEN_ERROR       =
              LOGIC_SWITCH            =
              TESTRUN                 =
              CONVERT_PARVW_AUART     = ' '
          importing
               salesdocument_ex        = wvbeln
           tables
               return                  = ibapiret2
               order_items_in          = item
              ORDER_ITEMS_INX         = IBAPISDITMX
               order_partners          = ipartner
               order_schedules_in      = ibapischdl
              ORDER_SCHEDULES_INX     =  ibapischdl
              order_conditions_in     = ibapicond
              ORDER_CFGS_REF          =
              ORDER_CFGS_INST         =
              ORDER_CFGS_PART_OF      =
              ORDER_CFGS_VALUE        =
              ORDER_CFGS_BLOB         =
              ORDER_CFGS_VK           =
              ORDER_CFGS_REFINST      =
              ORDER_CCARD             =
              ORDER_TEXT              =
              ORDER_KEYS              =
              EXTENSIONIN             =
              PARTNERADDRESSES        =
      if wvbeln ne space.
        call function 'BAPI_TRANSACTION_COMMIT'
             exporting
                  wait = wwait.
           IMPORTING
                RETURN  =
    sales document will be available in bapi return .
    saravanan

  • BAPI Problem - BAPI_PROCORDCONF_CREATE_TT

    I am using this BAPI to notify  Process Orders.
    But I do not make any recording the movement of goods into the table goodsmovements.
    Moreover, the table link_conf_goodsmov him the income index of the table goodsmovements that must change.
    How can I notify the movement of goods?

    Hi Pablo,
    I assume that you are creating process order confirmations and corresponding goods movements. BAPIs I am referring are different.
    Here are the steps that might help you.
    Reward if you find this useful.
    1. Call bapi - BAPI_PROCORDCONF_GET_HDR_PROP and pass PROP_GMOV = 'X' and ATHDRLEVELS. This bapi will return the proposals of automatic goods movements. After the execution of this bapi, following tables will be filled up with data
    ATHDRLEVELS
    GOODSMOVEMENTS
    LINK_CONF_GOODSMOV
    2. Change ATHDRLEVELS and GOODSMOVEMENTS as per file data
    3. Append GOODSMOVEMENTS with components from file.
    4. Append LINK_CONF_GOODSMOV with indexes for components
    5. Pass these 3 tables to bapi - BAPI_PROCORDCONF_CREATE_HDR. This bapi will create confirmation.
    But this will create 2 material documents, one for 101 movement type and other for your movement  for ex. 261 (consumption)
    Thanks,
    Shriram.

  • MB1B BDC/BAPI PROBLEM (FOR SAP IS -RETAILS)

    i am getting coding block error in mb1b recording while it is running correctly otherwise.i have also tried through bapi but no data is being posted and bapi gives error that data is not maintain in perticular plant whereas the data is there in the plant.
    REGDS

    hi please if u dont mind send me BDC for MB1B
    please please help me
    [email protected]

  • Bapi problem contains FBS1, FB03, f.81

    Hi ,
    when i try to post jurnarls through bapi 'BAPI_ACC_GL_POSTING_POST' for the Transaction FBS1 data was posted, and it is working fine,
    when i gon to the transaction FB03 with the document number given by the bapi it is displaying all the data posted.
    when i try to reverse the junarlas using the document number given by the bapi through the transaction f.81 it is giving the error like no list found( no document number)
    when i post data manually ( without using bapi) it is working fine.
    can any one give the replay asap

    Hi,
    PERFORM bdc_transaction USING 'FBS1'.
    After calling 1st T-Code
    Clear BDC data.
    ie.
    clear i_bdcdata[].
    After clear itab continue as per yur way.
    otherwise
    use 1st T-Code itab  i_bdcdata .
    use 2st T-Code itab  i_bdcdata_01.
    Reward if usefull...
    Thanks,
    Durai.V

Maybe you are looking for

  • Trouble connecting iMac to wireless networked HP printer -- printer not seen in

    HP Photosmart Premium 410 Operating System: OS X 10.9 I am trying to connect a new Mac with OSX 10.9.5 to an HP Photosmart Premium c410, which is on an existing home wireless network and functions properly with other (Windows) computers in the house.

  • Material Type for By product??

    hii What is the material type has to be followed while creating material master for By products. In subcontracting scenario ?? In real time , those who r  having this type of scenrio can confidently tel , how we can go abt  ???

  • Using OC4J with Apache Web Server

    Hi, I followed the instruction to put the following lines in apache/config/httpd.conf: <IfModule mod_proxy.c> ProxyRequests On ProxyPass /servlet/ http://sundev.ultradns.net:8888/servlet/ ProxyPassReverse /servlet/ http://sundev.ultradns.net:8888/ser

  • Registration Key not available in Zenworks Adaptive Agent

    No "registration key" is visible in Zenworks Adaptive Agent - Agent - Registration Keys. The device is managed and imported in the correct folder on the server side and all assigned bundles and policies are applied and working. But i need a way to se

  • Small Triangle?

    Only seen it a few times, but can't figure out what it means. Above the signal strength bars, I've seen a small triangle. It's been there in 1x and without. Have not noticed it in 3g or 4. What is the symbol for?