I want to reuse elements on a Selection Screen or Data / Type declarations which normally belong into a top include. I have several Reports sharing several elements on the selection screen. The same Reports share various data elements in regards to the application log, hence the question of reusability.
Since the SAP Programming Guidelines states
Do not use include programs more than once .
Use an include program for the modularization of exactly one master program.
We strongly recommended using only suitable means for reuse, such as global classes or interfaces
I am looking for alternatives to achieve my goal.
The only way I can think of using a global class for this is by defining class attributes instead of the data declarations and use those as variables.
class->Attribute = desired_value
This seems a bit weird, albeit very close to how classes are used for constants. On the other Hand I could then just create a structure in the DDIC containing all desired declarations as components.
Macros would be my last idea and the only one concerning the Selection Screen elements.
DEFINE test.
PARAMETERS: pa_delta TYPE c AS CHECKBOX.
PARAMETERS: pa_date TYPE dats.
END-OF-DEFINITION.
TABLES: lfb1.
SELECT-OPTIONS: so_lifnr FOR lfb1-lifnr.
SELECT-OPTIONS: so_bukrs FOR lfb1-bukrs.
test.
How would you solve this Problem?