<?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: Internal table field name problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181479#M125907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi the problem is with the INTO CORRESPONDING FIELDS additions to the SELECT statement.VBAP~MATNR has no fields in the itab with the same name ie,MATNR.So you please change the order of the fields in your itab and use INTO TABLE addition to the SELECT Statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abdul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jan 2006 07:15:56 GMT</pubDate>
    <dc:creator>abdul_hakim</dc:creator>
    <dc:date>2006-01-17T07:15:56Z</dc:date>
    <item>
      <title>Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181478#M125906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;          I am declaring one internal table &amp;amp; fetching data using inner join. Following is my structure of internal table but it is not fetching data into MATNR1, the data is there in the table.&lt;/P&gt;&lt;P&gt;Kindly suggest why this is happening?&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;Dilip Gupchup&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal table&lt;/P&gt;&lt;P&gt;data : begin of sales_to_purchase_link_itab occurs 10,&lt;/P&gt;&lt;P&gt;*******FOR P O RELATED INFORMATION&lt;/P&gt;&lt;P&gt;         EBELN LIKE EKKN-EBELN,"DOCUMENT NO&lt;/P&gt;&lt;P&gt;         AEDAT LIKE EKPO-AEDAT,"P O DATE&lt;/P&gt;&lt;P&gt;         EBELP LIKE EKKN-EBELP," ITEM&lt;/P&gt;&lt;P&gt;         MATNR LIKE EKPO-MATNR,"MATERIAL&lt;/P&gt;&lt;P&gt;         MENGE LIKE EKKN-MENGE,"QUANTITY&lt;/P&gt;&lt;P&gt;         SAKTO LIKE EKKN-SAKTO,"G/L Account Number&lt;/P&gt;&lt;P&gt;         NETWR LIKE EKKN-NETWR,"Net order value in PO &lt;/P&gt;&lt;P&gt;*******END FOR P O RELATED INFORMATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******FOR SALES ORDER RELATED INFORMATION&lt;/P&gt;&lt;P&gt;         VBELN LIKE EKKN-VBELN,"SALES DOC NO&lt;/P&gt;&lt;P&gt;         VBELP LIKE EKKN-VBELP,"SALES DOC ITEM&lt;/P&gt;&lt;P&gt;         MATNR1 LIKE VBAP-MATNR,"SALES MATERIAL&lt;/P&gt;&lt;P&gt;         ERDAT LIKE VBAP-ERDAT,"SALES DOC DATE&lt;/P&gt;&lt;P&gt;         ARKTX LIKE VBAP-ARKTX,"MATERIAL DESCRIPTION&lt;/P&gt;&lt;P&gt;         ZMENG LIKE VBAP-ZMENG,"QUANTITY&lt;/P&gt;&lt;P&gt;         NETPR LIKE VBAP-NETPR,"SALE VALUE&lt;/P&gt;&lt;P&gt;*******FOR SALES ORDER RELATED INFORMATION&lt;/P&gt;&lt;P&gt;   end of sales_to_purchase_link_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;ekkn~ebeln &lt;/P&gt;&lt;P&gt;EKKN~EBELP &lt;/P&gt;&lt;P&gt;EKKN~SAKTO &lt;/P&gt;&lt;P&gt;EKKO~AEDAT &lt;/P&gt;&lt;P&gt;ekko~bukrs&lt;/P&gt;&lt;P&gt;EKPO~MATNR &lt;/P&gt;&lt;P&gt;EKPO~MENGE &lt;/P&gt;&lt;P&gt;EKPO~NETWR &lt;/P&gt;&lt;P&gt;vbap~vbeln &lt;/P&gt;&lt;P&gt;ekkn~vbelp &lt;/P&gt;&lt;P&gt;vbap~arktx&lt;/P&gt;&lt;P&gt;VBAP~MATNR&lt;/P&gt;&lt;P&gt; into corresponding fields of table&lt;/P&gt;&lt;P&gt;sales_to_purchase_link_itab from ekkn&lt;/P&gt;&lt;P&gt;inner join ekko on ekkn&lt;SUB&gt;ebeln eq ekko&lt;/SUB&gt;ebeln "UP TO 10 ROWS.&lt;/P&gt;&lt;P&gt;INNER JOIN EKPO ON EKKO&lt;SUB&gt;EBELN EQ EKPO&lt;/SUB&gt;EBELN&lt;/P&gt;&lt;P&gt;inner join vbap on ekkn&lt;SUB&gt;vbeln eq vbap&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;EKPO~AEDAT IN S_ERDAT1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181478#M125906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-17T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181479#M125907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi the problem is with the INTO CORRESPONDING FIELDS additions to the SELECT statement.VBAP~MATNR has no fields in the itab with the same name ie,MATNR.So you please change the order of the fields in your itab and use INTO TABLE addition to the SELECT Statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abdul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:15:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181479#M125907</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-01-17T07:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181480#M125908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also tried this before. I didnt found a solution with "INTO CORRESPONDING FIELDS". Since it is not possible to provide a FIELD list of the type (f1, f2, f3, ...) in combination with INTO...TABLE, I would only JOIN the tables EKKN and EKKO. Then looping over the internal table and select single ... from VBAP for every row separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181480#M125908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-17T07:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181481#M125909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dilip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using CORRESPONDING fields and you don't have MATNR1 field in your SELECT clause, that is why it is failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181481#M125909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-17T07:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181482#M125910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this select :&lt;/P&gt;&lt;P&gt;See the "AS" clause...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select 
