实现方式1:
*&---------------------------------------------------------------------*
*& Report YCX_006
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT YDEMO_021.
TABLES: marc,ztpp0038,sscrfields.
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
PARAMETERS: p_file TYPE rlgrap-filename MODIF ID cj.
SELECT-OPTIONS: s_gc FOR marc-werks NO INTERVALS NO-EXTENSION MODIF ID cj."工厂
PARAMETERS: p_del TYPE c AS CHECKBOX DEFAULT abap_true MODIF ID cj.
SELECT-OPTIONS: s_werks FOR ztpp0038-werks MODIF ID cx,
s_ernam FOR ztpp0038-ernam MODIF ID cx,
s_ersda FOR ztpp0038-ersda DEFAULT sy-datum MODIF ID cx,
s_uzeit FOR ztpp0038-uzeit MODIF ID cx.
SELECTION-SCREEN:END OF BLOCK b1.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002.
PARAMETERS: p_cj TYPE c RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND flag1,
p_cx TYPE c RADIOBUTTON GROUP gp1.
SELECTION-SCREEN:END OF BLOCK b2.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (12) s_text MODIF ID cj.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (60) s_text1 MODIF ID cj.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (60) s_text2 MODIF ID cj.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (60) s_text3 MODIF ID cj.
SELECTION-SCREEN END OF LINE.
........
INITIALIZATION.
PERFORM frm_init_text.
AT SELECTION-SCREEN OUTPUT.
PERFORM frm_control_field.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL METHOD zcl_jt=>f4_file_excel
CHANGING
cv_file_name = p_file.
START-OF-SELECTION.
WRITE:'hello world'.
*&---------------------------------------------------------------------*
*& Form FRM_CONTROL_FIELD
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM frm_control_field .
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'CJ'.
screen-active = COND #( WHEN P_CJ IS NOT INITIAL THEN 1 ELSE 0 ).
WHEN 'CX'.
screen-active = COND #( WHEN P_CX IS NOT INITIAL THEN 1 ELSE 0 ).
WHEN OTHERS.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
IF p_cj IS NOT INITIAL.
sscrfields-functxt_01 = VALUE smp_dyntxt( icon_id = icon_export icon_text = |{ TEXT-003 }| ).
ELSE.
CLEAR: sscrfields-functxt_01.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form FRM_INIT_TEXT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM frm_init_text .
s_text = |{ icon_message_warning }{ TEXT-T00 }|.
s_text1 = |{ TEXT-T01 }|.
s_text2 = |{ TEXT-T02 }|.
s_text3 = |{ TEXT-T03 }|.
ENDFORM.
实现方式2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(77) comm1.
SELECTION-SCREEN END OF LINE.
*----------------------------------------------------------------------*
* INITIALIZATION.
*----------------------------------------------------------------------*
INITIALIZATION.
PERFORM frm_init_data.
FORM frm_init_data .
DATA: lv_subscreen TYPE string .
comm1 = icon_message_warning && '!!!注意:导入前请先关闭Excel文件'(s10).
mytab-prog = sy-repid.
ENDFORM.
你盯着我
不关注
不点赞
不评论
难道是想暗算我 ???
卡忙on,用丘比特的箭暗算我吧!
笔芯准备 I'm ready!!
来不及解释了,快上车!!!