<?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 query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845681#M1318784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you pass values directly, you need to pass the exact size of the field. For Ex: you need to append few leading zeroes as I can see only 8 digits in ur matnr. Similarly check for other fields also from your WHERE clause and then try again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since ur have the field selection in the same order of your internal table, you dont use INTO CORRESPONDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Jun 2009 15:11:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-21T15:11:28Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845676#M1318779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT matnr&lt;/P&gt;&lt;P&gt;          VKORG&lt;/P&gt;&lt;P&gt;          TRVOG&lt;/P&gt;&lt;P&gt;          AUDAT&lt;/P&gt;&lt;P&gt;          VTWEG&lt;/P&gt;&lt;P&gt;          SPART&lt;/P&gt;&lt;P&gt;          AUART&lt;/P&gt;&lt;P&gt;          KUNNR&lt;/P&gt;&lt;P&gt;          VKBUR&lt;/P&gt;&lt;P&gt;          VKGRP&lt;/P&gt;&lt;P&gt;          BSTNK&lt;/P&gt;&lt;P&gt;          ERNAM&lt;/P&gt;&lt;P&gt;          VBELN&lt;/P&gt;&lt;P&gt;          POSNR&lt;/P&gt;&lt;P&gt;          FROM vapma INTO&lt;/P&gt;&lt;P&gt;                 CORRESPONDING FIELDS of TABLE i_vapma&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                WHERE matnr = wa_input_bdc-matnr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 WHERE matnr = '10290554'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                AND   vkorg = p_vkorg&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 AND   vkorg = '0300'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                AND   trvog = v_trvog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 AND   trvog = '4'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                AND   vtweg = p_vtweg&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                  AND   vtweg = '90'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             AND   spart = p_spart.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 AND   spart = '67'.&lt;/P&gt;&lt;P&gt;above select query is not working....is any syntax error in this...&lt;/P&gt;&lt;P&gt;my internal table declared as :&lt;/P&gt;&lt;P&gt;data : begin of i_vapma occurs 0,&lt;/P&gt;&lt;P&gt;        matnr like vapma-matnr,&lt;/P&gt;&lt;P&gt;        VKORG like vapma-vkorg,&lt;/P&gt;&lt;P&gt;TRVOG like vapma-trvog,&lt;/P&gt;&lt;P&gt;AUDAT like vapma-audat,&lt;/P&gt;&lt;P&gt;VTWEG like vapma-vtweg,&lt;/P&gt;&lt;P&gt;SPART like vapma-spart,&lt;/P&gt;&lt;P&gt;AUART like vapma-auart,&lt;/P&gt;&lt;P&gt;KUNNR like vapma-kunnr,&lt;/P&gt;&lt;P&gt;VKBUR like vapma-vkbur,&lt;/P&gt;&lt;P&gt;VKGRP like vapma-vkgrp,&lt;/P&gt;&lt;P&gt;BSTNK like vapma-bstnk,&lt;/P&gt;&lt;P&gt;ERNAM like vapma-ernam,&lt;/P&gt;&lt;P&gt;VBELN like vapma-vbeln,&lt;/P&gt;&lt;P&gt;POSNR like vapma-posnr,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       kunnr like vapma-kunnr,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       end of i_vapma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 13:14:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845676#M1318779</guid>
      <dc:creator>former_member515329</dc:creator>
      <dc:date>2009-06-21T13:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845677#M1318780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance sake, remove CORRESPONDING FIELDS OF from your select query. Coming to your ques, please let us know what is the error you are getting? Incase it is not selecting any values into i_vapma itab, goto the database table VAPMA in se11 and try executing it with the values you are passing in the WHERE clause. Check if the values actually exist.&lt;/P&gt;&lt;P&gt;Do let me know incase the problem persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Harsh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 13:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845677#M1318780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-21T13:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845678#M1318781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have removed corresponding fields...i have checked in se11 it has around 200 entries...i m getting no error..but when i goto debug mode..after select query sy-subrc is 4 ...and no values r there in i_vapma table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 13:33:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845678#M1318781</guid>
      <dc:creator>former_member515329</dc:creator>
      <dc:date>2009-06-21T13:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845679#M1318782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ur query looks ok.,.. and had  it been a sytax error u cud have got an error while activating it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ways....&lt;/P&gt;&lt;P&gt;i guess ur select statement is not giving back any value.. if so then... pass the same values to the se16 in the  table n see u have entries corresponding to it or not..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i guess the values u are passing in where can be wrong.. loke '0300' in place of '300' etc... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and DO NOT USE " into correspoding fields" .. directly use "into table"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see... actually few fields have converstion routine to add the starting zeros and few have not,,,, so please check accordingly..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: soumya prakash mishra on Jun 21, 2009 3:37 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 13:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845679#M1318782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-21T13:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845680#M1318783</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;Please check the value which you have passed in where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Befor passing MATNR value use FM 'Conversion_exit' to get the leading 0 for the material number, similary check for the remaining feilds in where clause. Check the conversion routine for every field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this may be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 13:42:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845680#M1318783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-21T13:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845681#M1318784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you pass values directly, you need to pass the exact size of the field. For Ex: you need to append few leading zeroes as I can see only 8 digits in ur matnr. Similarly check for other fields also from your WHERE clause and then try again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since ur have the field selection in the same order of your internal table, you dont use INTO CORRESPONDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2009 15:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845681#M1318784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-21T15:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845682#M1318785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this once...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you Select Statement "Remove Corresponding Fields of (Not necessary Since Same Struce as Internal Table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : P_MATNR TYPE MARA-MATNR.

