AllSapLinks.com
Writing the values of Parameters/Select-options
This tip has been copied from SearchSap.com
Tip submitted by: Tom Meyer
The tip e-mail you sent on Describe Select-Options is 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!
Code
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.
All of the product names here are trademarks of their respective companies. The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity. Information used on this site is at your own risk.