<?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: problem with selection option in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623325#M1280709</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;Try this one ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM process_data USING p1_it_summu TYPE ty_t_summu
CHANGING p1_it_outdata TYPE ty_t_outdata.

LOOP AT p1_it_summu INTO wa_summu
WHERE entry_id IN s_tcode
and account in s_empl.

MOVE wa_summu-account TO wa_outdata-account.
MOVE wa_summu-entry_id TO wa_outdata-tcode.

*append wa_outdata to p1_it_outdata.*
 *clear wa_outdata.*

ENDLOOP. " LOOP AT IT_SUMMU
ENDFORM. " FORM PROCESS_DATA&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;Thanks&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 16:47:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-20T16:47:40Z</dc:date>
    <item>
      <title>problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623323#M1280707</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;I am working on a program where I want to have the user enter options and then loop thru a internal table using these options to process the data.the options are the user id and the t-code. I can get the user id to work but I am having problems with the t-code option. The only way that I can get the values to work in my selection process is to code in the ranges tab. If I enter a single t-code or a list of t-codes, this does not work. it does work for the user id field. I can do single selects, ranges, and selects using lists of users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what I I am doing wrong.&lt;/P&gt;&lt;P&gt;I have attached a portion of the code that highlights the process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone could take a look at this and let me know if there is something that I am missing or have coded wrong, that would be a big help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: tstct,&lt;/P&gt;&lt;P&gt;        usr02.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Structure for select options of bukrs(Company Code)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TYPES: BEGIN OF ty_tcode,&lt;/P&gt;&lt;P&gt;       sign(1)   TYPE c,&lt;/P&gt;&lt;P&gt;       option(2) TYPE c,&lt;/P&gt;&lt;P&gt;       low       TYPE tstct-tcode,&lt;/P&gt;&lt;P&gt;       high      TYPE tstct-tcode,&lt;/P&gt;&lt;P&gt;       END OF ty_tcode,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Structure for select options of lifnr(Vendor Number)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       BEGIN OF ty_empl,&lt;/P&gt;&lt;P&gt;       sign(1)   TYPE c,&lt;/P&gt;&lt;P&gt;       option(2) TYPE c,&lt;/P&gt;&lt;P&gt;       low       TYPE xubname,&lt;/P&gt;&lt;P&gt;       high      TYPE xubname,&lt;/P&gt;&lt;P&gt;       END OF ty_empl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_tcode for tstct-tcode,   " Transaction code&lt;/P&gt;&lt;P&gt;                s_empl  FOR usr02-bname.   " Vendor Number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM process_data USING   it_summu[]&lt;/P&gt;&lt;P&gt;                       CHANGING it_outdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; FORM process_data USING   p1_it_summu   TYPE ty_t_summu&lt;/P&gt;&lt;P&gt;                  CHANGING p1_it_outdata TYPE ty_t_outdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT p1_it_summu INTO wa_summu&lt;/P&gt;&lt;P&gt;     WHERE entry_id IN  s_tcode&lt;/P&gt;&lt;P&gt;       and account  in s_empl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE wa_summu-account       TO wa_outdata-account.&lt;/P&gt;&lt;P&gt;      MOVE wa_summu-entry_id      TO wa_outdata-tcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP. " LOOP AT IT_SUMMU&lt;/P&gt;&lt;P&gt;ENDFORM. " FORM PROCESS_DATA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 16:33:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623323#M1280707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623324#M1280708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks quite OK, however, you are comparing field 'entry_id' with s_tcode. Do these types differ? Has the field 'entry_id' the same type as s_tcode (CHAR20)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, it might be a good idea to post the whole code in here. Make sure you put this code in between &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; &amp;amp; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; for better formatting and that it does not exceed 2500 (or was it 5000) characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 16:44:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623324#M1280708</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-05-20T16:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623325#M1280709</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;Try this one ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM process_data USING p1_it_summu TYPE ty_t_summu
CHANGING p1_it_outdata TYPE ty_t_outdata.

LOOP AT p1_it_summu INTO wa_summu
WHERE entry_id IN s_tcode
and account in s_empl.

MOVE wa_summu-account TO wa_outdata-account.
MOVE wa_summu-entry_id TO wa_outdata-tcode.

*append wa_outdata to p1_it_outdata.*
 *clear wa_outdata.*

ENDLOOP. " LOOP AT IT_SUMMU
ENDFORM. " FORM PROCESS_DATA&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;Thanks&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 16:47:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623325#M1280709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T16:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623326#M1280710</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;Try like below code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
 TABLES: tstct,
         usr02.

data : BEGIN OF t_tcode occurs 0,
               tcode     TYPE tstct-tcode,
           END OF t_tcode,
 *      Structure for select options of lifnr(Vendor Number)
        BEGIN OF t_empl occurs 0,
          bname       TYPE xubname,
        END OF t_empl,

 
 SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
 
 SELECT-OPTIONS: s_tcode for tstct-tcode,   " Transaction code
                 s_empl  FOR usr02-bname.   " Vendor Number

 SELECTION-SCREEN END OF BLOCK a.
 
Start-of-selection

select tcode from tstc into table t_tcode where tcode in s_tcode.       "add this
select bname from user02 into table t_empl where bname in s_empl.   "add this



     PERFORM process_data USING   it_summu[]
                        CHANGING it_outdata.
 
 
  FORM process_data USING   p1_it_summu   TYPE ty_t_summu
                   CHANGING p1_it_outdata TYPE ty_t_outdata.
 
   LOOP AT p1_it_summu INTO wa_summu.

      read table t_code with key tcode = wa_summu-entry_id binary search.
       if sy-subrc = 0.
          MOVE wa_summu-entry_id      TO wa_outdata-tcode.
       
      read table t_empl  with key bname = wa_summu-account binary search.
       if sy-subrc = 0.
       MOVE wa_summu-account       TO wa_outdata-account.
         append wa_outdata to t_outdata.
      endif.
  
    endif.
   ENDLOOP. " LOOP AT IT_SUMMU
 ENDFORM. " FORM PROCESS_DATA

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhduas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 16:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623326#M1280710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T16:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623327#M1280711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prabhduas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the code. I tried it  and it is working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is happening is that the summu table contains data from the FM SAPWL_WORKLOAD_GET_STATISTIC. this data is the data that is displayed when you do a ST03N transaction. what is happening is that when the t-code is being checked, it is not selecting some of the t-codes that are showing up on a ST03N display because these are not in the TSTC table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:02:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623327#M1280711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T18:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623328#M1280712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are missing append statement in the loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT p1_it_summu INTO wa_summu.
....
....
Move.....
append wa_output to i_output "&amp;lt;&amp;lt;&amp;lt;&amp;lt;
ENDLOOP. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623328#M1280712</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-05-20T18:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with selection option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623329#M1280713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the program working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks to all for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 11:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-selection-option/m-p/5623329#M1280713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-21T11:59:49Z</dc:date>
    </item>
  </channel>
</rss>

