<?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: Replacing old logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198941#M130554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What doe syour special indicator do? any significance. Still if you just need to compare that your KUWEV-KUNNR which is 10 char against all the entries in ZZPLT_CUST-KUNNR(10 cahr ship to party),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do the same select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT KUNNR up to 1 rows from ZZPT_CUST&lt;/P&gt;&lt;P&gt;  into V_KUNNR&lt;/P&gt;&lt;P&gt;  where KUNNR = CUST &lt;/P&gt;&lt;P&gt;ENDSELECT,&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0 and LIKP-TRAID  = SPACE&lt;/P&gt;&lt;P&gt; perform logic&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2006 07:08:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-05T07:08:32Z</dc:date>
    <item>
      <title>Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198935#M130548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, i wanna know your thoughts on this. I've been asked to rewrite a few lines of codes, as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CLEAR CUST.
  CUST = KUWEV-KUNNR.

  IF LIKP-TRAID EQ SPACE.
    IF CUST = '1000000001' OR CUST = '1000000002' OR CUST = '1000000004'
    OR CUST = '1000000005' OR CUST = '1000000006' OR CUST = '1000000007'
    OR CUST = '1000000012' OR CUST = '1000000026' OR CUST = '1000000040'
    OR CUST = '1000000041' OR CUST = '1000000042' OR CUST = '1000000050'
    OR CUST = '1000000051' OR CUST = '1000000053' OR CUST = '1000000054'
    OR CUST = '1000000067' OR CUST = '1000000075' OR CUST = '1000000080'
    OR CUST = '1000000092' OR CUST = '1000000128'
    OR CUST = '1000000220' OR CUST = '1000000240'
*    OR CUST = '1000000474'
    OR CUST = '1000000363' OR CUST = '1000000366' OR CUST = '1000000463'
    OR CUST = '1000000486' OR CUST = '1000000528' OR CUST = '1000000566'
    OR CUST = '1000000580' OR CUST = '1000000641' OR CUST = '1000000643'
    OR CUST = '1000000665' OR CUST = '1000000705' OR CUST = '1000000752'
    OR CUST = '1000000765' OR CUST = '1000000771' OR CUST = '1000000775'
    OR CUST = '1000000777' OR CUST = '1000000785' OR CUST = '1000000808'
    OR CUST = '1000000835' OR CUST = '1000000840' OR CUST = '1000000847'
    OR CUST = '1000000897' OR CUST = '1000000905' OR CUST = '1000000920'
    OR CUST = '1000000925' OR CUST = '1000000935' OR CUST = '1000000960'
    OR CUST = '1000001071' OR CUST = '1000001105' OR CUST = '1000001120'
    OR CUST = '1000001147' OR CUST = '1000001150' OR CUST = '1000001161'
    OR CUST = '1000001185' OR CUST = '1000001289' OR CUST = '1000001397'
    OR CUST = '1000001436' OR CUST = '1000001459' OR CUST = '1000001532'
   OR CUST = '1000001649' OR CUST = '1000001666' OR CUST = '1000001671'.
*    OR CUST = '1000000030'.

        MESSAGE i000(z00) WITH 'You must enter pallet quantity'
                 'for customer ' CUST.
        LEAVE TO SCREEN 2000.
    ENDIF.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Since that we no longer want to hard-code the Vendor No., I've been asked to write a new logic. In short, if the user keys in a vendor number that is in the new table (ZZPLT_CUST) i just created, i need to automatically output the message. This is what i've been thinking to write:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: ZZPLT_CUST.

DATA: VEND LIKE ZZPLT_CUST-KUNNR.

  CLEAR CUST.
  CUST = KUWEV-KUNNR.

  CLEAR VEND.
  VEND = ZZPLT_CUST-KUNNR.

  IF LIKP-TRAID EQ SPACE.
    IF CUST = VEND.
        MESSAGE i000(z00) WITH 'You must enter pallet quantity'
                 'for customer ' CUST.
        LEAVE TO SCREEN 2000.
    ENDIF.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanna know your thoughts on it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 06:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198935#M130548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T06:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198936#M130549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bernard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Just one point here. the VEND that you want to compare with is actually a Z table entry and have about &amp;gt;40 types of VEND in it. So when you are comparing the CUST = VENd, you sould actually b e looping throught the entire list of Z table entries one by one to see, if the CUST exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to do it is to do a single select on ypur Ztable where VEND = CUST. If sy-subrc = 0, then entry exists and you should procced with thre LEAVE screen statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shobana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 06:45:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198936#M130549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T06:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198937#M130550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: ZZPLT_CUST.