ekkn~ebeln 
EKKN~EBELP 
EKKN~SAKTO 
EKKO~AEDAT 
ekko~bukrs
EKPO~MATNR 
EKPO~MENGE 
EKPO~NETWR 
vbap~vbeln 
ekkn~vbelp 
vbap~arktx
VBAP~MATNR AS MATNR1
into corresponding fields of table
sales_to_purchase_link_itab from ekkn
inner join ekko on ekkn~ebeln eq ekko~ebeln "UP TO 10 ROWS.
INNER JOIN EKPO ON EKKO~EBELN EQ EKPO~EBELN
inner join vbap on ekkn~vbeln eq vbap~vbeln
WHERE
EKPO~AEDAT IN S_ERDAT1. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ps: Reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:25:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181482#M125910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-17T07:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table field name problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181483#M125911</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;or change your coding like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA rep LIKE sy-repid.
TYPE-POOLS : slis.
DATA : fcat TYPE slis_t_fieldcat_alv.
DATA wa TYPE  slis_fieldcat_alv.
DATA : BEGIN OF fld OCCURS 0,
name(50),
END OF fld.

rep = sy-repid.
*only possible if fields of itab are defined with LIKE !
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
     EXPORTING
          i_program_name         = rep
          i_internal_tabname     = 'SALES_TO_PURCHASE_LINK_ITAB'
          i_client_never_display = 'X'
          i_inclname             = rep
     CHANGING
          ct_fieldcat            = fcat.


LOOP AT fcat INTO wa.
  CONCATENATE wa-ref_tabname '~' wa-fieldname INTO fld-name.
  APPEND fld.
ENDLOOP.


SELECT (fld)
INTO TABLE sales_to_purchase_link_itab
FROM ekkn
INNER JOIN ekko ON ekkn~ebeln EQ ekko~ebeln "UP TO 10 ROWS.
INNER JOIN ekpo ON ekko~ebeln EQ ekpo~ebeln
INNER JOIN vbap ON ekkn~vbeln EQ vbap~vbeln
WHERE
ekpo~aedat IN s_erdat1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2006 07:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-field-name-problem/m-p/1181483#M125911</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2006-01-17T07:38:09Z</dc:date>
    </item>
  </channel>
</rss>

