Avoid customizing e-mails from Describe Select-Options

Learn how to avoid customizing e-mails from Describe Select-Options in this user-submitted tip.

The tip e-mail you sent on Describe Select-Options may be useful. However, you would need to customize it for each

select-option/parameter in program's selection screen. That is tedious, time consuming, and error prone.

Why not use a standard FM? This routine that I have written code can be dropped in to any program as is, no mods.
It shows only options with values, leaves out "no-display" selections, and has a pretty frame to boot!


DATA: BEGIN OF INFO OCCURS 0,
      FLAG,
      OLENGTH TYPE X,
      LINE  LIKE RSVAR-INFOLINE,
      END OF INFO,
      DELETE_INDEX LIKE SY-TABIX.
.
.
.
PERFORM FRONT_PAGE.

FORM FRONT_PAGE.
CALL FUNCTION 'RS_COVERPAGE_SELECTIONS'
     EXPORTING
          REPORT            = SY-CPROG
          VARIANT           = ' '                    "sy-slset
          NO_IMPORT         = ' '
     TABLES
          INFOTAB           = INFO
     EXCEPTIONS
          ERROR_MESSAGE     = 1
          VARIANT_NOT_FOUND = 3
          OTHERS            = 2.
*         others            = 4.

LOOP AT INFO.
*  Clean up blank lines and "No selections"
   IF INFO-LINE CS 'No selections'
   OR INFO-LINE+1(77) IS INITIAL.
     DELETE_INDEX = SY-TABIX - 1.
     DELETE INFO INDEX SY-TABIX.
     READ TABLE INFO INDEX DELETE_INDEX.
     IF NOT INFO-LINE+2(1) IS INITIAL.
       DELETE INFO INDEX DELETE_INDEX.
     ENDIF.
     CONTINUE.
   ENDIF.
ENDLOOP.
PERFORM WRITE_COVER.
ENDFORM.

FORM WRITE_COVER.
LOOP AT INFO.
    IF INFO-LINE CS 'Invisible'.
      INFO-LINE = SY-ULINE.
      WRITE: / INFO-LINE.
      EXIT.
    ENDIF.
    WRITE: / INFO-LINE.
  ENDLOOP.
  NEW-PAGE.
ENDFORM.
This was first published in March 2001

Dig deeper on SAPscript and Smart Forms

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close