<?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: Initialization in SAP Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114923#M1362879</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;If you are working in T.Code :SQVI, then it is not possible.&lt;/P&gt;&lt;P&gt;If you are working with SQ01, SQ02., You can do this in SQ02.&lt;/P&gt;&lt;P&gt;Through Menu Option there, use GOTO --&amp;gt; Code --&amp;gt;&lt;/P&gt;&lt;P&gt;Here you can create some code and intitilize the value for material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;ANil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2009 09:48:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-10T09:48:29Z</dc:date>
    <item>
      <title>Initialization in SAP Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114921#M1362877</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 have created a SAP query with MSEG as one of the tables. I am using MATNR of MSEG.&lt;/P&gt;&lt;P&gt;I need to initialize the values of material before query is executed. Filter is based on one of the Characteristic which can not be done using variants. I could see there is an option to write code in dirrerent events of Report e.g. Initialization, Start-Of-Selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I selected the required materials in an internal tables in INITIALIZATION event. How can i pass these materials as default in Select-Option of MSEG-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 19:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114921#M1362877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T19:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Initialization in SAP Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114922#M1362878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the infoset, you will find the &lt;STRONG&gt;selection-screen field NAMES&lt;/STRONG&gt; in the SELECTIONS tab, at left of the CODE tab. Use the NAME of the field you want to default in the code of the INITIALIZATION event. Example : if your field has name XX and its type is selection criteria ("SelCrit"), if you want to default it to values AAA or BBB, then add this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
XX-sign = 'I'.
XX-option = 'EQ'.
XX-low = 'AAA'.
APPEND XX.
XX-low = 'BBB'.
APPEND XX.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2009 09:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114922#M1362878</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-09-10T09:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Initialization in SAP Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114923#M1362879</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;If you are working in T.Code :SQVI, then it is not possible.&lt;/P&gt;&lt;P&gt;If you are working with SQ01, SQ02., You can do this in SQ02.&lt;/P&gt;&lt;P&gt;Through Menu Option there, use GOTO --&amp;gt; Code --&amp;gt;&lt;/P&gt;&lt;P&gt;Here you can create some code and intitilize the value for material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;ANil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2009 09:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114923#M1362879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-10T09:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Initialization in SAP Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114924#M1362880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*---Authorization for Company code entered by the users.
*---This code will restrict users to see data for company
*---codes which they are not authorized to.

*---Select all the company codes based upon selection entered by the
*---user

 SELECT bukrs
   FROM t001
   INTO TABLE li_bukrs
  WHERE bukrs IN z_bukrs.


 IF sy-subrc EQ 0.

*---Clear Screen variable for Company code
   CLEAR z_bukrs.
   REFRESH z_bukrs.

*---Filter and prepare Select options for Company code table to be
*---passed to query. Table will only have values of company codes he is
*---authorized to for display.

   LOOP AT li_bukrs INTO lwa_bukrs.

     AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
                       ID 'BUKRS' FIELD lwa_bukrs
                       ID 'ACTVT' FIELD '03'.

     IF sy-subrc = 0.
       z_bukrs-sign = 'I'.
       z_bukrs-option = 'EQ'.
       z_bukrs-low = lwa_bukrs.
       z_bukrs-high = space.
       APPEND z_bukrs.
     ELSE.
       lv_flag = 'X'.
     ENDIF.

   ENDLOOP.
*---Give warning message to the user in case he is not authorized to see
*---data for all the company codes that he has entered.

   IF lv_flag = 'X'.
     MESSAGE ID 'ZF_MSS_FNG' TYPE 'W' NUMBER '015'.
   ENDIF.

 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just make sure that Z_BUKRS field is available in selection tab.&lt;/P&gt;&lt;P&gt;Also, declare below mentioned variables in INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: li_bukrs TYPE TABLE OF bukrs,
       lwa_bukrs TYPE bukrs,
       lv_flag TYPE c.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Jaideep,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2009 10:08:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/initialization-in-sap-query/m-p/6114924#M1362880</guid>
      <dc:creator>jaideepsharma</dc:creator>
      <dc:date>2009-09-10T10:08:02Z</dc:date>
    </item>
  </channel>
</rss>

