<?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: select single problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229362#M1208874</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;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: MSEG, MAKT.

DATA: BEGIN OF IT_MSEG OCCURS 0,
        MATNR LIKE MSEG-MATNR,
      END OF IT_MSEG.

SELECT-OPTIONS: S_MATNR FOR MSEG-MATNR.

SELECT MATNR FROM MSEG INTO TABLE IT_MSEG WHERE MATNR IN S_MATNR.

LOOP AT IT_MSEG.

SELECT SINGLE MAKTX FROM MAKT INTO MAKT-MAKTX
WHERE MAKT~MATNR = IT_MSEG-MATNR
 AND MAKT~SPRAS = 'EN'.

WRITE:/ MAKT-MAKTX.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks\&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 06:54:25 GMT</pubDate>
    <dc:creator>former_member222860</dc:creator>
    <dc:date>2009-02-23T06:54:25Z</dc:date>
    <item>
      <title>select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229352#M1208864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to retrieve single makt-maktx  value from makt &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where makt-matnr = mseg-matnr &lt;/P&gt;&lt;P&gt;and makt-spras = 'EN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for all entries not allowed in case of select single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how can I fetched makt-maktx for the above condition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;even if i use read statement, how to use the above conditions?can anybody please help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229352#M1208864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229353#M1208865</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 use join for this.&lt;/P&gt;&lt;P&gt; SELECT single maktx&lt;/P&gt;&lt;P&gt;into wf_maktx&lt;/P&gt;&lt;P&gt;         FROM makt AS a INNER JOIN mseg AS b&lt;/P&gt;&lt;P&gt;           ON b&lt;SUB&gt;matnr = a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;          AND b~spras = 'EN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Lokesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Lokesh Tripathi on Feb 23, 2009 7:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:37:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229353#M1208865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229354#M1208866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TEST THE SAMOLE CODE&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: makt , mseg.

data: BEGIN OF it OCCURS 10,
      matnr like mseg-matnr,
      maktx like makt-maktx,
      end of it.

     select makt~maktx mseg~matnr into CORRESPONDING FIELDS OF TABLE IT
       FROM MAKT
       inner join mseg on ( makt~matnr = mseg~matnr )
      WHERE MAKT~SPRAS = 'EN'.              
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: tahir naqqash on Feb 23, 2009 11:38 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229354#M1208866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229355#M1208867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I would suggest to use the function module ISM_SD_SELECT_MAKT&lt;/P&gt;&lt;P&gt;and it would an internal table as export parameter, this internal table should be put under the loop and the rest condition you can under this loop and then move the final data into another table.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shashi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229355#M1208867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229356#M1208868</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;  Select single is for a single value and you are retrieving single value, and you cannot use for all enries in select single, so there is no point of using for all entries in this case, if you want to use for all entries you have to take a internal table not a single field. Like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select matnr 
  from makt
  into table t_itab1 for all entries 
     in t_itab2
where matnr = t_itab2-matnr
*   and makt-matnr = mseg-matnr 
   and makt-spras = 'EN'.&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;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pritam Ghosh on Feb 23, 2009 7:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:41:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229356#M1208868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229357#M1208869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * not working for ALL ENTRIES.&lt;/P&gt;&lt;P&gt;use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select single * from makt where matnr = mseg-matnr and spras = 'EN'.
if sy-subrc = 0.
  name = makt-maktx.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229357#M1208869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229358#M1208870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many materials are you picking up from table MSEG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming multiple material will be picked up from table MSEG you'll need to get the description of each material hence SELECT SINGLE... wouldn't solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use SELECT SINGLE... it implies only one record is fetched at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When description of multiple materials are to be fetched obviously it should be quried in the below way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt; MATNR&lt;/P&gt;&lt;P&gt;                MAKTX&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;FROM&lt;/STRONG&gt; MAKT&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;INTO TABLE&lt;/STRONG&gt;   TBL_MAKT  "Table containing fields matnr, maktx&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;FOR ALL ENTRIES IN&lt;/STRONG&gt; TBL_MSEG&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;WHERE&lt;/STRONG&gt; MATNR &lt;STRONG&gt;EQ&lt;/STRONG&gt; TBL_MSEG-MATNR&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;AND&lt;/STRONG&gt;   SPRAS &lt;STRONG&gt;EQ&lt;/STRONG&gt; 'EN'.&lt;/P&gt;&lt;P&gt;&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;Regards,&lt;/P&gt;&lt;P&gt;Farheen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229358#M1208870</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229359#M1208871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to retrieve a single maktx(material description) for a particular material number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am trying to retrieve single maktx only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229359#M1208871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229360#M1208872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select maktx  into var_maktx  " var_maktx is variable jusr like maktx
       FROM MAKT
       
      WHERE SPRAS = 'EN'
       and matnr = '12345' .      
endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:53:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229360#M1208872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229361#M1208873</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;Let say you have data in itab_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take this data into temp_mseg data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp_mseg[] = itab_mseg[] .&lt;/P&gt;&lt;P&gt;sort temp_mseg by matnr.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from temp_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr&lt;/P&gt;&lt;P&gt;          maktx&lt;/P&gt;&lt;P&gt;    into table itab_makt&lt;/P&gt;&lt;P&gt;    for all entries in temp_mseg&lt;/P&gt;&lt;P&gt;   from makt&lt;/P&gt;&lt;P&gt; where matnr eq temp_makt-matnr&lt;/P&gt;&lt;P&gt;    and spras eq 'EN'   -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; u can take sy-langu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;   sort itab_makt by matnr. &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;Then when u want to read , use as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let say ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab_makt with key matnr = itab_mseg-matnr binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;use MAKTX.....&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;write : \1(40) itab_makt-maktx .&lt;/P&gt;&lt;P&gt;endif.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229361#M1208873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T06:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229362#M1208874</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;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: MSEG, MAKT.

DATA: BEGIN OF IT_MSEG OCCURS 0,
        MATNR LIKE MSEG-MATNR,
      END OF IT_MSEG.

SELECT-OPTIONS: S_MATNR FOR MSEG-MATNR.

SELECT MATNR FROM MSEG INTO TABLE IT_MSEG WHERE MATNR IN S_MATNR.

LOOP AT IT_MSEG.

SELECT SINGLE MAKTX FROM MAKT INTO MAKT-MAKTX
WHERE MAKT~MATNR = IT_MSEG-MATNR
 AND MAKT~SPRAS = 'EN'.

WRITE:/ MAKT-MAKTX.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks\&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 06:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229362#M1208874</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-02-23T06:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: select single problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229363#M1208875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and if you want to retrieve single maktx only, you have to do it in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Data:
  Begin of fs_itab,
    matnr type matnr,
  End of fs_itab.

Data:
  t_itab like standard table of fs_itab.
Data:
  wa_matnr type matnr.
  
Data:
  w_index type i value 1,
  w_lines type i.

Select matnr from mseg into table t_itab.

Describe table t_itab lines w_lines.

While w_index le w_lines.

Read table t_itab into fs_itab index w_index.

Select single maktx
  from makt
  into wa_matnr
 where matnr = fs_itab-matnr
   and spras = 'EN'.

If sy-subrc &amp;lt;&amp;gt; 0.
Endif.

w_index = w_index + 1.

Endwhile.&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;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pritam Ghosh on Feb 23, 2009 8:11 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 07:09:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-problem/m-p/5229363#M1208875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T07:09:49Z</dc:date>
    </item>
  </channel>
</rss>

