09-02-2008 7:17 AM
Hi All,
i have 20 parameters in Fm. if i pass any value in those parameters , the Fm should return the entries matching to that value. If i dont pass any value in params, the FM should return all the values . To achive this i have defined ranges for all 20 parameters and when those params have the value i am filling a range objects with values. If params not conatins any value am just not doing any thing.
Here my question is i want to fill this range objects using perform statement. I dont want to write 20 times. So i have created one subroutine passing range object as table and remaining values in USING statement. Here i am getting one error that range object is too big to hold the value.
MY perform statement is
perform range tables r_matnr
using 'I'
'EQ' 'lowvalue'.
form ranges tables p_r_matnr structure range_matnr
using p_i
p_eq
p_low.
endform.
can any one please tell me how to fill the range object dynamically, for example if the range object is werks then in the form statement structure i want to refer werks range.
Thanks,
CS Reddy.
09-02-2008 7:30 AM
Hi....
So here all the 20 parameters are same TYPE, is n't it?
If not how can you declared same RANGES table for all...?\
Plz get back here again.
Thanks,
Naveen.I
09-02-2008 8:10 AM
Hi,
Thanks all for u r reply.
All 20 params are different. Thats what the problem. here i want to build dynamic reference type .
Any suggestions..
If i remove the reference structure thr program throws an error,.......
Thanks,
CS.
09-02-2008 7:43 AM
Hi,
just remove the 'struture ranges_matnr'. in the perform statement.
Regards,
venkat
09-02-2008 8:46 AM
hi,
i had spent quite some time for implementing the same suboutine once with no success.
we cannot use subroutine here according to me.
09-02-2008 8:56 AM
Hi,
Pass the data using TYPE REF TO DATA.
DATA: lt_tab TYPE TABLE OF <some_type>.
DATA: data_ref TYPE REF TO DATA.
GET REFERENCE OF lt_tab INTO data_ref.
perform routine USING data_ref.
form routine p_data_ref TYPE REF TO DATA.
DATA: l_tab TYPE TABLE OF <some_type_same_as_above>.
l_tab = p_data_ref->*.
endform.
Best Regards,
Sesh
09-02-2008 9:17 AM
Hi CS Reddy,
Instead of the below statement
perform range tables r_matnr
using 'I'
'EQ' 'lowvalue'.
declare all the value like 'I','EQ' etc as constants.
Correct me if I am wrong.
Thanks & Regards,
M.Ramana Murthy