Hello Experts,
I have developed one report for Data transfer. The selection screen contains only the date field. The data is fetched from vbrk table. But if the user input is blank, then the date should be fetched from ztable which I have developed. The ztable contains only one date field which the users will maintain named as the last updated date field. So date-low will be last_updated date and date-high will be sy-datum. But I m having problem in writing select query for ELSE part.
The select query which I have written is :
DATA : l_date LIKE sy-datum.
DATA : it_path TYPE STANDARD TABLE OF zsd_path,
wa_path TYPE zsd_path.
DATA : aedat LIKE vbrk-aedat.
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
SELECT-OPTIONS : date FOR aedat.
SELECTION-SCREEN : END OF BLOCK blk.
AT SELECTION-SCREEN ON date.
IF date IS NOT INITIAL.
SELECT SINGLE aedat FROM vbrk INTO l_date WHERE aedat IN date.
IF sy-subrc <> 0.
MESSAGE 'Invoice is not available for this Period' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
(This query will fetch data based on data available in VBRK Table)
(IF the user input is blank, the ELSE part is written as :
ELSE.
date-low = last_updated.
date-high = sy-datum.
SELECT SINGLE last_updated FROM zsd_path INTO l_date WHERE last_updated = date-low.
IF sy-subrc <> 0.
MESSAGE 'Invoice is not available for this Period' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDIF.
Can anybody guide me in writing the ELSE part?
Thanks,
Satvik