ABAP/4 Example Code: HIDE and AT LINE-SELECTION

Example

DATA: it_spfli TYPE TABLE OF spfli WITH HEADER LINE,
      it_sflight TYPE TABLE OF sflight WITH HEADER LINE.


START-OF-SELECTION.
  SELECT * FROM spfli
           INTO TABLE it_spfli.
  IF SY-SUBRC = 0.
    LOOP AT it_spfli.
      WRITE:/ it_spfli-CARRID, it_spfli-CONNID,
              it_spfli-CITYFROM, it_spfli-AIRPFROM,
              it_spfli-CITYTO, it_spfli-AIRPTO.
      HIDE: it_spfli-CARRID, it_spfli-CONNID.
    ENDLOOP.
  ENDIF.

AT LINE-SELECTION.
  SELECT * FROM sflight
           INTO TABLE it_sflight
           WHERE carrid = it_spfli-carrid
             AND connid = it_spfli-connid.
  IF SY-SUBRC = 0.
    FORMAT COLOR = 3.
    WRITE:/ it_spfli-CARRID, it_spfli-CONNID.
    FORMAT COLOR OFF.
    LOOP AT it_sflight.
      WRITE:/ it_sflight-FLDATE, it_sflight-PRICE.
    ENDLOOP.
  ENDIF.

The output is:

 img104

When line selected by double click
img105

Technorati Tags: ,

this code is gud example

hi, i was looking for some gud example of at line slection and this is the simplest and best example which i had got ,hope u find it d same...

Post new comment