Accepts a wild card '*' as input parameter as program input and then uses the variant table to generate the output. Calls 2 functions namely 'ws_download' and 'call_browser' and displays the output in HTML format. Call Browser calls the default setup browser (IE) or (Netscape) as the case may be.
REPORT ZYSRM006 NO STANDARD PAGE HEADING.
************************************************************************
* Program to display the output list to html format.
* Date : 04/10/1999.
************************************************************************
TABLES: VARIT. "Variant directory
DATA: BEGIN OF ITAB OCCURS 10,
WW_REPT LIKE SY-REPID,
WW_VARID LIKE VARIT-VARIANT,
WW_VTEXT LIKE VARIT-VTEXT,
END OF ITAB.
DATA: FLDS LIKE W3FIELDS OCCURS 10.
DATA: F_HTML LIKE W3HTML OCCURS 10 WITH HEADER LINE.
PARAMETERS : REPT LIKE SY-REPID OBLIGATORY. "Accepts Report/Prg Name.
IF REPT CS '*'. "Check for wild card character.
WHILE ( SY-SUBRC EQ 0 ).
REPLACE '*' WITH '%' INTO REPT.
ENDWHILE.
ENDIF.
SELECT REPORT VARIANT VTEXT INTO
(ITAB-WW_REPT, ITAB-WW_VARID, ITAB-WW_VTEXT)
FROM VARIT
WHERE REPORT LIKE REPT AND LANGU LIKE SY-LANGU.
IF SY-SUBRC EQ 0.
APPEND ITAB.
ENDIF.
ENDSELECT.
CALL FUNCTION 'WWW_ITAB_TO_HTML'
TABLES
HTML = F_HTML
FIELDS = FLDS
ITABLE = ITAB.
IF SY-SUBRC NE 0.
WRITE: / 'Error in
Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial Director generating the html format'.
EXIT.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = 'c:test.html'
MODE = 'BIN'
TABLES
DATA_TAB = F_HTML
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE: / 'Output Saved in file c:test1.html'.
ENDIF.
CALL FUNCTION 'CALL_BROWSER'
EXPORTING
URL = 'c:test1.html'
EXCEPTIONS
FRONTEND_NOT_SUPPORTED = 1
FRONTEND_ERROR = 2
PROG_NOT_FOUND = 3
NO_BATCH = 4
UNSPECIFIED_ERROR = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
This was first published in September 2001