BAPI Table Input not passing to R/3 Backend

Hello Experts,
I am having trouble populating a Table input in my Web Dynpro Java application.  I have tried researching this issue on SDN and have attemped many of the solutions with no luck.  Here is my code:
          Bapi_Order_Input NewOrder = new Bapi_Order_Input();
          wdContext.nodeBapi_Order_Input().bind(NewOrder);
          Bapisdhd1 OrderHead = new Bapisdhd1(); - <i>(This is part of the Input Paramter, values are successfully passed)</i>
          OrderHead.setDoc_Type("ZOR");
          OrderHead.setSales_Org("2000");
          OrderHead.setDistr_Chan("40");
          NewOrder.setOrder_Header_In(OrderHead);                    
          Bapiparnr Partner = new Bapiparnr(); - <i>(This is a table parameter, values are not being passed to the backend)</i>
          Partner.setPartn_Role("SP");
          Partner.setPartn_Numb("20010");
          Partner.setItm_Number("000000");     
          NewOrder.addOrder_Partners(Partner);
          wdContext.currentBapi_Salesorder_Createfromdat2_InputElement().modelObject().execute();
I cannot use "NewOrder.setOrder_Partners(Partner)" because Order_Partners is an AbstactList.  I have attempted to create this abstract list below but it will not syntactically check:  
AbstractList PartnerList = new Bapiparnr.Bapiparnr_List();
If I test these same input values above in R/3, the BAPI executes fine.  When I test the BAPI from WD, I get the return message " Please enter a Sold-To or ShipTo Party".  I can replicate this same message in R/3 if I do not populate the Partner table.
I am also able to see the Partner values I enter when I create a Table is display them in Web Dynpro.
This is frusterating me a great deal and I would greatly appreciate, and rewards, any suggestions or recomendations.
Thank you for your help,
Matt

