WebDynpro Table Element to BAPI.

Dear ALL
I have a Table filled with data in Java WebDynpro. I need to pass the data to BAPI.
Table is bind to a Value Node Education, which is linked with a strucutre of BAPI.
Now how I would passs the values of table to BAPI and where I will pass this value weather in a view or custome controller.
BAPI has following paramters.
Import     EDUCATION_IMP     TYPE     ZONLINE_EDU
Export    EDUCATION_EXP     TYPE     ZONLINE_EDU
Table      EDUCATION_TAB     LIKE     ZONLINE_EDU
In the view I also tried to pass the value by hard codeing but getting java null exception.
   wdContext.currentEducation_ImpElement().setMajor("Physics");
   wdContext.currentEducation_ImpElement().setGpa("2.3");
   wdContext.currentEducation_ImpElement().setPassyear("2008");
   wdContext.currentEducation_ImpElement().setInstitute("PAF");
   In view I am calling an action.
  public void onActionInsertApplication(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionInsertApplication(ServerEvent)
    wdThis.wdGetInsertApplicationCustController().executeZONLINE_APP();
    //@@end
And custome controller has following code.
public void executeZONLINE_APP( )
    //@@begin executeZONLINE_APP()
    try
         wdContext.currentZONLINE_APPElement().modelObject().execute();
         wdContext.currentZRFC_ONLINE_EDUElement().modelObject().execute();
    catch ( Exception ex)
         ex.printStackTrace();
    wdContext.nodeOutput().invalidate();
    //@@end
Edited by: Adnan Maqbool on May 3, 2008 2:14 PM

getting java null exception on
wdContext.currentEducation_ImpElement().setMajor("Physics");
because the node Education_Imp is not existing during runtime. check the cardinality of that node which is set to 0..n
sol: you need to create the element before you are setting/accessing the element.
IPrivate<Comp_Name>.IEducation_ImpElement newelm;
newelem = wdContext.createEducation_ImpElement();
wdContext.nodeEducation_Imp().bind( newelm);
you need to create element for each record of EDUCATION_IMP TYPE ZONLINE_EDU Type.
same code will do and you can assign the values too.
you can do it in view controller itself
Now,  call component controllers' method.
try
wdContext.currentZRFC_ONLINE_EDUElement().modelObject().execute();
catch ( Exception ex)
ex.printStackTrace();
wdContext.nodeEDUCATION_EXP().invalidate();
nikhiL

Similar Messages

  • Regarding excel file download from webdynpro table element

    Hi All,
            I want steps to do excel download from webdynpro table element.
    Thanks in advance.
    Regards,
    Muneesh Gitta.

    Hi Gitta,
    There are 2 ways in doing it, one is using GUI DOWNLOAD FM or using class clwd_runtime_services.
    DATA:
        node_node_alv                       TYPE REF TO if_wd_context_node,
        elem_node_alv                       TYPE REF TO if_wd_context_element,
        stru_node_alv                       TYPE wd_this->element_node_alv,
        itab_node_alv                       TYPE TABLE OF wd_this->element_node_alv..
    navigate from <CONTEXT> to <NODE_ALV> via lead selection
    @TODO handle not set lead selection
      IF ( node_node_alv IS INITIAL ).
      ENDIF.
    get all declared attributes
      node_node_alv->get_static_attributes_table(
        IMPORTING
          table = itab_node_alv ).
      DATA:
        node_file_download                  TYPE REF TO if_wd_context_node,
        elem_file_download                  TYPE REF TO if_wd_context_element,
        stru_file_download                  TYPE wd_this->element_file_download ,
        item_fname                          LIKE stru_file_download-fname.
      navigate from <CONTEXT> to <FILE_DOWNLOAD> via lead selection
      node_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).
      get element via lead selection
      elem_file_download = node_file_download->get_element(  ).
      get single attribute
      elem_file_download->get_attribute(
        EXPORTING
          name =  `FNAME`
        IMPORTING
          value = item_fname ).
      CALL FUNCTION  'GUI_DOWNLOAD'
        EXPORTING
          filename                        = item_fname
        FILETYPE                        = 'ASC'
        TABLES
          data_tab                        = itab_node_alv.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    OR
    check this blog for
    Re: Export to Excel Sheet functionality

  • WebDynpro Table Contents to  Adobe:

    Hi ,
       I have WebDynpro Table element containing lots of data and on click of button it has to open in Adobe and display all the contents in Adobe Table. The problem is that i receive only one record which is lead selected in WebDynpro table. In Adobe i used one Subform ( Content type is flowed) and a table element.
    Expecting right ans.
    Thanks
       Vinod V
    Points waiting.

    Hi, Vinod,
       Really its surprising. Everything is fine, then y its not working. here I have created a sample application regarding u r problem. Its working fine. While i am giving Updatepdf it shows only one record. In generate pdf, It shows all the records. Possible, Try to create your Interactive form again as its a simple one.
    GS

  • Error while Creating WBS element using BAPI 'BAPI_BUS2054_CREATE_MULTI'

    Hi Expert,
    I've a requirement to create WBS elements using BAPI. And I am using BAPIs in the following manner.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'
      CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
        EXPORTING
          i_project_definition = g_pdwbs
      TABLES
        it_wbs_element             = it_wbs_element
       et_return                  = it_return
      EXTENSIONIN                =
      EXTENSIONOUT               =
        CALL FUNCTION 'BAPI_PS_PRECOMMIT'
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    When I do so I am getting the below errors. Please suggest.
    "Individual check for creating the object WBS Element C-497082 required ".
    "Individual check for creating the object WBS Element C-497082-0001 required".
    Please suggest how to correct this error. 
    <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
    Edited by: Alvaro Tejada Galindo on Aug 18, 2008 5:25 PM

    I am getting the same error, but I cannot figure it out how to detect it and fix it.  Will you please share your solution?
    Thanks,

  • Currency Key Reference field in WebDynpro Table Column

    Hi Experts,
    I am using a WebDynpro table (not ALV) showing multiple currency fields in a single row - each one potentially referencing a different currency key e.g. Japanese Yen and USD in a single row.
    My currency context attributes are already defined as currency types, but how can I assign different currency key references to each of my currency context attributes? Or is this somehow done as a property of the table column UI element?
    Thanks for your help,
    Peter

    Hi Kris,
    You answer is very helpful, but I do have a question about going the DDIC route. So you are saying that if I take a DDIC structure into my context with multiple currency keys as reference fields for multiple currency fields, then my WebDynpro context will know exactly which currency key is the reference for which currency field without having do do this programatically as you described? If that's true, can I bring a whole DDIC structure over to the context and then delete the 'Dictionary Structure' refrence from my context node, so that I can add my own additional fields to the context node?  E.g. in the case of DDIC structure VBAP can I get all my currency fields and their reference fields from the DDIC from VBAP and then delete 'VBAP' as a 'Dictionary Structure' from my context node and add my own custom fields. The fields I would have brought in from VBAP still retain their type and everything after the deletion of 'VBAP' as a 'Dictionary Structure', so my question is will it also retain the node_info of what currency key goes with what field?
    Please let me know if you happend to have done this before.
    Thanks,
    Peter

  • How to make 2 lines in a webdynpro table cell?

    Hi
    Is it possiable to create a WebDynpro Table Call that can contains 2 lines in 1 cell ?

    Hi Ami,
    There are a limited number of UI elements that you may use for a Table Cell Editor, however, with a TextView, you can display text that includes a line break.
    The line break is achieved by including the carriage-return-line-feed characters in the Table's data source...
    LOOP AT lt_flight_tab ASSIGNING <f>.
         CONCATENATE 'Line One' cl_abap_char_utilities=>cr_lf 'Line Two'  INTO <f>-test.
    ENDLOOP.
    Cheers,
    Amy

  • Webdynpro Table sorting

    Hi All,
    We are using the UI Table element in our webdynpro screen (Not using ALV). Now is it possible to use the sorting (ascending, descending) and also sorting by individual columns without changin it to ALV ?
    And in our screen, we have many editable fields. When the user makes a change and tries to exit without pressing 'SAVE' option , we should display a pop-up asking whether the datas should be 'SAVED' in database table. Is there any standard fm for doing this?
    Thanks in advance.

    hi
    it is possible to sort the table
    u must have binded ur context node to the internal table in WD DOINIT.
    thn  proceed like this :
    1 Go to Attributes Tab, Give TABLE_CONTROL in the Attribute Column , Check the Check Box in the RefTo Column & give IF_WD_TABLE_METHOD_HNDL in the Associated Type. 
    2 Then create one Event for onSort Event of the Table  .Then Give the Action Name as ON_TEST_SORT and press Enter. 
    3 In the onaction method ie ONACTIONON_TEST_SORT
    wd_this->table_control->apply_sorting( ).
    4 write this piece of code in WDDOMODIFYVIEW
    data wd_table type ref to cl_wd_table.
    check first_time = abap_true.
    * Name of the table UI element to be provided
    wd_table ?= view->get_element( 'TABLE' ).
    wd_this->table_control ?= wd_table->_method_handler.
    *Name of the key attribute of the context node to which the table binding is done to be  provided
    wd_this->table_control->set_key_attribute_name( 'MATNR' ).
    // here column "MATNR is sorted
    regards,
    amit
    Edited by: amit saini on Dec 7, 2009 10:49 AM

  • Select all in table element

    Hello all,
    I created a table element which contains a column of check boxes.
    I want to add to my table an option to check/uncheck all the check boxes.
    I already created the events but I dont know how to call the events I created using the table?
    Thanks in advance,
    Tomer

    Hi Tomer,
    you haven't said how your gui should look like. For example you can add two buttons ("select all" and "Unselect all") for this task. Now you add two actions, one for each button. Add the actions as eventtarget in the properties of the buttons. And in the event-methods of the actions you write your code to select/deselect the checkboxes, like
    public void onActionSelectAll(...) {
        for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
            wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(true);
    public void onActionUnselectAll(...) {
        for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
            wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(false);
    HTH,
    Frank

  • Editing Cell Column of a selected row in UI table element.

    Hi Experts,
    I have a UI Table Element with three columns. First two columns are input fields in read only mode. Third column is a text edit field.
    Now when I Select a row and press a button 'EDIT' i want that particular rows third column CELL alone to be in editable mode.
    In order to achieve this, I created a WDY_BOOLEAN attribute in the same node which is used to bind the table. I binded this attribute to the READ ONLY property of third column.
    In the EDIT button i wrote the following code.
    lo_el_n_stp->set_attribute(
    EXPORTING
       name = 'A_EDIT'
       value = ' ' ).
    Here A_EDIT is the name of the attribute.
    When i do this, my first rows third column is only going to EDIT mode and not the row which i selected.
    Please tell me how to solve this problem.
    Thanks in advance.

    Hi thanks for your reply.I have already tried this, the problem is i am not getting the seleted row value by using the below code
    l
    lo_nd_node1->get_static_attributes(
    IMPORTING
    static_attributes =  ). "here you will get the selected row
    Its giving me the first row value.
    Edited by: Delphi on Mar 11, 2010 11:52 AM

  • Error message in UI Table element

    Hi Experts,
    I am having a UI table element in my view. If there are zero records fetched in the select query, i am displaying an error message using message class in the top of the screen.
    Is it possible to display this error message inside the UI table (may be in the first row of the blank table)
    If so what should be done?
    Please help.
    Thanks in advance.

    Hi,
    When there are no records in the table, then the TABLE UI elements shows the message inside the table as
    'Table data not found' something likethis....by the framework. there is no need of explictily throwing a message.
    As we get the same with ALV.
    Please check it out.
    You can UNCHECK the DISPLAYEMPTYROWS option.
    Regards,
    Lekha.

  • How to Display the content of Excel file into Webdynpro Table

    Hi Experts
    I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
    Thanks and Regards
    Kalyan

    HI,
    Take for example, if Excel file contains 4 fields,
    Add jxl.jar to JavaBuild path and Use this snippet
    File f=new File("sample.xls");
    Workbook w=Workbook.getWorkbook(f);
    Sheet sh=w.getSheet(0);
    int cols=sh.getColumns();
    int rows=sh.getRows();
    Cell c=null;
    String s1=null;
    String s2=null;
    String s3=null;
    String s4=null;
    ArrayList al=new ArrayList();
    int j=0;
    for(int i=1;i<rows;i++)
    ITableElement table=wdContext.createTableElementz
         s1=sh.getCell(0,i).getContents();
         s2=sh.getCell(1,i).getContents();
         s3=sh.getCell(2,i).getContents();
         s4=sh.getCell(3,i).getContents();
                             table.setName(s1);
         table.setAddress(s2);
         table.setDesignation(s3);
         table.setDummy(s4);
         al.add(j,table);
         j++;                    
    wdContext.nodeTable().bind(al);
    Regards
    LakshmiNarayana

  • How to handle the table control in bapi?

    how to handle the table control in bapi? example va01.
    i pass multiple line item what is the procedure?
    header detail same .
    eample ship to party
           sale to party.
    line item mulptiple
    10 mat1
    2o mat2
    30 mat3.
    in bapi we can pass sinle line item.
    any way to handle multiple line item pass through the bapi.
    Message was edited by:
            Karthikeyan Pandurangan

    BAPI is not going through the screen flow logic so you need not to worry about the table control. Just check in the BAPi there must be one table parameter for line items just pass one int table with your data to that table parameter it will automatically update the tables.
    Regards
    shiba dutta

  • Pagination in Webdynpro Table

    Hi Colleagues.
    Im using NW 7.0 Java webdynpro
    Can I use dynamic pagination for java webdynpro table. I found an article explaining the same with NW7.1.
    Is there any option the functionality available in NW 7.0
    Thanks
    Bala

    Hi
    PLease check this article link
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0d6c30a-c99e-2b10-f09b-c9a00b7e78c6&overridelayout=true
    Also check this blog link
    /people/bertram.ganz/blog/2008/11/27/web-dynpro-java-table-paging-unleashed-optimizing-heavy-table-performance
    Regards
    Ruturaj
    Edited by: Ruturaj Inamdar on Jul 31, 2009 1:32 PM

  • Field symbols for tables used under tables tabstrip in bapi

    Hi all,
    I am created a bapi and under tables tabstrip i have given  3 tables,
    Inside the bapi , i have written a perform statement which returns these 3 tables .
    PERFORM bapi_sales TABLES it_valid it_error it_errorc USING testrun.
    how can we create field symbols for these tables ?
    Regards
    Nagarah

    hi,
    goto: system-utilities- debug system
    A.
    Message was edited by: Andreas Mann

  • Cannot deselect line of a table element

    Hi all,
    I use a table in my WD abap. I have a simple problem : once I've selected a line, I cannot deselect it. Is it a normal behaviour ? I want the user to be able to delesect the line, so that no line of the table is selected.
    Here are my settings :
    - Context node :
    Cardinality : 0..n
    Selection : 0..1
    Initialization lead selection : blank
    Singleton : blank
    - Table element :
    selectionChangeBehaviour : auto
    selectionMode : auto
    Thanks for your help.

    Thanks Saud, it helped me a lot.
    Finally I was forced to add some code to deselect the line. I think it's strange to have to do this, but I don't find any alternative...
    Here's the code I put in the ONSELECT action of the table :
    DATA : ls_old_ev_param TYPE wdr_event_parameter,
             ls_new_ev_param TYPE wdr_event_parameter.
      DATA : ls_old_sel TYPE wd_this->element_histo,
             ls_new_sel TYPE wd_this->element_histo.
      DATA : lo_element TYPE REF TO cl_wdr_context_element.
      DATA : lv_index TYPE i.
      FIELD-SYMBOLS : <ls_data> TYPE ANY.
      DATA : lo_node_table TYPE REF TO if_wd_context_node.
      READ TABLE wdevent->parameters
        WITH KEY name = 'OLD_LEAD_SELECTION'
          INTO ls_old_ev_param.
      IF sy-subrc = 0.
        ASSIGN ls_old_ev_param-value->* TO <ls_data>.
        IF <ls_data> IS NOT INITIAL.
          lo_element ?= <ls_data>.
          CALL METHOD lo_element->if_wd_context_element~get_static_attributes
            IMPORTING
              static_attributes = ls_old_sel.
        ENDIF.
      ENDIF.
      READ TABLE wdevent->parameters
        WITH KEY name = 'NEW_LEAD_SELECTION'
          INTO ls_new_ev_param.
      IF sy-subrc = 0.
        ASSIGN ls_new_ev_param-value->* TO <ls_data>.
        IF <ls_data> IS NOT INITIAL.
          lo_element ?= <ls_data>.
          CALL METHOD lo_element->if_wd_context_element~get_static_attributes
            IMPORTING
              static_attributes = ls_new_sel.
        ENDIF.
      ENDIF.
    *** Same selection -> deselection
      IF ls_old_sel-objid = ls_new_sel-objid.
        lo_node_table = wd_context->get_child_node( 'HISTO' ).
        CALL METHOD lo_element->if_wd_context_element~get_index
          RECEIVING
            my_index = lv_index.
        CALL METHOD lo_node_table->set_selected
          EXPORTING
            flag  = abap_false
            index = lv_index.
        lo_node_table->set_lead_selection_index( lo_node_table->no_selection ).
      ENDIF.
    Edited by: Julien999 on May 31, 2010 3:56 PM

Maybe you are looking for

  • ITunes Library on an external hard drive to be used by Mac and PC

    I have my music library on my PC and am willing to do whatever it takes to have it be read by both computers from the external drive. The external drive is already formatted properly so I don't need to worry about anything there. I transferred all of

  • Movies and Music on different drives

    Is there any way I can put my Movies in iTunes, but have them stored on my external drive (seperate from my Music on the internal one)? Thanks.

  • Spry Menu - Current Page question

    Hi I have a 2 level Spry Menu which is dynamically populated. (http://broke.brokefordwich.com.au)  I am able to add a class to the menu item for the current page. This works fine for the top level items and the second level items. However, I would li

  • Connecting vi's to build a dynamic system

    I have four vi's. For ease, I'll call them A, B, C, and D. I would like to set it up so that the user opens A, enters their data, then clicks on a button that opens B. Once the user is finished with B, they click a button on B which opens C. Once don

  • Scrolling within apps

    I have looked on many websites and now I don't understand, how am I able to allow the user to scroll? Is it using a scroll bar or scroll viewer? And once I do that how do I layout the design? Is that extend from the phone outline and carry on going d