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

Similar Messages

  • How to passing lowercase values to RFC/BAPI using webdynpro for JAVA

    Hi Exerts,
    When we sending values to RFC/BAPI through webdynpro (JAVA), the values are sent in capital (uppercase) letters to ECC.
    So if we fill xxxx, it is send like XXXX. Why? and how to avoid this?
    Thanks in advance,
    Joeri

    Hi,
    There could be two possibility if you are storing this value in ABAP table.
    1. You are entering value in UPPERCASE in your webdynpro application.
    2. The data stored in ABAP table, converts value in small to upper case.
    1.  Can you tell me how you are passing this value, is user entering value in some input field which is binded to some context and this value are you passing to RFC/BAPI...???
    Or else before passing value to RFC/BAPI you can use toLowerCase string function and the npass this value to RFC/BAPI
    e.g String name = wdContext().currentContextelement().getName().toLowercase();
    Now pass this name to RFC/BAPI is should go as lowercase only..
    This is from webdynpro java side..
    2. If you are storing this value in ABAP table, check the domain/type of variable in ABAP table for which you are storing the value. Ask ABAPper, so that this value are stored in small case letter.
    There is one tick in domain which you need to remove so that it stores in lower case. I dont have exact information but you can consult this with ABAPer.
    Hope this information helps guy ..!!!!
    Regards,
    Jigar

  • Passing values through RFC

    Hi All,
    I have a requirement where we need to connect to a different system using RFC and pass data.
    I have data in the table . The requirement is using RFC, i have to write a code, so that i can send all the possible values of a field in the table to the remote system. I have 5 fields in my table in SAP. First i need to pass all the possible values of field1 to the remote system and based on the input in their system, i need to pass all possible values for field2 to remote system and again based on field1 and field2 i need to pass all possible values for field3 to remote system.
    Pls let me know how to do coding for this.
    Thanks,
    Raju

    Raj,
    We need to pass the possible values from our custom table to the remote system, so that the user can see all the possible values for the fields. Similar to the F4 option.
    And based on field1 input in the form by the user, we need to get corresponding values for field2 of all possible values and pass it to the remote system.
    If your user is filling the forms in the non-SAP system itself, means you are just providing the data to that system for the actual user action there. So, either you can send the whole data everytime and let non-sap system handle the logic which you need for the possible values for each selection. Better if you are able to store all data in the remote system itself to avoid large data communication everytime and just sync the 2 systems whenever something changes in SAP.
    Otherwise, if you want to control it from SAP itself, then you need 2 way communication.....once user fills 1st field in FORM, remote system sends that to SAP and then you send the 2nd field valid values to remote system again using same/different RFC and so on. But, I doubt that will be efficient for the user filling the form.
    Regards,
    Diwakar

  • RFC+BAPI+TABLE HELP

    Hi all.
    Im install SAP NetWeaver Sneak preview ABAP edition.
    Me application writen i VB 6 connect ok.
    BAPI,TABLE- object connect ok.
    If retrieving data command BAPI getdetail+show app closed=crash,TABLE search ok,if TABLE show data or TABLE detail data,main app writen error - No search table-table not found ......
    Please help

    Armin,
    First of all than you for your reaction. I couldn't answer earlier because I was too busy to catch up with project deadlines.
    I checked the mapping between the custom controller and the view controller is done. It should be OK since I can display the bapi returned table in a Table widget.
    But I still don't know how to access this returned table from the wdDoInit() method of the view controller.
    My context is as following:
    Bapi_Currency_Getlist_Input
      -- Curreny_List
         -- Currency
    I can get a reference to currentBapi_Currency_Getlist_Input, next I can get a reference to currentCurrency_ListElement. But as from this point, I can't get a List or any other container with the currency values. (The bapi I call is bapi_currency_getlist and I try to create a value help with curency values)

  • Passing values to RFC holding structure.

    Hi Experts,
    I have DC which needs to update backend table through RFC.  In this RFC i have a structure in import tab which holds 2 fields.
    From webDynpro Java code , i have to pass the those 2 fields as input before when i execute the model.
    How can i write code for inputing the values for this structure fields ?
    thanks in advance.
    Regards,
    suresh

    Hi Suresh,
    Steps to execute you Adaptive RFC Model:
    1. Create an instance of the BAPI's input structure-
    <Your BAPI Name>_Input input = new  <Your BAPI Name>_Input();
    2. Set the two input parameters to this input structure with desired parameter values-
    input.set<Your Para 1>(<Desired Parameter Value>);
    input.set<Your Para 2>(<Desired Parameter Value>);
    3. Create and Bind a model node in context to the input structural node of Your BAPI using model binding. Now using code bind the instance of the input structute to the model nodel in conext as stated below-
    wdConext.node<Your Custom created Model Node in Context>().bind(input);
    4. Execute the model and invalidate the output node-
    try{
                   wdContext.current<Your Model Node in Conext>().modelObject().execute();
                    wdConext.node<Output Node in the conext>().invalidate();
    }catch(Exception){
    5. Pick all the output parameters from the Output Node in the context.
    Hope it helps!!
    Regards,
    Tushar S

  • Passing value to RFC

    Hi Friends
    I have a requirement where I have to pass few values from Adapter Module to RFC which will update the database table.
    Example: I have to pass filename and filesize to RFC which will update the table X
    Could someone provide me the snippet of the code.
    Thanks
    Abhishek Mahajan

    Hi Abhisek,
    Through UDF, you can access the Adapter Specific Attributes like File Name and pass the same to RFC.
    Pls go through
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
    Hope this will resolve.The code snippete is written there.
    Regards,
    Subhendu

  • Passing values to an internal table and use it with the table painter

    Hi,
    I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
    The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
    TYPES: BEGIN OF DETAILS,
           EBELP  TYPE EKPO-EBELP,
           BSMNG  TYPE EBAN-BSMNG,
           LFDAT  TYPE RM06P-LFDAT,
    END OF DETAILS.
    Then defined the following definition on the |Global Data| section:
    WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
    The problem is that when I try to assign a value to one of the fields in the program code like this:
    LOOP AT WA_EKPO.
         WA_DETAILS-EBELP = WA_EKPO-EBELP.
         WA_DETAILS-EMATN = WA_EKPO-EMATN.
         MODIFY WA_DETAILS.
    ENDLOOP.
    gives me the following error:
    "WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
    Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
    How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?

    Hi,
    if it is one record in wa_details. you can directly write as follows..
    REPORT  ZCR_TEST1                               .
    TYPES: BEGIN OF details,
              ebelp TYPE ekpo-ebelp,
              bsmng TYPE eban-bsmng,
              lfdat TYPE rm06p-lfdat,
              ematn TYPE ekpo-ematn,
           END OF details.
    DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
          wa_ekpo    TYPE STANDARD TABLE OF details WITH HEADER LINE.
    wa_details-ebelp = '1'.
    append wa_details.
    wa_ekpo-ebelp = '3'.
    append wa_ekpo.
    LOOP AT wa_ekpo.
      wa_ekpo-ebelp = wa_details-ebelp.
      wa_ekpo-ematn = wa_details-ematn.
      modify wa_ekpo.
    endloop.
    Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
    Regards,
    Sriram

  • Problem with passing table values to RFC

    Hi all,
    I am passing values in table in RFC. There are no import/export parameters in RFC. We are passing only tables.
    There are two tables in the RFC I_Dept and I_Subdept. Initially RFC is executed for getting the Dept which works fine as for this there is no need to set in input table value. But to get sub department I need to set the dept in I_Dept and after executing RFC I should get values in table I_Subdept. The code is as below:
    wdContext.nodeOutput_I_Dept().invalidate();
    wdContext.nodeOutput_I_Subdept().invalidate();
    Z_Bapi_Dept_Values_Input d_Input = new Z_Bapi_Dept_Values_Input();
    wdContext.nodeZ_Bapi_Dept_Values_Input().bind(d_Input);
    Zdept dept = new Zdept();
    dept.setZname("Sales");
    d_Input.addI_Dept(dept);
    try
    wdContext.nodeZ_Bapi_Dept_Values_Input().currentZ_Bapi_Dept_Values_InputElement().modelObject().execute();
    wdContext.nodeZ_Bapi_Dept_Values_Input().nodeOutput().invalidate();
    catch (WDDynamicRFCExecuteException e)
    msgManager.reportException(e.toString(), true);
    Is anything wrong in this code because even after executing the RFC the size of node I_Subdept() is zero. But the RFC works fine in the backend.
    Regards,
    Jaydeep

    A typical misunderstanding when populating structured input data  
    via code is the following:                                              
    - You have bound a WD context node hierarchy to the model say
      N1         >         M1
      ->N2       >         ->M2
                                                                                    where N1, N2 are WD Context nodes (N2 is child of N1) and M1, M2 are   
    model classes bound to the context nodes. Important: M1 has a relation 
    to M2 on the model side, means there is some method M1.setMyM2(M2)   
    (assuming the target role of the relation is called "MyM2").           
    - You create context elements for N1 and N2 which are bound to a model  
    class instances of M1 and M2 respectively.                                                                               
    Assuming that M1 is the "executable" model class (*_Input) and M2       
    represents an input structure needed, the M2-input will - using the     
    above approach - not be available on execution. Why? The relation on the
    model side (MyM2) is not available if just maintaining it via the     
    context, i.e. context and model are not "in sync". As RFC execution is  
    done via the model the M2 input will not be available.                  
    You best create complex/nested input structures on the model            
    side and then bind the top-level model object to the resp context node. 
    In the above sample this would be:                                      
    M1 m1ModelObject = new M1();                                            
    M2 m2ModelObject = new M2();                                            
    m1ModelObject.setMyM2(m2ModelObject);
    Hope it helps!
    Regards,
    Sangeeta

  • Passing values to a RFC table structure

    Hi
        I am using an RFC in which there is a table called Submit Details.I want to pass three rows to this table structure in the R/3 system.
                            Can anyone help me how to do this.
    regards
    Nayeem

    Hi,
    Private<name>View.I<value node name >Node node = wdContext.node<value node name >();
    Private<name>View.I<value node name>Element ele;
    <your rfc name> input = new <your rfc name>(); // your rfc name
    wdContext.node<your rfc name>().bind(input); // bind
    <table name> inputTable;
    for (int i=0; i < node.size(); i++ ) // value node - where data is available
    inputTable= new <table name>();
    ele = node.get<value node>ElementAt(i);
    inputTable.set<Attribute>(ele.get<Attribute>());
    input.add<table name>();
    // execute rfc.

  • File to RFC/BAPI - Async- How to capture response field value

    Hi,
    I am doing File to RFC/BAPI Scenario. I have Two BAPI's. THe same source xml file is mapped to the Two Target BAPI's.
    For the first flow i.e File to BAPI1, I need to capture BAPI Response, field value and pass this value as Input to the BAPI2.
    How do I proceed with the Mapping. I am working on PI 7.1
    Any input would be Appreciated.
    Thanks & Regards,
    Varun

    Hi Varun,
    apparently you need a Business Process:
    XML -> BP (asynchronous), Map to Bapi1 request structure
    BP -> BAPI 1 (synchronous)
    Transformations step with multi mapping merging XML and Bapi1 response to Bapi2 request structure
    BP-> BAPI2
    Regards,
    Udo

  • 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);

  • Passing Error message to BAPI Structure in RFC

    Hi Experts,
    I would like to know how we pass error message to BAPI structurre in RFC?
    Plz some one give the details about how we handle the errors.
    Thanks in advance.

    Like already mentioned before, every Standard SAP BAPI, has an export or tables parameter which is called something like RETURN with structure BAPIRET2. In here, you can store all the messages that are generated during the BAPI Call.
    However, if you also want to catch errors like system exceptions and communication errors, you will have to add these exceptions manually:
    EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    However, not sure if this addition works when calling BAPI from NON-sap application.
    Declaration:
    DATA: RFC_MESS(128).

  • Passing value to bind variable of another table from one table

    hi,
    I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
    My main problem is what code has to be written to pass value to bind variable and where it should be written.
    Please give me a detailed explaination as soon as possible.
    Thank you.

    Sorry, didnot add this. The table is multi select table.

  • How to pass values in dynamic structure and then dynamic table

    Hi,
    we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
    I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic  table type is any its not allowing an index operation like modify etc etc.
    Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure  and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.

    Hi Friends,
    This is the piece of code.After creating dynamic work area and dynamic table what i should do?
    TYPES: BEGIN OF STR,
    ID TYPE I,
    NAME(30) TYPE C,
    END OF STR.
    data: v_lines type i.
    STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
    STR_COMP = STR_TYPE->GET_COMPONENTS( ).
    APPEND LINES OF STR_COMP TO COMP_TAB.
    COMP-NAME = 'NAME1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING(  ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
    P_LINE_TYPE = NEW_STR
    P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
    P_UNIQUE = ABAP_FALSE ).
    CREATE DATA DREF TYPE HANDLE NEW_TAB.
    CREATE DATA DREF1 TYPE HANDLE NEW_str.

  • Pass Values between two Function Modules RFC in Portal

    I need to pass values ​​between 2 FM RFC.
    I have an implicit enhancement in HRMSS_RFC_EP_READ_GENERALDATA RFC function module.
    PERNR LIKE  PSKEY-PERNR
    ENHANCEMENT 1  Z_ESS_EXPORT_PERNR.    "active version
      EXPORT pernr to memory id 'PMK'.
      set parameter id 'PMK' field pernr.
    ENDENHANCEMENT.
    On the other hand an RFC function module that has the code:
            pmk    LIKE PSKEY-PERNR,
            pmk_2  LIKE PSKEY-PERNR.
      get parameter id 'PMK' field pmk.
      IMPORT pmk_2 FROM MEMORY ID 'PMK'.
    When the execution is done in development environment, the modules function at the level of R3, the "get parameter id" works only if the debbuger is classic, otherwise not work. The Import to memory id never works.
    In the environment of quality, r3 do not work any of the 2 sentences. If run from portal (which is as it should be) does not work.
    Thanks if anyone can help me get the problem. Both function modules are executed at the portal.
    Regards
    Edited by: Daynet1840 on Feb 15, 2012 2:02 AM

    When the execution is directly in r3, in development environment or quality, does the set / get parameter id. Export / Import memory id not work.
    But if the FM are called from the portal, does not the set / get parameter id.
    I tried changing the sentence as I indicated harishkumar.dy still not working.
    Madhu: They're in different function groups, one is standard and the other not.
    Regards
    Edited by: Daynet1840 on Feb 15, 2012 3:08 PM
    Edited by: Daynet1840 on Feb 15, 2012 3:11 PM

Maybe you are looking for