Application Development and Automation 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: 
Read only

please find the solutions !

Former Member
0 Likes
1,154

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,121

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,121

When you have S_MATNR on Selection screen why dont you restrict the data selection in this range.

Read only

bpawanchand
Active Contributor
0 Likes
1,121

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

Read only

KalC
Active Participant
0 Likes
1,121

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.

Read only

Former Member
0 Likes
1,121

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

Read only

Former Member
0 Likes
1,121

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

Read only

Former Member
0 Likes
1,122

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

Read only

Former Member
0 Likes
1,121

Hi,

Check this:

loop at <itab> into <wa>.
if wa-matnr in s_matnr[].
<move.........>
endif.
endloop.

Regards

Adil

Read only

Former Member
0 Likes
1,120

Hi,

Regards

Adil

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,120

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