2007 Dec 20 3:30 PM
hallow
i have table with emp nun(pernr) how i can invert this table
to range table becouse i wont to use delete for other table
like delete itab where pernr is not in pernr_tab.
regards
2007 Dec 20 3:45 PM
RANGES : pernr LIKE PERNR-pernr.
loop at itab.
pernr-sign = 'I'.
pernr-option = 'EQ'.
pernr-low = itab-pernr.
APPEND pernr.
endloop.
2007 Dec 20 3:39 PM
Hi ,
Two options :
1.
field-symbols : <ls_pernr_tab> like line of pernr_tab .
Loop at pernr_tab assigning <ls_pernr_tab> .
delete itab where pernr ne <ls_pernr_tab>-pernr .
endloop .
2.
data : lr_pernr type range of pernr_d .
data : ls_pernr like line of lr_pernr .
field-symbols : <ls_pernr_tab> like line of pernr_tab .
ls_pernr-sign = 'I' .
ls_pernr-option = 'EQ' .
Loop at pernr_tab assigning <ls_pernr_tab> .
ls_pernr-low = <ls_pernr_tab>-pernr .
endloop .
delete itab where pernr not in lr_pernr .
Both of the ways will do the job but the runtime will the depend on the table's sizes .
Hope it helps .
Best Regards .
Avi Sarmani
2007 Dec 20 3:40 PM
Declare a range in your program and append this value to the range
RANGES: r_werks FOR marcv-werks.
r_werks-sign = 'I'.
r_werks-option = 'EQ'.
r_werks-low = wa_inventory-werks.
You will get it.
2007 Dec 20 3:42 PM
loop at itab .
MOVE 'E' TO ra_matkl-sign.
MOVE 'EQ' TO ra_matkl-option.
MOVE itab-pernr TO ra_matkl-low.
APPEND ra_matkl.
MOVE itab-pernr TO ra_matkl-low.
APPEND ra_matkl.
MOVE itab-pernr TO ra_matkl-low.
APPEND ra_matkl.
clear wa_matkl..
endloop.
u cna use this range to delete from other table as u said..
but its not prepered ranges are again like a selection screen table.. so ppl say its not prefered..
hope Rob might have weblog for this as well..
2007 Dec 20 3:45 PM
RANGES : pernr LIKE PERNR-pernr.
loop at itab.
pernr-sign = 'I'.
pernr-option = 'EQ'.
pernr-low = itab-pernr.
APPEND pernr.
endloop.
2007 Dec 20 3:49 PM
Just a quick one for all ...
For all I now , RANGES statement is obsolete and you should use
DATA : lr_pernr type range of pernr_d .
RANGES defines a header line which is obsolete ...
2007 Dec 20 4:18 PM
Hi,
Ranges: r_pernr for tablename-pernr.
then you can use this r_pernr like your select-option.
Reward if useful.
Thanks,
Sreeram.