<?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 IF statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196729#M1202567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can work around by using a range based on delete_ind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; DATA: r_delind TYPE RANGE OF ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can fill it according to your parameters and then apply it as IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2009 16:19:20 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2009-02-13T16:19:20Z</dc:date>
    <item>
      <title>Dynamic IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196728#M1202566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all @SAPForums,&lt;/P&gt;&lt;P&gt;I need to manage an IF statement whose conditional expression depends on certain parameters. I wonder if there's an easy way to do as follows:&lt;/P&gt;&lt;P&gt;IF parameter 1 is not set (EQ SPACE), then the condition must be:  IF it_po_items-delete_ind &amp;lt;&amp;gt; 'L'.&lt;/P&gt;&lt;P&gt;IF parameter 2 is not set (EQ SPACE), then the condition must be:  IF it_po_items-delete_ind &amp;lt;&amp;gt; 'S'.&lt;/P&gt;&lt;P&gt;IF both parameters are not set, the condition must be the concatenation of the two above:&lt;/P&gt;&lt;P&gt;IF it_po_items-delete_ind &amp;lt;&amp;gt; 'L' AND it_po_items-delete_ind &amp;lt;&amp;gt; 'S'.&lt;/P&gt;&lt;P&gt;IF both params are set (EQ 'X', they are flags), then there's no condition at all. (IF true?).&lt;/P&gt;&lt;P&gt;Sounds like a thing I could manage using dynamic conditional statements, I did once time ago on a WHERE clause in a SELECT statement, but I'm not able to redo it in this case... maybe because isn't possible in an IF statement? &lt;/P&gt;&lt;P&gt;Thanks for any help you would give me &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 16:14:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196728#M1202566</guid>
      <dc:creator>matteo_montalto</dc:creator>
      <dc:date>2009-02-13T16:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196729#M1202567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can work around by using a range based on delete_ind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; DATA: r_delind TYPE RANGE OF ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can fill it according to your parameters and then apply it as IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 16:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196729#M1202567</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-13T16:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196730#M1202568</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 use ranges...for this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: r_range TYPE RANGE OF loekz,
          s_range LIKE LINE OF r_range.

s_range-sign = 'I'.
s_range-option = 'EQ'.

*IF parameter 1 is not set (EQ SPACE), then the condition must be: IF it_po_items-delete_ind 'L'.
IF parameter1 = SPACE.
  s_range-low = 'L'.
  APPEND s_range TO r_range.
ENDIF.

*IF parameter 2 is not set (EQ SPACE), then the condition must be: IF it_po_items-delete_ind 'S'.
IF parameter2 = SPACE.
  s_range-low = 'S'.
  APPEND s_range TO r_range.
ENDIF.

IF it_po_items-delete_ind IN r_range. " Only one IF condition should be enough..
**Condition satisfied.  
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 16:22:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196730#M1202568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-13T16:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196731#M1202569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thomas and thanks for your help.&lt;/P&gt;&lt;P&gt;Sound like a good solution.... Can you provide an example is code / pseudocode in order to evaluate how to apply this solution in my report? Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 16:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196731#M1202569</guid>
      <dc:creator>matteo_montalto</dc:creator>
      <dc:date>2009-02-13T16:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196732#M1202570</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 use case statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if p1 is initial.

IF it_po_items-delete_ind = 'L'.

endif.

elseif p2 is initial.

IF it_po_items-delete_ind = 'S'.

endif.

elseif p1 is initial  and p2 is initial.

IF it_po_items-delete_ind eq 'L' AND it_po_items-delete_ind eq 'S'.

endif.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sarves&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 16:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-if-statement/m-p/5196732#M1202570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-13T16:26:13Z</dc:date>
    </item>
  </channel>
</rss>

