Uday's website
Published on Uday's website (https://uday.net)

Home > SAP Technical > How-To > Write variant-specific code

Write variant-specific code

We can write ABAP code that will be executed for a particular variant only.

For this, we use ABAP system fields from SYST structure.

Sample code is as follows:

      IF sy-slset = 'XI_SHARP_RESET'.
        gs_output-removal_flag = 'Y'.
      ELSE.
        gs_output-removal_flag = 'N'.
      ENDIF.

In the above code, removal flag is set to 'Y' only if program is run using variant name = 'XI_SHARP_RESET'.

For any other variant, it is set to 'N'.

  • Log in [1] to post comments

 Valid XHTML 1.0 StrictCreative Commons LicenseVerbatim copying and redistribution of this entire page are permitted provided this notice is preserved. All content on this website including archives (including text, photographs, audio files and any other original work), unless otherwise noted, is licensed under a Creative Commons License or later.


Source URL:https://uday.net/write-variant-specific-code

Links
[1] https://uday.net/user/login?destination=node/527%23comment-form