11-27-2007 9:11 PM
hi friends,
the below stmt is not picking any values,
here itab has both columns hkont and bukrs,
SELECT saknr bukrs
INTO TABLE I_SKB1
FROM SKB1
FOR ALL ENTRIES IN ITAB
WHERE saknr = ITAB-hkont and bukrs = itab-bukrs.
wheni remove the condition saknr = itab-hkont, ie. only with bukrs, it is working perfectly fine,
where as if i remove bukrs = itab-bukrs and run with condition of saknr = itab-hkont it is not working.
for testing purpose, i had picked up the value 165000 form skb1 and put as
saknr = 165000, then also its not picking up any value,
did any one face this problem before.
thank you.
11-27-2007 9:16 PM
You have to pad with leading zeroes. You can use CONVERSION_EXIT_ALPHA_INPUT to do this.
Like this:
LOOP AT itab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = itab-hkont
IMPORTING
output = itab-hkont.
MODIFY itab.
ENDLOOP.
SELECT saknr bukrs
INTO TABLE i_skb1
FROM skb1
FOR ALL ENTRIES IN itab
WHERE saknr = itab-hkont AND bukrs = itab-bukrs.
Rob
Message was edited by:
Rob Burbank
11-27-2007 9:16 PM
You have to pad with leading zeroes. You can use CONVERSION_EXIT_ALPHA_INPUT to do this.
Like this:
LOOP AT itab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = itab-hkont
IMPORTING
output = itab-hkont.
MODIFY itab.
ENDLOOP.
SELECT saknr bukrs
INTO TABLE i_skb1
FROM skb1
FOR ALL ENTRIES IN itab
WHERE saknr = itab-hkont AND bukrs = itab-bukrs.
Rob
Message was edited by:
Rob Burbank
11-27-2007 9:17 PM
Sanjana,
Please make sure you are using AND condition, so it could be possible that combination values doesn't exist as per you itab.
Check that
-Pavan
11-27-2007 9:18 PM
This code of mine works fine for me..
PROGRAM ztest.
DATA: lt_skb1 TYPE TABLE OF skb1.
SELECT * UP TO 10 ROWS FROM skb1 INTO TABLE lt_skb1 WHERE bukrs EQ '0001' AND saknr EQ '0000001000'.
BREAK-POINT.
u have to put leading ZEROS.
use CONVERSION_EXIT_ALPHA_OUTPUT
A
Message was edited by:
Amandeep Bal
11-27-2007 9:21 PM
Andeep - I find mice code not that reliable. They don't test very well:-)
Rob
11-27-2007 9:27 PM
11-27-2007 9:32 PM
11-27-2007 10:57 PM
excellent rob, its working, thanks.
thanks for your time amandeep.
11-27-2007 11:10 PM