Code: Alles auswählen.
PARAMETERS:
p_werk TYPE t320-werks,
p_lgnum TYPE t320-lgnum .
Code: Alles auswählen.
* TABEL ist obsolet
DATA: gs_flight TYPE sflight.
DATA: gs_t320 TYPE t320.
DATA: gt_t320 TYPE t320.
DATA: BEGIN OF gty_lgnum,
lgnum TYPE t320-lgnum,
END OF gty_lgnum.
DATA: gt_lgnum LIKE TABLE OF gty_lgnum.
DATA: BEGIN OF gty_werk,
werks TYPE t320-werks,
END OF gty_werk.
DATA: gt_werk LIKE TABLE OF gty_werk.
DATA: it_return type STANDARD TABLE OF DDSHRETVAL.
DATA: wa_return like line of it_return.
SELECTION-SCREEN BEGIN OF BLOCK h100 WITH FRAME TITLE text-010.
SELECT-OPTIONS s_ca FOR gs_flight-carrid.
SELECT-OPTIONS s_date FOR gs_flight-fldate.
*zuerst müssen wir ein search help erstellen.
PARAMETERS:
p_werk TYPE t320-werks,
p_lgnum TYPE t320-lgnum .
SELECTION-SCREEN END OF BLOCK h100.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werk.
IF p_lgnum IS NOT INITIAL.
SELECT DISTINCT werks FROM t320 INTO CORRESPONDING FIELDS OF TABLE gt_werk WHERE lgnum EQ p_lgnum.
ELSE.
SELECT DISTINCT werks FROM t320 INTO CORRESPONDING FIELDS OF TABLE gt_werk.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'WERKS'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = gt_werk
* FIELD_TAB =
RETURN_TAB = it_return
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
READ TABLE it_return INTO wa_return INDEX 1.
p_werk = wa_return-fieldval.
refresh it_return.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_lgnum.
IF p_werk IS NOT INITIAL.
SELECT DISTINCT lgnum FROM t320 INTO CORRESPONDING FIELDS OF TABLE gt_lgnum WHERE werks EQ p_werk.
ELSE.
SELECT DISTINCT lgnum FROM t320 INTO CORRESPONDING FIELDS OF TABLE gt_lgnum.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'LGNUM'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = gt_lgnum
* FIELD_TAB =
RETURN_TAB = it_return
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
READ TABLE it_return into wa_return index 1.
p_lgnum = wa_return-fieldval.
refresh it_return.
INITIALIZATION.
s_date-low = sy-datum.
APPEND s_date TO s_date.
START-OF-SELECTION.
WRITE: s_date-low.