Automatic variants in reports
2011-10-17

When developing a report with a selection screen it is very annoying that every time we test it we have to input the test data to the selection screen. We usually end up creating a variant of the test to save us from this hassle. But, every time we run the report we still have to manually call this variant.
Here is a simple way to automatically call a variant.
This code can be inserted into the INITIALIZATION event during the development of the program:
INITIALIZATION.
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = sy-repid
variant = 'TESTE'
EXCEPTIONS
VARIANT_NOT_EXISTENT = 1
VARIANT_OBSOLETE = 2
OTHERS = 3.
Thank you Sérgio Fraga for the tip.
(And thank you to Telstar Logistics for the photo)
Greetings from Abapinho.
17 de October de 2011 às 07:54 PM
[…] ressaltar: Dica do blog do abapinho. https://abapinho.com/2011/10/variantes-automaticas/ Gostar disto:GostoBe the first to like this […]
18 de October de 2011 às 04:15 PM
Muito Obrigado pela dica! Dá um jeitaço!