<?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: Avoid IF-ELSE/CASE for below code with new Syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682771#M2017088</link>
    <description>&lt;P&gt;I guess you know the &lt;STRONG&gt;COND&lt;/STRONG&gt; constructor operator, right? What did you try? What is your issue?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 12:45:33 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-02-15T12:45:33Z</dc:date>
    <item>
      <title>Avoid IF-ELSE/CASE for below code with new Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682770#M2017087</link>
      <description>&lt;P&gt;Hi Experts,&lt;BR /&gt;&lt;BR /&gt;I have below code which I would like to write in one go with new syntax avoiding IF-ELSE or Case Statement.&lt;BR /&gt;Can you please suggest the same for below?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;IF p_vat IS NOT INITIAL.
    gt_final = VALUE #(  FOR ls_vat IN gt_vat_bp
                        ( partner = ls_vat-innuar
                          stceg = ls_vat-stceg
                         )
                      ).
  ELSEIF p_vertex IS NOT INITIAL.
    gt_final = VALUE #( FOR ls_vertex IN gt_vertex_bp
                        ( partner = ls_vertex-innuar
                          country = ls_vertex-country
                          region = ls_vertex-region
                          txjcd = ls_vertex-txjcd
                         )
                      ).
  ELSEIF p_gmap IS NOT INITIAL.
    gt_final = VALUE #( BASE gt_final
                        FOR ls_gmap IN gt_gmap_bp
                        ( partner = ls_gmap-innuar
                          country = ls_gmap-country
                          pstcd1 = ls_gmap-postcode1
                          street = ls_gmap-street
                          housenumber = ls_gmap-housenum
                         )
                      ).
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;*Expecting something like below:

gt_final = do all above processing based on COND/SWITCH maybe?&lt;BR /&gt;&lt;BR /&gt;*This should remove any need to if-else and pick which FOR LOOP to be run based on whats chosen as radiobutton parameter.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 15 Feb 2023 11:43:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682770#M2017087</guid>
      <dc:creator>sh4il3sh</dc:creator>
      <dc:date>2023-02-15T11:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid IF-ELSE/CASE for below code with new Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682771#M2017088</link>
      <description>&lt;P&gt;I guess you know the &lt;STRONG&gt;COND&lt;/STRONG&gt; constructor operator, right? What did you try? What is your issue?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 12:45:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682771#M2017088</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-02-15T12:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid IF-ELSE/CASE for below code with new Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682772#M2017089</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;gt_final = cond #( when p_vat is not initial &lt;BR /&gt;                                then value #( ..... )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 12:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682772#M2017089</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2023-02-15T12:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid IF-ELSE/CASE for below code with new Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682773#M2017090</link>
      <description>&lt;P&gt;Thanks Frederic and Sandra.&lt;BR /&gt;I was expecting a type to be there in place of hash and I was getting errors.&lt;BR /&gt;&lt;BR /&gt;It is done:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;gt_final = COND #(
        WHEN p_map IS NOT INITIAL THEN VALUE #(
                      FOR ls_gmap IN gt_gmap_bp
                        ( partner = ls_gmap-innuar
                          country = ls_gmap-country
                          pstcd1 = ls_gmap-postcode1
                          street = ls_gmap-street
                          housenumber = ls_gmap-housenum
                          city = ls_gmap-city
                          region = ls_gmap-region )
                                                 )"GMAP 
        WHEN p_vat IS NOT INITIAL THEN VALUE #(
                      FOR ls_vat IN gt_vat_bp
                      ( partner = ls_vat-innuar
                        stceg = ls_vat-stceg )
                                                ) "VAT 
        WHEN p_ver IS NOT INITIAL THEN VALUE #(
                      FOR ls_vertex IN gt_vertex_bp
                      ( partner = ls_vertex-innuar
                        country = ls_vertex-country
                        region = ls_vertex-region
                        pstcd1 = ls_vertex-pstcd1
                        city = ls_vertex-city
                        county = ls_vertex-county
                        txjcd = ls_vertex-txjcd )
                                                 ) "Vertex 
                    ). "This is COND Bracket&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 14:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-if-else-case-for-below-code-with-new-syntax/m-p/12682773#M2017090</guid>
      <dc:creator>sh4il3sh</dc:creator>
      <dc:date>2023-02-15T14:46:14Z</dc:date>
    </item>
  </channel>
</rss>

