Need to pass values to Internal table in Web dynpro ABAP

Hi all,
I need to pass table values for the below FM in web dynpro.
CALL FUNCTION 'ZFMHR_RWF'
  TABLES
    PB0006        = 
How do we declare and use Internal tables in WEBDYnpro.
Regards,
Vijayakumar S.

hi,
u mighnt need to show the internal table value in some table UI in the WebDynpro ABAP. So u can use the method bind_table for the same to bind ur context node with the internal table values.u can declare the internal table in the same  way as u do in the normal ABAP.
  DATA :itab TYPE STANDARD TABLE OF ztable.
// itab is my internal table which can be of either ztable or standard table type
now u can use the code wizrd(control+F7) and use the method bind_table .
  DATA: lo_nd_cn_node TYPE REF TO if_wd_context_node,
            lo_el_cn_node   TYPE REF TO if_wd_context_element,
           ls_cn_node        TYPE wd_this->element_cn_node.
*     navigate from <CONTEXT> to <CN_NODE> via lead selection
  lo_nd_cn_node = wd_context->get_child_node(
  name = wd_this->wdctx_cn_node ).
  lo_nd_cn_node->bind_table( itab ).
// where cn_node is the context node which is bind to ur table UI and itab is the value which is populated from ur FM
regards,
Amit

