Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP query Problem

Former Member
0 Likes
1,100

Dear All,

I am trying to run this query but it is not giving data :

SELECT vbeln erdat erzet netwr waerk FROM vbak INTO TABLE it_tab

WHERE vbeln ge frpos

and vbeln le topos .

Here frpos and topos are teo variables having values 0 and 9 respectively.

Please reply what can be the problem.

Thanks in Advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,058

hi,

before passing frpos and topos to vbak

use functional module CONVERSION_EXIT_ALPHA_INPUT and pass the input of frpos and get the ouput from the and then pass it in the querry , do the same thing for topos also . you will get the querry working.

regards,

guru

  • mark if helpful

11 REPLIES 11
Read only

Former Member
0 Likes
1,058

Hi ,

Goto se11 and check if there are records in that range .

Read only

0 Likes
1,058

yup there are records in the table for that range

Read only

0 Likes
1,058

Hi ,

What is the data type you have declared for frpos and to topos.

like for matnr it has to be given as,

where matnr = '000000000000000088' .

since it is char field .

Read only

Former Member
0 Likes
1,058

Hi

Following needs to Checked with You query ,

1) check that internal table structure and the selecting fields sequence is same . other wise use into corresponding

2) check that variables frpos and topos . are declared like VBELN .

3) Make sure that VBAK contains data for sales orders between 0 and 9

  • Please mark Useful answers

Read only

Former Member
0 Likes
1,058

Write the select statment in this way

SELECT vbeln erdat erzet netwr waerk FROM vbak INTO TABLE it_tab

WHERE ( vbeln ge frpos

and vbeln le topos ) .

frpos and topos are of vblen type check if not declare them as vbeln type.

Read only

Former Member
0 Likes
1,059

hi,

before passing frpos and topos to vbak

use functional module CONVERSION_EXIT_ALPHA_INPUT and pass the input of frpos and get the ouput from the and then pass it in the querry , do the same thing for topos also . you will get the querry working.

regards,

guru

  • mark if helpful

Read only

0 Likes
1,058

Thanks a lot everybody ,

we have to convert the inputs by using the function

CONVERSION_EXIT_ALPHA_INPUT as replied by Guru,

Thanks a lot Guru.

Read only

0 Likes
1,058

Hi ,

Reward points yaar.

regards,

Guru

Read only

Former Member
0 Likes
1,058

hi...

jus try the code i hav modified from ur's. it wil work...reward if useful.

SELECT vbeln erdat erzet netwr waerk

FROM vbak

INTO <b>corresponding fields of</b> TABLE it_tab

WHERE vbeln ge frpos

and vbeln le topos

all the best.

Read only

Former Member
0 Likes
1,058

Hi,

Data read is not placed in the output area, conversion is required.

regards,

pankaj singh

Read only

Former Member
0 Likes
1,058

Hi,

Write the select statment in this way

SELECT vbeln erdat erzet netwr waerk FROM vbak INTO TABLE it_tab

WHERE <b>vbeln between frpos and topos.</b>

Message was edited by:

Purshothaman P