2014 Dec 05 7:29 AM
I have internal table it_characteristics which is type table of structure characteristics which contains some values name_char which are various characteristics of materials and I have fetch the data from the ausp table based on objek (material number which is entered in selection screen ) and all character values from the internal table it_characteristics .
What would be my select query ?
SELECT objek
atinn
atzhl
mafid
klart
adzhl
atwrt
FROM ausp
INTO TABLE it_ausp
WHERE objek EQ s_object(this is material number)
And now I want feach attn. comparing the name_chares values from the internal table it_characteristics
Means atinn must match with the name_char vales
2014 Dec 05 7:44 AM
Hi ,
use this .
sort it_characteristics by name_char.
Loop at it_ausp into wa_ausp.
read table it_characteristics into wa_characteristics with key
name_char = wa_ausp-atinn
binary search.
if sy-subrc eq 0.
"put your logic here .
endif.
endloop.
Regards,
Saddam
2014 Dec 05 8:41 AM
First of all no use of looping it_ausp because there no data in that internal table.
i want put put values in internal table based on charterstics values.
2014 Dec 05 7:58 AM
Use
IF NOT it_characteristics[] IS INITIAL.
SELECT objek
atinn
atzhl
mafid
klart
adzhl
atwrt
FROM ausp
INTO TABLE it_ausp
FOR ALL ENTRIES IN it_characteristics <<<
WHERE objek IN s_object(this is material number)
AND atinn EQ it_characteristics-name_char. <<<
ENDIF.
2014 Dec 05 8:48 AM
getting error
there is conversion routine present for the filed attin field
CONVERSION_EXIT_ATINN_INPUT. but in table it_charaterstics there wont apply the conversion rotine so cant use /....
2014 Dec 05 8:57 AM
Hi,
Befor writing select query convert your it_charaterstics-name_char into the type which you want by using CONVERSION_EXIT_ATINN_INPUT and then write the select query as described by
LOOP AT it_charaterstics ASSIGNING <FS_CHAR>.
CALL FUNCTION CONVERSION_EXIT_ATINN_INPUT
EXPORTING
INPUT = <FS_CHAR>-MANE_CHAR
IMPORTING
OUTPUT = <FS_CHAR>-MANE_CHAR
ENDLOOP.
IF NOT it_characteristics[] IS INITIAL.
SELECT objek
atinn
atzhl
mafid
klart
adzhl
atwrt
FROM ausp
INTO TABLE it_ausp
FOR ALL ENTRIES IN it_characteristics
WHERE objek IN s_object(this is material number)
AND atinn EQ it_characteristics-name_char.
ENDIF.
Reagrds
Mani