Display an output list in HTML format for the Web

Display an output list in HTML format for the Web

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

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.