"
Supported by

Automatic variants in reports

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.

2 comentários a “Automatic variants in reports”

  1. Função RS_SUPPORT_SELECTIONS « SAP – ABAP – Ceará Diz:

    […] ressaltar: Dica do blog do abapinho. https://abapinho.com/2011/10/variantes-automaticas/ Gostar disto:GostoBe the first to like this […]

  2. Fabio Branquinho Diz:

    Muito Obrigado pela dica! Dá um jeitaço!

Deixe um comentário


About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).