<?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: Function module for table SWWWIHEAD in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273735#M1530494</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;I need the second select also,Please look at the query again .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Darshana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Sep 2010 10:55:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-20T10:55:55Z</dc:date>
    <item>
      <title>Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273731#M1530490</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 want to use the table &lt;STRONG&gt;SWWWIHEAD&lt;/STRONG&gt; (2 times in my program).&lt;/P&gt;&lt;P&gt;The requirment is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select data (ie WI_CHCKWI,higher level item)&lt;/P&gt;&lt;P&gt;from SWWWIHEAD&lt;/P&gt;&lt;P&gt;where WI_RH_TASK = 'TS90000007' &amp;amp;&lt;/P&gt;&lt;P&gt;WI_STAT = u2018COMPLETEDu2019 &amp;amp;&lt;/P&gt;&lt;P&gt;WI_AED = date entered on selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select data &lt;/P&gt;&lt;P&gt;from SWWWIHEAD&lt;/P&gt;&lt;P&gt;where WI_CHCKWI = WI_CHCKWI-found from above select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me with the &lt;STRONG&gt;function module&lt;/STRONG&gt;, so that there will not be any performance issues in future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Darshana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 10:04:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273731#M1530490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T10:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273732#M1530491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 10:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273732#M1530491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273733#M1530492</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;&lt;STRONG&gt;First select return me the 'Higher level item' (ie WI_CHCKWI)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and second one will retrun me the data (ie i need to evaluate the status depending on some tasks) &lt;STRONG&gt;corresponding to that higher level item (ie WI_CHCKWI).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Darshana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 10:36:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273733#M1530492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T10:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273734#M1530493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select data into table IT_TAB&lt;/P&gt;&lt;P&gt;from SWWWIHEAD &lt;/P&gt;&lt;P&gt;where WI_RH_TASK = 'TS90000007' &amp;amp;&lt;/P&gt;&lt;P&gt;WI_STAT = u2018COMPLETEDu2019 &amp;amp;&lt;/P&gt;&lt;P&gt;WI_AED = date entered on selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass WI_CHCKWI to WI_CHCKWI in second select statement you will get same info.&lt;/P&gt;&lt;P&gt;The table will return the required data for you. Just check it . If my understanding is correct, I am sure you don't require 2nd select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 10:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273734#M1530493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T10:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273735#M1530494</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;I need the second select also,Please look at the query again .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Darshana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 10:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273735#M1530494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T10:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273736#M1530495</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 don't think so there is a FM for the logic you have given, FYI you can check on this    SWW_WI*   in se37 ,&lt;/P&gt;&lt;P&gt;if u havent checked. If you find any FM Please do share with us , as iam developing a report on workflow&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 11:11:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273736#M1530495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T11:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273737#M1530496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your requirement is to get details of only Superordinate Work Item if it exists, may be after the following select statement you can delete entries from internal table.&lt;/P&gt;&lt;P&gt;select data into table IT_TAB&lt;/P&gt;&lt;P&gt;from SWWWIHEAD &lt;/P&gt;&lt;P&gt;where WI_RH_TASK = 'TS90000007' &amp;amp;&lt;/P&gt;&lt;P&gt;WI_STAT = u2018COMPLETEDu2019 &amp;amp;&lt;/P&gt;&lt;P&gt;WI_AED = date entered on selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete it_tab where WI_CHCKWI IS INITIAL. Will it help you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 12:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273737#M1530496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T12:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273738#M1530497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;SAP_WAPI_WORKITEMS_TO_OBJECT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 12:44:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273738#M1530497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-20T12:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273739#M1530498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Instead of two select query, just get all the required data in an internal table IT_SWWIHEAD and copied that to a another temporary table IT_TEMP.You can process your logic with the new internal table IT_TEMP. At last instead of second select query you can go and pick the value from main internal table  IT_SWWIHEAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just play with internal table instead of repeated select query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 13:13:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273739#M1530498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T13:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function module for table SWWWIHEAD</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273740#M1530499</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;Please, analyse the program &lt;STRONG&gt;RSWUWFML2&lt;/STRONG&gt;, find a perform statement &lt;STRONG&gt;select_workitems&lt;/STRONG&gt;. In my system it is line 623.&lt;/P&gt;&lt;P&gt;This program is very efficient as it reads this table to send notifications on e-mail about new work items in users' inboxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM select_workitems.

