<?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: Dynamic select with select-opitons in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019014#M1608526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope this will solve your porblem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;SELECt-OPTIONS: monat for bkpf-monat OBLIGATORY.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB,&lt;/P&gt;&lt;P&gt;     WTG001 TYPE COSP-WTG001,&lt;/P&gt;&lt;P&gt;     WTG002 TYPE COSP-WTG002,&lt;/P&gt;&lt;P&gt;     WTG003 TYPE COSP-WTG003,&lt;/P&gt;&lt;P&gt;  END OF ITAB.&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;LOOP AT monat.&lt;/P&gt;&lt;P&gt;  if monat-LOW = '01'  AND MONAT-HIGH IS INITIAL.&lt;/P&gt;&lt;P&gt;    select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;elseif   monat-LOW = '01'  AND MONAT-HIGH eq '01'.&lt;/P&gt;&lt;P&gt;    select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.    &lt;/P&gt;&lt;P&gt;ELSEIF MONAT-HIGH = '02'.&lt;/P&gt;&lt;P&gt;         select SINGLE WTG001 WTG002 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;           ELSEIF MONAT-HIGH = '03'.&lt;/P&gt;&lt;P&gt;         select SINGLE WTG001 WTG002 WTG003 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ZAHID HAMEED on Aug 9, 2011 12:35 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ZAHID HAMEED on Aug 9, 2011 12:38 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Aug 2011 19:34:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-08-08T19:34:30Z</dc:date>
    <item>
      <title>Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019008#M1608520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a selction screen with a Select-options : S_monat for bkpf-monat.&lt;/P&gt;&lt;P&gt;Depending on what the user has entered in that selection i need to select the field WOG001 to WOG016 from table COSP.&lt;/P&gt;&lt;P&gt;for example if user has entered Period '01' to Period '12' , then i should do SELECT  ( WOG001 to WOG012) from COSP. How to program that dynamic select fields??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cann anyone help???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 17:32:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019008#M1608520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T17:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019009#M1608521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why bother? Select them all and use only the ones you need in your calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 17:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019009#M1608521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T17:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019010#M1608522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok...but how would i know which field to take for calculation if for example my period is from 2 to 12...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 18:17:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019010#M1608522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T18:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019011#M1608523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't know which fields to use in the calculation, then how would you know which fields to retrieve if you tried the original SELECT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 18:20:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019011#M1608523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T18:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019012#M1608524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i know which field i will use if my select option goes from 1 to 12 then i would choose WOG001 to WOG012 but how do i define that range?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 18:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019012#M1608524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T18:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019013#M1608525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO...VARYING&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's documented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be careful though. Fiscal periods do not necessarily correspond to month numbers. I.E. MONAT = 1 is not necessarily January.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 18:29:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019013#M1608525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T18:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019014#M1608526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope this will solve your porblem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;SELECt-OPTIONS: monat for bkpf-monat OBLIGATORY.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB,&lt;/P&gt;&lt;P&gt;     WTG001 TYPE COSP-WTG001,&lt;/P&gt;&lt;P&gt;     WTG002 TYPE COSP-WTG002,&lt;/P&gt;&lt;P&gt;     WTG003 TYPE COSP-WTG003,&lt;/P&gt;&lt;P&gt;  END OF ITAB.&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;LOOP AT monat.&lt;/P&gt;&lt;P&gt;  if monat-LOW = '01'  AND MONAT-HIGH IS INITIAL.&lt;/P&gt;&lt;P&gt;    select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;elseif   monat-LOW = '01'  AND MONAT-HIGH eq '01'.&lt;/P&gt;&lt;P&gt;    select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.    &lt;/P&gt;&lt;P&gt;ELSEIF MONAT-HIGH = '02'.&lt;/P&gt;&lt;P&gt;         select SINGLE WTG001 WTG002 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;           ELSEIF MONAT-HIGH = '03'.&lt;/P&gt;&lt;P&gt;         select SINGLE WTG001 WTG002 WTG003 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ZAHID HAMEED on Aug 9, 2011 12:35 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ZAHID HAMEED on Aug 9, 2011 12:38 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 19:34:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019014#M1608526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-08T19:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019015#M1608527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob, i have never used DO VARYING can you please help me with the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 13:20:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019015#M1608527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T13:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019016#M1608528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the help files first and then if you still have a problem, get back to the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 13:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019016#M1608528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T13:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select with select-opitons</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019017#M1608529</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;You can check Rob's suggestion first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the ADD...UNTIL...THEN statement. Select all the fields from the COSP table&lt;/P&gt;&lt;P&gt;Then based on the Input ( MONAT ) ..concatenate 'WOG' and create the fields to be considered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  add lwa_all_cost-wkg012 then  lwa_all_cost-wkg013 until lwa_all_cost-wkg016 to gwa_final_costs-prd_12_cost.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case (lwa_all_cost-field) will be dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check it. I think it will work out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 15:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select-with-select-opitons/m-p/8019017#M1608529</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-08-09T15:03:48Z</dc:date>
    </item>
  </channel>
</rss>

