Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Author: Joyjit Ghosh
Submitted: 27.09.2008

Code:

Error rendering macro 'code': Invalid value specified for parameter 'lang'
*&---------------------------------------------------------------------*
*& Report  Z_DEMO_JG
*&
*&---------------------------------------------------------------------*
*& Go to any page of a report directly form selection screen
*&---------------------------------------------------------------------*

REPORT  z_demo_jg LINE-SIZE 80 LINE-COUNT 50
                                     NO STANDARD PAGE HEADING.
TABLES: sflight.

* Type declaration
TYPES : BEGIN OF ty_flight,
         carrid(19) TYPE c,
         connid(18) TYPE c,
         fldate LIKE sflight-fldate,
         fldate1(14) TYPE c,
         planetype(13) TYPE c,
        END OF ty_flight.

* Data declaration
DATA: i_flight TYPE STANDARD TABLE OF ty_flight,
      w_flight TYPE ty_flight.
DATA: field(50) TYPE c.
DATA: part1(30) TYPE c,
      part2(30) TYPE c.

DATA: l_counter TYPE i.
* Selection screen
SELECT-OPTIONS: s_carrid FOR sflight-carrid.
PARAMETERS: p_page TYPE int3.


START-OF-SELECTION.

* Fetch data from sflight table
  SELECT carrid
         connid
         fldate
         planetype
   FROM sflight
  INTO CORRESPONDING FIELDS OF TABLE i_flight
  WHERE carrid IN s_carrid.

  CHECK sy-subrc = 0.


* Display final data
  PERFORM display_data.


TOP-OF-PAGE.

* Display report header
  PERFORM display_column_name.



*&---------------------------------------------------------------------*
*&      Form  display_column_name
*&---------------------------------------------------------------------*
*       Display column header
*----------------------------------------------------------------------*
*       None
*----------------------------------------------------------------------*
FORM display_column_name .



  WRITE: /10 'Program name:', sy-repid.
  WRITE: /10 'Page no:', sy-pagno.


* Display report header
  SKIP.
  ULINE.
  FORMAT INTENSIFIED ON COLOR 1.
  WRITE: 1 sy-vline,
         2 'Airline Code'(001),
         21 sy-vline,
         22 'Flight Connection'(002),
         40 sy-vline,
         41 'Flight date'(003),
         55 sy-vline,
         56 'Aircraft Type'(004),
         80 sy-vline.
  ULINE.

ENDFORM.                    " display_column_name

*&---------------------------------------------------------------------*
*&      Form  display_data
*&---------------------------------------------------------------------*
*       Display flight data
*----------------------------------------------------------------------*
*       None
*----------------------------------------------------------------------*
FORM display_data .



  CLEAR w_flight.

* Display report final data
  LOOP AT i_flight INTO w_flight.
    w_flight-fldate1 = w_flight-fldate.
    FORMAT INTENSIFIED ON COLOR 2.
    WRITE: 1 sy-vline,
           2 w_flight-carrid,
           21 sy-vline,
           22 w_flight-connid,
           40 sy-vline,
           41 w_flight-fldate1,
           55 sy-vline,
           56 w_flight-planetype,
           80 sy-vline.

    ULINE.

  ENDLOOP.


  IF p_page IS NOT INITIAL AND p_page > 0.

*   Check whether any page exist with the number entered
*   in the selection screen
    READ LINE 1 OF PAGE p_page.
    IF sy-subrc = 0.

*     If exist then scroll down to that page
      SCROLL LIST TO PAGE p_page LINE 1 .
    ELSE.

*     Otherwise display information message and continue
*     processing
      MESSAGE i000(z_zzz_ca_messages)
          WITH 'Page number does not exist'(001).

    ENDIF.
  ENDIF.

ENDFORM.                    " display_data