Input table on BAPI

Hi all,
I have a problem when I call a BAPI parsing a input table.
Normaly, I can define a input using: on the Custom Controller.
     Z_Bapi_Mov_Estoc_Input input2 = new Z_Bapi_Mov_Estoc_Input();
     wdContext.nodeZ_Bapi_Mov_Estoc_Input().bind(input2);
     input2.setParam1("test");
but this bapi have a input table.
How can I add this values?
I've try with this code, but no work's:
     IPublicMagatzemListCust.IItemsElement newMaterialNodeElement;
     newMaterialNodeElement = wdContext.createItemsElement(new Zdetalle());
     wdContext.nodeItems().bind(newMaterialNodeElement);
     newMaterialNodeElement.setMatnr("3233");
     newMaterialNodeElement.setQuant(1);
the table is mapped using Items node.
Can anyone help me?
thanks in advance,
david

Hi David
  Well lets say the table name is "MYTAB"
Then what you need to do is in the model if you see you will get a Table class called "MYTAB"
//After your lines
Z_Bapi_Mov_Estoc_Input input2 = new Z_Bapi_Mov_Estoc_Input();
wdContext.nodeZ_Bapi_Mov_Estoc_Input().bind(input2);
input2.setParam1("test");
//code to add values to table
MYTAB tab = new MYTAB();
//Set table attributes
tab.set<attribute>();
tab.set<attribute1>();
now add the tab to the inp created
input2.setMYTAB(tab);
Hope that helps you. This will add the values to the table.
regards
ravi

