2008 Jul 04 10:32 PM
I had a problem while updating a table.
I had to check several document numbers and later decide if I wanted to update them.
As most of them are continous, I created a little algorithm to fill a range accordingly, if is a sole number or a between range which reduced the ammount of entries in the range greatly and solves a problem I had while updating the table.
Now I want to put this in a global class as we are moving to object oriented programming and this type of situation repeats itself in other programs.
I was trying to think of a solution wo would require very little knowledge to other users and with the smallest steps.
I was thinking about this
In case of non-object oriented programming a method that looked like this.
method fill_ranges exporting entry_table "a table with the entries
selection_field "in case is a table with more than one field
flag_ie "Chooses Include or exclude
changing range " the range table
In this case I would check if the table range is a range table with the same type as the field in the entry_table
However, in object oriented programming ranges statement is not allowed, so I was thinking in making a method to pass a data reference to the new table, ask them to create a dynamic table and later use the fill_range method
Is this a decent aproach? I was thinking it was better to have the table as an attribute, but generic types are not allowed, I also know of structure RSPARAMS_TT but I don't want to use a fixed structure, I would only be accepting numbers, probably integers, so 45 should be ennough, but I really want it to work in any possible solution
I had a problem while updating a table.
I had to check several document numbers and later decide if I wanted to update them.
As most of them are continous, I created a little algorithm to fill a range accordingly, if is a sole number or a between range which reduced the ammount of entries in the range greatly and solves a problem I had while updating the table.
Now I want to put this in a global class as we are moving to object oriented programming and this type of situation repeats itself in other programs.
I was trying to think of a solution wo would require very little knowledge to other users and with the smallest steps.
I was thinking about this
In case of non-object oriented programming a method that looked like this.
method fill_ranges exporting entry_table "a table with the entries
selection_field "in case is a table with more than one field
flag_ie "Chooses Include or exclude
changing range " the range table
In this case I would check if the table range is a range table with the same type as the field in the entry_table
However, in object oriented programming ranges statement is not allowed, so I was thinking in making a method to pass a data reference to the new table, ask them to create a dynamic table and later use the fill_range method
Is this a decent aproach? I was thinking it was better to have the table as an attribute, but generic types are not allowed, I also know of structure RSPARAMS_TT but I don't want to use a fixed structure, I would only be accepting numbers, probably integers, so 45 should be ennough, but I really want it to work in any possible solution
2008 Jul 05 2:31 PM
Hi,
I think it is possible.
You can have a generic table in the exporting parameter.
For eg:
itab type STANDARD TABLE.
Using this you can pass any table of type standard to the user.
Regards,
Saurabh
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |