<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023650#M961582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;Once you populate both the table then put the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Describle statement 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It will return the number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;********&lt;STRONG&gt;Reward Point if helpful&lt;/STRONG&gt;***********&amp;amp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2008 09:17:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-20T09:17:33Z</dc:date>
    <item>
      <title>logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023645#M961577</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;i am fetching lifnr from lfb1 table. ineed to check for this vendor how many line items available in bsik table and need to display the total number of line items in output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose in lfb1 table lifnr 10001 is there , in bsik table i have 2 line items for this lifnr, inned to get 2 in output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_lfb1[] = 1&lt;/P&gt;&lt;P&gt;gt_bsik[] = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me to write code do we need to take variable or is there any way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:09:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023645#M961577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023646#M961578</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 for all entries and describe table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Adil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023646#M961578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023647#M961579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;select lifnr into table i_lfb1 &lt;/P&gt;&lt;P&gt;               from LFB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0 and i_lfba[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into i_bsik&lt;/P&gt;&lt;P&gt;      from BSIK&lt;/P&gt;&lt;P&gt;for all entries in i_lfb1&lt;/P&gt;&lt;P&gt;     where lifnr = i_lfb1-linfr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is better to use Company Code also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Ravi Sankar.Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ravi Sankara. Z on Jun 20, 2008 11:13 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:13:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023647#M961579</guid>
      <dc:creator>ravisankara_varaprasad</dc:creator>
      <dc:date>2008-06-20T09:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023648#M961580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       First fetch the data from LFB1, and from the correspondign LIFNR, fetch the data from the other table using FOR ALL ENTRIES. Then use the statement DESCRIBE TABLE IT_BSIK LINES L, where L contains the number of line items from BSIK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                THANKS,&lt;/P&gt;&lt;P&gt;                 RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ram K on Jun 20, 2008 11:17 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ram K on Jun 20, 2008 11:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:16:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023648#M961580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023649#M961581</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;  After select the data from data base use statement DESCRIBE TABLE &amp;lt;table name&amp;gt; LINES &amp;lt;any variable of type i&amp;gt;, will give the total number of records in the particular internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After every select statement use the system field SY-DBCNT, to get the number of records that you fetched from the data base table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:17:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023649#M961581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023650#M961582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;Once you populate both the table then put the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Describle statement 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It will return the number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;********&lt;STRONG&gt;Reward Point if helpful&lt;/STRONG&gt;***********&amp;amp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023650#M961582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023651#M961583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;first select lifnr from lfbi......&lt;/P&gt;&lt;P&gt;then select line items from bsik in final intrenal table&lt;/P&gt;&lt;P&gt;data count type i value 0.&lt;/P&gt;&lt;P&gt;sort final internal table&lt;/P&gt;&lt;P&gt;loop at final internaltable&lt;/P&gt;&lt;P&gt;at new lifnr.&lt;/P&gt;&lt;P&gt; write : ifinal-lifnr.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;write : ifinal-lineitems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count = count + 1.&lt;/P&gt;&lt;P&gt;at end of lifnr.&lt;/P&gt;&lt;P&gt;write count.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023651#M961583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023652#M961584</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;If you need to count the number of line items against that vendor, it can be done in this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: cnt type i.

select lifnr bukrs
from lfb1
into table itab1
where lifnr = p_lifnr.

if not itab1 is initial.

select lifnr 
         bukrs
         belnr
         budat
form bsik
into table itab2
for all entries in itab1
where lifnr = itab1-lifnr
and bukrs = itab1-bukrs.
endif.
cnt = 0.
loop at itab2 into wa_itab2.

cnt = sy-tabix + cnt.

endloop.

write: cnt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2008 09:26:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic/m-p/4023652#M961584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-20T09:26:28Z</dc:date>
    </item>
  </channel>
</rss>

