2008 Jul 11 12:21 PM
Hi Friends,
I upload the data and keep in one internal table ( T_Compas).
and I given value range on the selection screen ( S_MATNR).
now I want to display the records base on the value range u201CS_MATNRu201D.
So I am using Read Statement , It is reading all the records.
it is not coming according my conditions.
( eg. LOOP AT T_COMPAS INTO W_COMPAS
READ TABLE T_COMPAS INTO W_COMPAS WITH KEY MATNR = S_MATNR.
IF SY-SUBRC = 0.
W_OUTPUT-CMATNR1 = W_COMPAS-Cmatnr1.
W_OUTPUT-MATNR = W_COMPAS-MATNR.
endif. )
please find out the solutions. <removed_by_moderator>
Edited by: Julius Bussche on Jul 11, 2008 12:48 PM
2008 Jul 11 12:30 PM
hi
U need not req. that read statement
loop at itab.
CHECK itab-MATNR in S_MATNR.
IF SY-SUBRC = 0.
IT_OUTPUT-CMATNR1 = W_COMPAS-Cmatnr1.
IT_OUTPUT-MATNR = W_COMPAS-MATNR.
append IT_OUTPUT.
endif.
endloop.
I hope this ll work
Thanks & Regards
vinsee
Hi Friends,
I upload the data and keep in one internal table ( T_Compas).
and I given value range on the selection screen ( S_MATNR).
now I want to display the records base on the value range u201CS_MATNRu201D.
So I am using Read Statement , It is reading all the records.
it is not coming according my conditions.
( eg. LOOP AT T_COMPAS INTO W_COMPAS
READ TABLE T_COMPAS INTO W_COMPAS WITH KEY MATNR = S_MATNR.
IF SY-SUBRC = 0.
W_OUTPUT-CMATNR1 = W_COMPAS-Cmatnr1.
W_OUTPUT-MATNR = W_COMPAS-MATNR.
endif. )
please find out the solutions. <removed_by_moderator>
Edited by: Julius Bussche on Jul 11, 2008 12:48 PM
2008 Jul 11 12:25 PM
When you have S_MATNR on Selection screen why dont you restrict the data selection in this range.
2008 Jul 11 12:25 PM
Hi
LOOP AT <ITAB> INTO <WA> WHERE MATNR >= s_matnr-low AND matnr <= s_matnr-high.
ENDLOOP.
try this loop i hope it works
Regards
Pavan
2008 Jul 11 12:25 PM
Hi ,
You can do this by using below code.
LOOP AT T_COMPAS INTO W_COMPAS where matnr in S_MATNR.
<put your code here>
ENDLOOP.
Hope this helps.
Regards,
Kalyan.
2008 Jul 11 12:26 PM
hi
do this
loop at t_compass.
if t_compas-matnr in s_matnr.
output-matnr = t_compas-matnr.
append output.
clear output.
endif.
endloop.
Cheers
Snehi
2008 Jul 11 12:29 PM
Hi,
tables:
mara.
select-options:
p_matnr for mara-matnr.
data:
itab like table of mara.
Data:
wa like line of itab.
select * from mara into table itab.
loop at itab into wa from p_matnr-low to p_matnr-high.
write: wa-matnr.
endloop.( eg. LOOP AT T_COMPAS INTO W_COMPAS from s_matnr-low to s_matnr-high.
IF SY-SUBRC = 0.
W_OUTPUT-CMATNR1 = W_COMPAS-Cmatnr1.
W_OUTPUT-MATNR = W_COMPAS-MATNR.
endif. )
reagrds,
pritam.
Edited by: Pritam Ghosh on Jul 11, 2008 1:39 PM
Edited by: Pritam Ghosh on Jul 11, 2008 1:40 PM
2008 Jul 11 12:30 PM
hi
U need not req. that read statement
loop at itab.
CHECK itab-MATNR in S_MATNR.
IF SY-SUBRC = 0.
IT_OUTPUT-CMATNR1 = W_COMPAS-Cmatnr1.
IT_OUTPUT-MATNR = W_COMPAS-MATNR.
append IT_OUTPUT.
endif.
endloop.
I hope this ll work
Thanks & Regards
vinsee
2008 Jul 11 12:39 PM
Hi,
Check this:
loop at <itab> into <wa>.
if wa-matnr in s_matnr[].
<move.........>
endif.
endloop.Regards
Adil
2008 Jul 11 12:41 PM
2008 Jul 11 12:45 PM
First : the value range, if it is an ABAP range./ select-option use the syntax
WHERE MATNR IN S_MATNR.But there may be a problem as usually MATNR has a conversion exit on it.
So in which format are material number in your uploaded table T_COMPAS.
If they are in internal format, then it should work, else you may have to convert the data before using any check using function modules CONVERSION_EXIT_MATN2_INPUT and OUTPUT.
Regards
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |