*全局变量结构 DATA: BEGIN OF GS_SFLIGHT_S, CARRID LIKE SFLIGHT-CARRID, CONNID LIKE SFLIGHT-CONNID, FLDATE LIKE SFLIGHT-FLDATE, END OF GS_SFLIGHT_S, GT_SFLIGHT_S LIKE TABLE OF GS_SFLIGHT_S.
*--------------------------Variables-----------------------------------* CONSTANTS: BEGIN OF LS_HEADER, CARTEXT TYPE CHAR12 VALUE 'Airline Code', CONTEXT TYPE CHAR17 VALUE 'Connection Number', FLDTEXT TYPE CHAR11 VALUE 'Flight date', END OF LS_HEADER. DATA: LV_TABIX TYPE SY-TABIX, LV_HEADER TYPE RGSEL-SEL_TITLE1, LV_TITLE TYPE RGSEL-DYNP_TITLE VALUE 'ALV Report Popup'. *----------------------------Logic-------------------------------------* CHECK GT_SFLIGHT IS NOT INITIAL. MOVE-CORRESPONDING GT_SFLIGHT TO GT_SFLIGHT_S. SORT GT_SFLIGHT BY CARRID.
*--------------------------Variables-----------------------------------* CONSTANTS: LC_C TYPE C LENGTH 1 VALUE 'C', LC_SEL TYPE C LENGTH 3 VALUE 'SEL', LC_TABNAME TYPE DD02L-TABNAME VALUE 'SFLIGHT'.
DATA: BEGIN OF LS_SFLIGHT, SEL TYPE C, CARRID TYPE SFLIGHT-CARRID, CONNID TYPE SFLIGHT-CONNID, FLDATE TYPE SFLIGHT-FLDATE, END OF LS_SFLIGHT, LT_SFLIGHT LIKE TABLE OF LS_SFLIGHT.
DATA: LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, LS_FIELDCAT LIKE LINE OF LT_FIELDCAT. *----------------------------Logic-------------------------------------* CHECK GT_SFLIGHT IS NOT INITIAL. "Get Selected Data MOVE-CORRESPONDING GT_SFLIGHT TO LT_SFLIGHT. SORT LT_SFLIGHT BY CARRID.
"Set Fieldcatalog CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING I_PROGRAM_NAME = SY-REPID I_STRUCTURE_NAME = LC_TABNAME I_INCLNAME = SY-REPID I_BYPASSING_BUFFER = GC_X CHANGING CT_FIELDCAT = LT_FIELDCAT EXCEPTIONS INCONSISTENT_INTERFACE = 1 PROGRAM_ERROR = 2 OTHERS = 3. IF SY-SUBRC <> 0. * Gets The field directory exception MESSAGE TEXT-E02 TYPE GC_S DISPLAY LIKE GC_E. EXIT. ENDIF.
DELETE LT_FIELDCAT WHERE FIELDNAME NE 'CARRID' AND FIELDNAME NE 'CONNID' AND FIELDNAME NE 'FLDATE'.
LOOP AT LT_FIELDCAT INTO LS_FIELDCAT. LS_FIELDCAT-KEY = GC_NULL. LS_FIELDCAT-OUTPUTLEN = 15. CASE LS_FIELDCAT-FIELDNAME. WHEN 'CARRID'. LS_FIELDCAT-JUST = LC_C. LS_FIELDCAT-SELTEXT_L = 'Airline Code'. WHEN 'CONNID'. LS_FIELDCAT-JUST = LC_C. LS_FIELDCAT-SELTEXT_L = 'Connection Number'. WHEN 'FLDATE'. LS_FIELDCAT-JUST = LC_C. LS_FIELDCAT-SELTEXT_L = 'Flight date'. WHEN OTHERS. ENDCASE. MODIFY LT_FIELDCAT FROM LS_FIELDCAT TRANSPORTING KEY SELTEXT_L JUST OUTPUTLEN. CLEAR: LS_FIELDCAT. ENDLOOP.
*全局变量结构 DATA: BEGIN OF GS_TEXT, TDLINE TYPE CHAR255, END OF GS_TEXT, GT_TEXT LIKE TABLE OF GS_TEXT. *----------------------------Logic-------------------------------------* CHECK GT_TEXT IS NOT INITIAL.
"Call Display Text Value Function CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY_OK' EXPORTING ENDPOS_COL = 72 "结束列 ENDPOS_ROW = 20 "结束行 STARTPOS_COL = 1 "开始列 STARTPOS_ROW = 1 "开始行 TITLETEXT = 'Display Text Value' "弹框标题 * IMPORTING * CHOISE = "表条目数 TABLES VALUETAB = GT_TEXT "展示内容的内表 EXCEPTIONS BREAK_OFF = 1 OTHERS = 2. IF SY-SUBRC <> 0. "Text Value Function Error MESSAGE TEXT-E03 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
*--------------------------Variables-----------------------------------* CONSTANTS: LC_TITLE TYPE STRING VALUE 'Dialog Popup', LC_TEXT1 TYPE STRING VALUE 'Text One', LC_TEXT2 TYPE STRING VALUE 'Text Two'. *----------------------------Logic-------------------------------------* CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT' EXPORTING TITEL = LC_TITLE TEXTLINE1 = LC_TEXT1 TEXTLINE2 = LC_TEXT2 * START_COLUMN = 25 * START_ROW = 6 . IF SY-SUBRC NE 0. "Text Value Function Error MESSAGE TEXT-E03 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
*--------------------------Variables-----------------------------------* CONSTANTS: LC_TITLE TYPE STRING VALUE 'Dialog Popup'. DATA: LV_RETURN TYPE C, LS_FIELDS TYPE SVAL, LT_FIELDS TYPE TABLE OF SVAL. *----------------------------Logic-------------------------------------* CLEAR: LT_FIELDS.
"Set Input Value Field LS_FIELDS-TABNAME = 'SFLIGHT'. LS_FIELDS-FIELDNAME = 'CARRID'. LS_FIELDS-FIELDTEXT = 'Airline Code'. APPEND LS_FIELDS TO LT_FIELDS.
*全局变量结构 DATA: BEGIN OF GS_TEXT, TDLINE TYPE CHAR255, END OF GS_TEXT, GT_TEXT LIKE TABLE OF GS_TEXT. *--------------------------Variables-----------------------------------* DATA: LV_TITLE TYPE STRING VALUE 'Text Box'. *----------------------------Logic-------------------------------------* CHECK GT_TEXT IS NOT INITIAL.
CALL FUNCTION 'ADA_POPUP_WITH_TABLE' EXPORTING STARTPOS_COL = 1 STARTPOS_ROW = 1 * TITLETEXT = LV_TITLE * WORDWRAP_POSITION = TABLES VALUETAB = GT_TEXT. IF SY-SUBRC NE 0. "Text pop-up function exception MESSAGE TEXT-E04 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
*全局变量结构 DATA: BEGIN OF GS_TEXT, TDLINE TYPE CHAR255, END OF GS_TEXT, GT_TEXT LIKE TABLE OF GS_TEXT. *--------------------------Variables-----------------------------------* DATA: LV_TITLE TYPE STRING VALUE 'Text Box'. *----------------------------Logic-------------------------------------* CHECK GT_TEXT IS NOT INITIAL. CALL FUNCTION 'TERM_CONTROL_EDIT' EXPORTING TITEL = LV_TITLE LANGU = SY-LANGU TABLES TEXTLINES = GT_TEXT EXCEPTIONS USER_CANCELLED = 1 OTHERS = 2. IF SY-SUBRC <> 0 AND SY-SUBRC <> 1. "Text pop-up function exception MESSAGE TEXT-E04 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
"全局内表结构 DATA: BEGIN OF GS_MESSAGE, MSGID TYPE BAL_S_MSG-MSGID, MSGNO TYPE BAL_S_MSG-MSGNO, MSGTY TYPE BAL_S_MSG-MSGTY, MSGV1 TYPE BAL_S_MSG-MSGV1, MSGV2 TYPE BAL_S_MSG-MSGV2, END OF GS_MESSAGE, GT_MESSAGE LIKE TABLE OF GS_MESSAGE. "初始值设置 REFRESH: GT_MESSAGE.
*--------------------------Variables-----------------------------------* DATA: LS_COMMAND TYPE BAL_S_EXCM, LT_MESSAGE TYPE RS_T_MSG. *----------------------------Logic-------------------------------------* "Get Message Value MOVE-CORRESPONDING GT_MESSAGE TO LT_MESSAGE.
"Call Message List Popup CALL FUNCTION 'RSDC_SHOW_MESSAGES_POPUP' EXPORTING I_T_MSG = LT_MESSAGE "Message 列表 I_TXT = 'Message List' "弹框标题 * I_WITH_S_ON_EMPTY = RS_C_TRUE "S消息,如果列表为空 * I_ONE_MSG_DIRECT = RS_C_TRUE "如果只有一条消息,则直接输出 * I_ONE_MSG_TYPE_S = RS_C_TRUE "将消息输出为“S”消息 IMPORTING E_S_EXIT_COMMAND = LS_COMMAND. "弹框点击按钮的返回值 IF SY-SUBRC NE 0. "Message pop-up exception MESSAGE TEXT-E06 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
*--------------------------Variables-----------------------------------* DATA: LS_MESSAGE TYPE ESP1_MESSAGE_WA_TYPE, LT_MESSAGE TYPE ESP1_MESSAGE_TAB_TYPE. *----------------------------Logic-------------------------------------* "Get Message Value LOOP AT GT_MESSAGE INTO GS_MESSAGE. LS_MESSAGE-LINENO = SY-TABIX. MOVE-CORRESPONDING GS_MESSAGE TO LS_MESSAGE. INSERT LS_MESSAGE INTO TABLE LT_MESSAGE. CLEAR: GS_MESSAGE,LS_MESSAGE. ENDLOOP.
CALL FUNCTION 'C14Z_MESSAGES_SHOW_AS_POPUP' * EXPORTING * I_MSGID = * I_MSGTY = * I_MSGNO = * I_MSGV1 = * I_MSGV2 = * I_MSGV3 = * I_MSGV4 = * I_LINENO = TABLES I_MESSAGE_TAB = LT_MESSAGE. IF SY-SUBRC NE 0. "Message pop-up exception MESSAGE TEXT-E06 TYPE GC_S DISPLAY LIKE GC_E. ENDIF.
*--------------------------Variables-----------------------------------* DATA: LS_WANTED TYPE SMESG, LS_COMMAND TYPE BAL_S_EXCM. *----------------------------Logic-------------------------------------* "Initial Message List CALL FUNCTION 'MESSAGES_INITIALIZE'.