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

Select statement not working in WHERE clause

Former Member
0 Likes
2,056

REPORT Zsap .

PARAMETERS : P_VKORG TYPE VBAK-VKORG.

TYPES: BEGIN OF TY_VBAK,

VBELN TYPE VBAK-VBELN,

END OF TY_VBAK.

DATA: IT_VBAK TYPE TABLE OF TY_VBAK,

WA_VBAK TYPE TY_VBAK.

SELECT VBELN

FROM VBAK

INTO TABLE IT_VBAK

WHERE VKORG = P_VKORG.

in selection screen im giving P_vkorg = '7999'.

error:

select stament is not working..

it_vbak is initails.

please let me know how i can get data into it_vbak

Edited by: Julius Bussche on Nov 7, 2008 8:58 PM

REPORT Zsap .

PARAMETERS : P_VKORG TYPE VBAK-VKORG.

TYPES: BEGIN OF TY_VBAK,

VBELN TYPE VBAK-VBELN,

END OF TY_VBAK.

DATA: IT_VBAK TYPE TABLE OF TY_VBAK,

WA_VBAK TYPE TY_VBAK.

SELECT VBELN

FROM VBAK

INTO TABLE IT_VBAK

WHERE VKORG = P_VKORG.

in selection screen im giving P_vkorg = '7999'.

error:

select stament is not working..

it_vbak is initails.

please let me know how i can get data into it_vbak

Edited by: Julius Bussche on Nov 7, 2008 8:58 PM

11 REPLIES 11
Read only

Former Member
0 Likes
1,574

Check the entries in VBAK for 7999.if there entries are exsist than only your it_vbak would get fill.

Read only

0 Likes
1,574

YES it has more than 3,000 records in VBAK .

Read only

Former Member
0 Likes
1,574

Your select statement works... when I give '7999', the internal table is initial because there is not any record with 7999, but if a use another that I know exist.. it works fine.

Read only

Former Member
0 Likes
1,574

Laurence - the moderators take a dim view of such meaningless titles. The first thing you should do is edit it if you can.

Rob

Read only

0 Likes
1,574

>

> The first thing you should do is edit it if you can.

> Rob

Changed

Read only

0 Likes
1,574

>

>

> Changed

But it only shows up on the individual thread. the original one stays the same.

Actually, this is probably a good thing

Rob

Read only

0 Likes
1,574

Julius managed the things

Read only

0 Likes
1,574

Yes - I was alittle confused to see that your title had takend.

BTW I wonder what the original question was

Rob

Read only

Former Member
0 Likes
1,574

In the where clause use P_VKORG-LOW or High instead of using only P_VKORG .

Thank You.

Read only

Former Member
0 Likes
1,574

ur select query is checking for vbeln which has vkorg = '7999'. Since it is not available it is not populating anything in the internal table.

Check for any other number that exists.

Regards,

SAPient.

Read only

0 Likes
1,574

Check in debugging mode, if P_VKORG is getting populated or not...

If not getting populated, try using Programming Events like...

At selection-screen

start-of-selection ...