How to loop through data of ALV grid in Webdynpro for Abap view

hello,
I have a view with an ALV component(SALV_WD_TABLE). I just want to loop through the lines shown (particularly when the user has set filter).
Can you help me to find how to reach the internal table ?
In summary, I want to know the reverse method of BIND_TABLE()
Thanks!

Not really...
Here is the solution :
  DATA lo_ui TYPE  if_salv_wd_table=>s_type_param_get_ui_info.
  lo_ui = lo_interfacecontroller->get_ui_info( ).
  DATA: lt_displayed     TYPE salv_bs_t_int,
        li_displayed     TYPE int4.
  lt_displayed = lo_ui-t_displayed_elements.
  check not lt_displayed is initial.
  loop at lt_displayed into li_displayed.
Regards

Similar Messages

  • How to get changed data in ALV in Web Dynpro for ABAP

    METHOD on_data_check .
    DATA:
        node_spfli                          TYPE REF TO if_wd_context_node,
        node_sflight                        TYPE REF TO if_wd_context_node,
        itab_sflight2                        TYPE if_display_view=>elements_sflight.
      node_spfli = wd_context->get_child_node( name = if_display_view=>wdctx_spfli ).
      node_sflight = node_spfli->get_child_node( name = if_display_view=>wdctx_sflight ).
      CALL METHOD node_sflight->get_static_attributes_table
        IMPORTING
          table = itab_sflight2.
    this code is ..get all data(changed and not changed)
    but i want get changed data only, not all data.
    how to get changed data?
    Edited by: Ki-Joon Seo on Dec 27, 2007 6:04 AM

    Hi,
    To get only the changed data in the ALV grid of a WD, you need to capture the "ON_DATA_CHECK" of the ALV grid.
    To this please do the following in the ALV initialization of the ALV table settings :
        lr_table_settings->set_data_check(
                IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CELL_EVENT ).
    You may also do this:
        lr_table_settings->set_data_check(            IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CHECK_EVENT)
    The above two ways would depend on when do you need to check for the changed data. If you want to check the data as soon as it is entered, then use the first method. Else, use the second method.
    You need to register an EVENT HANDLER for this event.(You may do this in your VIEW or Component Controller).
    In this Event handler, you would find an importing parameter R_PARAM which is a ref type of      IF_SALV_WD_TABLE_DATA_CHECK.
    The attribute T_MODIFIED_CELLS of this interface IF_SALV_WD_TABLE_DATA_CHECK will contain the modified cells of the ALV with the old & new values.

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • How can we Access RFC of R/3 in WEBDYNPRO FOR ABAP?

    Hi all,
    i wnat to access a Function Module(RFC) which has created in R/3 in WEBDYNPRO FOR ABAP.Can i access it through SERVICE CALL.or if any other process there.?And how can i map their context & how can i execute?
    Edited by: ravi k on Mar 27, 2008 1:07 PM

    Hi,
    you can find a [pdf document|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc57c23fd600] here.
    grtz,
    Koen

  • How to update changed data in alv grid.

    hi experts,
    i have a editable alv report how to update the changed data on the grid to database table when i click save.
    can anybody tell me how to do this if possible with example.
    thanks in advance.
    regards,
    venu

    The code below isn't a working program, but has most of what you should need.  Field-symbol <dyn_table> will always have what is in the grid.
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>.
    DATA: pt_fieldcat TYPE lvc_t_fcat,
          ls_fcat TYPE lvc_s_fcat,
          new_table TYPE REF TO data,
          new_line TYPE REF TO data.
    CREATE OBJECT g_custom_container
          EXPORTING container_name = g_container.
    CREATE OBJECT g_grid EXPORTING i_parent = g_custom_container.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'MATERIAL'.
    ls_fcat-datatype  = 'CHAR'.
    ls_fcat-intlen    = 18.
    ls_fcat-outputlen = 18.
    ls_fcat-coltext   = 'Material'.
    ls_fcat-edit      = 1.
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'QUANTITY'.
    ls_fcat-datatype  = 'INT4'.
    ls_fcat-intlen    = 6.
    ls_fcat-outputlen = 6.
    ls_fcat-coltext   = 'Qty'.
    ls_fcat-edit      = 1.
    APPEND ls_fcat TO pt_fieldcat.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
                 EXPORTING
                    it_fieldcatalog = pt_fieldcat
                 IMPORTING
                    ep_table = new_table.
    * assign ref variable  to a field symbol
    ASSIGN new_table->* TO <dyn_table>.
    * Create dynamic work area and assign to FS
    CREATE DATA new_line LIKE LINE OF <dyn_table>.
    ASSIGN new_line->* TO <dyn_wa>.
    * data_itab is filled with data that you want in grid
    LOOP AT data_itab INTO data_wa.
      CLEAR <dyn_wa>.
      ASSIGN COMPONENT 'MATERIAL' OF STRUCTURE <dyn_wa> TO <fs>.
      <fs> = data_wa-material.
      ASSIGN COMPONENT 'QUANTITY' OF STRUCTURE <dyn_wa> TO <fs>.
      <fs> = data_wa-quantity.
      APPEND <dyn_wa> TO <dyn_table>.
    ENDLOOP.
    CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          i_structure_name              = '<DYN_TABLE>'
          is_variant                    = gs_variant
          i_save                        = 'A'
          i_default                     = 'X'
          is_layout                     = gs_layout
          it_toolbar_excluding          = gt_exclude
        CHANGING
          it_outtab                     = <dyn_table>
          it_fieldcatalog               = pt_fieldcat[]
          it_sort                       = gt_sort[].

  • How to loop through dates using For Loop?

    Hi All,
    I assume the For Loop is the best way to loop through days in a date range, but I can't figure out how to add a day in the "AssignExpression" box.  The following gets the errors "The expression contains unrecognized token 'DAY'",
    and "Attempt to parse the expression 'DATEADD(DAY, 1, @CounterPlayer)' failed and returned error code 0xC00470A4."
    InitExpression: @CounterPlayer = @DownloadFileDatePlayer
    EvalExpression: @CounterPlayer <= @Today
    AssignExpression: @CounterPlayer = DATEADD(DAY, 1, @CounterPlayer)
    I need to step through days, not through files.  What am I doing wrong here?  I changed "DAY" to "Day," but that didn't fix it.
    Thanks,
    Eric

    DOH!  It just needed properly placed quotes.  Here's the answer:
    AssignExpression: @CounterPlayer = DATEADD("DAY", 1, @CounterPlayer)

  • How I can update data in ALV GRID?

    Hi all,
    I have to update data in an ALV GRID and only one column is editable. I've exclude insert and delete row pushbutton, and I inserted a save pushbutton.
    What I have to write under the "save function" to update my internal table displayed in ALV GRID?
    Thanks advance
    Christian
    Message was edited by: Christian Marchiol

    REPORT  ZTESTDFALV1                             .
    *Data Declaration
    DATA: BEGIN OF T_EKKO,
      EBELN TYPE EKPO-EBELN,
      EBELP TYPE EKPO-EBELP,
    END OF T_EKKO.
    DATA: BEGIN OF IT_EKKO OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_EKKO.
    DATA: BEGIN OF IT_BACKUP OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_BACKUP.
    *ALV data declarations
    TYPE-POOLS: SLIS.                                 "ALV Declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
      IT_BACKUP[] = IT_EKKO[].
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  build_fieldcatalog
    *       text
    FORM BUILD_FIELDCATALOG.
      REFRESH FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELN'.
      FIELDCATALOG-SELTEXT_M   = 'Purchase Order'.
      FIELDCATALOG-INPUT     = 'X'.
      FIELDCATALOG-EDIT     = 'X'.
      FIELDCATALOG-COL_POS     = 2.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELP'.
      FIELDCATALOG-SELTEXT_M   = 'PO Item'.
      FIELDCATALOG-COL_POS     = 3.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM BUILD_LAYOUT.
      "Permet d'ajuster les colonnes au text
    *  gd_layout-colwidth_optimize = 'X'.
      GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
    *  gd_layout-box_fieldname = 'SELECT'.
    *  gd_layout-box_tabname   = 'IT_EKKO'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM DISPLAY_ALV_REPORT.
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM        = GD_REPID
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_CALLBACK_PF_STATUS_SET  = 'SET_PF_STATUS'
                I_CALLBACK_USER_COMMAND   = 'USER_COMMAND'
    *            i_grid_title             = 'My Title'
                IS_LAYOUT                 = GD_LAYOUT
                IT_FIELDCAT               = FIELDCATALOG[]
           TABLES
                T_OUTTAB                  = IT_EKKO
           EXCEPTIONS
                PROGRAM_ERROR             = 1
                OTHERS                    = 2.
      IF SY-SUBRC <> 0.
        WRITE:/ SY-SUBRC.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN EBELP
       UP TO 10 ROWS
        FROM EKPO
        INTO CORRESPONDING FIELDS OF TABLE  IT_EKKO.
    ENDFORM.                    " DATA_RETRIEVAL
    *                      FORM SET_PF_STATUS                              *
    FORM SET_PF_STATUS USING RT_EXTAB   TYPE  SLIS_T_EXTAB.
      <b>SET PF-STATUS 'STANDARD_FULLSCREEN1' EXCLUDING RT_EXTAB.</b>
    ENDFORM.                    "set_pf_status
    *&      Form  user_command
    *       text
    *      -->R_UCOMM    text
    *      -->RS_SELFIELDtext
    FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.
    <b> DATA: GD_REPID LIKE SY-REPID, "Exists
      REF_GRID TYPE REF TO CL_GUI_ALV_GRID. "new
    </b>
    *then insert the following code in your USER_COMMAND routine...
      <b>IF REF_GRID IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            E_GRID = REF_GRID.
      ENDIF.
      IF NOT REF_GRID IS INITIAL.
        CALL METHOD REF_GRID->CHECK_CHANGED_DATA
      ENDIF.</b>
      CASE R_UCOMM.
        WHEN '&IC1'.
          CHECK RS_SELFIELD-TABINDEX > 0.
          IF RS_SELFIELD-VALUE EQ '6000000001'.
            CALL TRANSACTION 'ZDF2'.
          ENDIF.
        WHEN 'REFRESH'.
          READ TABLE IT_EKKO INDEX  RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            READ TABLE IT_BACKUP INDEX RS_SELFIELD-TABINDEX.
            IF SY-SUBRC = 0.
              IF IT_EKKO <> IT_BACKUP.
    *  then do your check
              ENDIF.
            ENDIF.
          ENDIF.
          PERFORM DATA_RETRIEVAL.
          RS_SELFIELD-REFRESH = 'X'.
      when 'SAVE'.
    ***do your save**
      ENDCASE.
    ENDFORM.                    "user_command
    concentrate on Bold....
    regards
    vijay

  • ALV Operations In Webdynpro for ABAP

    Hello Experts,
                          I have a requirement in ALV table in which I want To make one column as link. On clicking of that link a textedit UI element should be created on the same page on top of ALV Table. Please Suggest me how to display textedit on the same page above the ALV table and also how to create link of the column.
    Thanks,
    Pratibha

    Hi,
    To create all the cells of a column as a link follow this thread:
    Re: Creating hyperlink in column based on data, in ALV Web Dynpro ABAP
    You have to set the cell editor as linktoaction. The corresponding click you can capture in event ON_CLICK ( define your own event handler for this ALV event ).
    You can create a textedit box whose visiblity is bound to a context attribut of type wdy_boolean, on the event handler of click you can just change this attribute property and set it to true and bind it back.
    Regards
    Manas Dua

  • Insert,update and delete data in a table using webdynpro for abap

    Dear All,
    I have a requirement to create a table allowing the user to add rows in it and update a row as well as delete a row from that table.To do this I guess I have to make use of ALV.But using ALV I am not able to enter data to a table where as I can make a column editable delete a row etc. please guide me to perform these operations(insert,update and delete) on table.
    Thanks,
    Reddy.

    Hi Sridhar,
    By using ALV you can do all insert delete etc things. if you want to edit i mean you can yenter data in ALV.
    Check this...
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1
    Editing alv in web dynpro
    editing rows in alv reports
    Re: editing rows and columns in alv reports in webdynpro abap
    Cheers,
    Kris.

  • How to loop through dates and return a list of dates?

    hi,
    thank you all for your help my all my oracle endaevors so far:)
    I was going through PL/SQL Programming book by Oracle Press, but overall wasnt able to find the answer for the following.
    I have a list of shops, simple: shop_name (table), date_holiday (table) that lets me keep dates that certain shop is closed.
    example: shopID = 10
    shopID 10
    date_holiday 12/31/2009
    shopID 10
    date_holiday 1/1/2009
    now, what I am trying to achieve is I am trying to get the list of days (formatted as MM/DD/YYYY, but thats not biggy) starting today and ending up in 3 months from now that will EXCLUDE all the holidays, example
    select date_open ...... where shopID = 10;
    [starting today]
    12/29/2009
    12/30/2009
    1/2/2010
    1/3/2010
    [ending 3 months from today]
    any simple ways or ideas that may help?
    thank you!

    somehow like this
    select :the_shop shopid,the_day date_open
      from (select the_day,date_holiday
              from (select trunc(sysdate) + level the_day
                      from dual
                    connect by level <= add_months(trunc(sysdate),3) - trunc(sysdate)
                   ) d,
                   (select date_holiday
                      from holday_table
                     where shopid = :the_shop
                   ) h
             where the_date = date_holiday(+)
           (select nvl2(location_open1,'open,','mon,')||
                   nvl2(location_open2,'open,','tue,')||
                   nvl2(location_open3,'open,','wed,')||
                   nvl2(location_open4,'open,','thu,')||
                   nvl2(location_open5,'open,','fri,')||
                   nvl2(location_open6,'open,','sat,')||
                   nvl2(location_open7,'open,','sun') location_not_open
              from locations
             where locationid = (select shopid
                                   from shops
                                  where shopid = :the_shop
    where instr(location_not_open,to_char(the_day,'dy')) = 0
        or date_holiday is nullRegards
    Etbin

  • How to get f4 help in alv grid in container-urgent

    hi,
    how to get f4 help in alv grid in container using abap objects
    ganesh

    Hi Ganesh,
    Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
    Here is part of the header documentation:
    *& Report  BCALV_GRID_F4_HELP                                          *
    Purpose:
    ~~~~~~~~
    This report illustrates the use of f4-Help in an alv grid control.
    Background:
    ~~~~~~~~~~~
    There a two possibilities to implement an f4-Help in the alv grid
    control: one can either use standard f4-help or write one by Hand.
    For the former there is nothing to do at all. This report shows how
    to implement user-defined f4-help.
    I am sure you will find within this report the solution you are looking for.
    Reward points if this Helps.
    Manish

  • How to integrate WebDynpro for ABAP application with SAPEnterprisePortal7.0

    Hi WebDynpro for ABAP Experts,
    We developed an WebDynpro for ABAP application on R/3, and now we are planning to show this as an iview on SAP Portal EP7.0 (SAP j2EE Engine--Java stack). is it possible to integrate this application with portal?
    If so can you proviode me the way how can we achieve this?
    ADV Thanks
    Regards
    Phani

    Hi Alex,
    Thanks for your response.
    I already created the system object R/3 Backend.
    Actually some WebDynpro java applications/iViews are currently running on Portal. and the developers developed these in NWDS and deployed the .sca files on the Portal server and we created Webdynpro for java iViews.
    but now the requirement is creation of webDynpro for ABAP views.
    The developers developed  WebDynpro for ABAP on the R/3 system. So what are the parameter values we need to give at teh time of creation of  WebDynpro for ABAP iview like the Namespace, Application name etc which are mandatory values and how the Portal server detects the application, this means no need to deploy the application on the Portal server?
    Shall we need to maintain any JCo Destinations or not?
    Pl share your ideas.
    ADV Thanks
    Regards
    Phani

  • How to loop through a Data Node

    Hello,
    I have an Interactive Adobe form in WebDynpro Java project. 
    My data View tab includes the following structure:
    Bapi_test
    ValueHelpData
    CodeNumber
    CodeDescription
    Can someone please tell how I can loop through the “ValueHelpData” node, and get values for “CodeNumber” and “CodeDescription”
    The ValueHelpData node has the cardinality of  0..n. and has approximately 100 elements.
    Thanks. Your help is much appreciated.
    Rob.

    Hi Robby,
    You could try the following :
    int n = wdContext.nodeValueHelpData().size();
    for(int i = 0; i < n; i++)
       wdContext.nodeValueHelpData().moveTo(i);
       IPrivateMyDataView.IValueHelpDataElement ele = wdContext.currentValueHelpDataElement();
       String codenum = ele.getCodeNumber();
       String codedesc = ele.getCodeDescription();
       // Any other processing logic..//
    Hope this helps.

  • How to loop through a single row of data?

    What I'm trying to do is use a cursor to loop through a clob. When I create my cursor I get the an error telling me that the table does not exist. Which implies that I have an implicit cursor. Is there a way to get around this?

    > How to loop through a single row of data?
    By not looping as there is only a single row?
    > What I'm trying to do is use a cursor to loop through a clob
    Processing (looping through) a CLOB has nothing to do with a cursor.
    > When I create my cursor I get the an error telling me that the table does
    not exist. Which implies that I have an implicit cursor.
    Incorrect. It simply means that
    a) you do not have permissions to access that table from within the current context
    b) it does not exist (e.g. you have misspelled the object name, you have not qualified it properly within the current scope, etc)

  • How do I go about this? Creating table while looping through dates?

    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!

    thedunnyman wrote:
    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!I hope you are asking about writing a query to DISPLAY the data that way ... not to actually create such a massively denormalized table ....

Maybe you are looking for