09-13-2008 8:22 AM
Hi guys,
I have 1 internal table with set of GL accounts. I have 2nd internal table where lower interval and upper interval of GL accounts
How to filter out records from 1 internal table by comparing with the GL account ranges present in 2nd internal table.
Please reply.
09-13-2008 8:42 AM
Hi
Create a RANGE for GL Accounts.
LOOP the second Internal Table.
And assign HIGH & LOW to ranges from second ITAB.
And Delete the accounts which are not there in the range.
Use the below code as reference.
DATA: itab TYPE TABLE OF mara WITH HEADER LINE.
DATA: r_matnr TYPE RANGE OF matnr WITH HEADER LINE.
SELECT * FROM mara INTO TABLE itab UP TO 10 ROWS.
r_matnr-sign = 'I'.
r_matnr-option = 'BT'.
r_matnr-low = '000000000016900036'.
r_matnr-high = '000000000016900040'.
APPEND r_matnr.
DELETE itab WHERE matnr NOT IN r_matnr.
09-13-2008 8:34 AM
Vinay,
sort itab2 ascending by hkont.
loop at itab1.
read table itab2 where hkont = itab1-hkont.
if sy-subrc ne 0.
delete itab1.
endloop.
K.Kiran.
09-13-2008 8:42 AM
Hi
Create a RANGE for GL Accounts.
LOOP the second Internal Table.
And assign HIGH & LOW to ranges from second ITAB.
And Delete the accounts which are not there in the range.
Use the below code as reference.
DATA: itab TYPE TABLE OF mara WITH HEADER LINE.
DATA: r_matnr TYPE RANGE OF matnr WITH HEADER LINE.
SELECT * FROM mara INTO TABLE itab UP TO 10 ROWS.
r_matnr-sign = 'I'.
r_matnr-option = 'BT'.
r_matnr-low = '000000000016900036'.
r_matnr-high = '000000000016900040'.
APPEND r_matnr.
DELETE itab WHERE matnr NOT IN r_matnr.
09-13-2008 11:38 AM
Post your whole requirement here(data decleration aslo) here.
definatly i'll code for you its saturday only.
09-13-2008 1:10 PM