DATA: VEND LIKE ZZPLT_CUST-KUNNR.  
CLEAR CUST.  
CUST = KUWEV-KUNNR. 
 CLEAR VEND. 
 VEND = ZZPLT_CUST-KUNNR.
  IF LIKP-TRAID EQ SPACE. 
   IF CUST = VEND.   
  MESSAGE i000(z00) WITH 'You must enter pallet quantity'       'for customer ' CUST.  
 LEAVE TO SCREEN 2000.   
 ENDIF. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;this is fine for any vendor, is it ok....&lt;/P&gt;&lt;P&gt;but what if the other vendors which are not there in your previous if logic...then also will it work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 06:46:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198937#M130550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T06:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198938#M130551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to just do this&lt;/P&gt;&lt;P&gt; select * from ZZPLT_CUST &lt;/P&gt;&lt;P&gt;  where VEND = CUST.&lt;/P&gt;&lt;P&gt; IF sy-subrc = 0 and traid = space.&lt;/P&gt;&lt;P&gt;  Message &lt;/P&gt;&lt;P&gt; Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im assuming that VEND is the field in your ZZPKT_CUST table which stores all the vendor numbers there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 06:50:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198938#M130551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T06:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198939#M130552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if '1000000001' and so on are vendor numbers &amp;amp; you are populating them in the table ZZPLT_CUST..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can change the logic as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR CUST.&lt;/P&gt;&lt;P&gt;CUST = KUWEV-KUNNR.&lt;/P&gt;&lt;P&gt;  IF LIKP-TRAID EQ SPACE.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE VENDOR&lt;/P&gt;&lt;P&gt;                  INTO V_VENDOR&lt;/P&gt;&lt;P&gt;                  FROM ZZPLT_CUST&lt;/P&gt;&lt;P&gt;                  WHERE VENDOR = CUST.&lt;/P&gt;&lt;P&gt;   IF SY-SUBRC  = 0 .&lt;/P&gt;&lt;P&gt;*--CUST = VEND.&lt;/P&gt;&lt;P&gt;   MESSAGE i000(z00) WITH 'You must enter pallet   &lt;/P&gt;&lt;P&gt;       quantity' 'for customer ' CUST. &lt;/P&gt;&lt;P&gt;    LEAVE TO SCREEN 2000.  &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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 06:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198939#M130552</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T06:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198940#M130553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The table ZZPLT_CUST which i just created has the following fields, length and their respective description:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MANDT(3)   -&amp;gt; Client
IND(1)     -&amp;gt; Special Indicator
KUNNR(10)  -&amp;gt; Customer Number 1
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the original logic, CUST was defined like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: CUST LIKE KUWEV-KUNNR.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So i don't think i could just do a SELECT * WHERE VEND = CUST&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 07:03:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198940#M130553</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T07:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198941#M130554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What doe syour special indicator do? any significance. Still if you just need to compare that your KUWEV-KUNNR which is 10 char against all the entries in ZZPLT_CUST-KUNNR(10 cahr ship to party),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do the same select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT KUNNR up to 1 rows from ZZPT_CUST&lt;/P&gt;&lt;P&gt;  into V_KUNNR&lt;/P&gt;&lt;P&gt;  where KUNNR = CUST &lt;/P&gt;&lt;P&gt;ENDSELECT,&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0 and LIKP-TRAID  = SPACE&lt;/P&gt;&lt;P&gt; perform logic&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 07:08:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198941#M130554</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T07:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198942#M130555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The special indicator works similarly like a mark for deletion indicator&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 07:17:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198942#M130555</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T07:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198943#M130556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it an indicator to show that you need not check that particular vendor in the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your requirement is pretty simple, you just need to query your Ztable with the user input in the where caluse. If you need to check only those records that have splind &amp;lt;&amp;gt; X than add that also to the where clause and in this case you can also make it select single as you will be using all the keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 07:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198943#M130556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T07:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing old logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198944#M130557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks....actually all i wanted to know of any logic that could replace the earlier logic (which can perform the same thing as the earlier one and hopefully provide better performance, since we no longer want to hard-code each and every new vendor number)...for the meanwhile, i'll have to wait for the user to get back to me on this once they've tested it...i won't close this thread yet...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;truth to be told, i'm not so sure as to why the indicator is needed inside the table...the consultant wanted it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2006 07:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-old-logic/m-p/1198944#M130557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-05T07:36:41Z</dc:date>
    </item>
  </channel>
</rss>

