‎2007 Jul 18 6:49 AM
Hello,
I am writing one report, in which I am using macors.
Macro definition
define _sel.
select-options: &1 for &2.
end-of-definition.
loop at lt_dfies into ls_dfies.
For testing purposes,
concatenate ls_dfies-tabname ls_dfies-fieldname into lv_field separated by '-'.
sel lvsel lv_field.
endloop.
when i check this code.. it says lv_sel is already declared, whereas it is not ?
can you tell me where the error is ?
I have made sure that there is NO Include in the report and there is no place the data has been declared ...
any pointers if we have to do something special with macro's
‎2007 Jul 18 7:04 AM
Before the program execute, macro is resolved once and only once as
SELECT-OPTIONS LV_SEL FOR LV_FIELD.Try to execute in debug, you will get a select-options parameter at the beginning of your program.
Abap doesn't resolve this declaration dynamically.
If you want to dynamically set select-options, look at <a href="http://sap.ittoolbox.com/code/archives.asp?i=10&d=3038&a=s">Source: Dynamic Table Maintenance (enhanced)</a>, there you will find a program which maintain a table dynamically defined with denamic selections like in logical database.
Regards