Skip to Content
-1

select options

Hi, I am just studying ABAP. I'm creating a program that uses select-options and date as input and extracts data by comparing with DB table . I don't know what to do when the get data. So please help me and provide sample code.

REPORT ZEXERCISE.

DATA: WA_DATE TYPE ZDATE-DATBI.

SELECT-OPTIONS DATE FOR WA_DATE NO INTERVALS.

*WA_DATE = ?? (what can i do)

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

date_external = WA_DATE

IMPORTING

date_internal = WA_DATE.

WRITE :/5 'No',20 'Valid Date'.

SKIP.

tables : ZDATE.

SELECT * FROM ZDATE.

IF ZDATE-DATBI < WA_DATE.

WRITE:/5 ZDATE-NO,20 ZDSTE-DATBI.

ENDIF.

ENDSELECT.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 22, 2020 at 02:16 PM

    Hi,

    You need to learn with some latest ABAP documents. Please search for ABAP 740 and you get current syntax for ABAP.

    Regarding your requirement, it can be written in few lines like below

    DATA: WA_DATE TYPE ZDATE-DATBI.
    SELECT-OPTIONS DATE FOR WA_DATE NO INTERVALS.
    
    select * from zdate into table @data(lt_date) where DATBI in s_date.
    "print
    cl_abap_demo_services=>list_table( table =  lt_date ).
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.