Capturing User Action and populating Standard table

Hi Friends ,
I have a requirement , its a classical report and in that based on the user action ( if the user checks a check box that is available in the output screen of the report and saves it) the value should be updated in a standard table as 'X'. I have appended the field in the standard table and now i need to write a logic at user command to populate the zfield that i have added in the table based on the user's input.
I need to capture the user's action into an internal table and then pass this value into a function module to update the standard table, Can someone suggest me how to proceed further on this issue ? Kindly let me know if you have any sample piece of code related to this scenario...
thanks in advance.

DATA: date TYPE d,
      flag TYPE c LENGTH 1,
      wa   TYPE c LENGTH 10.
START-OF-SELECTION.
  date = sy-datum.
  DO 10 TIMES.
    date = date + sy-index.
    WRITE: / flag AS CHECKBOX, (10) date.
  ENDDO.
AT LINE-SELECTION.
  DO.
    READ LINE sy-index FIELD VALUE flag
                                   date INTO wa.
    IF sy-subrc <> 0.
      EXIT.
    ELSEIF flag = 'X'.
      WRITE / wa.
    ENDIF.
  ENDDO.

Similar Messages

  • Query on Creating and Populating I$ table on different condition

    Hi,
    I have a query on creating and populating I$ table on different condition.In which condition the I$ table is created??And These condition are mentioned below:
    1)*source and staging area* are on same server(i.e target is on another server)
    2)*staging area and Target* are on same server(i.e source is on another server)
    3)*source,staging area and Target* are on *3 different* server
    4)source,staging area and Target are on same server
    Thanks

    I am not very much clear about your question. Still trying my best to clear it out.
    In your all above requirement I$ table will be created.
    If staging same as target ( One database,one user) then all temp tables will be created under this user
    If staging is different than target ( One database,two user (A,B)) then all temp tables will be created under this user A (lets consider) and data will be inserted to the target table that is present in user B
    If staging is different than target ( Two database,two user (A1,A2), not recommended architecture) then all temp tables will be created under this user A1 (database A1) and data will be inserted to the target table that is present in user A2 (database A2)
    If source,staging,target will under one database then No LKM is required,IKM is sufficient to load the data into target. Specifically for this you can see one example given by Craig.
    http://s3.amazonaws.com/Ora/ODI-Simple_SELECT_and_INSERT-interface.swf
    Thanks.

  • Extended Notification-Capture User Action at Outlook

    Hi gurus,
    I have done the configuration for SAP Extended Notification. The hyperlinks for work items are sent to users by outlook. It works OK.
    What I want to know is whether the user has click the work item Hyperlink at Outlook. 
    I need to capture the users' action of clicking the link and sent it back to SAP.
    Is it possible to get the action captured from the Outlook?
    Cheers.

    Thanks Rainer,
    That has worked a treat, i used the CREATE_WINDOW method directly rather than using it viw the OPEN_POPUP method but should not make any different should it? see code below
    Thanks again
    Regards
    Martin
      data: lr_popup type ref to if_wd_window,
            lr_view_controller type ref to if_wd_view_controller.
      data:
      lr_api_comp_controller type ref to if_wd_component,
      lr_window_manager type ref to if_wd_window_manager.
      lr_api_comp_controller = wd_comp_controller->wd_get_api( ).
      lr_window_manager = lr_api_comp_controller->get_window_manager( ).
      lr_popup = lr_window_manager->create_window(
      MODAL = ABAP_TRUE
      window_name = 'WND_TEXT'
      TITLE = 'TITLE '
      CLOSE_BUTTON = ABAP_TRUE
      BUTTON_KIND = if_wd_window=>co_buttons_okcancel
      MESSAGE_TYPE = if_wd_window=>co_msg_type_none
      CLOSE_IN_ANY_CASE = ABAP_TRUE
    *MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
      lr_view_controller = wd_this->wd_get_api( ).
      lr_popup->subscribe_to_button_event(
      button = if_wd_window=>co_button_ok
      button_text = 'ok_text'
      action_name = 'SUBMIT'
      action_view = lr_view_controller ).
      lr_popup->open( ).

  • Appending files from server node and populating custom table

    Hello Experts-
    I am trying to a built a report for portal KM activity. In EP i have set a command which writes the user  activity in KM  to a txt file and its written to each node on the cluster to the following directory.
    /usr/sap/<SID>/J[C]<instance_#>/j2ee/cluster/server<number>/portalActivityTraces
    I am not very well versed in UNIX scripting to append these text files.
    Can any one suggest me the best way to append all these files and how to access them.
    I have XI developer access. What kind of other access would i need for me to get the collection of files and then parse it and populate a table.
    I have gone through the documentation below. It uses UNIX scripting. I want to use XI for this. Please let me know if any one have any thoughts on this.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e07edaa8-70ae-2b10-2390-f068636c8b1e?quicklink=index&overridelayout=true
    Thanks,
    Raj

    Hi,
    You have to use FTP for this. XI has capability to pick file from any remote location by using transport protocol as FTP in Sender File Adapter. Once you get the user id, password, dir path & file name from AIX then XI will pick the file from your AIX source location.
    Regards,
    Sarvesh

  • Capturing User Id and Time

    Hi All,
    I need to keep track of the user ID and Time for the data entered through a web interface.
    Please suggest the way to achieve this.
    Thanks,
    Deepthi.

    Hi Deepthi,
    there is a how to paper: How to Line Items in SEM-BPS.
    It describes how to add user and time to each dataset enterd/changed.
    Best regards
    Steffen

  • Unable to capture user comments and responder in RESPOND API

    We are building a custom application that uses Oracle Workflow underneath. The application users and responsibilities have been integrated into Workflow. Notifications are acknowledged and responded to directly from the application using the PL/SQL Notification APIs.
    When using the wf_notification.respond API with the appropriate user and comment information filled in, we are still unable to capture the responder information as well as the reponders comments. In other words, the RESPONDER and USER_COMMENT fields in the WF_NOTIFICATION is blank. However, the response does seem to go through otherwise. Do we need to set some kind of user context outside of just setting the response attributes and calling the respond API? Following is the code....
    owf_mgr.wf_notification.setattrtext(p_nid,
                   'RESULT'          ,
                   'APPROVED');
    -- This procedure then caused the WF to advance to next step
    -- Respond to notification, depends on RESULT setattrtext above
    owf_mgr.wf_notification.respond(     p_nid, -- notification id     
         p_respond_comment,     -- response_comment
    p_responder     );     --responder role
    Any help is greatly appreciated.
    Thanks,
    Raj

    If you are on 11.5.10 or greater or standalone 2.6.4 if you pass the responder value to wf_notification.respond API it should be updated in wf_notifications.responder column. The comments is now updated in wf_comments table against the notification id and not wf_notifications.user_comment column.
    Thanks, Vijay

  • How to capture user name and date in the database

    How to capture the person name who edits the application and the date of edit in the database...
    Pallavi

    Hi
    There are substitution strings you can use for this purpose.
    1.APP_USER ------is the current user running the application
    2.SYSDATE --------represents the current date on the database server
    APP_USER Syntax
    Bind variable------ :APP_USER
    PL/SQL------- V('APP_USER')
    Substitution string---------- &APP_USER.
    SYSDATE_YYYYMMDD Syntax
    Bind variable------- :SYSDATE_YYYYMMDD
    Direct PL/SQL------- APEX_APPLICATION.G_SYSDATE (DATE DATATYPE)
    PL/SQL-------- V('SYSDATE_YYYYMMDD')
    Your application will be based on a table with primary key column. You create a 'before update trigger' on that table and add columns 'UPDATED_ON' and 'UPDATED_BY' to that table. Add the following to that trigger:
    :NEW.UPDATED_ON := SYSDATE;
    SELECT V('APP_USER') INTO :NEW.UPDATED_BY FROM DUAL;
    -Priyanka

  • Capture user action from method cl_wd_popup_factory= popup

    Hi There,
    Just wondering if anyone can explain to me how i capture what button a user pressed when using the method 'cl_wd_popup_factory=>popup' and how I perfor different methods/ functionality depending on what they pressed.
    At the moment i can create the popup using the code below but it is not displayed untill the current method has been completed, at this point it seems too late to allow me to control of the code.
    call method cl_wd_popup_factory=>popup
          EXPORTING
            component    = lr_component_api
            view_name    = 'VIEW2'
            button_kind  = if_wd_window=>CO_BUTTONS_YESNO
            message_type = if_wd_window=>CO_MSG_TYPE_QUESTION
          IMPORTING
           POPUP_WINDOW        = window
           COMPONENT_USAGE     = comp_usage.
    Any ideas would be much appreciated
    Regards
    Martin

    Thanks Rainer,
    That has worked a treat, i used the CREATE_WINDOW method directly rather than using it viw the OPEN_POPUP method but should not make any different should it? see code below
    Thanks again
    Regards
    Martin
      data: lr_popup type ref to if_wd_window,
            lr_view_controller type ref to if_wd_view_controller.
      data:
      lr_api_comp_controller type ref to if_wd_component,
      lr_window_manager type ref to if_wd_window_manager.
      lr_api_comp_controller = wd_comp_controller->wd_get_api( ).
      lr_window_manager = lr_api_comp_controller->get_window_manager( ).
      lr_popup = lr_window_manager->create_window(
      MODAL = ABAP_TRUE
      window_name = 'WND_TEXT'
      TITLE = 'TITLE '
      CLOSE_BUTTON = ABAP_TRUE
      BUTTON_KIND = if_wd_window=>co_buttons_okcancel
      MESSAGE_TYPE = if_wd_window=>co_msg_type_none
      CLOSE_IN_ANY_CASE = ABAP_TRUE
    *MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
      lr_view_controller = wd_this->wd_get_api( ).
      lr_popup->subscribe_to_button_event(
      button = if_wd_window=>co_button_ok
      button_text = 'ok_text'
      action_name = 'SUBMIT'
      action_view = lr_view_controller ).
      lr_popup->open( ).

  • Cost and Controlling Standard tables

    Please list down the standard SAP tables used in the Controlling and costing module

    Dear,
    KNA1 General Data in Customer Master
    KNAS Customer master (VAT registration numbers general section)
    KNAT Customer Master Record (Tax Groupings)
    KNB1 Customer Master (Company Code)
    KNB4 Customer Payment History
    KNB5 Customer master (dunning data)
    KNBK Customer Master (Bank Details)
    KNBW Customer master record (withholding tax types) X
    KNC1 Customer master (transaction figures)
    KNC3 Customer master (special G/L transaction figures)
    KNEX Customer Master: Legal Control - Sanctioned Party List
    KNKA Customer master credit management: Central data
    KNKK Customer master credit management: Control area data
    KNMT Customer-Material Info Record Data Table
    KNMTK Customer-Material Info Record Header Table
    KNOB Assignment of Cost Est. Number to Config. Object
    You can create a Generic Extractor , Create a view on 2 tables with proper join condition n use this to load 0COSTCENTER.
    Regards,
    R.Brahmankar

  • Experience updating app, keeping user data, and extending SQLite tables?

    We're updating an application in the App Store, and haven't yet found good information on how to deal with updates to the SQLite Schema and data that should be transferred between apps.
    Anyone successfully done this?
    Q1: Does the old DB files stay on the iPhone after update? Does the installer do a "diff" between them? In our case, we just extended tables, rather than changing them, in hope that we can successfully move the data for users gracefully.
    Q2: If the installer does in fact wipe all the data and files on the app before install, is there a way to access the data before it updates, so the app can gracefully update the data?

    Would you mind sharing your solution?
    I've implemented it by using the PRAGMA SQL statements to query the table structure, and if it's missing the column I need for the new version, adding it.
    The bigger problem, though, is some of my users have experienced their data being deleted when they received an updated version from the app store.

  • LMS 4.2 User tracking and router arp table

    Hi,
    If I have understand correctly, the IP address - mac address matching was made with the arp table of a cisco acces switch if it will made the L3.
    My access switch wasn't used for L3 routing, only L2
    It's possible to set user track to use the arp table of a firewall or a router for made this matching ?
    Thanks a lot

    As long as you have a supported Cisco Layer 3 device in your LMS-management domain, you should be able to correlate the IP-MAC addresses in User Tracking (UT).
    UT support is not specifically listed for the ASA firewall - I'm not sure it will support that feature if it is the users' gateway.
    Useful links:
    UT explanation from the LMS Admin Guide
    Supported devices listing
    Hope this helps.

  • Capture UI actions in SAP Standard iViews

    Hi,
    I need to know which 'push button' the user used in the implementation of the Check/Change BADI in SRM 7.0.
    Thanks

    Hi Madhvika,
    If the text is a static test, you can change it without any code.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c5/f4b9422e0fb911e10000000a1550b0/frameset.htm
    If the text of the label/button is bound to a context attribute (dynamically set)- then you will need write some code in pre, post or overwrite methods based on your requirement.
    Check the below links:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/609baac0-ff58-2c10-7aa3-d23e1ceda594?QuickLink=index&overridelayout=true
    Thanks,
    Shanti

  • Populating Spry Table using button action and Nested XML

    Ah, yet another question.
    So I have a catalog page with a Spry repeating table. The XML
    has 2 sets of nodes -- one for outfits and one for line sheets (the
    technical drawings for clothes). What i want to do is have the
    outfits show and populate the table to start off with, but
    re-populate with the line sheet info if a user clicks on a button.
    currently the page is set up and works perfectly by sucking
    in the XML and populating the table. What I can't seem to do is get
    the button (when clicked) to switch the outfit info with the line
    sheet info.
    I have the following
    // javascript:
    var siracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/siracusa/outfits", { filterFunc: MyPagingFunc });
    var siracusaLS = new
    Spry.Data.NestedXMLDataSet(siracusafall08, "linesheet",
    {filterFunc:MyPagingFunc });
    siracusafall08.setColumnType("photoURL", "image");
    siracusafall08.setColumnType("lrgphoto", "image");
    var pageOffset = 0;
    var pageSize = 1;
    var pageStop = pageOffset + pageSize;
    //var dssiracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml", "collection/outfits", {
    filterFunc: MyPagingFunc });
    function MyPagingFunc(ds, row, rowNumber)
    if (rowNumber < pageOffset || rowNumber >= pageStop)
    return null;
    return row;
    function chooseLS()
    // no idea what to put here...
    function UpdatePage(offset)
    var numRows = siracusafall08.getUnfilteredData().length;
    if (offset > (numRows - pageSize))
    offset = numRows - pageSize;
    if (offset < 0)
    offset = 0;
    pageOffset = offset;
    pageStop = offset + pageSize;
    // Re-apply our non-destructive filter on dsStates1:
    siracusafall08.filter(MyPagingFunc);
    html
    <div spry:region="siracusafall08">
    <table>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top">{name}<br />{desc}</td>
    <td rowspan="8" valign="top" width="300"><img
    src="imx/{photoURL}"/></td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top">{SKU1}<br />{SKU2}<br
    />{SKU3}</td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top"><a href="imx/{lrgphoto}"
    target="_blank">enlarge</a></td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top"><input type="image"
    src="../../imx/back.gif" onclick="UpdatePage(pageOffset -
    pageSize);" />
    <input type="image" src="../../imx/next.gif"
    onclick="UpdatePage(pageOffset + pageSize);" /><br
    /><br /><input type="button" value="filter"
    onclick="chooseLS();" /></td>
    </tr>
    <tr>
    <td height="200"> </td>
    </tr>
    </table>
    </div>
    XML
    <collection>
    <siracusa>
    <outfits>
    <photoURL>6648sm.jpg</photoURL>
    <lrgphoto>6648lg.jpg</lrgphoto>
    <SKU1>JS271SM</SKU1>
    <SKU2>PN109SM</SKU2>
    <SKU3></SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>5237sm.jpg</photoURL>
    <lrgphoto>5237lg.jpg</lrgphoto>
    <SKU1>JS272SM</SKU1>
    <SKU2>LTK121SM</SKU2>
    <SKU3>PW112SM</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>5540sm.jpg</photoURL>
    <lrgphoto>5540lg.jpg</lrgphoto>
    <SKU1>JS272SM</SKU1>
    <SKU2>LTK121SM</SKU2>
    <SKU3>PW112SM</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>6276sm.jpg</photoURL>
    <lrgphoto>6276lg.jpg</lrgphoto>
    <SKU1>JL258SM</SKU1>
    <SKU2>PN100SM</SKU2>
    <SKU3></SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <linesheet>
    <photoURL>5540sm.jpg</photoURL>
    <lrgphoto>5540lg.jpg</lrgphoto>
    <SKU1>JS128SM</SKU1>
    <SKU2>Mandarin collar jacket with box pleat
    cuff</SKU2>
    <SKU3>XS-XL</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </linesheet>
    </siracusa>
    </collection>
    There's nothing in the documentation about using a button to
    repopulate a table. the Nested XML Data Sample page in the Spry
    documentation has been helpful in the past however this is more of
    a switch / toggle situation and frankly that kind of coding is a
    bit beyond my fine arts-trained skills.
    Any suggestions are greatly appreciated!

    Hi Bit Crusher,
    Sorry for the delayed response ...
    Looking at your setup, you can get rid of most of the code in
    collection.js since you are using a pageSize of 1 ... if displaying
    only one row of a data set is all you ever need, then you can get
    the equivalent functionality by just using a spry:detailregion and
    a couple of prev()/next() functions. For example:
    <script type="text/javascript">
    var siracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/siracusa/outfits");
    siracusafall08.setColumnType("photoURL", "image");
    siracusafall08.setColumnType("lrgphoto", "image");
    var crepesfall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/crepes/outfits");
    crepesfall08.setColumnType("photoURL", "image");
    crepesfall08.setColumnType("lrgphoto", "image");
    function DSPrev(ds)
    var curRowNum = ds.getCurrentRowNumber();
    if (--curRowNum >= 0)
    ds.setCurrentRowNumber(curRowNum);
    function DSNext(ds)
    var curRowNum = ds.getCurrentRowNumber();
    if (++curRowNum < ds.getRowCount())
    ds.setCurrentRowNumber(curRowNum);
    </script>
    <div spry:detailregion="siracusafall08">
    </div>
    <div spry:detailregion="crepesfall08">
    </div>
    After you've simplified all that, the next thing I would do
    to get your linesheet switching working is to use "states". Take a
    look at these samples:
    http://labs.adobe.com/technologies/spry/samples/data_region/RegionStatesSample.html
    http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html
    The first link is some basic background on states, but what
    should be of interest to you is the 2nd sample. What I would do is
    have a "styles" and a "linesheet" state in my region.
    Also since you are using nested XML data, you will need to
    access your <linesheet> data with a NestedXMLDataSet:
    http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html#Using NestedDataSets
    http://labs.adobe.com/technologies/spry/samples/data_region/NestedDataSample.html
    --== Kin ==--

  • Differences between Standard , sorted and hashed internal tables

    Can any body please tell me what are the main Differences between
    1) <b>Standard internal table</b>
    2) <b>Hashed internal table</b>
    3) <b>Sorted internal table</b>
    Please give me a clear idea about these Three.
    Thanks
    Prabhudutta<b></b>

    Hi,
    <b>Standard Internal Tables</b>
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command).  The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    <b>Sorted Internal Tables</b>
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition.  Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    <b>Hashed Internal Tables</b>
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    Regards
    Sudheer

  • ALV  issue - capturing user changes in editable fields using custom button?

    Hi,
    I created a custom button in ALV tool bar.   And also in my ALV grid I have couple of fields Editable option. User can change values for these 2 fields.
    My question is -
    After changing values for these editable fields(more than 1 record)  , user will click on custom button and then I have to update all the user changed values in to my internal table(lt_tab)  and then I have to process logic.
    Problem is when user click on Custom button in ALV tool bar it is not having the changed values in lt_tab table.
    Only when user clicks  some thing on ALV grid records or fields then it is getting all the changed values in to lt_tab.
    Can any one tell me how I can get changed values when user clicks on custom button?
    1. Can we place custom button in ALV Grid? instead of ALV tool bar? 
    or
    How I can capture user changes when they click on custom button?
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    TABLES
          T_OUTTAB                          = lt_tab
    Please check this logic-
    CASE r_ucomm.
        WHEN '&IC1'.
    - It_tab  having all changed field values
      WHEN 'custom button'.
          lt_tab  - not having any changed values - showing all initial lt_tab values.
    I highly appreciate your answers on this.
    Thanks.
    Rajesh.

    Hi,
    Use this code, its working:-
    *&      Form  ALV_DISPLAY
    *       SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
    *       FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
    *       AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
    *       DISPLAYED IN THE GRID FORMAT
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sort        " sort info
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
         i_save                            = 'A'
         is_variant                        = wa_variant     " variant name
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 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.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is EXECUTE then process the selected records
        WHEN 'EXECUTE'. "user-defined button
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          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.
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
      ENDCASE.
    ENDFORM.
    This will reflect all the changes in the internal table. Now you can include your logic as per your requirement.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

Maybe you are looking for