<?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 INternal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667293#M883305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP GURU"s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide the coding for following  details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-we have two internal table with some feilds and we want to extract both table data into third internal table.&lt;/P&gt;&lt;P&gt;2- how many types we create internal table give details with examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLz reply me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Apr 2008 11:10:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-03T11:10:50Z</dc:date>
    <item>
      <title>INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667293#M883305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP GURU"s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide the coding for following  details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-we have two internal table with some feilds and we want to extract both table data into third internal table.&lt;/P&gt;&lt;P&gt;2- how many types we create internal table give details with examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLz reply me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:10:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667293#M883305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667294#M883306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are 3 types of internal table  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorted &lt;/P&gt;&lt;P&gt;hash&lt;/P&gt;&lt;P&gt;standard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for  combining 2 internal tables   u have to populate 3rd internal table having all the fields of that 2 internal tables in it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and loop on the two internal table transferring  values into third internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider you have 2 internal tables say itab1, itab2.&lt;/P&gt;&lt;P&gt;Itab1 has fng fields say A, B, C, D.&lt;/P&gt;&lt;P&gt;Itab2 has fng fields say D, E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To combine itab1 and itab2,,, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 &lt;/P&gt;&lt;P&gt;itab3-fld1 = itab1-fld1.&lt;/P&gt;&lt;P&gt;itab3-fld2 = itab1-fld2.&lt;/P&gt;&lt;P&gt;itab3-fld3 = itab1-fld3. &lt;/P&gt;&lt;P&gt;append itab3.&lt;/P&gt;&lt;P&gt;clear itab3. &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;itab3-fld4 = itab1-fld4.&lt;/P&gt;&lt;P&gt;itab3-fld5 = itab1-fld5.&lt;/P&gt;&lt;P&gt;append itab3.&lt;/P&gt;&lt;P&gt;clear itab3. &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ashish Paliwal on Apr 3, 2008 4:45 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667294#M883306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667295#M883307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MOVING DATA BETWEEN TWO INTERNAL TABLES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;look at the folowing code for reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--mard structure&lt;/P&gt;&lt;P&gt;types: begin of struc_mard,&lt;/P&gt;&lt;P&gt;matnr type matnr, "Material Number&lt;/P&gt;&lt;P&gt;werks type werks_d, "Plant&lt;/P&gt;&lt;P&gt;lgort type lgort_d, "Storage Location&lt;/P&gt;&lt;P&gt;labst type labst, "Valuated stock with unrestricted use&lt;/P&gt;&lt;P&gt;end of struc_mard.&lt;/P&gt;&lt;P&gt;*&amp;amp;--mara structure&lt;/P&gt;&lt;P&gt;types: begin of struc_mara,&lt;/P&gt;&lt;P&gt;matnr type matnr, "material number&lt;/P&gt;&lt;P&gt;meins type meins, "unit of measurement&lt;/P&gt;&lt;P&gt;mtart type mtart, "material type&lt;/P&gt;&lt;P&gt;ersda type ersda, "Creation date&lt;/P&gt;&lt;P&gt;end of struc_mara.&lt;/P&gt;&lt;P&gt;*&amp;amp;--maktx structure&lt;/P&gt;&lt;P&gt;types: begin of struc_maktx,&lt;/P&gt;&lt;P&gt;matnr type matnr, "material number&lt;/P&gt;&lt;P&gt;maktx type maktx, "material description&lt;/P&gt;&lt;P&gt;end of struc_maktx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--Final structure&lt;/P&gt;&lt;P&gt;types: begin of struc_final,&lt;/P&gt;&lt;P&gt;matnr type matnr, "Material Number&lt;/P&gt;&lt;P&gt;werks type werks_d, "Plant&lt;/P&gt;&lt;P&gt;lgort type lgort_d, "Storage Location&lt;/P&gt;&lt;P&gt;labst type labst, "Valuated stock with unrestricted use&lt;/P&gt;&lt;P&gt;meins type meins, "unit of measurement&lt;/P&gt;&lt;P&gt;mtart type mtart, "material type&lt;/P&gt;&lt;P&gt;ersda type ersda, "Creation date&lt;/P&gt;&lt;P&gt;maktx type maktx, "material description&lt;/P&gt;&lt;P&gt;v_box(1) type c, "for checkbox field&lt;/P&gt;&lt;P&gt;end of struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;---work area for Internal Tablespopulation 1&lt;/P&gt;&lt;P&gt;data: wa_mard type struc_mard,&lt;/P&gt;&lt;P&gt;wa_mara type struc_mara,&lt;/P&gt;&lt;P&gt;wa_maktx type struc_maktx,&lt;/P&gt;&lt;P&gt;wa_final type struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERNAL TABLES DECLARATION * &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;---Internal tables for storing data.populaiton 1&lt;/P&gt;&lt;P&gt;data: i_mard type standard table of struc_mard,&lt;/P&gt;&lt;P&gt;i_mara type standard table of struc_mara,&lt;/P&gt;&lt;P&gt;i_maktx type standard table of struc_maktx,&lt;/P&gt;&lt;P&gt;i_final type standard table of struc_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--fetching the data from table for storage&lt;/P&gt;&lt;P&gt;select matnr&lt;/P&gt;&lt;P&gt;werks&lt;/P&gt;&lt;P&gt;lgort&lt;/P&gt;&lt;P&gt;labst&lt;/P&gt;&lt;P&gt;into table i_mard&lt;/P&gt;&lt;P&gt;from mard&lt;/P&gt;&lt;P&gt;where matnr in r_matnr and werks in r_werks and lgort in&lt;/P&gt;&lt;P&gt;r_lgort&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc 0. "if unsuccesful&lt;/P&gt;&lt;P&gt;message e004. "Error- Record does not exist&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;&lt;/P&gt;&lt;P&gt;selection of material description &lt;/P&gt;&lt;P&gt;if i_mard[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*SELECT DISTINCT FOR UNIQUE ENTRIES ONLY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct matnr&lt;/P&gt;&lt;P&gt;maktx&lt;/P&gt;&lt;P&gt;into table i_maktx&lt;/P&gt;&lt;P&gt;from makt&lt;/P&gt;&lt;P&gt;for all entries in i_mard&lt;/P&gt;&lt;P&gt;where matnr = i_mard-matnr and&lt;/P&gt;&lt;P&gt;spras = sy-langu.&lt;/P&gt;&lt;P&gt;if sy-subrc 0. " if unsucessful&lt;/P&gt;&lt;P&gt;wa_maktx-maktx = text-028. "NO DESCRIPTION&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*fetching information from material master&lt;/P&gt;&lt;P&gt;select distinct matnr&lt;/P&gt;&lt;P&gt;meins&lt;/P&gt;&lt;P&gt;mtart&lt;/P&gt;&lt;P&gt;ersda&lt;/P&gt;&lt;P&gt;into table i_mara&lt;/P&gt;&lt;P&gt;from mara for all entries in i_mard&lt;/P&gt;&lt;P&gt;where matnr = i_mard-matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc 0.&lt;/P&gt;&lt;P&gt;message e003.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--sorting the tables&lt;/P&gt;&lt;P&gt;sort: i_mard by matnr werks lgort,&lt;/P&gt;&lt;P&gt;i_mara by matnr,&lt;/P&gt;&lt;P&gt;i_maktx by matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;--Clearing workareas.&lt;/P&gt;&lt;P&gt;clear: wa_mard,&lt;/P&gt;&lt;P&gt;wa_mara,&lt;/P&gt;&lt;P&gt;wa_maktx,&lt;/P&gt;&lt;P&gt;wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*PROCESSING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mard into wa_mard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*moving values to final workarea&lt;/P&gt;&lt;P&gt;wa_final = wa_mard.&lt;/P&gt;&lt;P&gt;at new matnr.&lt;/P&gt;&lt;P&gt;read table i_maktx into wa_maktx&lt;/P&gt;&lt;P&gt;with key matnr = wa_mard-matnr binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_mara into wa_mara&lt;/P&gt;&lt;P&gt;with key matnr = wa_mard-matnr binary search.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;"if succesful then move to final workarea&lt;/P&gt;&lt;P&gt;wa_final-maktx = wa_maktx-maktx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*for mara values&lt;/P&gt;&lt;P&gt;wa_final-meins = wa_mara-meins.&lt;/P&gt;&lt;P&gt;wa_final-mtart = wa_mara-mtart.&lt;/P&gt;&lt;P&gt;wa_final-ersda = wa_mara-ersda.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;*append final workarea&lt;/P&gt;&lt;P&gt;append wa_final to i_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clearing and refreshing the table I_MARD &lt;/P&gt;&lt;P&gt;refresh: i_mard.&lt;/P&gt;&lt;P&gt;clear: wa_mard.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. "zf_populate_info&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will move all the data into final table you have got, with the performnce tuned way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TYPES OF INTERNAL TABLES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables&lt;/P&gt;&lt;P&gt;Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects. A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Data Types&lt;/P&gt;&lt;P&gt;Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled&lt;/P&gt;&lt;P&gt;very quickly, since the system does not have to check whether there are already existing entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are&lt;/P&gt;&lt;P&gt;known generically as index tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic Internal Tables&lt;/P&gt;&lt;P&gt;Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures. You cannot use them to declare data objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Dynamic Data Objects&lt;/P&gt;&lt;P&gt;Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choosing a Table Type&lt;/P&gt;&lt;P&gt;The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access,&lt;/P&gt;&lt;P&gt;standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for&lt;/P&gt;&lt;P&gt;partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables&lt;/P&gt;&lt;P&gt;This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.&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;STRONG&gt;Kindly Reward Points If You Found The Reply Helpful&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chaitanya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:16:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667295#M883307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667296#M883308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create the 3 rd internal table with the structure which has fields of both internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and append them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u hav to read the 3 rd table while appending second internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667296#M883308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667297#M883309</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;You can achieve your requirement by using inner join .See th sample code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner joins using 3 tables  &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;SELECT stpo&lt;SUB&gt;stlnr stpo&lt;/SUB&gt;idnrk mast&lt;SUB&gt;matnr mara&lt;/SUB&gt;mtart stpo~menge  &lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast  &lt;/P&gt;&lt;P&gt;JOIN stpo ON stpo&lt;SUB&gt;stlnr = mast&lt;/SUB&gt;stlnr  &lt;/P&gt;&lt;P&gt;JOIN mara ON mara&lt;SUB&gt;matnr = mast&lt;/SUB&gt;matnr  &lt;/P&gt;&lt;P&gt;WHERE stpo&lt;SUB&gt;stlty = 'M' "AND stpo&lt;/SUB&gt;idnrk IN s_matnr  &lt;/P&gt;&lt;P&gt;AND mast~werks = 1000.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here s_matnr is a select-options on the selection-screen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:  &lt;/P&gt;&lt;P&gt;     Select single Vbrk&lt;SUB&gt;Bukrs Vbrk&lt;/SUB&gt;Kunrg    Vbrk~Vbeln  &lt;/P&gt;&lt;P&gt;                   Vbrk&lt;SUB&gt;Fkdat Vbrk&lt;/SUB&gt;Bstnk_Vf Vbrk~Zterm  &lt;/P&gt;&lt;P&gt;                   Tvzbt~Vtext  &lt;/P&gt;&lt;P&gt;                   Vbak&lt;SUB&gt;Vbeln Vbak&lt;/SUB&gt;Bstdk  &lt;/P&gt;&lt;P&gt;                   Likp&lt;SUB&gt;Vbeln Likp&lt;/SUB&gt;lfdat    Likp~Lfuhr  &lt;/P&gt;&lt;P&gt;       into w_vbrk  &lt;/P&gt;&lt;P&gt;       from vbrk  &lt;/P&gt;&lt;P&gt;      inner join       Tvzbt on Tvzbt&lt;SUB&gt;Zterm        = Vbrk&lt;/SUB&gt;Zterm      and  &lt;/P&gt;&lt;P&gt;                                Tvzbt~Spras        = sy-langu  &lt;/P&gt;&lt;P&gt;      Inner join       Vbfa  as SalesLnk  &lt;/P&gt;&lt;P&gt;                             on SalesLnk~vbeln     = pu_vbeln        and  &lt;/P&gt;&lt;P&gt;                                SalesLnk~vbtyp_v   = c_order  &lt;/P&gt;&lt;P&gt;            inner join Vbak  on Vbak&lt;SUB&gt;Vbeln           = SalesLnk&lt;/SUB&gt;Vbelv &lt;/P&gt;&lt;P&gt;      Inner join       Vbfa  as DeliveryLnk  &lt;/P&gt;&lt;P&gt;                             on DeliveryLnk~vbeln   = pu_vbeln       and  &lt;/P&gt;&lt;P&gt;                                DeliveryLnk~vbtyp_v = c_Delivery  &lt;/P&gt;&lt;P&gt;            inner join Likp  on Likp&lt;SUB&gt;Vbeln          = DeliveryLnk&lt;/SUB&gt;Vbelv  &lt;/P&gt;&lt;P&gt;      where vbrk~vbeln = pu_Vbeln.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code locates sales, delivery and payment terms info from a billing document number.  &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;Here, this one also works fine : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select zfpcd&lt;SUB&gt;cadivi zfpcd&lt;/SUB&gt;proforma zfpcd&lt;SUB&gt;factura zfpcd&lt;/SUB&gt;aniofactura  &lt;/P&gt;&lt;P&gt;zfpcd&lt;SUB&gt;montousd zfpcd&lt;/SUB&gt;montoap zfpcd&lt;SUB&gt;ebeln zfpcd&lt;/SUB&gt;inco1  &lt;/P&gt;&lt;P&gt;zfpcd&lt;SUB&gt;lifnr lfa1&lt;/SUB&gt;name1 zcdvs&lt;SUB&gt;status zfpcd&lt;/SUB&gt;conint  &lt;/P&gt;&lt;P&gt;into it_lista  &lt;/P&gt;&lt;P&gt;from zfpcd inner join zcdvs  &lt;/P&gt;&lt;P&gt;on zfpcd&lt;SUB&gt;ebeln = zcdvs&lt;/SUB&gt;ebeln  &lt;/P&gt;&lt;P&gt;and zfpcd&lt;SUB&gt;proforma = zcdvs&lt;/SUB&gt;proforma  &lt;/P&gt;&lt;P&gt;and zfpcd&lt;SUB&gt;lifnr = zcdvs&lt;/SUB&gt;lifnr  &lt;/P&gt;&lt;P&gt;inner join lfa1  &lt;/P&gt;&lt;P&gt;on zfpcd&lt;SUB&gt;lifnr = lfa1&lt;/SUB&gt;lifnr  &lt;/P&gt;&lt;P&gt;where zcdvs~status = '04'.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Internal Tables &lt;/P&gt;&lt;P&gt;You define internal tables first as an abstract data type in the program or ABAP Dictionary, and then as a data object based on that, or they are declared directly as a fully specified data object. When you create an internal table as a data object, you should ensure that only the administration entry which belongs to an internal table is declared statically. The size of table headers for initial tables is currently 8 bytes. This should be heeded whenever internal tables occur as components of complex data objects. Also, empty tables can use up a relatively high amount of storage space as components of tables. The size of the entire storage space required for an internal table is not defined in the declaration &amp;#150; as is the case for data objects of the type string or xstring. Table rows are added to and deleted from the table dynamically at runtime by the various statements for adding and deleting records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Special Aspects of Standard Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward Points if found helpfull..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cheers,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chandra Sekhar.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:16:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667297#M883309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667298#M883310</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;Standard tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to define internal tables locally in a program. You can also define internal tables globally as data types in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES &amp;lt;t&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;          [INITIAL SIZE &amp;lt;n&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The type constructor defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linetype&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;t&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.

