<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: lists in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655140#M290784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all generate the primary list in your START-OF-SELECTION event. &lt;/P&gt;&lt;P&gt;The system variable sy-linno will contain one line more than the total no: of lines in the list. So take this value into a variable l_lines after subtracting one from sy-linno. This variable now represents the total no: of lines in your list.&lt;/P&gt;&lt;P&gt;Now you can handle the user command as follows:&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt; CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;   WHEN 'SAVE'.&lt;/P&gt;&lt;P&gt;     DO l_lines.&lt;/P&gt;&lt;P&gt;      READ LINE sy-index FIELD  VALUE &amp;lt;this will contain the differentiaing value&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;compare the value here &amp;amp; make the changes.&lt;/P&gt;&lt;P&gt;     ENDO.&lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chetan.&lt;/P&gt;&lt;P&gt;PS: Reward points if this is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Chetan H. Dubey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2006 08:49:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-16T08:49:55Z</dc:date>
    <item>
      <title>lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655137#M290781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi!&lt;/P&gt;&lt;P&gt;i have a program which runs on internal table and create list.&lt;/P&gt;&lt;P&gt;i have to update this list and when clicking on SAVE i have to read the list ( few lines ) and the update my table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know how to read the list line.&lt;/P&gt;&lt;P&gt;i used AT USER-COMMAND&lt;/P&gt;&lt;P&gt;          CASE 'SAVE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i dont know how to continue from there,&lt;/P&gt;&lt;P&gt;if someone have sample code it will be very helpul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;yifat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 07:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655137#M290781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T07:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655138#M290782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to have a check box for every row in the list .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use &lt;/P&gt;&lt;P&gt;READ LINE statement to read the selected lines (selected check boxes)  into an internal table .&lt;/P&gt;&lt;P&gt;and then when u click on save capture the ucomm of save and write &lt;/P&gt;&lt;P&gt;modify &amp;lt; databasetable &amp;gt; from &amp;lt;internaltable&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 08:06:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655138#M290782</guid>
      <dc:creator>shishupalreddy</dc:creator>
      <dc:date>2006-11-16T08:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655139#M290783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the demo program: demo_list_read_line to get some idea of reading the lines from the list.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 08:16:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655139#M290783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T08:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655140#M290784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all generate the primary list in your START-OF-SELECTION event. &lt;/P&gt;&lt;P&gt;The system variable sy-linno will contain one line more than the total no: of lines in the list. So take this value into a variable l_lines after subtracting one from sy-linno. This variable now represents the total no: of lines in your list.&lt;/P&gt;&lt;P&gt;Now you can handle the user command as follows:&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt; CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;   WHEN 'SAVE'.&lt;/P&gt;&lt;P&gt;     DO l_lines.&lt;/P&gt;&lt;P&gt;      READ LINE sy-index FIELD  VALUE &amp;lt;this will contain the differentiaing value&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;compare the value here &amp;amp; make the changes.&lt;/P&gt;&lt;P&gt;     ENDO.&lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chetan.&lt;/P&gt;&lt;P&gt;PS: Reward points if this is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Chetan H. Dubey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 08:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655140#M290784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655141#M290785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yifat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create the list as internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Display using ALV. For the newcomer, FM REUSE_ALV_GRID_DISPLAY is recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See sample report BC&lt;STRONG&gt;Alv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 09:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655141#M290785</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-11-16T09:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: lists</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655142#M290786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yifat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use READ LINE to read the list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the sample code...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_ALV_GRAY                          .
type-pools: slis.

data: begin of itab occurs 0,
       vbeln like vbak-vbeln,
       posnr like vbap-posnr,
       check(1),
       process(1),
      end of itab.

data: it_fieldcat type slis_t_fieldcat_alv,
      x_fieldcat type slis_fieldcat_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.
 x_events-NAME = SLIS_EV_END_OF_LIST.
  x_events-FORM = 'END_OF_LIST'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .



select vbeln
       posnr
       into table itab
       up to 100 rows
       from vbap.

x_fieldcat-fieldname = 'CHECK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-checkbox = 'X'.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-col_pos = 1.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.

x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.

x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
 EXPORTING
   I_CALLBACK_PROGRAM             = sy-repid
   I_CALLBACK_PF_STATUS_SET       = 'STATUS'
   I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
    IT_FIELDCAT                    = IT_FIELDCAT
     it_events                = it_events
  TABLES
    T_OUTTAB                       = ITAB
 EXCEPTIONS
   PROGRAM_ERROR                  = 1
   OTHERS                         = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
  SET PF-STATUS 'STATUS'.
ENDFORM.                 " STATUS
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  USER_COMMAND
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;R_UCOMM      text
*      --&amp;gt;RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.
      leave to screen 0.
    when '&amp;amp;IC1'.
    ITAB-PROCESS = 'X'.
    "do what ever here....
    modify itab index rs_selfield-tabindex transporting PROCESS.
  endcase.
  rs_selfield-refresh = 'X'.
ENDFORM.                    "USER_COMMAND
FORM END_OF_LIST.
data: l_vbeln like vbak-vbeln,
      l_posnr like vbap-posnr,
      l_index type sy-tabix.

DO 106 TIMES.  "Here check your itab count and do that many times
    CLEAR: L_VBELN, L_POSNR.
    READ LINE SY-INDEX INDEX SY-LSIND
         FIELD VALUE ITAB-VBELN INTO L_VBELN
                     ITAB-POSNR INTO L_POSNR .
"3lines are reserved for alv headings , so i am reading it form 4th line
"so 4th line is equal to 1st line of itab
    IF SY-SUBRC = 0 AND SY-INDEX GE 4.
       l_index = sy-index - 3.
      READ TABLE ITAB INDEX l_index.
      IF SY-SUBRC = 0 AND ITAB-PROCESS = 'X'.
*-Modifying current list
        MODIFY LINE SY-INDEX INDEX SY-LSIND
                   FIELD FORMAT ITAB-CHECK INPUT OFF.
      ENDIF.
    ENDIF.
  ENDDO.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 09:32:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lists/m-p/1655142#M290786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T09:32:32Z</dc:date>
    </item>
  </channel>
</rss>

