<?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: how the code works? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304726#M791426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Describe statement doesnt fetch data, but it gives the details of the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the statement in your code, it retreives the number of records existing in the internal table &lt;STRONG&gt;it_bom_link&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an extract from the help for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DESCRIBE - Return attributes of an internal table 


Basic form 
DESCRIBE TABLE itab. 



Effect 
Returns the attributes of the internal table itab. You must use at least one of the additions listed below: 



Note 
The DESCRIBE statement cannot be used for all ABAP types. In connection with ABAP Objects, SAP has introduced a RTTI concept based on system classes to determine type attributes at runtime. This concept applies to all ABAP types and as such covers all the functions of the DESCRIBE TABLE statement. 



Extras: 

1. ... LINES n 

2. ... OCCURS n 

3. ... KIND   k 



Addition 1 
... LINES n 


Effect 
Places the number of filled lines of the table t in the field lin. The value returned to lin has type I. 

Note 
The number of filled lines of the table itab can also be ascertained using the predefined function lines( itab ). 



Example
DATA: N    TYPE I, 

      ITAB TYPE TABLE OF I. 
... 
CLEAR ITAB. 
APPEND 36 TO ITAB. 
DESCRIBE TABLE ITAB LINES N. 



Result: N contains the value 1. 



Addition 2 
... OCCURS n 


Effect 
Passes the size of the OCCURS parameter from the table definition (as defined with DATA) to the variable n. The value returned to n has type I. 



Example
DATA: N1    TYPE I, 
      N2    TYPE I, 
      ITAB1 TYPE TABLE OF I INITIAL SIZE 10, 
      ITAB2 TYPE I OCCURS 5. 
DESCRIBE TABLE ITAB1 OCCURS N1. 
DESCRIBE TABLE ITAB2 OCCURS N2. 



Result: OCC contains the value 10 and N2 the value 5. 



*Addition 3* 
... KIND k 


*Effect* 
Writes the table type from itab to the variables n. The value returned to k is of type C. The constants SYDES_KIND-STANDARD, SYDES_KIND-SORTED and SYDES_KIND-HASHED are defined in the type group SYDES for the return values. 



Example 
Generic FORM routine any table type 


TYPE-POOLS: SYDES. 
... 
FORM GENERIC_FORM USING ITAB TYPE ANY TABLE. 
  DATA: K TYPE C. 
  DESCRIBE TABLE ITAB KIND K. 
  CASE K. 
    WHEN SYDES_KIND-STANDARD. 
      ... 
    WHEN SYDES_KIND-SORTED. 
      ... 
    WHEN SYDES_KIND-HASHED. 
      ... 
  ENDCASE. 
ENDFORM. 



*Notes* 

Performance: The runtime for executing the DESCRIBE TABLE statement is approximately 4 msn (standardized microseconds). 

The DESCRIBE TABLE statement also passes values to the SY-TFILL and SY-TLENG System fields 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jan 2008 03:16:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-30T03:16:27Z</dc:date>
    <item>
      <title>how the code works?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304725#M791425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry to ask some silly question. but can any one explain the below code what is does? i have no idea on it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what does - USING, DESCRIBE TABLE, are use for?&lt;/P&gt;&lt;P&gt;how does this part fetch the data from table into the internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form validate_sernos_z41_bundle  tables it_bom_link STRUCTURE zmm_bom_link
                                 it_sernos_file STRUCTURE alsmex_tabline
                          using fs_mseg like mseg
                                w_qty
                                w_field_name
                                w_tablename.



* No of serial numbers entered for the current line item
  DESCRIBE TABLE it_bom_link LINES lw_no_of_snos.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 03:11:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304725#M791425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T03:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: how the code works?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304726#M791426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Describe statement doesnt fetch data, but it gives the details of the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the statement in your code, it retreives the number of records existing in the internal table &lt;STRONG&gt;it_bom_link&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an extract from the help for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DESCRIBE - Return attributes of an internal table 


Basic form 
DESCRIBE TABLE itab. 



Effect 
Returns the attributes of the internal table itab. You must use at least one of the additions listed below: 



Note 
The DESCRIBE statement cannot be used for all ABAP types. In connection with ABAP Objects, SAP has introduced a RTTI concept based on system classes to determine type attributes at runtime. This concept applies to all ABAP types and as such covers all the functions of the DESCRIBE TABLE statement. 



Extras: 

1. ... LINES n 

2. ... OCCURS n 

3. ... KIND   k 



Addition 1 
... LINES n 


Effect 
Places the number of filled lines of the table t in the field lin. The value returned to lin has type I. 

Note 
The number of filled lines of the table itab can also be ascertained using the predefined function lines( itab ). 



Example
DATA: N    TYPE I, 

      ITAB TYPE TABLE OF I. 
... 
CLEAR ITAB. 
APPEND 36 TO ITAB. 
DESCRIBE TABLE ITAB LINES N. 



Result: N contains the value 1. 



Addition 2 
... OCCURS n 


Effect 
Passes the size of the OCCURS parameter from the table definition (as defined with DATA) to the variable n. The value returned to n has type I. 



Example
DATA: N1    TYPE I, 
      N2    TYPE I, 
      ITAB1 TYPE TABLE OF I INITIAL SIZE 10, 
      ITAB2 TYPE I OCCURS 5. 
DESCRIBE TABLE ITAB1 OCCURS N1. 
DESCRIBE TABLE ITAB2 OCCURS N2. 



Result: OCC contains the value 10 and N2 the value 5. 



*Addition 3* 
... KIND k 


*Effect* 
Writes the table type from itab to the variables n. The value returned to k is of type C. The constants SYDES_KIND-STANDARD, SYDES_KIND-SORTED and SYDES_KIND-HASHED are defined in the type group SYDES for the return values. 



Example 
Generic FORM routine any table type 


TYPE-POOLS: SYDES. 
... 
FORM GENERIC_FORM USING ITAB TYPE ANY TABLE. 
  DATA: K TYPE C. 
  DESCRIBE TABLE ITAB KIND K. 
  CASE K. 
    WHEN SYDES_KIND-STANDARD. 
      ... 
    WHEN SYDES_KIND-SORTED. 
      ... 
    WHEN SYDES_KIND-HASHED. 
      ... 
  ENDCASE. 
ENDFORM. 



*Notes* 

Performance: The runtime for executing the DESCRIBE TABLE statement is approximately 4 msn (standardized microseconds). 

The DESCRIBE TABLE statement also passes values to the SY-TFILL and SY-TLENG System fields 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 03:16:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304726#M791426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T03:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: how the code works?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304727#M791427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DESCRIBE gives you the number of lines/records/rows in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE table it_tab LINES n.&lt;/P&gt;&lt;P&gt;n gives the no of lines in internal table it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 03:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304727#M791427</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2008-01-30T03:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: how the code works?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304728#M791428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  USING : By this you can pass the values inside of the subroutine.This is just like&lt;/P&gt;&lt;P&gt;               IMPORT the values not like EXPORT from subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE it_bom_link LINES lw_no_of_snos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Describe : IT will give the no. of records present in that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful.......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 03:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-the-code-works/m-p/3304728#M791428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T03:51:47Z</dc:date>
    </item>
  </channel>
</rss>

