<?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: select-options issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137576#M1190740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rocky ,&lt;/P&gt;&lt;P&gt;  Here a logic id like to share .&lt;/P&gt;&lt;P&gt;say your select option is s_werks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if s_werk is INITIAL.&lt;/P&gt;&lt;P&gt;move itab to itab1 .&lt;/P&gt;&lt;P&gt;elseif s_werks = '001'.&lt;/P&gt;&lt;P&gt;move itab where werks in s_werks to itab1 .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is basic logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much Regards ,&lt;/P&gt;&lt;P&gt;Amuktha .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2009 11:51:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-05T11:51:40Z</dc:date>
    <item>
      <title>select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137574#M1190738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello gurus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table itab, it has key pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in selection screen i have select-options for werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now if the select-options is empty then i have to move all the records from itab into itab1, but if its not empty then i want to copy only those records that have a matching werks from select-options into another database table pa0315 with key pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can use selects with if condition, i was wondering if you have a better idea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:46:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137574#M1190738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137575#M1190739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 if


else


Endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If value enter than copy with passing that value into where clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy to all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun kayal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:48:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137575#M1190739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137576#M1190740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rocky ,&lt;/P&gt;&lt;P&gt;  Here a logic id like to share .&lt;/P&gt;&lt;P&gt;say your select option is s_werks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if s_werk is INITIAL.&lt;/P&gt;&lt;P&gt;move itab to itab1 .&lt;/P&gt;&lt;P&gt;elseif s_werks = '001'.&lt;/P&gt;&lt;P&gt;move itab where werks in s_werks to itab1 .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is basic logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much Regards ,&lt;/P&gt;&lt;P&gt;Amuktha .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137576#M1190740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137577#M1190741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If not s_works[] is initial.
 DELETE itab WHERE werks not in s_werks.
" Now you will have all the entries which werks passed in the selection screen
ELSE.
 Itab1[] = itab[].
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:53:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137577#M1190741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137578#M1190742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Due to the nature of SELECT-OPTIONS, you can do this with the one loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITAB 
    WHERE WERKS in (select-option for WERKS).
   APPEND itab TO itab1.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your select option is null, all records will be copied.  Otherwise, ITAB-WERKS must be within&lt;/P&gt;&lt;P&gt;the values in the SELECT-OPTIONS range.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137578#M1190742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137579#M1190743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Paul, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried teh same, however when select-options is empty, it doest return anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137579#M1190743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137580#M1190744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF s_werks [] IS INITIAL.&lt;/P&gt;&lt;P&gt;*Move the data from 1 table to another&lt;/P&gt;&lt;P&gt;  Itab1 = itab.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Delete all the entries other than selection screen werks.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; DELETE itab WHERE werks NOT IN s_werks [].&lt;/P&gt;&lt;P&gt; Itab1 = itab .&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137580#M1190744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137581#M1190745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Instead of having selects with if condition, this will be good i feel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:&lt;/P&gt;&lt;P&gt; pa0315.&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt; t_itab type table of pa0315 with key pernr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select-options:&lt;/P&gt;&lt;P&gt; s_werks for pa0315-werks. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; select * from pa0315 into table t_itab where werks in s_werks.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; if s_werks eq space.&lt;/P&gt;&lt;P&gt;   "move to itab1.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;   "move to pa0315&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137581#M1190745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T12:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137582#M1190746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the select option is blank then the below statement will delete all the records frm itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DELETE itab WHERE werks NOT IN s_werks [].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137582#M1190746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T12:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137583#M1190747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Must be a version issue Rocky.  I'm running on 4.6c and this works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  BEGIN OF my_rec,
    fld1          TYPE c,
    fld2(4)       TYPE c,
  END OF my_rec,
  itab LIKE STANDARD TABLE OF my_rec,
  itab1 LIKE STANDARD TABLE OF my_rec.

SELECT-OPTIONS s_fld FOR my_rec-fld1.

START-OF-SELECTION.

  PERFORM load_the_table.

  REFRESH itab1.
  LOOP AT itab INTO my_rec WHERE fld1 IN s_fld.
    APPEND my_rec TO itab1.
  ENDLOOP.

  LOOP AT itab1 INTO my_rec.
    WRITE:/ my_rec-fld1, my_rec-fld2.
  ENDLOOP.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  load_the_table
*&amp;amp;---------------------------------------------------------------------*
FORM load_the_table.

  my_rec-fld1 = '1'. my_rec-fld2 = 'AA  '. APPEND my_rec TO itab.
  my_rec-fld1 = '1'. my_rec-fld2 = 'AB  '. APPEND my_rec TO itab.
  my_rec-fld1 = '1'. my_rec-fld2 = 'AC  '. APPEND my_rec TO itab.
  my_rec-fld1 = '2'. my_rec-fld2 = 'BA  '. APPEND my_rec TO itab.
  my_rec-fld1 = '2'. my_rec-fld2 = 'BB  '. APPEND my_rec TO itab.
  my_rec-fld1 = '2'. my_rec-fld2 = 'BC  '. APPEND my_rec TO itab.
  my_rec-fld1 = '3'. my_rec-fld2 = 'CA  '. APPEND my_rec TO itab.
  my_rec-fld1 = '3'. my_rec-fld2 = 'CB  '. APPEND my_rec TO itab.
  my_rec-fld1 = '3'. my_rec-fld2 = 'CC  '. APPEND my_rec TO itab.
  my_rec-fld1 = '1'. my_rec-fld2 = 'AD  '. APPEND my_rec TO itab.

ENDFORM.                    " load_the_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137583#M1190747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T12:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: select-options issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137584#M1190748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rocky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this would help solve your problem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES:
  PA0315.

DATA:
  W_WERKS LIKE PA0315-WERKS,
  BEGIN OF FS_TAB,
    -RELATED FIELDS----------
    PERNR LIKE PA0315,
  END OF FS_TAB.

DATA:
         T_TAB LIKE
  STANDARD TABLE
               OF FS_TAB.

DATA:
        T_TAB1 LIKE
  STANDARD TABLE
               OF FS_TAB.

SELECT-OPTIONS:
  S_WERKS FOR  W_WERKS.

START-OF-SELECTION.
IF S_WERKS IS INITIAL.
  PERFORM TRANSFER.
ELSE.
  PERFORM TRANSFER_SELECTED.
ENDIF.

FORM TRANSFER.
  MOVE T_TAB TO T_TAB1.
ENDFORM.

FORM TRANSFER_SELECTED.
  SELECT F1
               F2
               F3
               ---
               ---
  FROM   PA0315
  INTO TABLE I_TAB1
  WHERE WERKS IN S_WERKS.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case, you got to insert from I_TAB1 to PA0315, then simply code: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT PA0315 FROM TABLE I_ITAB1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  , but for this you got to have access key...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Zahack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 15:18:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-issue/m-p/5137584#M1190748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T15:18:01Z</dc:date>
    </item>
  </channel>
</rss>

