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 last published in March 2001

Dig Deeper on SAPscript and Smart Forms

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close