<?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: Enhancing a BW Extract Structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521138#M239300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much UWE that did the trick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Aug 2006 08:46:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-21T08:46:15Z</dc:date>
    <item>
      <title>Enhancing a BW Extract Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521136#M239298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a ZZ field and appended to the Extract Structure for the Material Master BW DataSource.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I need to write the logic to populate the component.  What I am trying to do is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) In my ZZ field I am grouping MARA-MAKTL into 3 categories; IMPLANT, INSTRUMENT and NOT KNOWN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) All MARA-MAKTL starting with 1 (maximum of 3 characters) and MARA-MAKTL 991 are IMPLANTS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) All MARA-MAKTL starting with 2 (maximum of 3 characters) and MARA-MAKTL 992 are INSTRUMENTS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) All other MARA-MAKTL are NOT KNOWN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I am having is I do not know how to group.  Can someone assist with writing this code? Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now written some logic as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gw_mara  TYPE          biw_mara_s&lt;/P&gt;&lt;P&gt;      CLEAR gw_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;        IF&lt;/P&gt;&lt;P&gt;          gw_mara-maktl+0(1) = "1" OR gw_mara-maktl = "991"&lt;/P&gt;&lt;P&gt;          THEN&lt;/P&gt;&lt;P&gt;          gw_mara-ZZBWIMPINST = "IMPLANT".&lt;/P&gt;&lt;P&gt;        ELSEIF&lt;/P&gt;&lt;P&gt;          gw_mara-maktl+0(1) = "2" OR gw_mara-maktl = "992"&lt;/P&gt;&lt;P&gt;          THEN&lt;/P&gt;&lt;P&gt;          gw_mara-ZZBWIMPINST = "INSTRUMENT"&lt;/P&gt;&lt;P&gt;          ELSE&lt;/P&gt;&lt;P&gt;          gw_mara-ZZBWIMPINST = "NOT KNOWN"&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;But get the message: &lt;/P&gt;&lt;P&gt;"Incorrect logical expression...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is this? Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Niten Shah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Aug 2006 09:20:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521136#M239298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-20T09:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing a BW Extract Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521137#M239299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Niten&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some mistakes in the coding.&lt;/P&gt;&lt;P&gt;(1) Literal values are placed inbetween ' ' and not " ".&lt;/P&gt;&lt;P&gt;(2) &amp;lt;i&amp;gt;then&amp;lt;/i&amp;gt; (like in Java) does not exist in ABAP&lt;/P&gt;&lt;P&gt;(3) Does the first IF statement have any meaning? I did not see it that's why I inactivated the coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gw_mara TYPE z_biw_mara_s.

CLEAR gw_mara.

*IF sy-subrc IS INITIAL.
IF ( gw_mara-matkl+0(1) = '1'     OR
     gw_mara-matkl      = '991' ).
*then  " does not exist in ABAP
  gw_mara-zzbwimpinst = 'IMPLANT'.
ELSEIF ( gw_mara-matkl+0(1) = '2'     OR
         gw_mara-matkl      = '992' ).
*then  " does not exist in ABAP
  gw_mara-zzbwimpinst = 'INSTRUMENT'.
ELSE.
  gw_mara-zzbwimpinst = 'NOT KNOWN'.
ENDIF.
*ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;   Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Aug 2006 19:53:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521137#M239299</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-08-20T19:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Enhancing a BW Extract Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521138#M239300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much UWE that did the trick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Aug 2006 08:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancing-a-bw-extract-structure/m-p/1521138#M239300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-21T08:46:15Z</dc:date>
    </item>
  </channel>
</rss>

