‎2010 May 19 9:47 AM
Hi All,
The selection screen has a select-option input field for Profit Center (S_PRCTR).
Hence user can enter the value like 1000 to 1200 in the selection screen.
Now in the Program, one internal table has list of Profit centers.
ex: ITAB will have following profit centers.
1000, 1001, 1002, 1200
Now, i would like to know which are the Profit centers that are missing in the ITAB from S_PRCTR.
How to write the logic?
Regards
Pavan
‎2010 May 19 9:55 AM
itab1[] = itab[].
delete itab1 where prctr in s_prctr.
The matched record will be deleted from itab1 and the unmatched record remains in itab1.
‎2010 May 19 9:55 AM
itab1[] = itab[].
delete itab1 where prctr in s_prctr.
The matched record will be deleted from itab1 and the unmatched record remains in itab1.
‎2010 May 19 10:01 AM
Thanks Keshav...
But in the selection screen, the user will be entering a range.. like 1000 to 1200.
The internal table ITAB in the Program will have list of Profit centers like 1000, 1001, 1002, 1150, 1200.
NOw, how can i list out the Profit centers which are missing in the ITAB within that selection screen range???
I would like list out the missing profit centers like 1003, 1004,.........1049, 1051,.......1199.
Regards
Pavan
‎2010 May 19 10:04 AM
‎2010 May 19 10:11 AM
Hi Pavan,
in your select-option field you've got a range of profit centers that need to be checked - use it in select statement on table CEPC, then you get all existing profit centers.
compare the result with values in your itab.
reagards
rea
‎2010 May 19 10:00 AM
Hi
you need to have the exact values of the select-options. So put in an internal table the value of profit center
select prctr into table t_tab from cepc where prctr in s_prctr
after you can loop on your second tab and read the table t_tab to find the values out.
like something like this:
loop at itab.
read table t_tab with key prctr = itab-prctr.
if not sy-subrc is initial.
--> you find it
endif.
endloop.
i hope it's helpful