* Select those workitems with the correct task, state and creation
* date and time.

************************************************************************
* The select statement encourages one of the database indices          *
* to be used. Either the task index or the status/type index.          *
* Tests show that this really does influence the database access       *
* positively.                                                          *
* This algorithm will be inefficient when tasks are excluded rather    *
* than included.                                                       *
* The combination 'Waiting' and Notification/deadline type             *
* cannot occur.                                                        *
************************************************************************
  IF task_sel[] IS INITIAL.            "No tasks
*   Use the type/status index.

    SELECT wi_id tclass
      INTO CORRESPONDING FIELDS OF TABLE lt_wi_data
      FROM swwwihead
      WHERE
         wi_type = wi_normal       AND
         wi_stat = wi_status_ready AND
         retry_cnt = '0'           AND
*        note 969538:
         crea_tmp &amp;gt; l_from_tstamp  AND
         crea_tmp &amp;lt;= l_to_tstamp.

    SELECT wi_id tclass
      APPENDING CORRESPONDING FIELDS OF TABLE lt_wi_data
      FROM swwwihead
      WHERE
         wi_type = wi_deadline     AND
         wi_stat = wi_status_ready AND
         retry_cnt = '0'           AND
*        note 969538:
         crea_tmp &amp;gt; l_from_tstamp  AND
         crea_tmp &amp;lt;= l_to_tstamp
*     note 0000790920
      %_hints
      oracle 'INDEX("&amp;amp;TABLE&amp;amp;" "SWWWIHEAD~C" "SWWWIHEAD^C" "SWWWIHEAD_C" "SWWWIHEAD_C__X")'
      DB2    'USE VALUES FOR OPTIMIZATION'
      DB2    '&amp;amp;SUBSTITUTE VALUES&amp;amp;'. "#EC CI_HINTS

*   no longer select waiting work items

  ELSE.
*   Use the task index.
    SELECT wi_id tclass
      INTO CORRESPONDING FIELDS OF TABLE lt_wi_data
      FROM swwwihead
      WHERE
        wi_rh_task IN task_sel AND
        wi_stat = wi_status_ready AND
        wi_type = wi_normal       AND
*       note 969538:
        crea_tmp &amp;gt; l_from_tstamp  AND
        crea_tmp &amp;lt;= l_to_tstamp.

*   Add all the deadline items.
    SELECT wi_id tclass
      APPENDING CORRESPONDING FIELDS OF TABLE lt_wi_data
      FROM swwwihead
      WHERE
        wi_stat = wi_status_ready AND
        wi_type = wi_deadline     AND
*       note 969538:
        crea_tmp &amp;gt; l_from_tstamp  AND
        crea_tmp &amp;lt;= l_to_tstamp
*   note 0000790920
    %_hints
    oracle 'INDEX("&amp;amp;TABLE&amp;amp;" "SWWWIHEAD~C" "SWWWIHEAD^C" "SWWWIHEAD_C" "SWWWIHEAD_C__X")'
    DB2    'USE VALUES FOR OPTIMIZATION'
    DB2    '&amp;amp;SUBSTITUTE VALUES&amp;amp;'. "#EC CI_HINTS

*   Filter out the deadline items with wrong task
    DATA: l_wi_header LIKE swwwihead.

    LOOP AT lt_wi_data.

      CLEAR l_wi_header.
      CALL FUNCTION 'SWW_WI_HEADER_READ'
        EXPORTING
          wi_id     = lt_wi_data-wi_id
        IMPORTING
          wi_header = l_wi_header
        EXCEPTIONS
          OTHERS    = 1.

      CHECK l_wi_header-wi_type = wi_deadline.

      CLEAR swwwihead.
      SELECT SINGLE * FROM swwwihead
                      WHERE wi_id = l_wi_header-wi_chckwi.

      IF NOT swwwihead-wi_rh_task IN task_sel.
        DELETE lt_wi_data.
      ENDIF.
    ENDLOOP.

  ENDIF.

ENDFORM.                    "select_workitems&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 14:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-table-swwwihead/m-p/7273740#M1530499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T14:38:53Z</dc:date>
    </item>
  </channel>
</rss>

