<?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 for single record in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209756#M473135</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;smenr is not a filed of vbak that's why it's going to dump.&lt;/P&gt;&lt;P&gt;remove that one .u will get correct output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 May 2007 06:38:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-11T06:38:43Z</dc:date>
    <item>
      <title>select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209751#M473130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am working for script which is letter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i had to extract the fields as shown in the code. from two tables i had to extract single record. and pass this values to script.i developed the code. wen i execute the code its going to dump. can any body help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : VBAK, KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : p_vbeln LIKE vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : name like kna1-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_vbak ,&lt;/P&gt;&lt;P&gt;	vbeln(10),&lt;/P&gt;&lt;P&gt;       netwr(15),&lt;/P&gt;&lt;P&gt;       bstdk(8),&lt;/P&gt;&lt;P&gt;       kunnr(10),&lt;/P&gt;&lt;P&gt;       smenr(8),&lt;/P&gt;&lt;P&gt;       end of wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_final,&lt;/P&gt;&lt;P&gt;       vbeln(10),&lt;/P&gt;&lt;P&gt;       netwr(15),&lt;/P&gt;&lt;P&gt;       bstdk(8),&lt;/P&gt;&lt;P&gt;       kunnr(10),&lt;/P&gt;&lt;P&gt;       smenr(8),&lt;/P&gt;&lt;P&gt;       name1(35),&lt;/P&gt;&lt;P&gt;       end of wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Select single vbeln&lt;/P&gt;&lt;P&gt;                     netwr&lt;/P&gt;&lt;P&gt;                     bstdk&lt;/P&gt;&lt;P&gt;                     kunnr&lt;/P&gt;&lt;P&gt;                     smenr from vbak&lt;/P&gt;&lt;P&gt;                     into wa_vbak where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Select single name1 from kna1 into name  where kunnr  =  wa_vbak-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Move wa_vbak-vbeln to wa_final-vbeln.&lt;/P&gt;&lt;P&gt;      Move wa_vbak-netwr to wa_final-netwr.&lt;/P&gt;&lt;P&gt;      Move wa_vbak-bstdk to wa_final-bstdk.&lt;/P&gt;&lt;P&gt;      Move wa_vbak-kunnr to wa_final-kunnr.&lt;/P&gt;&lt;P&gt;      Move wa_vbak-smenr to wa_final-smenr.&lt;/P&gt;&lt;P&gt;      Move name to wa_final-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    write:/10 wa_final-vbeln, 20 wa_final-netwr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209751#M473130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209752#M473131</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;Select single name1 from kna1 into name where kunnr = wa_vbak-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name is not a table,plz check....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:30:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209752#M473131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209753#M473132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    smenr from vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think in VBAK table don't having the field like smner. Check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209753#M473132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209754#M473133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;smenr is not a filed of VBAK. check it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:36:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209754#M473133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209755#M473134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure that field names(itab) are same as database tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also INTO CORRESPONDING FIELDS OF TABLE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The modified code is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : VBAK, KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : p_vbeln LIKE vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : name like kna1-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_vbak ,&lt;/P&gt;&lt;P&gt;vbeln(10),&lt;/P&gt;&lt;P&gt;netwr(15),&lt;/P&gt;&lt;P&gt;bstdk(8),&lt;/P&gt;&lt;P&gt;kunnr(10),&lt;/P&gt;&lt;P&gt;smenr(8),&lt;/P&gt;&lt;P&gt;end of wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_final,&lt;/P&gt;&lt;P&gt;vbeln(10),&lt;/P&gt;&lt;P&gt;netwr(15),&lt;/P&gt;&lt;P&gt;bstdk(8),&lt;/P&gt;&lt;P&gt;kunnr(10),&lt;/P&gt;&lt;P&gt;smenr(8),&lt;/P&gt;&lt;P&gt;name1(35),&lt;/P&gt;&lt;P&gt;end of wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;  T_wa_vbak like standard table of  wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single vbeln&lt;/P&gt;&lt;P&gt;netwr&lt;/P&gt;&lt;P&gt;bstdk&lt;/P&gt;&lt;P&gt;kunnr&lt;/P&gt;&lt;P&gt;smenr from vbak&lt;/P&gt;&lt;P&gt;into &amp;lt;b&amp;gt;CORRESPONDING FIELDS OF TABLE T_&amp;lt;/b&amp;gt;wa_vbak where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single name1 from kna1 into name where kunnr = wa_vbak-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move wa_vbak-vbeln to wa_final-vbeln.&lt;/P&gt;&lt;P&gt;Move wa_vbak-netwr to wa_final-netwr.&lt;/P&gt;&lt;P&gt;Move wa_vbak-bstdk to wa_final-bstdk.&lt;/P&gt;&lt;P&gt;Move wa_vbak-kunnr to wa_final-kunnr.&lt;/P&gt;&lt;P&gt;Move wa_vbak-smenr to wa_final-smenr.&lt;/P&gt;&lt;P&gt;Move name to wa_final-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/10 wa_final-vbeln, 20 wa_final-netwr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama chary.Pammi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209755#M473134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209756#M473135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;smenr is not a filed of vbak that's why it's going to dump.&lt;/P&gt;&lt;P&gt;remove that one .u will get correct output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209756#M473135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209757#M473136</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 think your itab defination has some problem in lengths...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so instead of declaring like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_vbak ,&lt;/P&gt;&lt;P&gt;vbeln(10),&lt;/P&gt;&lt;P&gt;netwr(15),&lt;/P&gt;&lt;P&gt;bstdk(8),&lt;/P&gt;&lt;P&gt;kunnr(10),&lt;/P&gt;&lt;P&gt;smenr(8),&lt;/P&gt;&lt;P&gt;end of wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_vbak ,&lt;/P&gt;&lt;P&gt;vbeln type vbak-vbeln,&lt;/P&gt;&lt;P&gt;netwr type vbak-netwr,&lt;/P&gt;&lt;P&gt;bstdk type vbak-bstdk,&lt;/P&gt;&lt;P&gt;kunnr type vbak-kunnr,&lt;/P&gt;&lt;P&gt;smenr  type vbak-smenr,&lt;/P&gt;&lt;P&gt;end of wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And try again ...&lt;/P&gt;&lt;P&gt;It is just assumption ... otherwise give ur dump erro here which will help a lot to resolve issue..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209757#M473136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: select query for single record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209758#M473137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no field smenr in VBAK, So pls remove that field and check the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy this code and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : VBAK, KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : p_vbeln LIKE vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : name like kna1-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_vbak ,&lt;/P&gt;&lt;P&gt;        vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;        netwr like vbak-netwr,&lt;/P&gt;&lt;P&gt;        bstdk like vbak-bstdk,&lt;/P&gt;&lt;P&gt;        kunnr like vbak-kunnr,&lt;/P&gt;&lt;P&gt;     end of wa_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of wa_final,&lt;/P&gt;&lt;P&gt;        vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;        netwr like vbak-netwr,&lt;/P&gt;&lt;P&gt;        bstdk like vbak-bstdk,&lt;/P&gt;&lt;P&gt;        kunnr like vbak-kunnr,&lt;/P&gt;&lt;P&gt;        name1(35),&lt;/P&gt;&lt;P&gt;end of wa_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single vbeln&lt;/P&gt;&lt;P&gt;netwr&lt;/P&gt;&lt;P&gt;bstdk&lt;/P&gt;&lt;P&gt;kunnr&lt;/P&gt;&lt;P&gt;from vbak&lt;/P&gt;&lt;P&gt;into wa_vbak where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single name1 from kna1 into name where kunnr = wa_vbak-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move wa_vbak-vbeln to wa_final-vbeln.&lt;/P&gt;&lt;P&gt;Move wa_vbak-netwr to wa_final-netwr.&lt;/P&gt;&lt;P&gt;Move wa_vbak-bstdk to wa_final-bstdk.&lt;/P&gt;&lt;P&gt;Move wa_vbak-kunnr to wa_final-kunnr.&lt;/P&gt;&lt;P&gt;Move name to wa_final-name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/10 wa_final-vbeln,&lt;/P&gt;&lt;P&gt;       20 wa_final-netwr,&lt;/P&gt;&lt;P&gt;       50 wa_final-name1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:54:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-for-single-record/m-p/2209758#M473137</guid>
      <dc:creator>former_member460168</dc:creator>
      <dc:date>2007-05-11T06:54:56Z</dc:date>
    </item>
  </channel>
</rss>

