Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Query

Former Member
0 Kudos

Hi Experts,

Currently my ABAP query is pulling data from the tables EKPO and MARA using JOIN. The requirement is to select rows only within a PARTICULAR date range. The date range I have to enter on the selection screen of the query.

I have to add the date range field on the selection screen also.

Is it possible to do it in the ABAP query? If so how can we do that?

Thanks for the great help,

Sobhan.

8 REPLIES 8

Former Member
0 Kudos

Hi

YOu mean SAP Query?? i.e. SQ01 transaction..

if yes then create a query in SQ01 and mapp the fields for selection...during mapping you need to select the date which you want on selection screen of query report..

Thanks

balu

0 Kudos

If by query, you mean, an SQ01 query, then refer to the above post. It is very easy to include your date into the selection screen.

If by query, you mean an ABAP report which you are coding in SE38. All you need to do is to create you selection screen by using the SELECT-OPTIONS statement.



SELECT-OPTIONS: s_datum for sy-datum.

Then in your where clause of your select statement say...



WHERE SOME_DATE in s_datum.

Regards,

Rich Heilman

0 Kudos

Balu,

Yes, it is SAP Query. Thanks for the help. Can you point me to some documentation for SAP Query SQ01? As you know this tool is used by functional consultants. I dont know how to map also. I am working on 4.6c.

Thanks,

Sobhan.

0 Kudos

Hi,

Check this link.

http://www.sappoint.com/abap/ab4query.pdf

Kindly reward points if it is useful.

former_member181959
Contributor
0 Kudos

Yes sobhan,

You can do that by using select options statement in the ABAP.

For example…

You can use the select options statement for date range as

SELECT-OPTIONS: v_date for SY-DATUM.

And the about variable v_date can be used as

SELECT <some fields>

FROM (EKKO AS A INNER JOIN EKPO AS B

ON AEBELN = BEBELN)

INNER JOIN EKET AS C

ON AEBELN = CEBELN

AND BEBELP = CEBELP

INTO TABLE ITAB

WHERE <date field> in v_date.

Here I have used inner join to join 3 table. You can use simple join statement to join 2 tables.

Hope it helps…

Regards,

Prasasd.

Former Member
0 Kudos

Dear ABAPers ,

I am Chandra shekar I newly joined into this SDNetwork,

I am working On Automation employ vendor creation.Means if they create employ in employ master automatically it has to create vendor throw FK01 with same employ number.

I am using Standard tcode PRAA But it is creating using XK01. So plz can you help me

with regards

Chandru

Former Member
0 Kudos

Hi,

In SQ01 change mode you can see the title, format... Press next button (Select Field Group) -> Next (select field ) - > NEXT ( Selection fields ) . In this screen select the data range ( for example select ERSDA - material creation date ) then it will come come automatically to the selection screen.

One more method also , in the infoset we can define the date range and the relevant coding in the extras.

Hope this will work.

Cheers

Sasi