<?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 Select statement where have 2 same field type. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028295#M1348860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi abaper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to do the select statement where there are 2 same variables which have exactly same name , same data type but different table source. as below where both table TJ30T and TJ02T have variables name TXT04 with same data typer J_TXT04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table TJ30T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MANDT	MANDT&lt;/P&gt;&lt;P&gt;STSMA	J_STSMA&lt;/P&gt;&lt;P&gt;ESTAT	J_ESTAT&lt;/P&gt;&lt;P&gt;SPRAS	SPRAS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TXT04	J_TXT04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TXT30	J_TXT30&lt;/P&gt;&lt;P&gt;LTEXT	J_LANGTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table TJ02T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ISTAT	J_ISTAT&lt;/P&gt;&lt;P&gt;SPRAS	SPRAS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TXT04	J_TXT04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TXT30	J_TXT30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both i have to select using select statement and choose the TJ30T&lt;SUB&gt;txt04 and TJ02T&lt;/SUB&gt;txt04. but the problems i faced,  since both using txt04, one of it i have to rename with different name, ustxt04. when i did the select statement, the data for TJ30T~txt04 failed to find the ustxt04. here the select statement. thanks you&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**********data types declaration*********
types: begin of stobj,
  pspnr type proj-pspnr,
  stspr type proj-stspr,
  objnr type proj-objnr,
  pspid type proj-pspid,
  psphi type prps-psphi,
  posid type prps-posid,
  aufnr type aufk-aufnr,
  pspel type aufk-pspel, 
  inact type jest-inact,
  stat type jest-stat,
  udate type jcds-udate,
  usnam type jcds-usnam, 
  utime type jcds-utime, 
  estat type tj30t-estat,
  TXT04 type TJ02T-txt04,
  USTXT04 type TJ30T-txt04,
end of stobj.

*******Internal and work area declaration*******
 data: itobj type table of stobj,
       waobj like line of itobj.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;** select statement code*********
select
    a~pspnr a~stspr a~objnr a~pspid
    b~psphi b~posid
    c~aufnr c~pspel
    d~inact d~stat
    e~udate e~usnam e~utime "e~stat
   F~TXT04
    g~estat
    G~TXT04
    from proj as a
    inner join prps as b on a~pspnr = b~psphi
    inner join aufk as c on b~pspnr = c~pspel
    inner join jest as d on c~objnr = d~objnr
    inner join jcds as e on d~objnr = e~objnr
                         and d~stat = e~stat
    inner join tj02t as f on e~stat = f~istat
    inner join tj30t as g on a~stspr = g~stsma
    for all entries in itparm
    where  a~pspid = itparm-pspid "or e~stat = itparm-psy )
    or  b~posid = itparm-posid "or e~stat = itparm-wsy )
    or  c~aufnr = itparm-aufnr "or e~stat = itparm-nsy  )
    and ( d~inact &amp;lt;&amp;gt; 'X' or e~inact &amp;lt;&amp;gt; 'X')
    and f~spras = 'E' and g~spras = 'E'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2009 03:08:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-17T03:08:19Z</dc:date>
    <item>
      <title>Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028295#M1348860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi abaper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to do the select statement where there are 2 same variables which have exactly same name , same data type but different table source. as below where both table TJ30T and TJ02T have variables name TXT04 with same data typer J_TXT04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table TJ30T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MANDT	MANDT&lt;/P&gt;&lt;P&gt;STSMA	J_STSMA&lt;/P&gt;&lt;P&gt;ESTAT	J_ESTAT&lt;/P&gt;&lt;P&gt;SPRAS	SPRAS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TXT04	J_TXT04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TXT30	J_TXT30&lt;/P&gt;&lt;P&gt;LTEXT	J_LANGTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table TJ02T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ISTAT	J_ISTAT&lt;/P&gt;&lt;P&gt;SPRAS	SPRAS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TXT04	J_TXT04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;TXT30	J_TXT30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both i have to select using select statement and choose the TJ30T&lt;SUB&gt;txt04 and TJ02T&lt;/SUB&gt;txt04. but the problems i faced,  since both using txt04, one of it i have to rename with different name, ustxt04. when i did the select statement, the data for TJ30T~txt04 failed to find the ustxt04. here the select statement. thanks you&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**********data types declaration*********
types: begin of stobj,
  pspnr type proj-pspnr,
  stspr type proj-stspr,
  objnr type proj-objnr,
  pspid type proj-pspid,
  psphi type prps-psphi,
  posid type prps-posid,
  aufnr type aufk-aufnr,
  pspel type aufk-pspel, 
  inact type jest-inact,
  stat type jest-stat,
  udate type jcds-udate,
  usnam type jcds-usnam, 
  utime type jcds-utime, 
  estat type tj30t-estat,
  TXT04 type TJ02T-txt04,
  USTXT04 type TJ30T-txt04,
end of stobj.

*******Internal and work area declaration*******
 data: itobj type table of stobj,
       waobj like line of itobj.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;** select statement code*********
