<?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: lopp and select problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708894#M310253</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 to do like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;IF itab-action &amp;lt;&amp;gt; 'y1'&lt;/P&gt;&lt;P&gt;and itab-action &amp;lt;&amp;gt; 'y2'&lt;/P&gt;&lt;P&gt;and itab-action &amp;lt;&amp;gt;'y3'.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;append contents of itab to aothet internal table(in_itab)with same structure of itab.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM t542a&lt;/P&gt;&lt;P&gt;into table it_job&lt;/P&gt;&lt;P&gt;for all entries in in_itab.&lt;/P&gt;&lt;P&gt;WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;AND ansvh = in_itab-contract&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and same with other selects....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Nov 2006 09:34:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-02T09:34:29Z</dc:date>
    <item>
      <title>lopp and select problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708893#M310252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i wont to do a report of &amp;lt;b&amp;gt;list of error&amp;lt;/b&amp;gt; and i put in itab the value in the call function.(see the function) my problem is that i dont now how to do the loop and the select that i can select values from itab where the if statment (y1,y2,y3) to be valid and i do the select and put it in other record.&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF file_ser IS INITIAL.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    CODEPAGE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       filename                      = l_name&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    FILETYPE                      = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    HEADLEN                       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    LINE_EXIT                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    TRUNCLEN                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    USER_FORM                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    USER_PROG                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    DAT_D_FORMAT                  = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    FILELENGTH                    =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        data_tab                      = itab&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;       conversion_error              = 1&lt;/P&gt;&lt;P&gt;       file_open_error               = 2&lt;/P&gt;&lt;P&gt;       file_read_error               = 3&lt;/P&gt;&lt;P&gt;       invalid_type                  = 4&lt;/P&gt;&lt;P&gt;       no_batch                      = 5&lt;/P&gt;&lt;P&gt;       unknown_error                 = 6&lt;/P&gt;&lt;P&gt;       invalid_table_width           = 7&lt;/P&gt;&lt;P&gt;       gui_refuse_filetransfer       = 8&lt;/P&gt;&lt;P&gt;       customer_error                = 9&lt;/P&gt;&lt;P&gt;       no_authority                  = 10&lt;/P&gt;&lt;P&gt;       OTHERS                        = 11&lt;/P&gt;&lt;P&gt;              .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    OPEN DATASET file_ser IN TEXT MODE&lt;/P&gt;&lt;P&gt;       ENCODING DEFAULT FOR INPUT.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e002(yhr)  .&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;      READ DATASET file_ser INTO wa_itab.&lt;/P&gt;&lt;P&gt;      IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      APPEND wa_itab TO itab.&lt;/P&gt;&lt;P&gt;    ENDDO.&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;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR wa_itab.&lt;/P&gt;&lt;P&gt;  LOOP AT itab INTO wa_itab.&lt;/P&gt;&lt;P&gt;    IF wa_itab-action = 'y1'&lt;/P&gt;&lt;P&gt;    OR wa_itab-action = 'y2'&lt;/P&gt;&lt;P&gt;    OR wa_itab-action = 'y3'.&lt;/P&gt;&lt;P&gt;    ENDIF.&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;  SELECT * &lt;/P&gt;&lt;P&gt;  FROM t542a&lt;/P&gt;&lt;P&gt;  WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;  AND ansvh = wa_itab-contract.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; append itab_job.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * &lt;/P&gt;&lt;P&gt;  FROM t0001p&lt;/P&gt;&lt;P&gt;  WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;  AND werks = wa_itab-personnel_area&lt;/P&gt;&lt;P&gt;  AND btrtl = wa_itab-personnel_subarea.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  select * &lt;/P&gt;&lt;P&gt;  from hrp 1000 &lt;/P&gt;&lt;P&gt;  where otype ='s'&lt;/P&gt;&lt;P&gt;  and plans = wa_itab-plans.&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;&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;ENDSELECT.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 09:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708893#M310252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T09:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: lopp and select problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708894#M310253</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 to do like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;IF itab-action &amp;lt;&amp;gt; 'y1'&lt;/P&gt;&lt;P&gt;and itab-action &amp;lt;&amp;gt; 'y2'&lt;/P&gt;&lt;P&gt;and itab-action &amp;lt;&amp;gt;'y3'.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;append contents of itab to aothet internal table(in_itab)with same structure of itab.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM t542a&lt;/P&gt;&lt;P&gt;into table it_job&lt;/P&gt;&lt;P&gt;for all entries in in_itab.&lt;/P&gt;&lt;P&gt;WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;AND ansvh = in_itab-contract&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and same with other selects....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 09:34:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708894#M310253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T09:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: lopp and select problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708895#M310254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR wa_itab.&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa_itab where wa_itab-action = 'y1'&lt;/P&gt;&lt;P&gt;                             OR wa_itab-action = 'y2'&lt;/P&gt;&lt;P&gt;                             OR wa_itab-action = 'y3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM t542a&lt;/P&gt;&lt;P&gt;*into wa_t542a   or into table i_t542a&lt;/P&gt;&lt;P&gt;WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;AND ansvh = wa_itab-contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM t0001p&lt;/P&gt;&lt;P&gt;*into wa_t0001p  or into table i_t0001p&lt;/P&gt;&lt;P&gt;WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;AND werks = wa_itab-personnel_area&lt;/P&gt;&lt;P&gt;AND btrtl = wa_itab-personnel_subarea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from hrp 1000 &lt;/P&gt;&lt;P&gt;*into wa_hrp 1000  or into table i_hrp 1000&lt;/P&gt;&lt;P&gt;where otype ='s'&lt;/P&gt;&lt;P&gt;and plans = wa_itab-plans.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if this Helps.&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Manish Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 09:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708895#M310254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T09:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: lopp and select problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708896#M310255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. get yr itab first.&lt;/P&gt;&lt;P&gt;2. loop at itab.&lt;/P&gt;&lt;P&gt;    check condition. &lt;/P&gt;&lt;P&gt;      get values into itab2.&lt;/P&gt;&lt;P&gt;      apend itab2.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. use for all entries from itab2 and get the records like&lt;/P&gt;&lt;P&gt;   if not itab2[] is initial.&lt;/P&gt;&lt;P&gt;      SELECT * &lt;/P&gt;&lt;P&gt;      FROM t542a&lt;/P&gt;&lt;P&gt;      into table itab_job&lt;/P&gt;&lt;P&gt;      for all entries in itab2&lt;/P&gt;&lt;P&gt;      WHERE molga ='IL'&lt;/P&gt;&lt;P&gt;       AND ansvh = itab2-contract.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note- using select statements in loop is not advisable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Anu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anupama Reddy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2006 09:52:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lopp-and-select-problem/m-p/1708896#M310255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-02T09:52:46Z</dc:date>
    </item>
  </channel>
</rss>

