<?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: Problem in code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617565#M600851</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;In the Fist If Statement&lt;/P&gt;&lt;P&gt;IF NOT CE0_M200-FKART EQ r_fkart. - Are you sure this works since r_fkart is an internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Else Part Did you check the value of CE0_M200-FKART in Debug Mode ? Also check if the value exists in r_fkart. If It exists, then it should execute the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2007 03:56:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-30T03:56:35Z</dc:date>
    <item>
      <title>Problem in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617564#M600850</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;   As my requirement i write the logic.But when i go to debug mode iam  facing some problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Condition :&lt;/P&gt;&lt;P&gt; 1.If the document type is empty  move the posting date(BUDAT) in the input structure to reporting date to the output structure.&lt;/P&gt;&lt;P&gt;    1.1.	If the document type(FKART) of the input structure is not empty and does not contains any of the following doocument types &amp;#147;B1, B1E, B2, B2E, B3, B3E, B4, BK1, BK3, FXG, G2, G2S, JGL, RE, VLG2, BM1, BM3, FXL, JLL or L2&amp;#148; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Logic :  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of i_vbeln occurs 0,&lt;/P&gt;&lt;P&gt;       vbeln like vbfa-vbeln,&lt;/P&gt;&lt;P&gt;       end of i_vbeln.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;data : wa_vbeln like i_vbeln.&lt;/P&gt;&lt;P&gt;data : ws_c_budat like bkpf-budat,&lt;/P&gt;&lt;P&gt;       ws_c_matnr like vbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : ws_lines type i.&lt;/P&gt;&lt;P&gt;Ranges : r_fkart for CE10001-fkart.&lt;/P&gt;&lt;P&gt;         r_fkart-sign = 'I'.&lt;/P&gt;&lt;P&gt;         r_fkart-option = 'EQ'.&lt;/P&gt;&lt;P&gt;         r_fkart-low    = 'B1'.&lt;/P&gt;&lt;P&gt;         Append r_fkart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         r_fkart-sign = 'I'.&lt;/P&gt;&lt;P&gt;         r_fkart-option = 'EQ'.&lt;/P&gt;&lt;P&gt;         r_fkart-low    = 'B1E'.&lt;/P&gt;&lt;P&gt;         Append r_fkart.     -&lt;/P&gt;&lt;HR originaltext="----------------" /&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING I_ITEM to CE0_M200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         IF NOT CE0_M200-fkart is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                IF NOT CE0_M200-FKART EQ r_fkart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               CE0_M200-WWRPT = CE0_M200-BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This part is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the below part is not working.Means in the debug mode when cursor reach the elseif part it does not check the other conditions,directly it goes to last statemetn.(move-corresponding CE0_M200 to E_ITEM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conditions:&lt;/P&gt;&lt;P&gt;2. if the document type(FKART) of the input structure is not empty and contains any one the                     following document type  &amp;#147;B1, B1E, B2, B2E, B3, B3E, B4, BK1, BK3,  FXG,G2, G2S, JGL, RE, VLG2, BM1, BM3, FXL, JLL or L2 .&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   2.1	Find the preceding doc (VBFA-VBELV) with the preceding document category(VBFA-VBTYP_V) M(invoice).&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   2.2	If only one preceding document with category M found, then pass VBRK as the  referenceprocedure(BKPF - AWTYP)  and the billing (invoice) document number found above as the reference key(BKPF &amp;#150;  AWKEY) to the input structure and pass the posting date(BKPF &amp;#150; BUDAT) to the reporting date (WWWRPT) to the output structure.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   2.3.	If there are multiple preceding document with category M(invoice) are found,use the material number in the credit memo to find the invoice with matched material number.If the first invoice found with the matched material number will be used to derive the reporting date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Logic :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  ElseiF CE0_M200-FKART IN r_fkart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    SELECT VBELn FROM VBFA into table i_vbeln&lt;/P&gt;&lt;P&gt;                                         where vbelv = CE0_M200-kaufn&lt;/P&gt;&lt;P&gt;                                                   and VBTYP_V eq 'M'&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      Describe table i_vbeln lines ws_lines .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      If ws_lines = 1 .&lt;/P&gt;&lt;P&gt;                        Read table i_vbeln into wa_vbeln index 1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        select single budat into ws_budat&lt;/P&gt;&lt;P&gt;                          from bkpf where awtyp = 'VBRK'&lt;/P&gt;&lt;P&gt;                                    and   awkey = wa_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        CE0_M200-WWRPT = ws_budat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      Elseif ws_lines &amp;gt;= 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        loop at i_vbeln into wa_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                          select single matnr from vbrp into ws_c_matnr&lt;/P&gt;&lt;P&gt;                                           where vbeln = wa_vbeln-vbeln&lt;/P&gt;&lt;P&gt;                                           and   matnr = CE0_M200-artnr&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                          if sy-subrc   = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            select single budat into ws_budat&lt;/P&gt;&lt;P&gt;                              from bkpf&lt;/P&gt;&lt;P&gt;                                where awtyp = 'VBRK'&lt;/P&gt;&lt;P&gt;                                and   awkey = wa_vbeln-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            CE0_M200-WWRPT = ws_budat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                          ENDIF.&lt;/P&gt;&lt;P&gt;                        endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      ENDIF.&lt;/P&gt;&lt;P&gt;                    ENDIF.&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;                  move-corresponding CE0_M200 to E_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is else if part is not working.Is there any changes in the code?Please suggest me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;sudhakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 03:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617564#M600850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T03:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617565#M600851</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;In the Fist If Statement&lt;/P&gt;&lt;P&gt;IF NOT CE0_M200-FKART EQ r_fkart. - Are you sure this works since r_fkart is an internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Else Part Did you check the value of CE0_M200-FKART in Debug Mode ? Also check if the value exists in r_fkart. If It exists, then it should execute the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 03:56:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617565#M600851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T03:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617566#M600852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thanks for reply.It it working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 05:29:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-code/m-p/2617566#M600852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T05:29:59Z</dc:date>
    </item>
  </channel>
</rss>

