&---------------------------------------------------------------------
*& Report Z_YY_PRG_004
*&
&---------------------------------------------------------------------
*&
*&
&---------------------------------------------------------------------
*REPORT Z_YY_PRG_004 line-SIZE 60 LINE-COUNT 10(2) NO STANDARD PAGE HEADING.
REPORT Z_YY_PRG_004 .
- NO STANDARD PAGE HEADING line-SIZE 30
*write ‘list heading testxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaaaa’.
*data : gt_sflight type TABLE OF sflight,
-
gs_sflight TYPE sflight.
*select-OPTIONS : s_carrid for gs_sflight-carrid.
*
*INITIALIZATION.
*s_carrid-sign = ‘I’.
*s_carrid-option = ‘EQ’.
*s_carrid-low =‘AA’.
*append s_carrid.
*
*START-OF-SELECTION.
*select carrid connid
- from sflight
- into CORRESPONDING FIELDS OF table gt_sflight
- WHERE carrid in s_carrid.
- end-of-SELECTION.
- loop at gt_sflight into gs_sflight.
- write : / gs_sflight-carrid , gs_sflight-connid.
- ENDLOOP.
*--------------------------------------------------------------------
*
*
*data l_fname(20) type c.
*
*PARAMETERS: p_1 DEFAULT ‘A’,
-
p_2 TYPE char10,
-
p_3 type c LENGTH 3 default ‘123’,
-
p_4 type p DECIMALS 2 DEFAULT ‘123456.789’,
-
p_5 like sflight-carrid,
-
p_6 MEMORY ID scl,
-
p_7 MATCHCODE OBJECT zcarrid,
-
p_8 MODIF ID mid,
-
p_9 NO-DISPLAY,
-
p_10 DEFAULT ‘a’ LOWER CASE,
-
p_11 OBLIGATORY,
-
p_12 as CHECKBOX,
-
p_13 RADIOBUTTON GROUP radi,
-
p_13_2 RADIOBUTTON GROUP radi,
-
P_14(10) VISIBLE LENGTH 3 DEFAULT ‘1234567890’,
-
p_15 like sflight-carrid value CHECK,
-
p_16 like (l_fname),
-
p_17 like sflight-carrid as LISTBOX VISIBLE LENGTH 3,
-
p_18 as CHECKBOX USER-COMMAND abc.
-
.
-
*TABLES : sflight.
*data : gs_scarr type scarr.
*data : gv_val type char20.
*
*SELECT-OPTIONS : s_1 for sflight-carrid default ‘AC’,
- s_2 for gs_scarr-carrid default ‘AA*’ OPTION eq sign I,
- s_3 for gv_val default ‘1111’ to ‘9999’,
- s_4 for gv_val default ‘AAA’ to ‘ZZZZ’ OPTION BT SIGN E,
- s_5 for sflight-carrid MEMORY ID scl,
- s_6 for gv_val MATCHCODE OBJECT zcarrid,
- s_7 for sflight-carrid MODIF ID car,
- s_8 for sflight-carrid no-DISPLAY,
- s_9 for sflight-carrid LOWER CASE,
- s_10 for sflight-carrid OBLIGATORY,
- s_11 for sflight-carrid no-EXTENSION,
- s_12 for sflight-carrid no INTERVALS,
- s_13 for sflight-carrid VISIBLE LENGTH 1
- .
*-----------------------------------------------------------------------------
*tables : scarr ,sscrfields.
*
*SELECTION-SCREEN begin of line.
-
SELECTION-SCREEN COMMENT 1(10) text_001 for field p_1.
-
PARAMETERS : p_1 like scarr-carrid.
** -
SELECTION-SCREEN POSITION POS_LOW.
-
PARAMETERS: p_2 like scarr-carrname.
-
SELECTION-SCREEN end of LINE.
-
SELECTION-SCREEN skip 2.
-
SELECTION-SCREEN ULINE.
-
SELECTION-SCREEN ULINE /1(10).
-
SELECTION-SCREEN ULINE pos_low(10).
-
SELECTION-SCREEN uline pos_high(10).
-
SELECTION-SCREEN PUSHBUTTON /pos_low(10) text-002 USER-COMMAND btn01.
-
SELECTION-SCREEN begin of BLOCK block WITH FRAME TITLE text-003.
-
PARAMETERS : p_3 type c.
-
SELECT-OPTIONS : s_1 for scarr-carrid.
-
SELECTION-SCREEN end of BLOCK block.
-
SELECTION-SCREEN begin of BLOCK block2 with FRAME TITLE text-004 NO INTERVALS.
-
PARAMETERS : p_4 type c.
-
SELECT-OPTIONS : s_2 for scarr-carrid.
-
SELECTION-SCREEN end of block block2.
-
SELECTION-SCREEN FUNCTION KEY 1.
-
INITIALIZATION.
-
move ‘Function Key 1’ to sscrfields-functxt_01.
-
at SELECTION-SCREEN.
-
if sscrfields-ucomm = ‘FC01’.
-
MESSAGE 'You clicked function Key 1 ' type 'I'.
-
ENDIF.
-
if sscrfields-ucomm = ‘BTN01’.
-
MESSAGE 'You click function Key button' type 'I'.
-
ENDIF.
-
*TABLES : sflight.
-
PARAMETERS : p_carrid like sflight-carrid,
-
p_connid like sflight-connid.
-
SELECT-OPTIONS : s_fldate for sflight-fldate.
-
INITIALIZATION.
-
p_carrid = 'AA'.
-
p_connid = '17'.
-
s_fldate-low = '20190101'.
-
s_fldate-high = '20190102'.
-
append s_fldate.
-
--------------------------------------------------------
-
data : g_total type i,
-
g_cnt type i,
-
g_index type i.
*data : gt_sflight type TABLE OF sflight with HEADER LINE.
*
*START-OF-SELECTION.
-
select * into CORRESPONDING FIELDS OF TABLE gt_sflight
-
from sflight.
-
DESCRIBE TABLE gt_sflight LINES g_total.
-
LOOP AT gt_sflight.
-
g_cnt = g_cnt + 1.
-
PERFORM progress_indicator USING g_cnt g_total 'Progressing...' .
-
ENDLOOP.
-
write : 'success'.
*&---------------------------------------------------------------------
**& Form PROGRESS_INDICATOR
*&---------------------------------------------------------------------
** text
*----------------------------------------------------------------------
** -->P_G_CNT text
** -->P_G_TOTAL text
** -->P_0053 text
*----------------------------------------------------------------------
*FORM PROGRESS_INDICATOR USING value(p_cur)
-
value(p_total)
-
VALUE(P_text).
- data : lv_text(50) type c,
-
lv_idx(3) type n.
- lv_idx = ( p_cur / p_total ) * 100.
- CONCATENATE lv_idx ‘%:’ p_text INTO lv_text.
*CALL FUNCTION ‘SAPGUI_PROGRESS_INDICATOR’
- EXPORTING
- PERCENTAGE = lv_idx
- TEXT = lv_text
-
.
*ENDFORM. " PROGRESS_INDICATOR
*-----------------------------------------------------------------------------------
*end of selection
*
*
*data : gs_str type scarr,
*gt_itab type TABLE OF scarr.
*
*START-OF-SELECTION.
*select * INTO CORRESPONDING FIELDS OF TABLE gt_itab
- from scarr.
*end-of-SELECTION.
- loop at gt_itab into gs_str.
- write : / gs_str-carrid , gs_str-carrname.
- ENDLOOP.
*------------------------------------------------------
*top-of-page
*
*TOP-OF-PAGE.
-
write : sy-title,60 ‘page No:’ ,sy-pagno.
-
uLine.
-
write : / ‘Enjoy abap’,sy-datum.
-
ULINE.
-
START-OF-SELECTION.
-
do 50 times.
-
write / sy-index.
-
enddo.
-
*TOP-OF-PAGE .
- write : ‘Top of page’.
- ULINE at /(60).
- end-of-PAGE .
- ULINE.
- write : /30 ‘Page No:’,sy-pagno.
- START-OF-SELECTION.
- do 20 times.
- write / sy-index.
- ENDDO.
*----------------------------------------------------------
*
- START-OF-SELECTION.
- write ‘first List’.
- FORMAT HOTSPOT on COLOR 7.
- write : / ‘click this line’.
- FORMAT HOTSPOT off color off.
- AT LINE-SELECTION.
-
write : 'Secondary List'.
-
write : / 'sy-ucomm=', sy-ucomm.
*------------------------------------------------------------
data: gs_scarr type scarr,
gt_scarr TYPE TABLE OF scarr,
gv_fname(20) type c,
gv_value(20) type c,
gv_carrid like scarr-carrid,
gv_carrname like scarr-carrname.
at LINE-SELECTION.
get CURSOR FIELD gv_fname VALUE gv_value.
case gv_fname.
when ‘GS_SCARR-CARRID’.
SPLIT sy-lisel at ’ ’ into gv_carrid gv_carrname.
write : gv_carrid, gv_carrname.
when OTHERS.
ENDCASE.
START-OF-SELECTION.
select * into CORRESPONDING FIELDS OF TABLE gt_scarr
from scarr.
LOOP at gt_scarr into gs_scarr.
WRITE : / gs_scarr-carrid, gs_scarr-carrname.
ENDLOOP.