<?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: Logic correction in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705868#M309198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the corrections.&lt;/P&gt;&lt;P&gt;but the corresponding fields should get updated in the table VBEP and i have check that .&lt;/P&gt;&lt;P&gt;The values in the table VBEP are not changed.&lt;/P&gt;&lt;P&gt;Please check this logic in your server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be very helpful.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;(and yes i have rewarded the points).&lt;/P&gt;&lt;P&gt;Sonal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Nov 2006 08:36:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-02T08:36:40Z</dc:date>
    <item>
      <title>Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705862#M309192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the logic below... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If VBAK-BSARK contains ZG01 AND VBAK-SUBMI CONTAINS(O_L_O2DL or O_L_O2SH)&lt;/P&gt;&lt;P&gt;The value in field VBEP-ETTYP needs to change from CP tp Cn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following code is writen...&lt;/P&gt;&lt;P&gt;REPORT  YATPLOOP                                .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  BEGIN OF IVBAK OCCURS 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         BSARK LIKE VBAK-BSARK, " Purchase order type&lt;/P&gt;&lt;P&gt;         SUBMI LIKE VBAK-SUBMI, " Collective number (SD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       END OF IVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA:  BEGIN OF IVBEP OCCURS 0,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      ETTYP LIKE VBEP-ETTYP, " Shedule line category&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      END OF IVBEP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA:IVBEP LIKE VBEP OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF IVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IVBAK.&lt;/P&gt;&lt;P&gt;      IF IVBAK-BSARK = 'ZG01' AND IVBAK-SUBMI = 'O_L_O2DL' OR IVBAK-SUBMI = 'O_L_O2SH' .&lt;/P&gt;&lt;P&gt;         select ettyp from vbep into ivbep where vbeln = ivbep-vbeln.&lt;/P&gt;&lt;P&gt;         endselect.&lt;/P&gt;&lt;P&gt;         MOVE 'CN' TO IVBEP-ETTYP.&lt;/P&gt;&lt;P&gt;         MODIFY IVBEP.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE VBEP FROM TABLE IVBEP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the logic is not working..&lt;/P&gt;&lt;P&gt;can anybody help in finding the error and making it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded...&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;P&gt;Sonal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705862#M309192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T07:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705863#M309193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ho sonal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. use BRACKETS () in condition for OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IVBAK-BSARK = 'ZG01' AND &lt;/P&gt;&lt;P&gt;( IVBAK-SUBMI = 'O_L_O2DL' OR IVBAK-SUBMI = 'O_L_O2SH' )&lt;/P&gt;&lt;P&gt;&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705863#M309193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T07:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705864#M309194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IVBAK-BSARK = 'ZG01' AND &lt;/P&gt;&lt;P&gt;( IVBAK-SUBMI = 'O_L_O2DL' OR IVBAK-SUBMI = 'O_L_O2SH' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second:&lt;/P&gt;&lt;P&gt;it's BETTER write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE IVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THEN&lt;/P&gt;&lt;P&gt;SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF IVBAK.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:23:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705864#M309194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T07:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705865#M309195</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;change your query like following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE IVBAK.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR do like this your are not appending into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF IVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND IVBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705865#M309195</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-11-02T07:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705866#M309196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sonal,&lt;/P&gt;&lt;P&gt;Check your modified code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF IVBAK OCCURS 0,
VBELN LIKE VBAK-VBELN , " Purchase order Number
BSARK LIKE VBAK-BSARK, " Purchase order type
SUBMI LIKE VBAK-SUBMI, " Collective number (SD)

END OF IVBAK.


DATA:IVBEP LIKE VBEP OCCURS 0 WITH HEADER LINE.
*--Get VBAK data
SELECT VBELN BSARK SUBMI INTO TABLE IVBAK
FROM VBAK
    WHERE BSARK = 'ZG01'
    AND ( SUBMI = 'O_L_O2DL'
    OR    SUBMI = 'O_L_O2SH' ).

*Get vbep data
IF NOT IVBAK IS INITIAL.
  SELECT VBELN ETTYP FROM VBEP INTO CORRESPONDING FIELDS OF TABLE IVBEP
      FOR ALL ENTRIES IN IVBAK
      WHERE VBELN = IVBAK-VBELN .
  LOOP AT IVBEP .
    READ TABLE IVBAK WITH KEY VBELN = IVBEP-VBELN .
    IF SY-SUBRC = 0.
      MOVE 'CN' TO IVBEP-ETTYP.
      MODIFY IVBEP.
    ENDIF.

  ENDLOOP .
  UPDATE VBEP FROM TABLE IVBEP.
ENDIF.
*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705866#M309196</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T07:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705867#M309197</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;Use brackets in ur if statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF IVBAK-BSARK = 'ZG01' AND ( IVBAK-SUBMI = 'O_L_O2DL' OR IVBAK-SUBMI = 'O_L_O2SH' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; also the way u r updating IVBEP seems to have wrong logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:IVBEP LIKE VBEP OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA:VBEP LIKE VBEP OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IVBAK.&lt;/P&gt;&lt;P&gt;IF IVBAK-BSARK = 'ZG01' AND ( IVBAK-SUBMI = 'O_L_O2DL' OR IVBAK-SUBMI = 'O_L_O2SH' ).&lt;/P&gt;&lt;P&gt;select * from vbep into ivbep where vbeln = ivbep-vbeln.&lt;/P&gt;&lt;P&gt;MOVE 'CN' TO IVBEP-ETTYP.&lt;/P&gt;&lt;P&gt;MODIFY IVBEP.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE VBEP FROM TABLE IVBEP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 07:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705867#M309197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T07:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Logic correction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705868#M309198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the corrections.&lt;/P&gt;&lt;P&gt;but the corresponding fields should get updated in the table VBEP and i have check that .&lt;/P&gt;&lt;P&gt;The values in the table VBEP are not changed.&lt;/P&gt;&lt;P&gt;Please check this logic in your server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be very helpful.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;(and yes i have rewarded the points).&lt;/P&gt;&lt;P&gt;Sonal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 08:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-correction/m-p/1705868#M309198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T08:36:40Z</dc:date>
    </item>
  </channel>
</rss>