TYPES: BEGIN OF LINE,
COLUMN1 TYPE I,
COLUMN2 TYPE I,
COLUMN3 TYPE I,
END OF LINE.

TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.

TYPES: BEGIN OF DEEPLINE,
FIELD TYPE C,
TABLE1 TYPE VECTOR,
TABLE2 TYPE ITAB,
END OF DEEPLINE.

TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE 
WITH DEFAULT KEY.


&lt;/CODE&gt;&lt;/PRE&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;Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement. You can also declare static internal tables in procedures using the STATICS statement, and static internal tables in classes using the CLASS-DATA statement. This description is restricted to the DATA statement. However, it applies equally to the STATICS and CLASS-DATA statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference to Declared Internal Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;itab&amp;gt; TYPE &amp;lt;type&amp;gt;|LIKE &amp;lt;obj&amp;gt; [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (&amp;lt;itab&amp;gt;[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.

DATA: ITAB TYPE VECTOR,
      JTAB LIKE ITAB WITH HEADER LINE.

* MOVE ITAB TO JTAB.   &amp;lt;-  Syntax error!

MOVE ITAB TO JTAB[].




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Merging two internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if both the internal tables have same structure you can add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of itab1 to itab3. " good performance&lt;/P&gt;&lt;P&gt;append lines of itab2 to itab3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope thishelps, DO reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Apr 3, 2008 4:55 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667298#M883310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667299#M883311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;          b~vbeln&lt;/P&gt;&lt;P&gt;          b~posnr&lt;/P&gt;&lt;P&gt;          a~wadat&lt;/P&gt;&lt;P&gt; into table i_tab1&lt;/P&gt;&lt;P&gt;          from likp as a&lt;/P&gt;&lt;P&gt;          inner join lips as b&lt;/P&gt;&lt;P&gt;          on a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;          where a~vkorg in s_vkorg "selection screen &lt;/P&gt;&lt;P&gt;if not i_tab1[] is initial.&lt;/P&gt;&lt;P&gt;    select gbstk&lt;/P&gt;&lt;P&gt;           vbeln&lt;/P&gt;&lt;P&gt;           into table i_tab2&lt;/P&gt;&lt;P&gt;           from vbuk for all entries in i_tab1&lt;/P&gt;&lt;P&gt;           where vbeln = i_tab1-vbeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not i_tab2[] is initial.&lt;/P&gt;&lt;P&gt;    select &lt;/P&gt;&lt;P&gt;           vbeln&lt;/P&gt;&lt;P&gt;           into table i_tab3&lt;/P&gt;&lt;P&gt;           from vbak for all entries in i_tab2&lt;/P&gt;&lt;P&gt;           where vbeln = i_tab2-vbeln.&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;&lt;/P&gt;&lt;P&gt;Here the i_tab1 is a internal table joined with another table.&lt;/P&gt;&lt;P&gt;now i_tab2 is second table. and i_tab3 is third table and now i_tab1, i_tab2 data is with i_tab3.&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;Regards&lt;/P&gt;&lt;P&gt;Swetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 11:29:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667299#M883311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T11:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: INternal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667300#M883312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt; U can use this sample program for ur reference.&lt;/P&gt;&lt;P&gt;TABLES: ekko,&lt;/P&gt;&lt;P&gt;        ekpo,&lt;/P&gt;&lt;P&gt;        eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_ekko,&lt;/P&gt;&lt;P&gt;       ebeln LIKE ekko-ebeln, " Purchasing Document Number&lt;/P&gt;&lt;P&gt;       bukrs LIKE ekko-bukrs, " Company Code&lt;/P&gt;&lt;P&gt;       statu LIKE ekko-statu, " Status of purchasing document&lt;/P&gt;&lt;P&gt;       aedat like ekko-aedat, "Date on which the record was created&lt;/P&gt;&lt;P&gt;       END OF t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_ekko TYPE STANDARD TABLE OF t_ekko.&lt;/P&gt;&lt;P&gt;DATA: wa_ekko TYPE t_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_ekpo,&lt;/P&gt;&lt;P&gt;       ebeln LIKE ekpo-ebeln, "Purchasing Document Number&lt;/P&gt;&lt;P&gt;       menge LIKE ekpo-menge, "Purchase order quantity&lt;/P&gt;&lt;P&gt;       werks LIKE ekpo-werks, "Plant&lt;/P&gt;&lt;P&gt;       matnr like ekpo-matnr, "Material Number&lt;/P&gt;&lt;P&gt;       END OF t_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_ekpo TYPE STANDARD TABLE OF t_ekpo.&lt;/P&gt;&lt;P&gt;DATA: wa_ekpo TYPE t_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_eket,&lt;/P&gt;&lt;P&gt;      ebeln like eket-ebeln,&lt;/P&gt;&lt;P&gt;      ebelp LIKE eket-ebelp, "Item Number of Purchasing Document&lt;/P&gt;&lt;P&gt;      menge LIKE eket-menge, "Scheduled quantity&lt;/P&gt;&lt;P&gt;      etenr like eket-etenr,&lt;/P&gt;&lt;P&gt;      END OF t_eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_eket TYPE STANDARD TABLE OF t_eket.&lt;/P&gt;&lt;P&gt;DATA: wa_eket TYPE t_eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of t_final,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       ebeln LIKE ekko-ebeln, " Purchasing Document Number&lt;/P&gt;&lt;P&gt;       bukrs LIKE ekko-bukrs, " Company Code&lt;/P&gt;&lt;P&gt;       statu LIKE ekko-statu, " Status of purchasing document&lt;/P&gt;&lt;P&gt;       aedat like ekko-aedat,&lt;/P&gt;&lt;P&gt;       menge LIKE ekpo-menge, "Purchase order quantity&lt;/P&gt;&lt;P&gt;       werks LIKE ekpo-werks, "Plant&lt;/P&gt;&lt;P&gt;       matnr like ekpo-matnr, "Material Number&lt;/P&gt;&lt;P&gt;ebelp LIKE eket-ebelp,&lt;/P&gt;&lt;P&gt;       etenr like eket-etenr,&lt;/P&gt;&lt;P&gt;       end of t_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_final type standard table of t_final.&lt;/P&gt;&lt;P&gt;data: wa_final type t_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_date for EKKO-aedat,&lt;/P&gt;&lt;P&gt;	         s_matnr for ekpo-MATNR,	&lt;/P&gt;&lt;P&gt;                s_etenr for eket-etenr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ebeln&lt;/P&gt;&lt;P&gt;       bukrs&lt;/P&gt;&lt;P&gt;       statu&lt;/P&gt;&lt;P&gt;       aedat&lt;/P&gt;&lt;P&gt;       from ekko into table lt_ekko where ebeln in s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       if not lt_ekko[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       select&lt;/P&gt;&lt;P&gt;       ebeln&lt;/P&gt;&lt;P&gt;       menge&lt;/P&gt;&lt;P&gt;       werks&lt;/P&gt;&lt;P&gt;       matnr&lt;/P&gt;&lt;P&gt;       from ekpo into table lt_ekpo for all ENTRIES in lt_ekko where&lt;/P&gt;&lt;P&gt;ebeln = lt_ekko-ebeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not lt_ekko[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;      ebeln&lt;/P&gt;&lt;P&gt;      ebelp&lt;/P&gt;&lt;P&gt;      menge&lt;/P&gt;&lt;P&gt;      etenr&lt;/P&gt;&lt;P&gt;      from eket into table lt_eket for all entries in lt_ekko where&lt;/P&gt;&lt;P&gt;ebeln = lt_ekko-ebeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_ekko into wa_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move:wa_ekko-BUKRS to wa_final-bukrs,&lt;/P&gt;&lt;P&gt;wa_ekko-STATU to wa_final-bukrs.&lt;/P&gt;&lt;P&gt;read table lt_ekko into wa_ekko with key ebeln = wa_ekko-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move : wa_ekpo-menge to wa_final-menge, "Purchase order quantity&lt;/P&gt;&lt;P&gt;       wa_ekpo-werks to wa_final-werks. "Plant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       read table lt_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move: wa_EKET-EBELP to wa_final-ebelp,&lt;/P&gt;&lt;P&gt;wa_eket-MENGE to wa_final-menge.&lt;/P&gt;&lt;P&gt;read table lt_eket into wa_eket with key ebeln = wa_ekko-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_final to lt_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;loop at lt_final into wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ wa_final-BUKRS,wa_final-STATU,wa_final-menge, wa_final-werks,&lt;/P&gt;&lt;P&gt;wa_final-EBELP, wa_final-MENGE.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 11:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/3667300#M883312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T11:30:39Z</dc:date>
    </item>
  </channel>
</rss>