select
    a~pspnr a~stspr a~objnr a~pspid
    b~psphi b~posid
    c~aufnr c~pspel
    d~inact d~stat
    e~udate e~usnam e~utime "e~stat
   F~TXT04
    g~estat
    G~TXT04
    from proj as a
    inner join prps as b on a~pspnr = b~psphi
    inner join aufk as c on b~pspnr = c~pspel
    inner join jest as d on c~objnr = d~objnr
    inner join jcds as e on d~objnr = e~objnr
                         and d~stat = e~stat
    inner join tj02t as f on e~stat = f~istat
    inner join tj30t as g on a~stspr = g~stsma
    for all entries in itparm
    where  a~pspid = itparm-pspid "or e~stat = itparm-psy )
    or  b~posid = itparm-posid "or e~stat = itparm-wsy )
    or  c~aufnr = itparm-aufnr "or e~stat = itparm-nsy  )
    and ( d~inact &amp;lt;&amp;gt; 'X' or e~inact &amp;lt;&amp;gt; 'X')
    and f~spras = 'E' and g~spras = 'E'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:08:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028295#M1348860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T03:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028296#M1348861</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;Since you are using a~tablename, I think there would be no issues if there are fields having the same names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Benedict&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:13:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028296#M1348861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T03:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028297#M1348862</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;have you tried to use an alias to each field?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT F~TXT04 as txt1
    G~TXT04 as txt2
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you use INTO CORRESPONDIG FIELDS OF.. may fail to find correst field.&lt;/P&gt;&lt;P&gt;So you should declare your structure in the same order as your select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Frisoni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:15:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028297#M1348862</guid>
      <dc:creator>guilherme_frisoni</dc:creator>
      <dc:date>2009-08-17T03:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028298#M1348863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;correctio0n on the select statement&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;select statement code*********&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;    a&lt;SUB&gt;pspnr a&lt;/SUB&gt;stspr a&lt;SUB&gt;objnr a&lt;/SUB&gt;pspid&lt;/P&gt;&lt;P&gt;    b&lt;SUB&gt;psphi b&lt;/SUB&gt;posid&lt;/P&gt;&lt;P&gt;    c&lt;SUB&gt;aufnr c&lt;/SUB&gt;pspel&lt;/P&gt;&lt;P&gt;    d&lt;SUB&gt;inact d&lt;/SUB&gt;stat&lt;/P&gt;&lt;P&gt;    e&lt;SUB&gt;udate e&lt;/SUB&gt;usnam e&lt;SUB&gt;utime "e&lt;/SUB&gt;stat&lt;/P&gt;&lt;P&gt;   F~TXT04&lt;/P&gt;&lt;P&gt;    g~estat&lt;/P&gt;&lt;P&gt;    G~TXT04&lt;/P&gt;&lt;P&gt;    into corresponding fields of table itobj&lt;/P&gt;&lt;P&gt;    from proj as a&lt;/P&gt;&lt;P&gt;    inner join prps as b on a&lt;SUB&gt;pspnr = b&lt;/SUB&gt;psphi&lt;/P&gt;&lt;P&gt;    inner join aufk as c on b&lt;SUB&gt;pspnr = c&lt;/SUB&gt;pspel&lt;/P&gt;&lt;P&gt;    inner join jest as d on c&lt;SUB&gt;objnr = d&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;    inner join jcds as e on d&lt;SUB&gt;objnr = e&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;                         and d&lt;SUB&gt;stat = e&lt;/SUB&gt;stat&lt;/P&gt;&lt;P&gt;    inner join tj02t as f on e&lt;SUB&gt;stat = f&lt;/SUB&gt;istat&lt;/P&gt;&lt;P&gt;    inner join tj30t as g on a&lt;SUB&gt;stspr = g&lt;/SUB&gt;stsma&lt;/P&gt;&lt;P&gt;    for all entries in itparm&lt;/P&gt;&lt;P&gt;    where  a&lt;SUB&gt;pspid = itparm-pspid "or e&lt;/SUB&gt;stat = itparm-psy )&lt;/P&gt;&lt;P&gt;    or  b&lt;SUB&gt;posid = itparm-posid "or e&lt;/SUB&gt;stat = itparm-wsy )&lt;/P&gt;&lt;P&gt;    or  c&lt;SUB&gt;aufnr = itparm-aufnr "or e&lt;/SUB&gt;stat = itparm-nsy  )&lt;/P&gt;&lt;P&gt;    and ( d&lt;SUB&gt;inact  'X' or e&lt;/SUB&gt;inact  'X')&lt;/P&gt;&lt;P&gt;    and f&lt;SUB&gt;spras = 'E' and g&lt;/SUB&gt;spras = 'E'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028298#M1348863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T03:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028299#M1348864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks  Frisoni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used  INTO CORRESPONDIG FIELDS OF.. i declare the internal table as i declare in the select statement.&lt;/P&gt;&lt;P&gt;Thanks you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:21:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028299#M1348864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-17T03:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement where have 2 same field type.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028300#M1348865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SOLUTION 1.: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select
    a~pspnr a~stspr a~objnr a~pspid
    b~psphi b~posid
    c~aufnr c~pspel
    d~inact d~stat
    e~udate e~usnam e~utime  g~estat
    F~TXT04 G~TXT04
INTO TABLE  itobj.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOLUTION 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;a~pspnr a~stspr a~objnr a~pspid
    b~psphi b~posid
    c~aufnr c~pspel
    d~inact d~stat
    e~udate e~usnam e~utime "e~stat
   F~TXT04
    g~estat
    G~TXT04 as USTXT04
into corresponding fields of ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 03:24:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-where-have-2-same-field-type/m-p/6028300#M1348865</guid>
      <dc:creator>daixiong_jiang3</dc:creator>
      <dc:date>2009-08-17T03:24:05Z</dc:date>
    </item>
  </channel>
</rss>