Similar Messages

  • Upload .xls file in internal table in web dynpro abap

    Hi everyone,
    i want to upload .xls(excel file) into an internal table.....after lots of attempts i came to a conclusion that web dynpro only supports .CSV(another format of excel file) to be uploaded into internal table....i tried many ways....is there a way i can upload .xls file...kindly help me in the same. following is the code i m using
      DATA LO_EL_CONTEXT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA LS_CONTEXT TYPE WD_THIS->ELEMENT_CONTEXT.
      DATA ITEM_FILE TYPE WD_THIS->ELEMENT_CONTEXT-EXCEL_UPLOAD.
      get element via lead selection
      LO_EL_CONTEXT = WD_CONTEXT->GET_ELEMENT( ).
      @TODO handle not set lead selection
      IF LO_EL_CONTEXT IS INITIAL.
      ENDIF.
      get single attribute
      LO_EL_CONTEXT->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `EXCEL_UPLOAD`
        IMPORTING
          VALUE = ITEM_FILE ). "xstring format
    DATA S_CONT TYPE STRING.
    DATA CONVT TYPE REF TO CL_ABAP_CONV_IN_CE.
    DATA: FIELDS1 TYPE STRING_TABLE.
    1st tried this code-> using "cl_abap_conv_in_ce"
    CALL METHOD cl_abap_conv_in_ce=>create
    EXPORTING
    *encoding = c_encoding "optional
    input = ITEM_FILE
    RECEIVING
    conv = CONVT.
    CALL METHOD CONVT->read
    IMPORTING
    data = S_CONT.
    when it didnt work out...then tried followin function module
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          IN_XSTRING        = ITEM_FILE "xsrting
       IMPORTING
         OUT_STRING          = S_CONT
    TYPES: BEGIN OF TY_TAB,
           NAME_CHAR TYPE  STRING,
           DESCR_CHAR TYPE  STRING,
           NUMBER_DIGITS TYPE  STRING,
           END OF TY_TAB.
    DATA: FIELDS TYPE STRING_TABLE.
    DATA: LV_FIELD TYPE STRING.
    DATA: S_TABLE TYPE STRING_TABLE.
    DATA: ITAB TYPE TABLE OF TY_TAB.
    DATA: STR_ITAB TYPE TY_TAB.
    *splits string based on new line
    SPLIT S_CONT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE S_TABLE.
    FIELD-SYMBOLS: <WA_TABLE> LIKE LINE OF S_TABLE.
    LOOP AT S_TABLE ASSIGNING <WA_TABLE>.
    splits string on basis of tabs
      SPLIT <WA_TABLE> AT ',' INTO
                      STR_ITAB-NAME_CHAR
                      STR_ITAB-DESCR_CHAR
                      STR_ITAB-NUMBER_DIGITS.
      APPEND STR_ITAB TO ITAB.
    ENDLOOP.
    I am able to do the uploading if the file is in .CSV format and not .XLS format....
    there are lots of forums on SDN for the same....but at the end there is no solution provided.....
    experts kindly solve it this time...thanks in advance

    Hi,
    It is not possible to upload an xls file because it will be having some binary characters. better to go with .csv file format.
    Refer this [link too|Re: Excel File Uplaod] it will explain you clearly.
    Regards
    Arun.P

  • How do we pass values and Internal tables to Sub-routines

    how do we pass values and Internal tables to Sub-routines

    Hi,
    You can use the USING..or TABLES..or Changing addition..
    Check this example.
    DATA: T_MARA TYPE STANDARD TABLE OF MARA.
    PERFORM DISPLAY USING T_MARA.
    FORM DISPLAY USING LT_MARA LIKE T_MARA.
    DATA: WA TYPE MARA.
    LOOP AT LT_MARA INTO WA.
      WRITE: / WA-MATNR.
    ENDLOOP.
    ENDFORM.
    Thanks
    Naren

  • How to display an status Icon in Table UI web dynpro ABAP?

    Hi Experts ,
    How to display an status Icon ( Traffic light ) in Table UI web dynpro ABAP? can somebody tell with a coding example. also I need to update status on condition so whats the best way?
    Thanks in advance.
    Regards,

    Hi Laeeq,
    click on table cntrol n place it on the screen..
    now click on the icon button n place it in the table control area.. a column of icons get created. name it (say) ICON.
    in the PBO..
    loop at internal table and call module in the loop (say) .
    MODULE ICON_DISP.
    now in the module try the foll code :
    module icon_display output.
    check some condition and assign the icon to the variable icon_r
      icon_R = 'ICON_GREEN_LIGHT'.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name                        = ICON_R
        TEXT                        = ' '
        INFO                        = ' '
        ADD_STDINF                  = 'X'
       IMPORTING
         RESULT                      = ICON
      EXCEPTIONS
        ICON_NOT_FOUND              = 1
        OUTPUTFIELD_TOO_SHORT       = 2
        OTHERS                      = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      endmodule.
    where icon(35) and icon_r(35) type c .
    hope this helps u..
    Regards
    Aparna

  • ALV - need to sum values of internal table and display in ALV

    I have data in internal table as:
    Material     date     sum1     sum2
    Mat_A     19990101     4     4
    Mat_A     20080501     3     0
    Mat_A     20080601     2     0
    Mat_B     19990101     2     0
    Mat_B     20080601     5     5
    Required output is :
    Material     qty1     qty2     19990101     20080501     20080601
    Mat_A     432     4     4     3     2
    Mat_B     2+5     5     2           5
    Thinking of using ALV to pass the internal table and display as classical report (and also to save as excel spreadsheet).
    Counting your help on the following questions:
    1) How to accomplish the sum in ALV report? Can ALV FM do that or one has to use ABAP to compute the sum from the given internal table?
    2) Mat_A can have more date values. Here it got 3 distinct date values 19990101, 20080601, 20080501. If it has say 5 date values, how to create the ALV date columns (from 3 to 5 date columns) dynamically?
    Thanks for the help.

    for the sum inalv we use generally..
    it_fieldcat-do_sum = 1.
    check this examples...
    http://www.****************/Tutorials/ALV/Subtotals/text.htm
    *& Report  ZTEST_ALV_PERC_13317
    REPORT  ztest_alv_perc_13317.
    TYPE-POOLS: slis.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE slis_fieldcat_alv,
          it_events TYPE slis_t_event,
          wa_events TYPE slis_alv_event,
          it_sort TYPE slis_t_sortinfo_alv,
          wa_sort TYPE slis_sortinfo_alv,
          l_layout TYPE slis_layout_alv.
    TYPES: BEGIN OF ty_itab,
            field1(10),
            qty1 TYPE i,
            qty2 TYPE i,
            qty3 TYPE i,
            dummy TYPE c,
          END OF ty_itab.
    DATA: itab TYPE STANDARD TABLE OF ty_itab WITH  HEADER LINE,
    itab1 TYPE ty_itab.
    START-OF-SELECTION.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      itab-field1 = 'FIRST'.
      itab-qty1 = 2.
      itab-qty2 = 1.
      itab-qty3 = 5.
      itab-dummy = 10.
      APPEND itab.
      wa_fieldcat-col_pos = 1.
      wa_fieldcat-fieldname = 'FIELD1'.
      wa_fieldcat-tabname = 'ITAB'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 2.
      wa_fieldcat-fieldname = 'QTY1'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 3.
      wa_fieldcat-fieldname = 'QTY2'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 4.
      wa_fieldcat-fieldname = 'QTY3'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-col_pos = 5.
      wa_fieldcat-fieldname = 'DUMMY'.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-do_sum = 'X'.
      wa_fieldcat-no_out = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
       CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_events
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program           = sy-repid
         it_fieldcat                    = it_fieldcat
        TABLES
          t_outtab                       = itab
    EXCEPTIONS
       program_error                  = 1
       OTHERS                         = 2
      IF sy-subrc <> 0.
      ENDIF.

  • Upload excel file to internal table in web dynpro program

    Hi friend's
    In web dynpro program how to upload excel file into  internal table and finally data will be save Y table.

    hi,
    See the properties of File Upload UI element..
    Link: [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/732f0510d83ff6e10000000a42189c/frameset.htm]
    Goto References -> User Interface Elements -> Integration Category -> File upload..
    After creating the 'FILE UPLOAD' element in a view.. Bind a datasource(a context attribute with STRING) with the data property..
    Double click on ONACTION_UPLOAD method. Write a code as given below.
    METHOD onactionon_upload .
    TYPES :   BEGIN OF str_itab,
           name(10) TYPE c,
           age(10) TYPE c,
           END OF str_itab.  DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
             i_data TYPE STANDARD TABLE OF string,
             l_string TYPE string,
             fs_table TYPE str_itab,
             l_xstring TYPE xstring,
             fields TYPE string_table,
             lv_field TYPE string.
    DATA : t_table TYPE if_main=>elements_data_tab,
             data_table TYPE if_main=>elements_data_tab.
    * get single attribute 
    wd_context->get_attribute(  
    EXPORTING    
    name =  `DATASOURCE`  
    IMPORTING    
    value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string. 
    SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
    * Bind With table Element.
    LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
       READ TABLE fields INTO lv_field INDEX 1.
        fs_table-name = lv_field.  
    READ TABLE fields INTO lv_field INDEX 2.
        fs_table-age = lv_field.   
    APPEND fs_table TO t_table1.     "Append to  the internal  table
      ENDLOOP.
    Edited by: Rameshkumar Raamasamy on Feb 9, 2010 9:39 AM

  • Configuration of alv table in web dynpro abap

    Hi,
    I'm using component SALV_WD_TABLE in my component. I have created a configuration for the alv.
    I want to hide a column in the alv.
    Do you know how to do it using the configuration?
    Thanks in advance
    Karim

    >
    Karim Ja wrote:
    > Thomas,
    >
    > In fact, i think that when user changes the global view and clicks on save button, a copy of the view is created(with the same name) and is then available for all other users. This copy can be delete but not the "standard" global one.
    > Is this possible?
    >
    > Now I'm thniking about creating an ehancement for the standard web dynpro component and hide the column using abap code.
    >
    > Is it a good idea?
    >
    > Kind regards
    > Karim
    Make sure that your security is setup correctly.  End users without administrative rights can not create globa views. When they get the Save View As Dialog, what values do they see for the Assignement field?  When I logon without Adminstrative mode, I only see Assignment of User:
    http://www.flickr.com/photos/tjung/3406367817/
    When I launch the same transaction in Administrative or Configuration mode, the Assignment Option is All and only then do I have the optoin to transport the View:
    http://www.flickr.com/photos/tjung/3407176898/
    Is it good to modify the standard ALV component?  I would say not.  First of all the functionality you seek is already in the system.  Perhaps you need a support package application if your system has a very old SP level. In genreal changing the ALV component, would be a bad idea because it is very widely used and very generic.  It is also quite often changed by SAP.

  • Create dynamic table in web dynpro abap

    Hi Friends,
    I want to create several tables in a web dynpro. For this reason I have created a View, a group1 and a context node.
    Now I want create a table for each characteristic group from cabn in the ui group1.
    For this reason I want to use create_table_from_node and I have to craete dynamicly attributes in the node.
    Is it the propper way  or is there a different approach.
    So in this case
    1. I read the node
    2. craete attribute for each characteristic group in this node
    3. create a UI Table with create_table_from_node for each attribute
    4. bind the data to the UI Table
    Can I do the same without to craete attributes?
    Thank in advance.
    RG. Jimbob

    Hi Jimbob,
    Have you looked at using the row-repeater UI element? You could then have as many tables as per your characteristic groups.
    Although this would be more difficult if the attributes of each table were to also be only known at run-time. (I'm not sure that this is the case though from your description of the issue.)
    so have a context of the form:
    Context Root
    --->node_characteristic_group (0..n)
    >node_char_group_details(0...n) (non-singleton child node)
    then bind your row repeater to node "node_characteristic_group " and bind the table inside the row repeater to node "node_char_group_details".
    Each time you had a new element in the node_characteristic_group you would get a new table...
    Much easier to support that anything dynamically created.
    Cheers,
    Chris

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • Scrolling to Standard table in web dynpro abap

    Hi Frnds,
              HI have created table i need for that scroll vertically and horizontally , as per frnds suggestion keeping in webdynpro application adding the parameters wddonavigator but its getting error can any please explain clearly and any screen shots regards tyo that .
    thanks.

    ok

  • Get index of row selectable in table in web dynpro abap

    Hi all,
    How i get the index for the row in a table which i selected .
    Help me.
    Points are Sured.
    Sanket sethi

    Hi ,
    in the wdevent parameter of the action get the selected element
    eg
    context_element type ref to if_wd_context_element .
    context_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    then call the get_index method..
    context_element->get_index( ).
    Regards
    Yash

  • Insert table in between two rows of the table in Web dynpro abap.

    Hi All,
    I have a requirment like this,
    while click on a hide/show button from the first row and last column of the table, want to display  a table(or add some rows to insert data) in between the  rows of the table and insert data in the new table .
    please help me wheather it is possible or not?
    Thanks,
    Raju.

    hi raju....
           if you want to insert rows.... then read the index of the row clicked and then read the node that is bound to the table and insert an empty row at that index and bind it back again....
           if you want another table then make use of table popin.
    --regards,
      alex b justin

  • Passing the Dynamic Internal Table as the Output Parameter of the FM...

    Hi,
    How can we pass the internal table as the output from the Function Module TABLES parameter.
        SELECT * FROM TVRO BYPASSING BUFFER INTO TABLE <ltable>.
    Now I need to pass the dynamic internal table <ltable> as the output in the function module.
    Thanks!
    Puneet.

    I can't use TVRO as the table type. The Table name is as the Input. This program will download the contents of the table and create an app server file. It can be for any database table.
    so i want the output of this FM should be the data from that table. So what should be the TABLE type.
    like in  a program i will use:::
      FIELD-SYMBOLS: <ltable> TYPE ANY TABLE,
                     <l_line> TYPE ANY,
                     <l_field> TYPE ANY.
        SELECT * FROM (p_table) BYPASSING BUFFER INTO TABLE <ltable>.
    That is my requirement.

  • Web DynPro ABAP - Disable a entire row in the Table of the output.

    Hi Web Dynpro Experts,
    Need ur Help.!
    I have a requirement to disable the one row of the table in web dynpro ABAP
    For example . my table is like
    Field1   Field2
    A           Success
    B            Failure
    C            Failure
    I need to allow the User to select the record only if its status is Success,if status is Failure then i should not the allow user to select.
    This enabling and disabling of the rows should be done before displaying on to the Screen.
    Please suggest me ASAP.
    Thanks,
    Akila

    Hi Akila,
    please try this.
    Create a node (Eg: TEST) of type 0-n and 0-1. Take attributes attr1, attr2, flag (of type BOOLEAN). Create a table and give the TEST node as datasource. Now using "Create Binding" create columns for attr1 and atte2. Now, bind the read-only property of the columns with flag attribute.
    Now, in the INIT method, set the table values like this:
    For examle, if you want to disable row having test2,
    ls_test-attr1 = 'A'.
    ls_test-attr1 = 'TEST1'.
    ls_test-flag = ' '.
    append ls_test to lt_test.
    clear ls_test.
    ls_test-attr1 = 'B'.
    ls_test-attr1 = 'TEST2'.
    ls_test-flag = 'X'.
    append ls_test to lt_test.
    clear ls_test.
    ls_test-attr1 = 'C'.
    ls_test-attr1 = 'TEST1'.
    ls_test-flag = ' '.
    append ls_test to lt_test.
    clear ls_test.
    lo_test->bind_table( lt_test ).
    By doing this, 2nd row gets disabled.
    Also, if you already have the internal table with values, based on some condition you can change the value of flag and bind the table to node.
    Hope this helps you, Please let me know in case of any queries.
    Regards,
    Manogna

  • How to add button ui element in alv table data in web Dynpro ABAP

    Hi Experts,
    I have one requirement,
    Actually I was devloped normal table in web Dynpro ABAP
    in that i have one column Display as a button .
    when i select that button need to display some data.
    same requirement i need to devlope in alv table.
    i am going to attach file please check.
    Thanks in advance.
    Regards,
    Subba Reddy.

    Hi,
    You can create Button in your ALV table column with below code
    DATA lo_button              TYPE REF TO cl_salv_wd_uie_button.
    CREATE OBJECT lo_button.
        CALL METHOD lv_value->if_salv_wd_column_settings~get_column
          EXPORTING
            id    = <your column name>
          RECEIVING
            value = lo_system_select_hdr.
        lo_button->set_enabled( value = abap_true ).
       lo_button->set_text( value = 'Avaliable List'  ).
        lo_button->set_tooltip( value = 'Avaliable List' ).
        lo_system_select_hdr->set_cell_editor( value = lo_button ).
    And for button click action,
    Create a method (say SHOW_DATA( ) ) with on_click event handler.And when you click button on your ALV table, SHOW_DATA( ) method will trigger.
    Thanks
    KH

Maybe you are looking for

  • Magic mouse connection lost

    I have tried several suggested fixes for losing magic mouse connection.  I still lose connection.  Why is this happening and how can I fix it once and for all?

  • Mac office/excel 2004 causing internet to crash

    Why would this happen? if i am totally out of excel - no problems cant have my excel up and play online at same time Thanks

  • Show "No Applicable Data Found" for Report 0SD_C01_Q22

    Hi Gurus, I just activated BI Content Report, 0SD_C01_Q22 and it's relevant InfoSource,  DataSource and so on. The data from R3 were loaded into the infoCube successfully. However, it shows "No Applicable Data Found" when I executed the query. I have

  • Files are deleted, not really

    I listen to files especially podcasts, when I am done I delete the file. ITunes asks do I want to delete to the recycle bin I say yes and the file is gone from Itunes. Yet I ck the folder in Itunes directory and the file is still there. It dosent hap

  • Internet explorer settings

    hi all i have seen so many times , in any sap servers for eg in sap crm when we click some things which opens internet explorer page , it shows page can,t be displayed. what are the settings to be made for that? thanks akhil