Application Development 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: 

query not working on BSIS

Former Member
0 Kudos

SELECT BUKRS HKONT DMBTR FROM BSIS

INTO TABLE IT_BSIS

WHERE HKONT = '511125'

AND BUKRS = P_VKORG.

this query not giving any data.. and in bsis table already i found this data..

if u remove hkont condition it's working fine but with hkont condition giving me 0 data...

and in table actully data exist for this selection..

Edited by: Julius Bussche on Sep 10, 2008 10:10 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use CONVERSION_EXIT_ALPHA_INPUT before passing HKONT value in the where clause.

Regards

Karthik D

6 REPLIES 6

Former Member
0 Kudos

Try this

SELECT BUKRS HKONT DMBTR FROM BSIS

INTO TABLE IT_BSIS

WHERE HKONT = '0000511125'

AND BUKRS = P_VKORG.

Former Member
0 Kudos

Hi,

Use CONVERSION_EXIT_ALPHA_INPUT before passing HKONT value in the where clause.

Regards

Karthik D

Former Member
0 Kudos

Hi,

try this:

DATA: IHKONT LIKE BSIS-HKONT.

*

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = '511125'

IMPORTING

OUTPUT = IHKONT.

*

SELECT * FROM BSIS UP TO 100 ROWS WHERE HKONT = IHKONT.

WRITE: / IHKONT, BSIS-BELNR.

ENDSELECT.

Regards, Dieter

0 Kudos

I TRIED STILL NOT WORKING..

0 Kudos

Hi,

perhaps there is another problem.

Is this correct: AND BUKRS = P_VKORG ???

VKORG is not BUKRS!

Try in SE16 with the values you use in your Report and look if you get some results.

Regards, Dieter

0 Kudos

Hi,

Check carefully in the BSIS table.

1. U have to pass the hkont field with leading zeros.

2. is p_bukrs has some value???

3. is it p_vkorg or p_bukrs???

I think second one is causing the problem.

While executing table u might not be entering BUKRS. But since it is parameter in select query it compares with blank.

Pass some value to p_bukrs and check. u should get the data.

another way is instead of parameter declare p_bukrs as below.

SELECT-OPTIONS so_bukrs FOR bsis-bukrs NO INTERVALS NO-EXTENTION.

In select query instead of = operator use IN operator

SELECT .....

INTO TABLE...

FROM ...

WHERE....

AND bukrs IN so_bukrs.

Hope it solves ur issue.

Check this and get back in case of any issues.

thanks,

Vinod.