How to Write Web Reports in SAP
*&---------------------------------------------------------------------*
*& Report  ZWEBREPORT                                                  
*&---------------------------------------------------------------------*

REPORT  zwebreport                              .
TABLES:spfli.
DATA:qstring LIKE w3query OCCURS 10 WITH HEADER LINE,
      myhtml LIKE w3html OCCURS 10 WITH HEADER LINE,
      mymime LIKE w3mime OCCURS 10 WITH HEADER LINE.
DATA:funct(100).
START-OF-SELECTION.
GET spfli.
REFRESH qstring.
qstring-name = 'CARRIED'.qstring-value = spfli-carrid.
APPEND qstring.
qstring-name = 'CONNID'.qstring-value = spfli-connid.
APPEND qstring.
WRITE:/'o' HOTSPOT COLOR = 5,
  spfli-carrid,
  spfli-connid,
  spfli-cityfrom,
  spfli-cityto.

  CALL FUNCTION 'WWW_SET_URL'
    EXPORTING
      offset              = 0
      length              = 1
      func                = 'secondary_list'
   TABLES
    query_string        = qstring
   EXCEPTIONS
    invalid_table       = 1
     OTHERS              = 2
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  WRITE:/ 'error in that line'.
  ENDIF.

  END-OF-SELECTION.

  AT LINE-SELECTION.
  IF sy-cucol = 2.
  CALL FUNCTION 'WWW_GET_URL'
  IMPORTING
     func               = funct
  TABLES
    query_string       = qstring
            .

IF sy-subrc NE 1.
CALL FUNCTION funct
TABLES
query_string = qstring
html = myhtml
mime = mymime.
IF sy-subrc = 1.
WRITE'error'.
ENDIF.
ENDIF.

ENDIF.
ABAP Tips by :  Manas Ranjan Panda

Fast Links:
Get help for your ABAP problems
Do you have a ABAP Question?

SAP Books
SAP Certification, Functional, Basis Administration and ABAP Programming Reference Books

ABAP Tips
ABAP Forum for Discussion and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com

All the site contents are Copyright © www.sap-img.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.sap-img.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.sap-img.com or the content authors.