‎2007 Nov 14 4:59 AM
hi all,
there is a problem , when i write like below :
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs = p_bukrs
AND hkont = p_hkont.
p_bukrs , p_hkont are all on the selection screen , and p_bukrs = 1200 another is eq blank. i can not find any data , but with the same condition i can find some data in database , when i debeg i found that p_hkont is initial.
when i write like this :
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs = p_bukrs .
this time i can find the data like the database.
so , does someone know where the problem is , why i can not get data ?
kind regards
kevin
‎2007 Nov 14 5:11 AM
Hi Kevin,
Try this:
make ur selection parameter as select options and change the queries to
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs IN p_bukrs
AND hkont IN p_hkont.
Now try i think now it will work.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Regards,
Rajesh Akarte
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:22 PM
‎2007 Nov 14 5:11 AM
Hi Kevin,
Try this:
make ur selection parameter as select options and change the queries to
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs IN p_bukrs
AND hkont IN p_hkont.
Now try i think now it will work.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Regards,
Rajesh Akarte
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:22 PM
‎2007 Nov 14 5:11 AM
hi,
maybe bukrs and hkont are both mandatory fields for bsis table, and keeping hkont eq blank wil not give any result, as no result matches the given fields.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:23 PM
‎2007 Nov 14 5:14 AM
Hi Kevin,
As HKONT is a key field in BSIS and you are not passing anything to it so it is not fetching any data. The best way is change paramters to select-option as some one said or make both the parameters mandatory.
Regards,
Atish
‎2007 Nov 14 5:17 AM
HI Kevin,
I think here you need to use conversion exit for p_hkont field.
The actual length of this field is 10 char. I think you are giving less than 10 char in the selection screen.
Just add zeros in the left side and execute it. You will get data.
use this function module to add zeros,
<b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
‎2007 Nov 14 5:22 AM
Hi,
U r not getting data bcoz of conversion exit.
use this FM before passing data..
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = p_hkont
IMPORTING
OUTPUT = p_hkont
.
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs = p_bukrs
AND hkont = p_hkont.
now it will work.
regds,
Paras
‎2007 Nov 14 6:22 AM
Hi Paras ,
the field p_hkont is a parameter , it is reference to field bsis-hkont, and it is the key field of table BSIS , but in program i want to get all data where p_bukrs = 1200 and hkont i don't fill it.
i have tried the FM you told me , i think it will work if i enter some value to field p_bukrs , but this time , i don't enter anything , so , i still can not get data form bsis.
can you explain this ?
thanks
regards
kevin
‎2007 Nov 14 6:25 AM
Hi Kevin,
have you tried as I said.
Define p_hkont as
TABLES bsis.
SELECT-OPTIONS p_hkont FOR bsis-hkont.
and use IN in the WHERE clause.
Regards,
Atish
‎2007 Nov 14 6:31 AM
hi Atish ,
it may work , but if i just want to use p_hkont as a parameter , how can i do this ? pls explain more , thanks
regards
kevin
‎2007 Nov 14 6:40 AM
Hi Kevin u can use p_hkont as parameter use the following syntax for declaration :
SELECT-OPTIONS p_hkont FOR bseg-hkont <b>NO-EXTENSION</b>
<b>NO INTERVALS.</b>
Regards,
Rajesh Akarte
‎2007 Nov 14 6:45 AM
Hi Kevin,
You can use as told by Rajesh, it will effectively show as a parameter on the selection screen, but if you want to use the PARAMETERS in the program then you need to make that field mandatory so that it should not be blank. There is no other option in that case.
Regards,
Atish
‎2007 Nov 14 7:19 AM
hi ,
thanks a lot , i have tried you way and solved this
best regards
kevin
‎2007 Nov 14 5:29 AM
hi,
if u r using bukrs and hkont as parameters in selection screen then
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs = p_bukrs
AND hkont = p_hkont.
this will work.
if u r using then as select-option then the above does n't work.
bcoz select-options work as internal table bcoz of that u have use the query like this
SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
WHERE bukrs IN p_bukrs
AND hkont IN p_hkont.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:25 PM
‎2008 Aug 15 6:28 AM
hi all ,
thanks u for the answers. the issue is solved now
regards