‎2010 Mar 18 9:56 AM
hi Experts,
i have an Internal table and i have two records where i
HIST_TYPE = 'E' and
HIST_TYPE = 'Q'.
if i find both E and Q then i should take into consideration of = Q.
If i find only E then i should take E alone.
the second one is fine. but if i have both E and Q how can i take Q Into consideration?
can i have some input please?
thank you,
pasala.
‎2010 Mar 18 10:02 AM
Hello
Try logic:
read itab with key HIST_TYPE = 'E'.
if sy-subrc = 0.
read table itab with key HIST_TYPE = 'Q'.
if sy-subrc = 0.
result = 'Q'.
else.
result = 'E'.
endif.
endif.
‎2010 Mar 18 10:00 AM
No big deal
read table itab with key HIST_TYPE = 'E'.
if sy-subrc = 0.
"then look for Q
read table itab with key HIST_TYPE = 'Q'.
if sy-subrc = 0.
"take Q
else.
"take E
endif.
endif.
Regards
Marcin
‎2010 Mar 18 10:02 AM
//
i have an Internal table and i have two records where i
HIST_TYPE = 'E' and
HIST_TYPE = 'Q'.
if i find both E and Q then i should take into consideration of = Q.
If i find only E then i should take E alone.
the second one is fine. but if i have both E and Q how can i take Q Into consideration?//
just to give an idea .
if the itab has only two records then set up a flag for condition 1 when E and Q are there.
loop will iterate for two times . one first occurance of E set it to 1 . for occurance of Q set it to 2 .
When the flag becomes 2 it means you have to consider Q.
If iterated for 1 then you can see it is E.
if inside the loop u need to clear thh count eveytime for new item / Uniqe no and process this with ctrl break statements .
Br,
VIjay.
‎2010 Mar 18 10:02 AM
Hello
Try logic:
read itab with key HIST_TYPE = 'E'.
if sy-subrc = 0.
read table itab with key HIST_TYPE = 'Q'.
if sy-subrc = 0.
result = 'Q'.
else.
result = 'E'.
endif.
endif.