Application Development and Automation 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: 
Read only

Condition on selection screen parameters

Former Member
0 Likes
4,077

Hi friends,

I have an ABAP query. Here , I have a date field (ISEG_ZLDAT - Cycle count date ) in the selection screen which is a parameter (not a select option). I have to write a condition for the report to pull all the materials which have a cycle count date less than the value entered on the selection screen.

How do I give this condition in the code ? Is there a way to do it without using select options ?

Please help.

Thanks,

Dikshitha

1 ACCEPTED SOLUTION
Read only

awin_prabhu
Active Contributor
0 Likes
1,703

Use like below.

REPORT ztest

TABLES: iseg.

DATA: BEGIN OF itab OCCURS 0,

matnr TYPE matnr,

END OF itab.

PARAMETERS: p_zldat TYPE iseg-zldat.

SELECT matnr FROM iseg INTO TABLE itab

WHERE zldat < p_zldat.

Thanks.

7 REPLIES 7
Read only

venkatesan_nagiah
Active Participant
0 Likes
1,703

If you run the query and double click on the, it will display option for how the selection should take place.

in that select "<=" option then put whatever number, the query will select less than or equal value automatically

Read only

Former Member
0 Likes
1,703

Hi,

1. Use the LE condition in your SELECT or

2. Use a RANGE and transfer the content of your parameter to your range.

Issa

Read only

jcutinho
Explorer
0 Likes
1,703

Can you provide me with the table to find the Material cycle time.

The syntax is as follows

SELECT fields

into workarea or internal table

from tablename

where ZLDAT < p_date.

Here p_date is the entered date as parameter on the screen. Hope this helps you.

Read only

awin_prabhu
Active Contributor
0 Likes
1,704

Use like below.

REPORT ztest

TABLES: iseg.

DATA: BEGIN OF itab OCCURS 0,

matnr TYPE matnr,

END OF itab.

PARAMETERS: p_zldat TYPE iseg-zldat.

SELECT matnr FROM iseg INTO TABLE itab

WHERE zldat < p_zldat.

Thanks.

Read only

Former Member
0 Likes
1,703

Hi Dikshitha,

as also said by others try it this way:

Parameters:
  p_ZLDAT type ISEG-ZLDAT.

Data:
  t_ISEG like standard table of ISEG.

select * from ISEG into table t_ISEG where ZLDAT lt p_ZLDAT.

if sy-subrc ne 0.
endif.

With luck,

Pritam.

Read only

Former Member
0 Likes
1,703

Hi Folks,

Thanks for your reply.

What I have is an abap query. It has 9 input fields and 11 output fields and it uses join conditions.

In this scenario how do I write the condition for the above mentioned scenario ?

Thanks,

Dikshitha

Read only

0 Likes
1,703

Just add the condition,

'WHERE zldat < p_zldat' at the end of your select query.

Ex:

SELECT amatnr bwerks bdispo cmaktx INTO CORRESPONDING FIELDS OF TABLE itab

FROM mara AS a INNER JOIN marc AS b ON amatnr = bmatnr

INNER JOIN makt AS c ON amatnr = cmatnr

INNER JOIN iseg as d ON amatnr = dmatnr

WHERE amatnr IN s_matnr AND bwerks IN s_werks AND b~dispo IN s_dispo

AND d~zldat < p_zldat. <---- ADD LIKE THIS

Edited by: Sap Fan on Apr 14, 2009 5:21 PM