Similar Messages

  • Input Table for BAPI appears under "Output port"

    Hi,
    I have the following problem:
    I want to call BAPI "BAPI_BCA_PAYMITEM_POST_ITEM"
    in my Model.
    The BAPI has an input-table PAYMENTITEMS.
    The problem is, that in Visual Composer it appears as an output port.
    Therefore I can not fill this table and call the BAPI.
    Any ideas ?
    Regards
    Georg

    Hi Marcel,
    thanks for your reply. It works !
    How about I want to use a table both for in- and output ?
    Regards
    Georg

  • BAPI Input Table

    Hi,
    1. I need to know how to implement a table as input for a bapi.
    We've created a BAPI (RFC Func.) via SE37 and added input tables to tables TAB. But no sure if this is correct.
    How can we try this BAPI via SE37.
    2. Is there very generic sample RFC Func. which has input table structure in standart SAP system?
    regads

    Dear Husyein,
           BAPI's are nothing but remote enabled function modules they are similar to any other function modules.You refer tables to function modules to pass internal tables to function modules.
          in the tables tab you declare the tables refering to standard structures.
           go look into any function module which table is passed .
          go a hhead.
    cheers,
    Suresh.

  • 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

  • Passing a multiple value in to inut table of BAPI in weddynpro java

    Hi,
    I am a facing a problem How to  pass a more than one personnal perno in to inpuut parameter of Bapi which is a table(It_Pernr).
    And Personnal nos are a output of anothe function module which we are displaying in Table and,,,, and from selecting a row of table we want to pass it in to another BAPI input(table type).
    its very urgen ,,,, plz help me....

    Hi All,
    Now I am able to pass a value in it_pernr table .
    Actually for this we have to intantiate a object of model class which contains a personnel no in my case this is pernrtab, basically this is a internal table of backend system.
    i implemented like below and for me its working fine
    // Create and add the selected elements into a collection
                           list = new ArrayList();
                          for(int i=0; i<wdContext.nodeIt_Pernr().size(); i++) {
                               if(wdContext.nodeIt_Pernr().isMultiSelected(i)) {
                                    list.add(wdContext.nodeIt_Pernr().getElementAt(i));
                          if (wdContext.nodeIt_Pernr().getLeadSelection() == 0) {
                               int j = wdContext.nodeIt_Pernr().getLeadSelection();
                               list.add(wdContext.nodeIt_Pernr().getElementAt(j));
                         //how to get back element
                for(int i=0; i<list.size(); i++) {
    //create object of model class pernrtab basically this is a internal table which contains personnel nos list
                               Pernrtab p = new Pernrtab();
                               IIt_PernrElement pernrElemnt = (IIt_PernrElement) list.get(i);
                              p.setPernr(pernrElemnt.getPernr());
                               inp2.addIt_Pernr(p);
    Thanks,
    Reagards
    YAgyashikha
    Edited by: yagyashikha on Jun 30, 2010 1:45 PM

  • How can I Export dynamic table to bapi,  which is imported from BAPI.

    At first time execution of BAPI , I am getting Items(Table formate) . Again I have export these Items to BAPI. As a Input Table. How can transfer data export table to import table.
    And also I need delete some items, which are come form bapi. Then I need to export .
    Any body can help me to achieve this issue.
    <b>EX.   At first execution of BAPI, I am getting items in one out structure. After that I need to execute same BAPI using these items.</b>

    You'll have to *alias* your columns, not prefix it with the table names:
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id, b.id, a.val1, b.val1, a.val2, b.val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
      for rData in cData loop
    ERROR at line 18:
    ORA-06550: line 18, column 3:
    PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
    ORA-06550: line 18, column 3:
    PL/SQL: Statement ignored
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id a_id, b.id b_id, a.val1 a_val1, b.val1 b_val1, a.val2 a_val2, b.val2 b_val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
    PL/SQL procedure successfully completed.
    cheers

  • Set value in a table, from Bapi

    Hi, I have a little Problem, I hope that you can help me.
    i have the following structure (in the View)
    ->Zbapi_Requisition_Change_Input (Model Node, from bapi, RFC)
    --> Requisition_Items_Change (Model Node, table in the Bapi)
    > Currenci (Model Atribut, from table, in bapi)
    > Prq_No    (Model Atribut, from table, in bapi)
    > Preq_Item (Model Atribut, from table, in bapi)
    > Etc...
    --> Number (Model Atribut, import from bapi)
    now, i Have another structure, a Value Node
    -> GetDetailData (value Node)
    ---> Currenci (Value Atribut)
    ---> Prq_No   (Value Atribut)
    ---> Preq_Item (Value Atribut)
    ---> Number    (Value Atribut)
    ---> etc...
    this Value node is populate from OVS, but this is not a problems.
    The Value node have the value that i need for execute the Bapi Requisition Change (not all).
    Then, i need populate de Zbapi_Requisition_Change_Input , whit the GetDetailData value ( the user can change this, via inputfield, in Form)
    I write the following sentence in the view:
    wdContext.currentZbapi_Requisition_Change_InputElement().setNumber(wdContext.currentGetDetailDataElement().getPreq_No());
    this work fine, it populate de input field "Number", because the Number is "Import" form bapi, is not a "table".
    My problem, is when i need populate the table "Requisition_Items_Change" (Necessary to execute the Bapi), i put this:
    wdContext.nodeZbapi_Requisition_Change_Input().nodeRequisition_Items_Change().currentRequisition_Items_ChangeElement().setPreq_Item(wdContext.currentGetDetailDataElement().getPreq_Item());
    this have the same logical that anterior, but don't work, result a "JaVaNullPoint Exception"
    why happens this??? to set a value in a table, I need another procedure???
    Please help me, i need your knowledge...
    regards...

    Hi Antonio,
    I feel, your code should look some thing similar to the below:
    Assume that BAPI 'Zbapi_Requisition_Change' uses a table 'Requisition_Items_Change' of some type 'ZTAB' .
    Zbapi_Requisition_Change_Input input = new Zbapi_Requisition_Change_Input () // create an instance of the Input class;
    ZTAB table = new ZTAB();
    //if you do not know table type of 'Requisition_Items_Change' , check the function input.addRequisition_Items_Change(<table type>)
    table.set<property1>(<your-value>);
    table.set<propertyn>(<your-value>););
    input.addRequisition_Items_Change(table);
    wdcontext.currentZbapi_Requisition_Change_InputElement.bind(input);
    Now execute the BAPI using the following line
    wdContext.currentZbapi_Requisition_Change_InputElement().modelObject().execute();
    wdContext.nodeOutput.invalidate()
    // clears the old value in the output node
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • Updating values in mara table through bapi

    Hi friends,
    I am very new to ABAP , just now i have started my carrier in SAP-ABAP.
    I have to update these three fields MSTAE, EXTWG, MTPOS_MARA in MARA table through bapi. I need to give these values from selection screen followed by Material no.
    I already found some program in the forum  but that programs are very lenthy , i am not able to understand.
    Can anyone help me by giving some idea or sample program so that i can learn how to do this thing.
    Thankx in advance...

    Hi Ritesh,
    Use BAPI_MATERIAL_SAVEDATA to update the entries MSTAE, EXTWG and MTPOS_MARA by passing the following fields:
    DATA: ls_headdata     TYPE  bapimathead,
           ls_clientdata   TYPE  bapi_mara,
           ls_clientdatax  TYPE  bapi_marax,
           ls_return       TYPE  bapiret2.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
       EXPORTING
         input        = ls_material-matnr
       IMPORTING
         output       = ls_headdata-material
       EXCEPTIONS
         length_error = 1
         OTHERS       = 2.
    IF sy-subrc <> 0.
       CLEAR: ls_headdata-material.
    ENDIF.
    ls_clientdata-extmatlgrp  = ls_material-extwg.
    ls_clientdata-pur_status  = ls_material-mstae.
    ls_clientdata-item_cat    = ls_material-mtpos_mara.
    ls_clientdatax-extmatlgrp  = 'X'.
    ls_clientdatax-pur_status  = 'X'.
    ls_clientdatax-item_cat    = 'X'.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
       EXPORTING
         headdata    = ls_headdata
         clientdata  = ls_clientdata
         clientdatax = ls_clientdatax
       IMPORTING
         return      = ls_return.
    IF ls_return-type = 'E' OR ls_return-type = 'A'.
       CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ELSE.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
           wait = 'X'.
    ENDIF.
    Thanks & Regards,
    Prasanna

  • Two input ports to BAPI submit on one event

    Hi colleagues!
    I'm trying to setup incoming invoice creation in Visual Composer.
    I use standard BAPI (BAPI_INCOMINGINVOICE_CREATE).
    This BAPI expects one input form (headerdata) and, as far as I understood, one table (itemdata) as mandatory input.
    So I put bapi on storyboard, flipped port ITEMDATA from output to input. Created input form from HEADERDATA and input table from ITEMDATA. Also I created output form with Invoice Number.
    I created custom event SUBMITPO on both input form and table. Upon that event data, entered into form and table, should be submitted to BAPI, and Invoice should be created.
    But when I deploy and run iView, it throws two errors (see Link: [screenshot|http://www.dennisk.org/tmp/inv_screeenshot.jpg]).
    I think it's because uppon event two data streams are triggered, and BAPI deals with them independently. How can I avoid that?
    More broad question. How to create invoice in VC, preferably using standard function modules?
    Here's Link: [model|http://www.dennisk.org/tmp/IncomingInvoiceTest19052008.gml] itself.
    Thanks in advance for help and assistance!
    Regards,
    DK

    Dear dk ,
    I think ur question is even u have one mandatory field in ur first screen even u dont fill in mandatory field the data is populating in table at mean time an error is returing from back end right . is ur exact requirement means send me reply we will do this .
    or
    brief about ur problem
    Regards ,
    venkat

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Startrfc - how to call with "input table"?

    I have not been able to get sapnwrfc for Perl to compile correctly on my AIX systems so i want to try something different.
    I started to investigate using startrfc to get my data but am running in to a problem.
    Problem Summary:  I want to get information via RFC_READ_TABLE using startrfc.  I can successfully call function modules but cannot figure out how to send in a "WHERE" clause using startrfc.  Does anyone know how to send "input tables" to startrfc so that I can limit my results?
    Background:  I want to dump a list of the dialog UIDs in a SID/client.  When I do RFC_READ_TABLE via SE37, it asks for an "OPTIONS" input table that you use to put the "WHERE" clause.  I fill in the information in the "TEXT" field and all is well.
    I can call startrfc with the -T option and capture the output to a file, but I cannot figure out how to use an input file to provide the OPTIONS table.  -E doesn't work. 
    Here is what I call:
    /usr/sap/<SID>/DVEBMGS60/exe/startrfc -t -3 -h <hostname> -s 60 -c 000 -l E -u <my id> -p <my password> -F RFC_READ_TABLE -E QUERY_TABLE=USR02 -E "DELIMITER=|" -T DATA,1000,w=output.txt -T OPTIONS,100,r=input.txt
    My input file (input.txt) looks like:
    TEXT="BNAME = 'someuid'"
    Here is the error message I get when I run this.
    RFC Call/Exception: SYSTEM_FAILURE
    Group       Error group 104
    Key         RFC_ERROR_SYSTEM_FAILURE
    Message     A dynamically specified column name is unknown.
    Note that I know that there are other functions to check for existence.  I am attempting to get a dump of all dialog users with some information from USR02 not normally provided by the builtin function modules (ERDAT).  This is just the first step to getting there.  Once I have this figured out, I'll send in a "*" to match all.  Also, I am able to do this sort of successfully via Perl's sapnwrfc but am unable to get it compile on AIX and that is where I need to run this.
    Can anyone help?
    Edited by: Eric Young on Apr 7, 2011 5:59 PM
    Edited by: Eric Young on Apr 7, 2011 6:00 PM

    It's fairly obtuse as well, but I can see that I'm sending something.  I just don't know what it should look like so that SAP likes it.  Here's the relevant send section:
    000240 | 04000000 01033003 02000800 0001F400 |......0.......ô.|
    000250 | 00000003 02030100 074F5054 494F4E53 |.........OPTIONS|
    000260 | 03010330 00040000 00020330 03020008 |...0.......0....|
    000270 | 00000032 00000001 03020303 00325445 |...2.........2TE|
    000280 | 5854203D 2022424E 414D4520 20202020  |XT = "BNAME = 'S|
    000290 | 20202020 20202020 20202020 20202020 |SOMEUID'"        |
    0002a0 | 20202020 20202020 20202020 20202020 |                |
    Please note that I've obfuscated "SOMEUID" and the corresponding HEX dump.
    Edited by: Eric Young on Apr 7, 2011 6:26 PM

  • How to implement two dependent dropdown lists in an input  table row?

    Hi all,
    I am new in Jdev 11g. I try to develop an input table with two dependent dropdown list. I can create independent dropdown list in such table. When I try to implement dependent one following some examples do it in a form using bind variable in the view object I get an empty listbox. How can I do this? Is it possible. I cannot find any documents about this.
    Thanks in advance

    Hi,
    it hasn't changed between 10.1.3 and 11. The basic outline of how you do it is
    - use a managed bean to query the data
    - populate the list with f:selectItems that point to the managed bean ArrayList<SelectItem> for the master and the detail
    - obtain the master ID in the managed bean by parsing the #{row} variable when the table renders
    - then bulild the detail list
    - have the detail list referencing the ArrayList<SelectItem> you expose for the details
    Note that without proper caching, the action is quite expensive
    Frank

  • Input table sort for uncommited data

    Hi OTN,
    I have an input table on my ADF page. The table is based on a view object which has ORDER BY VALUE clause.
    There is an opportunity to insert new rows and edit Value attribute of any row.
    I would like the table always to be sorted by Value attribute before commiting the changes.
    Input fields have autosubmit=true and I also have button which performs ADFUtils.findIterator(..).executeQuery() and refreshing the table (with addPartialTarget or table's partial trigger).
    Besides I tried declarative column sorting.
    By no means I succeeded to sort the table with new values without commiting data.
    Is there any possibility to do this?
    Thanks.
    JDev 11.1.1.4

    Hi,
    After applying this code in a managed bean           System.out.println("ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS");
              trIter.getViewObject().setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
              trIter.getViewObject().setSortBy("NEnd");
              trIter.executeQuery();in-memory sorting really works.
    But now I have a row with null NEnd first in my table. Without modifying query mode it was last just as I need.
    It is now:null
    10
    20
    30Can I bring null row back to last position?
    Tried trIter.getViewObject().setSortBy("NEnd nulls last"); and trIter.getViewObject().setSortBy("deocde(NEnd, null, 9999, NEnd)"); with no success.
    Edited by: ILya Cyclone on Jul 8, 2011 3:28 PM

  • How do I change the order of input tables in joiner?

    I have 3 input tables in a JOINER, how can I change the order? for instance, the order now is: t1, t2, t3, for some reason, I want to change to t3, t2,t1.
    I use outer join among tables, different table order cause OWB generated different sql statement.
    Please help! Thanks.

    Unfortunately you cannot... The only way is to remove one group, then create a new one instead and re-connect the group...
    JP

  • Upload an excelfile to a table using BAPI method

    Hi,
    I would like to upload an excel file having three coulumns of data to a table using BAPI  methods.
    Anybody with a solution?
    Thanks in advance.

    Hi,
    You will find many posts regarding upload data from excel file. e.g. take a look at below thread.
    Link: UPLOAD DATA FROM EXCEL FILE
    change the given sample code in above thread with BAPI table name and pass this table to your BAPI FM. 
    Hope this will solve your problem.
    Regards
    Ahsan

Maybe you are looking for

  • User Exit: Saving data in Production Order Header Long Text

    Hi PP Gurus, Can any one let me know which user exit can be used to save some data in the Long Text of Production Order Header. We try PPCO0007, it works well on ECC, but my client's system version is 4.7, it does not work. In 4.7 version, is there a

  • Queries from Client regarding Database design

    1. Is it advisable to use IDENTITY [(seed, increment)] to generate the sequence number in a table for concurrent user in Microsoft SQL Server 2012? 2. Is it advisable to use SCOPE_IDENTITY () to get the latest identity number during concurrent user i

  • Alternate Color Space

    We are running Creative Suite 6 on our macs here.  When you create a new spot color from the library the alternate color space is in LAB.  We work at a printing company and this doesn't do us very much good.  Is it possible to change this to be CMYK?

  • Yaourt failed to install missing dependencies. then fail md5

    [billytcf@dynames ~]$ yaourt -S aptana ==> Downloading aptana PKGBUILD from AUR... ==> Last 5 comments ordered by date (asc): I deleted the comments here ==> aptana dependencies: - firefox (package found) - libstdc++5 (already installed) - j2re (pack

  • I can't chat with BB 10 or android or iphone

    Dears, i hope this email find you well.. I can't chat with BB 10 or android or iphone.. since 16-OCT-2013 and i received their messages but i can't reply to them.. please note that i just can only chat with the 7.1OS balckberry. kindly do the needful