Code: Alles auswählen.
DATA: lv_day TYPE C LENGTH 2,
lv_month TYPE C LENGTH 2,
lv_year TYPE C LENGTH 4,
lv_months TYPE C LENGTH 4,
gv_date_start TYPE D,
gv_date_end TYPE D,
gv_newdate TYPE D.
AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN.
START-OF-SELECTION.
SELECTION-SCREEN BEGIN OF SCREEN 0102 TITLE text-001.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-002.
PARAMETERS: months LENGTH 3,
rfull RADIOBUTTON GROUP grp1,
rhalf RADIOBUTTON GROUP grp1,
rquart RADIOBUTTON GROUP grp1,
rmonth RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 0102.
CALL SELECTION-SCREEN 0102.
******************* Auswertungsende *******************
CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'
EXPORTING
I_DATE_OLD = sy-datum
IMPORTING
E_DATE_NEW = gv_date_end.
******************* Auswertungsbeginn *******************
IF sy-subrc = 0.
lv_months = months * '-1'.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = lv_months
OLDDATE = gv_date_end
IMPORTING
NEWDATE = gv_newdate.
lv_year = gv_newdate+0(4).
lv_month = gv_newdate+4(2).
lv_day = gv_newdate+6(2).
*** Ermittlung des aktiven Radiobuttons auf SelScreen
IF rfull = 'X'.
lv_month = '01'.
ELSE.
IF rhalf = 'X'.
IF lv_month =< '06'.
lv_month = '01'.
ELSE.
lv_month = '07'.
ENDIF.
ELSE.
IF rquart = 'X'.
CASE lv_month.
WHEN '01' OR '02' OR '03'.
lv_month = '01'.
WHEN '04' OR '05' OR '06'.
lv_month = '04'.
WHEN '07' OR '08' OR '09'.
lv_month = '07'.
WHEN '10' OR '11' OR '12'.
lv_month = '10'.
ENDCASE.
* ELSE.
* IF rmonth = 'X'. "schon in CALL FUNCTION 'RE_ADD_MONTH_TO_DATE' abgefangen
*
* ENDIF.
ENDIF.
ENDIF.
ENDIF.
lv_day = '01'.
CONCATENATE lv_year lv_month lv_day INTO gv_date_start.
CALL FUNCTION '/XXX/Programm'
EXPORTING: GV_PERIOD_START = GV_DATE_START "Auswertungsbeginn wird übergeben
GV_PERIOD_END = GV_DATE_END. "Auswertungsende wird übergeben
ELSE.
SET SCREEN 0.
LEAVE TO SCREEN 0.
ENDIF.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
Bjuti