<?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 Keep previous values for Select-Options in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/keep-previous-values-for-select-options/m-p/1077336#M96659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using macros to populate my selections with the previously entered values.  Everything works fine until I want to delete the previous selections for so_snp via the Trash Can button.  The selections come back.  The issue seems to be that the selections are deleted from the so_snp range but then the AT SELECTION-SCREEN OUTPUT executes makro_get_range which re-populates the so_snp selection from the data stored in the buffer because so_snp is initial.  How do I get the AT SELECTION-SCREEN code to execute first so that the makro_set_range can clear out the shared buffer for '/SAPAPO/PT_PLAN_SNP'.  I have included excerpts from my ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.  I struggled with this all day long.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro_get_range.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;initialization&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear:&lt;/P&gt;&lt;P&gt;    lv_line,&lt;/P&gt;&lt;P&gt;    lv_key.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;import SET/GET-parameter from shared buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if &amp;amp;2[] is initial.&lt;/P&gt;&lt;P&gt;    concatenate sy-uname  &amp;amp;1 '_T' into lv_key.           &lt;/P&gt;&lt;P&gt;    import &amp;amp;2[] from shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;    if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;      read table &amp;amp;2 index 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if &amp;amp;2 is initial.&lt;/P&gt;&lt;P&gt;    get parameter id &amp;amp;1 field &amp;amp;2.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0 and &amp;amp;2 is initial.&lt;/P&gt;&lt;P&gt;      refresh &amp;amp;2[].&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if not &amp;amp;2   is initial&lt;/P&gt;&lt;P&gt;       and &amp;amp;2[] is initial.&lt;/P&gt;&lt;P&gt;      append &amp;amp;2.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro_set_range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;initialization&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear:&lt;/P&gt;&lt;P&gt;    lv_line,&lt;/P&gt;&lt;P&gt;    lv_key.&lt;/P&gt;&lt;P&gt;  concatenate sy-uname &amp;amp;1 '_T' into lv_key.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;export SET/GET-parameter to shared buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  describe table &amp;amp;2[] lines lv_line.&lt;/P&gt;&lt;P&gt;  if lv_line gt 1.&lt;/P&gt;&lt;P&gt;    export &amp;amp;2[] to shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    delete from shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;    set parameter id &amp;amp;1 field &amp;amp;2.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS so_snp FOR /sapapo/matloc-planner_snp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt;   makro_get_range '/SAPAPO/PT_PLAN_SNP'    so_snp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;    makro_set_range '/SAPAPO/PT_PLAN_SNP'    so_snp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Oct 2005 21:18:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-21T21:18:29Z</dc:date>
    <item>
      <title>Keep previous values for Select-Options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keep-previous-values-for-select-options/m-p/1077336#M96659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using macros to populate my selections with the previously entered values.  Everything works fine until I want to delete the previous selections for so_snp via the Trash Can button.  The selections come back.  The issue seems to be that the selections are deleted from the so_snp range but then the AT SELECTION-SCREEN OUTPUT executes makro_get_range which re-populates the so_snp selection from the data stored in the buffer because so_snp is initial.  How do I get the AT SELECTION-SCREEN code to execute first so that the makro_set_range can clear out the shared buffer for '/SAPAPO/PT_PLAN_SNP'.  I have included excerpts from my ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.  I struggled with this all day long.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro_get_range.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;initialization&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear:&lt;/P&gt;&lt;P&gt;    lv_line,&lt;/P&gt;&lt;P&gt;    lv_key.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;import SET/GET-parameter from shared buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if &amp;amp;2[] is initial.&lt;/P&gt;&lt;P&gt;    concatenate sy-uname  &amp;amp;1 '_T' into lv_key.           &lt;/P&gt;&lt;P&gt;    import &amp;amp;2[] from shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;    if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;      read table &amp;amp;2 index 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if &amp;amp;2 is initial.&lt;/P&gt;&lt;P&gt;    get parameter id &amp;amp;1 field &amp;amp;2.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0 and &amp;amp;2 is initial.&lt;/P&gt;&lt;P&gt;      refresh &amp;amp;2[].&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if not &amp;amp;2   is initial&lt;/P&gt;&lt;P&gt;       and &amp;amp;2[] is initial.&lt;/P&gt;&lt;P&gt;      append &amp;amp;2.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE makro_set_range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;initialization&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear:&lt;/P&gt;&lt;P&gt;    lv_line,&lt;/P&gt;&lt;P&gt;    lv_key.&lt;/P&gt;&lt;P&gt;  concatenate sy-uname &amp;amp;1 '_T' into lv_key.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;export SET/GET-parameter to shared buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  describe table &amp;amp;2[] lines lv_line.&lt;/P&gt;&lt;P&gt;  if lv_line gt 1.&lt;/P&gt;&lt;P&gt;    export &amp;amp;2[] to shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    delete from shared buffer indx(st) id lv_key.&lt;/P&gt;&lt;P&gt;    set parameter id &amp;amp;1 field &amp;amp;2.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS so_snp FOR /sapapo/matloc-planner_snp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt;   makro_get_range '/SAPAPO/PT_PLAN_SNP'    so_snp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;    makro_set_range '/SAPAPO/PT_PLAN_SNP'    so_snp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 21:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keep-previous-values-for-select-options/m-p/1077336#M96659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T21:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Keep previous values for Select-Options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keep-previous-values-for-select-options/m-p/1077337#M96660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you set a flag to indicate that it needs to be done only once like below?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT SELECTION-SCREEN OUTPUT.
IF v_flag_get_done_once IS INITIAL.
*-- get the values from the shared buffer
  makro_get_range '/SAPAPO/PT_PLAN_SNP' so_snp.
  v_flag_get_done_once = 'X'.
ELSE.
*-- user manipulated the selection screen values, so 
*   don't do it again. Do Nothing.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 22:58:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keep-previous-values-for-select-options/m-p/1077337#M96660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T22:58:49Z</dc:date>
    </item>
  </channel>
</rss>

