在带有验证的单选按钮上执行报告程序?

Execute a report program on radio button with validations?

我正在尝试 运行 2 个报告程序,REPORTS_1REPORTS_2。只有选中第一个单选按钮并填写所有参数(参数字段为总是强制性的?)。而第二个程序REPORTS_2只有在选中第二个单选按钮并填写所有相应参数时才会执行。下面是代码。这是调用 SUBMIT 的地方和正确方法吗?

* Selection screen 1
SELECTION-SCREEN BEGIN OF BLOCK flight_block WITH FRAME TITLE text-002.
    PARAMETERS: carrid TYPE sbook-carrid MODIF ID sc1.
    PARAMETERS: connid TYPE sbook-connid MODIF ID sc1.
    PARAMETERS: fldate TYPE sbook-fldate MODIF ID sc1.
SELECTION-SCREEN END OF BLOCK flight_block.
*Selection screen 2
SELECTION-SCREEN BEGIN OF BLOCK customid_block WITH FRAME TITLE text-003.
    PARAMETERS: customid TYPE sbook-customid MODIF ID sc2.
SELECTION-SCREEN END OF BLOCK customid_block.
AT SELECTION-SCREEN OUTPUT.
* Toggle the selection screens based on radio buttons
 LOOP AT SCREEN.
     IF rad_flt = 'X' AND screen-group1 = 'SC2'.
         PERFORM modify_screen. "Calling subroutine
         SUBMIT Z15081947_MINI_REPORTS_1 AND RETURN. " Issue???
     ELSEIF rad_cus = 'X' AND screen-group1 = 'SC1'.
         PERFORM modify_screen. "Calling subroutine
         SUBMIT Z15081947_MINI_REPORTS_2 AND RETURN. " Issue???
     ENDIF.
 ENDLOOP.
* Subroutines.
FORM modify_screen.
 screen-active = 0.
 MODIFY SCREEN.
ENDFORM.

我没有看到单选按钮声明。我假设它是这样的:

PARAMETERS rad_flt type char01 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND RAD.
PARAMETERS rad_cus type char01 RADIOBUTTON GROUP g1.

此处 USER-COMMAND RAD 部分在单选按钮更改后立即触发 PBO/PAI。

关于报告的调用:事件 AT SELECTION-SCREEN OUTPUT 不适合放置 SUMBIT 语句,因为它将在 PBO 调用,可能不允许用户显示选择完全没有屏幕。

更常见的做法是仅更改 AT SELECTION-SCREEN OUTPUT

中的屏幕字段(字段停用)
AT SELECTION-SCREEN OUTPUT.
* Toggle the selection screens based on radio buttons
   LOOP AT SCREEN.
     IF rad_flt = 'X' AND screen-group1 = 'SC2'.
         PERFORM modify_screen. "Calling subroutine
     ELSEIF rad_cus = 'X' AND screen-group1 = 'SC1'.
         PERFORM modify_screen. "Calling subroutine
     ENDIF.
 ENDLOOP.

并执行 START-OF-SELECTION 部分中的剩余逻辑,例如:

START-OF-SELECTION.
  CASE 'X'.
  WHEN rad_flt.
    IF carrid IS NOT INITIAL AND
       connid IS NOT INITIAL AND
       fldate IS NOT INITIAL.
      SUBMIT Z15081947_MINI_REPORTS_1 AND RETURN.
    ENDIF.
  WHEN rad_cus.
    IF customid IS NOT INITIAL.
      SUBMIT Z15081947_MINI_REPORTS_2 AND RETURN.
    ENDIF.
  ENDCASE.