P_MATNR = '10290554'.
*Debug from here and see p_matnr what happens after the function module
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT  = P_MATNR
  IMPORTING
    OUTPUT = P_MATNR.

SELECT MATNR
VKORG
TRVOG
AUDAT
VTWEG
SPART
AUART
KUNNR
VKBUR
VKGRP
BSTNK
ERNAM
VBELN
POSNR
FROM VAPMA INTO
TABLE I_VAPMA "Remove Corresponding Fields of
WHERE MATNR = '000000000010290554' "Pass the leading 0's Total should be 18 chars Or Use P_MATNR
*WHERE MATNR = P_MATNR
AND VKORG = '0300'
AND TRVOG = '4'
AND VTWEG = '90'
AND SPART = '67'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Dileep .C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 02:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845682#M1318785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T02:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845683#M1318786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see...i have chnaged my select query...but don't know why it is not picking exact values from table vapma...pls help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--FM for Conversion Exit for Material Number&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;                input  = wa_input_bdc-matnr&lt;/P&gt;&lt;P&gt;           IMPORTING&lt;/P&gt;&lt;P&gt;                output = v_matnr1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--FM for Conversion Exit for SoldTO&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input        = wa_input_bdc-soldto&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;         OUTPUT        = v_soldto1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate sy-datum&lt;EM&gt;4(2) sy-datum&lt;/EM&gt;6(2) sy-datum+0(4) into v_dat_date&lt;/P&gt;&lt;P&gt;           separated by '/'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     SELECT matnr FROM vapma INTO TABLE i_vapma&lt;/P&gt;&lt;P&gt;                   WHERE matnr = v_matnr1&lt;/P&gt;&lt;P&gt;                   AND   vkorg = p_vkorg&lt;/P&gt;&lt;P&gt;                   AND   trvog = v_trvog&lt;/P&gt;&lt;P&gt;                   AND   vtweg = p_vtweg&lt;/P&gt;&lt;P&gt;                   AND   spart = p_spart&lt;/P&gt;&lt;P&gt;                   AND  ( auart = 'YDOL' OR auart = 'YDCL'&lt;/P&gt;&lt;P&gt;                   OR     auart = 'YDSC' OR auart = 'YDPC' )&lt;/P&gt;&lt;P&gt;                   AND   kunnr = v_soldto1&lt;/P&gt;&lt;P&gt;                   AND   datab &amp;lt;= '06/24/2009' "v_dat_date&lt;/P&gt;&lt;P&gt;                   AND   datbi &amp;gt;= '06/24/2009'."v_dat_date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 23:52:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845683#M1318786</guid>
      <dc:creator>former_member515329</dc:creator>
      <dc:date>2009-06-24T23:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845684#M1318787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I m having doubt in this last 2 fields..&lt;/P&gt;&lt;P&gt;AND datab &amp;lt;= '06/24/2009' "v_dat_date&lt;/P&gt;&lt;P&gt;AND datbi &amp;gt;= '06/24/2009'."v_dat_date.&lt;/P&gt;&lt;P&gt;if i comment these..then i m getting the correct ouput...is this correct way of giving the date..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 00:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845684#M1318787</guid>
      <dc:creator>former_member515329</dc:creator>
      <dc:date>2009-06-25T00:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845685#M1318788</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;AND datab &amp;lt;= '20090624' "v_dat_date&lt;/P&gt;&lt;P&gt;AND datbi &amp;gt;= '20090624'."v_dat_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar Bandanadham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 03:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845685#M1318788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-25T03:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845686#M1318789</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;/P&gt;&lt;P&gt;When you are not sure as to how you pass your date format, do a debugging on your sy-datum and check the format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should have been&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND datab &amp;lt;= '20090624' .  "v_dat_date&lt;/P&gt;&lt;P&gt;AND datbi &amp;gt;= '20090624'.    "v_dat_date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 04:25:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845686#M1318789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-25T04:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845687#M1318790</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;use this select query....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mandt 
matnr 
FROM vapma 
INTO TABLE i_vapma
WHERE matnr = v_matnr1
AND vkorg = p_vkorg
AND trvog = v_trvog
AND vtweg = p_vtweg
AND spart = p_spart
AND ( auart = 'YDOL' OR auart = 'YDCL'
OR auart = 'YDSC' OR auart = 'YDPC' )
AND kunnr = v_soldto1
AND datab &amp;lt;= sy-datum "v_dat_date
AND datbi &amp;gt;= sy-datum. "v_dat_date.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 04:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5845687#M1318790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-25T04:40:28Z</dc:date>
    </item>
  </channel>
</rss>

