<?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: Issues fetchng data from VBFA table... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029161#M1169961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;populate the same table with two different selects... check if the select option is filled... based on that use different select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2009 02:08:12 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2009-01-14T02:08:12Z</dc:date>
    <item>
      <title>Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029158#M1169958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having an issue realted to a SQL query in a report. I am having three select options viz: sales order number, Delivery document number and Billing document numbr as select options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I enter either Delivery document number or Billing document number, data gets fetched but when I enter both &lt;STRONG&gt;Delivery document number and Billing ocument number&lt;/STRONG&gt; on screen, nothing gets fetched...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of i_vbfa,&lt;/P&gt;&lt;P&gt;      vbelv like vbfa-vbelv,&lt;/P&gt;&lt;P&gt;      vbtyp_v like vbfa-vbtyp_v,&lt;/P&gt;&lt;P&gt;      vbeln like vbfa-vbeln,&lt;/P&gt;&lt;P&gt;      vbtyp_n like vbfa-vbtyp_n,&lt;/P&gt;&lt;P&gt;      end of i_vbfa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_vbfa like table of i_vbfa with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S_VBELN for VBAK-VBELN,&lt;/P&gt;&lt;P&gt;S_DELNOT for VBFA-VBELN,&lt;/P&gt;&lt;P&gt;S_BILDOC for VBFA-VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;       from VBFA into table it_vbfa&lt;/P&gt;&lt;P&gt;       where VBELV in S_VBELN&lt;/P&gt;&lt;P&gt;       and  ( ( VBELN in S_DELNOT ) and ( VBELN in S_BILDOC ) )&lt;/P&gt;&lt;P&gt;       and  VBTYP_V = 'C'&lt;/P&gt;&lt;P&gt;       and  ( ( VBTYP_N = 'J' ) OR ( VBTYP_N = 'M' ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&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;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 21:30:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029158#M1169958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T21:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029159#M1169959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use an OR in the select where condition. VBELN cannot be s_delnot and s_bildoc. It will hold either of the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;from VBFA into table it_vbfa&lt;/P&gt;&lt;P&gt;where VBELV in S_VBELN&lt;/P&gt;&lt;P&gt;and ( ( VBELN in S_DELNOT ) and ( VBELN in S_BILDOC ) )&lt;/P&gt;&lt;P&gt;and VBTYP_V = 'C'&lt;/P&gt;&lt;P&gt;and ( ( VBTYP_N = 'J' ) OR ( VBTYP_N = 'M' ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;from VBFA into table it_vbfa&lt;/P&gt;&lt;P&gt;where VBELV in S_VBELN&lt;/P&gt;&lt;P&gt;and ( ( VBELN in S_DELNOT )&lt;STRONG&gt;OR&lt;/STRONG&gt; ( VBELN in S_BILDOC ) )&lt;/P&gt;&lt;P&gt;and VBTYP_V = 'C'&lt;/P&gt;&lt;P&gt;and ( ( VBTYP_N = 'J' ) OR ( VBTYP_N = 'M' ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2009 21:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029159#M1169959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-13T21:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029160#M1169960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Using 'OR' would not work because if we feed the value for S_BILDOC field and leave the S_DELNOT field then, the query will fetch value for S_BILDOC and also all the data records for S_DELNOT if kept blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other idea..&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;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2009 01:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029160#M1169960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-14T01:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029161#M1169961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;populate the same table with two different selects... check if the select option is filled... based on that use different select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2009 02:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029161#M1169961</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-01-14T02:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029162#M1169962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;&amp;gt;        from VBFA into table it_vbfa&lt;/P&gt;&lt;P&gt;&amp;gt;        where VBELV in S_VBELN&lt;/P&gt;&lt;P&gt;&amp;gt;        and  ( ( VBELN in S_DELNOT ) and ( VBELN in S_BILDOC ) )&lt;/P&gt;&lt;P&gt;&amp;gt;        and  VBTYP_V = 'C'&lt;/P&gt;&lt;P&gt;&amp;gt;        and  ( ( VBTYP_N = 'J' ) OR ( VBTYP_N = 'M' ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi u cant have an and condition like that.&lt;/P&gt;&lt;P&gt;because vbeln at a time can have only ether delivery number or billing number.&lt;/P&gt;&lt;P&gt;what ur condition suggests is that the number in the table should be both delivery number and billing doc at the same time which is not possible, so use two queries, in first give vbelv as sales order number and vbeln as delivery number then in next query use vbelv as delivery and vbeln is billing doc of ur select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select vbelv vbtyp_v vbeln vbtyp_n
       from VBFA into table it_vbfa
        where VBELV in S_VBELN
        and  ( VBELN in S_DELNOT )
        and  VBTYP_V = 'C'
        and  (( VBTYP_N = 'J' ) .

select vbelv vbtyp_v vbeln vbtyp_n
        from VBFA into table it_vbfa   " not sure if its overwrtes or appends so just check it
        where VBELV in S_delnot
        and   VBELN in S_BILDOC 
        and  VBTYP_V = 'J'
        and  ( VBTYP_N = 'M' ) .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Jan 14, 2009 7:52 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Jan 14, 2009 7:56 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2009 02:21:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029162#M1169962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-14T02:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issues fetchng data from VBFA table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029163#M1169963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh... in VBFA table u can have record for sales doc and delivery doc combination and for sales doc and billing doc number but not for delivery doc and billing doc ...&lt;/P&gt;&lt;P&gt;so as Kartik has suggested u can use two queries.. one to get data for sales doc and delivery doc... and nother for sales doc and billing doc combination...&lt;/P&gt;&lt;P&gt;just one correction for second query use appending clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;       from VBFA into table it_vbfa&lt;/P&gt;&lt;P&gt;        where VBELV in S_VBELN&lt;/P&gt;&lt;P&gt;        and  ( VBELN in S_DELNOT )&lt;/P&gt;&lt;P&gt;        and  VBTYP_V = 'C'&lt;/P&gt;&lt;P&gt;        and  (( VBTYP_N = 'J' ) .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select vbelv vbtyp_v vbeln vbtyp_n&lt;/P&gt;&lt;P&gt;        from VBFA appending into table it_vbfa   &lt;/P&gt;&lt;P&gt;        where VBELV in S_delnot&lt;/P&gt;&lt;P&gt;        and   VBELN in S_BILDOC &lt;/P&gt;&lt;P&gt;        and  VBTYP_V = 'J'&lt;/P&gt;&lt;P&gt;        and  ( VBTYP_N = 'M' ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this solves your problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2009 04:31:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-fetchng-data-from-vbfa-table/m-p/5029163#M1169963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-14T04:31:56Z</dc:date>
    </item>
  </channel>
</rss>