Hi Everyone,
Well, I was finally able to resolve my issue.  After debugging the Web Dynpro Application from the ECC BAPI side, I was able to see that the Partner values were failing to be passed to the back-end SAP system.  After I restarted the J2EE engine, I was able to create the sales order.
I noticed a couple of interesting things as well:
-You need to fill in the leading zeros for Customer Number (KUNNR) before passing of this value
-The ECC BAPI automatically (atleast in my case) changed the input value of Partner-PartnerRole from "SP" to "AG".  This change occurs before the first step in the Debugger is performed.  This change, however, does not occur when the BAPI is called from Web Dynpro.  Once I edited the Web Dynpro Partner Role input to "AG", I was able to create the sales order.
I have list my code below, thank you all for your help.
Regards,
Matt
     Bapi_Salesorder_Createfromdat2_Input SO = new Bapi_Salesorder_Createfromdat2_Input();
     Bapi_Transaction_Commit_Input Commit = new Bapi_Transaction_Commit_Input();
     Bapisdhd1 OrderHeader = new Bapisdhd1();
     OrderHeader.setSales_Off("0000");
     OrderHeader.setDoc_Type("ZOR");
     OrderHeader.setPo_Meth_S("CU01");
     SO.setOrder_Header_In(OrderHeader);
     Bapiparnr Partner = new Bapiparnr();
     Bapiparnr.Bapiparnr_List PartnerList = new Bapiparnr.Bapiparnr_List();     
     Partner.setPartn_Numb(PartnerNumber);
     Partner.setPartn_Role("AG");
     PartnerList.addBapiparnr(Partner);
     SO.setOrder_Partners(PartnerList);
     int size = wdContext.nodeShoppingCart().size();
     BigDecimal Qty;
     Bapisditm.Bapisditm_List ItemsList = new Bapisditm.Bapisditm_List();
     Bapisditm Items;
     IPublicUserAccount.IShoppingCartElement CartItem = wdContext.currentShoppingCartElement();
     for (int i=0; i < size; i++){     
          Items = new Bapisditm();
          Qty = new BigDecimal(BigInteger.ZERO);
          CartItem = wdContext.nodeShoppingCart().getShoppingCartElementAt(i);
          Qty = Qty.add(BigDecimal.valueOf(CartItem.getQuantity()));                              
          Items.setTarget_Qty(Qty);
          Items.setTarget_Qu("EA");
          Items.setMaterial(CartItem.getMaterial_number());          
          ItemsList.add(Items);
     SO.setOrder_Items_In(ItemsList);     
     wdContext.nodeBapi_Salesorder_Createfromdat2_Input().bind(SO);
     wdContext.nodeBapi_Transaction_Commit_Input().bind(Commit);
catch(Exception ex) {
     IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
     msgMgr.reportException(ex.getLocalizedMessage()+ " Create SO Failed!", true);
     try {
          wdContext.currentBapi_Salesorder_Createfromdat2_InputElement().modelObject().execute();
          wdContext.currentBapi_Transaction_Commit_InputElement().modelObject().execute();
     catch (Exception ex){
          IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
          msgMgr.reportException(ex.getLocalizedMessage()+ " Retrieve Cart Failed!", true);

Similar Messages

  • How BAPI Tables parameters are passed by reference

    Hi Gurus,
                     I have a genuine doubt regarding BAPI parameters. I would like to point out the genreal rules of bapi like,
    1. BAPI parameters should be passed by value. (Because they are rfc fm's. So both systems will be in different servers. This is the normal scenario.)
    2. But the tables parameters in BAPI can't be passed by value. Instead they are passed by reference.
    3. I know they use some kind of delta mechanism to transfer tables parameters to remote servers.
    So gurus I would like to know what exactly happens when a tables parameter is passed. And also I didn't understand the delta mechanism. Kindly guide me.
    Thanks in advance,
    Jerry Jerome

    You'll see in [SAP Library - RFC - Parameter Handling in Remote Calls|http://help.sap.com/saphelp_nw04s/helpdata/en/22/042551488911d189490000e829fbbd/frameset.htm] that tables are not passed by reference when you use RFC. It also explains the delta.
    When you make a remote function call, the system handles parameter transfer differently than it does with local calls.
    TABLES parameters
    The actual table is transferred, but not the table header. If a table parameter is not specified, an empty table is used in the called function.
    The RFC uses a delta managing mechanism to minimize network load during parameter and result passing. Internal ABAP tables can be used as parameters for function module calls. When a function module is called locally, a parameter tables is transferred u201Cby reference". This means that you do not have to create a new local copy. RFC does not support transfer u201Cby referenceu201D. Therefore, the entire table must be transferred back and forth between the RFC client and the RFC server. When the RFC server receives the table entries, it creates a local copy of the internal table. Then only delta information is returned to the RFC client. This information is not returned to the RFC client every time a table operation occurs, however; instead, all collected delta information is passed on at once when the function returns to the client.
    The first time a table is passed, it is given an object-ID and registered as a "virtual global table" in the calling system. This registration is kept alive as long as call-backs are possible between calling and called systems. Thus, if multiple call-backs occur, the change-log can be passed back and forth to update the local copy, but the table itself need only be copied once (the first time).

  • BAPI table input parameters for Visual Composer not working?

    I am using a BAPI with table input parameters (2 input fields for the table). I tested the BAPI in ecc function builder (it works as planned).  However, it doesn't work in Visual Composer using the same input values (not getting any error messages).  Is this a bug in VC 7.0?  Any help would be greatly appreciated.
    Edited by: Brent Crabb on Aug 29, 2008 8:12 PM

    Hi,
    The data service at a time  can execute only one input data.
    it will not handle too many inputs at time otherwise all the input ports should have same submit action then it is possible to Execute multiple input forms data .
    When you are mapping the input form and the dataservice ,give the same event like this *submit for both Inputforms
    Thanks,
    Govindu

  • Dynamic table page not passing ID parameter

    I have a page with a simple dynamic table:
    http://www.lenoxweb.net/idea/test10.php.
    BUt it does not show the data in the dynamic table.
    I have attached a record set to the page,and have it set for
    10 records at a time (there are three records in the database
    table); everything looks fine but when I view in Dreamweaver, but
    when I look it on the web, there is no data in the table.
    The URL for the page is:
    http://www.lenoxweb.net/idea/test10.php
    and there is no data there
    I have also attached the code for this simple page.
    I have another page that looks at the exact same data and it
    works fine. When I look at it on the web, it shows all three DB
    entries:
    http://www.lenoxweb.net/idea/control_panel_news.php
    Can anyone tell me why the dynamic table on the page is not
    working properly?
    Regards,
    BIll Schaepe

    Problem solved!
    I found my problem. I wanted the table to show all the data
    from the MySQL table, but I had the Filter set to ID. If I added
    ?ID=1 to the end of the URL, it showed record one.
    So I just took the filter off on the RecordSet, and it works.
    IT shows all records.

  • BRM - Derived roles values not passing to backend

    Hello ,
    When we define a derive role with org values in BRM . derived role getting created in backend but it is not passing org values in backend .
    org values are empty in derived roles for backend system
    we have finished su25 activity as well in backend
    we are in sp12 on NW7.31
    Any solution available
    Regards
    Rajendra

    Hi Andrzej,
    Generation and maintain authotization are working fine .
    My issue is, in derivation phase, when I derive a role in BRM,
    the derived role which got created doesn't have org values in backend system.
    So I want to know whether this is bug or Derivation phase in BRM will not pass org values to back end
    Regards
    Rajendra

  • Passing values to RFC/BAPI Table

    Hi,
    I am having a very strange problem. While passing the values to RFC/BAPI table using add method the values are not passed to backend SAP. Below is the code which I am using just to pass some data in RFC/BAPI table.
    The same code was working few days back. Is there any configuration in JCO or any other problems other than the code?
    Your l help is greatly appreciated.
      public void executeZtest_Function_Input( )
    //    //@@begin executeZtest_Function_Input()
    //     //$$begin Service Controller(943377124)
           IWDMessageManager manager = wdComponentAPI.getMessageManager();
           try{
      Ztest_Function_Input input = new Ztest_Function_Input();
           for (int i=0; i<5;i++){
                Zhr_Ear_Cclist cc =new Zhr_Ear_Cclist();
                cc.setFi_User("[email protected]");
                input.addIcc_List(cc);
           wdContext.nodeZtest_Function_Input().bind(input);
           wdContext.currentZtest_Function_InputElement().modelObject().execute();
                wdContext.nodeOutput().invalidate();
           } catch(WDDynamicRFCExecuteException ce) {
                manager.reportException(ce.getMessage(), false);
         //$$end
        //@@end

    Hi Raksh,
              I also got the same problem. Please check the following ways then you will solve problem.
    1. First check the appropriate BAPI in SAP GUI Software. You have to determine where is the problem?. Is it in Dynpro or BAPI itself?.
    2. Suppose the BAPI structure change you will wont't run. If BAPI strusture change you have to reimport BAPI.
    3. Please check the JCo connectio using test Button. Then redeploy your project.
    4. Rebuild your project then redeploy.
    Check the above ways you may get answer.
    Kind Regards,
    S.Saravanan

  • GL Posting using BAPI BAPI_ACC_DOCUMENT_POST but not updating in table BSEG

    Hi Experts,
    Hope all are doing greatu2026
    I need you help to resolve the below issue.
    We have on Z-Tcode to GL Posting the document using BAPI u2018BAPI_ACC_DOCUMENT_POST' and this program is successfully posted from the source file and documnet # also created successully.
    We have entries in BKPF, but the table BSEG not updating and we do not have entries.
    Please help me on this regards,
    Thanks in Advance.
    Amjad

    Hi Srikant,
    Thanks for your reply...
    As you suggest, i have checked the structure ACCOUNTGL and below values are passing.
    ACCOUNTGL -ITEMNO_ACC
    ACCOUNTGL -GL_ACCOUNT
    ACCOUNTGL- ITEM_TEXT
    ACCOUNTGL- COMP_CODE
    ACCOUNTGL- COSTCENTER
    ACCOUNTGL- CS_TRANS_T
    Could you please suggest me if there are any  changes needs to do.
    Thanks & Regards,
    Amjad Hussain

  • I want to get the data of a table inside the Form but it is not passed

    I want to get the data of a table inside the Form but it is not passed to the form by tables parameters.
    How can I do this.
    Regards

    If there is a problem with defining it globaly, you can define a field symbol globably and point to it. For example.  It would probably be better to define your table globably.
    report zrich_0003 .
    field-symbols: <imarc> type marc_upl_tt.
    start-of-selection.
      perform get_data.
    *       FORM get_data                                                 *
    form get_data.
      data: imarc type table of marc with header line.
      select * from marc into table imarc up to 10 rows.
      assign imarc[] to <imarc>.
      perform write_data.
    endform.
    *       FORM write_data                                               *
    form write_data.
      data: xmarc type marc.
      loop at <imarc> into xmarc.
        write: / xmarc-matnr, xmarc-werks.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • Japanese characters alone are not passing correctly (passing like ??? or some unreadable characters) to Adobe application when we create input variable as XML data type. The same solution works fine if we change input variable data type to document type a

    Dear Team,
    Japanese characters alone are not passing correctly (passing like ??? or some unreadable characters) to Adobe application when we create input variable as XML data type. The same solution works fine if we change input variable data type to document type. Could you please do needful. Thank you

    Hello,
    most recent patches for IGS and kernel installed. Now it works.

  • Passing BAPI standard Inputs using User inputs

    Hi,
    I have a requirement where i need to update SAP using an Adobe Interactive form.
    I got a BAPI which can do this job.It worked fine with BAPI standard inputs...
    But my requirement is to show something different in form and its corresponding value should be passed to BAPI.
    Eg: I should provide a dropdown box which has A,B,C...etc if A is selected I should pass 100 as input value to BAPI and if B is selected in dropdown I should pass 200.
    Along with this I should also pass few more standard inputs..
    Any help is greatly apprecited.
    FYI.. I developed this using JAVA Webdynpro .
    Rgds
    Vara

    Hi,
    For this do one thing .
    Create a local attribute.
    Craete a simple type.
    Move to Enumeration and fill the Value & Description fields.
    What ever you want to display in the dropdown give it in the "Description".
    The value you want to pass to R/3 give it in "Value".
    Now give the attribute type as the "Simple type" that is created by you
    Now when ur passing data to R/3 do one thing.
    Pass the data available in the local attribute to teh RFC import parameter.
    Sorry i dont have any idea
    On passing more data then this.
    "Along with this I should also pass few more standard inputs"
    Thanks & Regards,
    Lokesh

  • Output Table from one BAPI as Input Table to another Bapi

    Hi
    I have two BAPIs.  First BAPI returned me a table, I displayed it on the view. 
    Then, user will select some rows and then the same Table with user selected values should be input of the Second BAPI.
    Please advise how to achieve this.
    Thanks,
    Jai

    Hi,
    Copy the values from the output of BAPI 1 to a value Node and bind it to the table which is shown in the View. After you make the changes in the table and the user performs an action to send the table values to another BAPI as input, try the following code:
    //Create an instance of the new BAPI
    BAPI<name>Input bapi2Object = new BAPI<name>();
    wdContext().currentBAPI<name>Input().bind(bapi2Object);
    //get the size of the table from the view
    int sizeOfTable = wdContext().node<tableNode>.size();
    //initialize a List to hold all the records
    ArrayList listOfRecords = new ArrayList();
    for(int i = 0; i < sizeOfTable; i++)
         //Initialize the structure which is sent as an Input to the BAPI
         <structurename> structObject = new <structurename>();
         //Set all the parameters required
         structObject.set<attribute>(wdContext().node<tableNode>().get<tableNode>ElementAt(i).get<attributeName>);
         listOfRecords.add(structObject);
    //set the list to the input structure
    wdContext().currentBAPI<name>Input().set<structurename>(listOfRecords);
    //execute the BAPI
    Hope this helps you
    Regards,
    Poojith MV

  • How to set the table input in Query template?

    Hi all.
    I need to call a Bapi_objcl_change, with import parameter and a table as an input. I have done this, in BLS. I have set the table input in the
    form of xml. In BLS, I get the output(the value gets change in SAP R3, what i have given in BLS).  But if i set the same xml structure  in
    query template, I didn't get the output. Table input parameter does not take that xml source.  How to set the table input in Query template?
    can anyone help me?
    Regards,
    Hemalatha

    Hema,
    You probably need to XML encode the data so that it will pass properly and then xmldecode() it to set the BAPI input value.
    Sam

  • Sale Order change BAPI - Storage loc not updated

    Hi Everybody,
    Iam using "BAPI_SALESORDER_CHANGE", to change the sale order items.
    First iam calling above bapi with switch B, for new pricing & then second time for material change.
    When i change any material number, it is getting updated correctly.
    But the storage location, even though iam passing in the bapi it is not updated, & is blank - updation flag is also passed.
    When i execute sale order change again it is updated - ie, for any material change for first bapi call, storage loc is not updated - for 2nd bapi call storage loc is updation - for same input in both the cases.
    Is there any way to update the storage loc is first call of sales order change bapi.
    Below is the parameters iam passing in bapi :
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT      = LS_SALESDOCUMENT
          ORDER_HEADER_IN    = LT_HEADER_IN
          ORDER_HEADER_INX   = LT_HEADER_X
        TABLES
          RETURN                            = LT_RETURN
          ORDER_ITEM_IN               = LT_ITEMS
          ORDER_ITEM_INX             = LT_ITEM_X
          ORDER_CFGS_REF          = LT_CFGS_REF
          ORDER_CFGS_INST         =  LT_PARTS
          ORDER_CFGS_VALUE     = LT_VALUES
          ORDER_CFGS_BLOB        = LT_CUBLOB
          ORDER_CFGS_VK            = LT_CUVK
          ORDER_CFGS_REFINST   = LT_CUREF
          SCHEDULE_LINES            = LT_SCHEDULE_L
          SCHEDULE_LINESX         = LT_SCHEDULE_X
          ORDER_TEXT                   = LT_TEXT
          CONDITIONS_IN                = LT_CONDITION_L
          CONDITIONS_INX              = LT_CONDITION_X.
    Any help is appreciated.
    Regards,
    Nagarajan.J

    Hi,
    Storage location is updated only when same sale order bapi is called another time with required details.
    rgs,
    Nagarajan J

  • Dashboard prompt value is not passing into the report

    Hi,
    I am using OBIEE 10g. The problem is in Oracle BI Answers
    I have a prompt and its related report. In the prompt, in one of the column, I am using sql result. The sql query is a co-related sub query where i have used 2 tables. employee_data and employee_region. The reason for using sub-query is that there is no data_center column in the employee_data table. It has the records for all the data_center e.g USA, UK,IND,AUSTRALIA etc So, I used the sub query with condition which will give the result on a particular data center (here it is USA) and this sub query's output is input for the main query. And the prompts works fine and gives correct result
    The sql query used for the column in the prompt (in Oracle BI Answers) as
    SELECT EMPLOYEE_DATA.ENAME FROM EMPLOYEE WHERE EMPLOYEE_DATA.ENAME IN (SELECT EMPLOYEE_REGION.ENAME FROM EMPLOYEE WHERE EMPLOYEE_REGION.DATA_CENTER = 'USA')Now in the report, there are 2 coulmns. - EMPLOYEE_DATA.ENAME and EMPLOYEE_REGION.DATA_CENTER
    I have used the main column EMPLOYEE_DATA.ENAME for filter as 'prompted'.
    The problem is the value from the prompt is not passing from the prompt to the report, what I found. Because, instead of showing the result for 'USA' data_center, It also shows other data_center 's (UK,IND,AUSTRALIA) data.
    How filter condition I should use for EMPLOYEE_DATA.ENAME column in the report so that the prompt value will pass to the report properly ?
    Thanks
    Edited by: Kuldip on Feb 21, 2013 6:17 AM

    Hi Kuldip,
    There are 2 ways of doing it.
    1. Nice and good: For the section where the report is put have a condition to display only if it returns rows. For details please refer to :
    http://bischool.wordpress.com/category/guided-navigation/
    2. The easy way: Add a "No Result" view to your report and add few spaces in the text.
    Let me know if this helped.
    Regards,
    Jay

  • How to populate multiple entries to Bapi Table

    Hi all,
      How to populate multiple entries to Bapi Table.....
    Here is the code(in component controller)
      Z_Recr_Apply_Point_Input request = new Z_Recr_Apply_Point_Input(WDModelScopeType.TASK_SCOPE);
           int  size = wdContext.nodeApplicants().size();
                for(int i = 0 ; i < size ; i++)
                    String isselected = wdThis.wdGetContext().nodeApplicants().getElementAt(i).getAttributeAsText("Appl_Number");
                     if(isselected == "true")
                               com.models.veteranpoint.Zrecr_Aplno appid = new
                                    com.models.veteranpoint.Zrecr_Aplno();                                        
                                    appid.setAppl_Number(wdContext.nodeApplicants().
                                        getApplicantsElementAt(i).getAppl_Number());
                               request.addApplicants(appid);
    I want to pass the selected input field to bapi..
    Please tel me where i pass the input field...
    Please correct my code...
    Thanks & regards
    Mathi s

    Hi,
    Steps to insert multiple entries to BAPI table.
    1.Create an instance for BAPI input
    2.Bind the instance to the Node of the BAPI input
    3.Create instance of the Structure(BAPI table) to which input has to be added.
    4.Set the input values to the Structure instance.
    5.Add the instance to the BAPI input.
    6.Execute
    From the given example,I assume Z_Recr_Apply_Point_Input  is the BAPI Input and com.epiuse.us.recruitment.models.veteranpoint.Zrecr_Aplno as Structure
    Step 1:
    Z_Recr_Apply_Point_Input request = new Z_Recr_Apply_Point_Input(WDModelScopeType.TASK_SCOPE);
    Step 2:
    <b>wdContext.nodeZ_Recr_Apply_Point_Input.bind(request);</b>
    Steps 3 & 4:
    int size = wdContext.nodeApplicants().size();
    for(int i = 0 ; i < size ; i++)
    String isselected = wdThis.wdGetContext().nodeApplicants().getElementAt(i).getAttributeAsText("Appl_Number");
    if(isselected == "true")
    com.epiuse.us.recruitment.models.veteranpoint.Zrecr_Aplno appid = new
    com.epiuse.us.recruitment.models.veteranpoint.Zrecr_Aplno();
    appid.setAppl_Number(wdContext.nodeApplicants().
    getApplicantsElementAt(i).getAppl_Number());
    <b>wdContext.currentZ_Recr_Apply_Point_InputElement().modelObject().addRecr_Aplno(appid);</b>
    Step 5:
    <b>wdContext.currentZ_Recr_Apply_Point_InputElement().modelObject().execute();</b>
    Regards,
    Viji Priya

Maybe you are looking for

  • ST-PI upgrade issue in IS_SELECT

    I am running PREPARE on a 4.6C (Linux/DB2)  > ECC 6.0 upgrade and have recieved the warning that 'Add-on ST-PI is toohigh for this upgrade".  I have downloaded the 'ST-PI 2008_1_710' patches (SAPKITLRE1, SAPKITLRE2, SAPKITLRE3) into /usr/sap/put and

  • Import process hangs indefinately on JPG and AVI files

    Hi, I'm seeing a similar issue to some of the other posts. My configuration is Windows 7 x64, 4GB RAM and a Core i7. All the photos I want imported have been moved to the C drive. When I try to import a folder with a couple of sub-folders containing

  • Milestone Billing FI Configuration (Account Assignment)

    Dear All, I am configuring milestone billing is system. Upill i had defined a milestone billing type and all the configuration realted to milestone billing date and date categories is done I have also defined the condition type AZWR in my pricing prc

  • Exclamation Mark Icon on Mail

    I have used Mail for years and never had a problem until I upgraded to a MacBook this year and joined Mobile Me. Now Mail shows the exclamation mark icon several times a day, and I have to force quit it and reopen it to get new emails. Sometimes emai

  • Error: Error #2029: This URLStream object does not have a stream opened

    Hi there, I am working on sound. Error: Error #2029: This URLStream object does not have a stream opened. Error occured during the sound.close() Anyone Knows kindly reply, Thanks in advance, Saransoft