‎2009 Apr 14 3:07 PM
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
‎2009 Apr 14 3:32 PM
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.
‎2009 Apr 14 3:12 PM
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
‎2009 Apr 14 3:13 PM
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
‎2009 Apr 14 3:15 PM
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.
‎2009 Apr 14 3:32 PM
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.
‎2009 Apr 14 3:44 PM
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.
‎2009 Apr 14 4:09 PM
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
‎2009 Apr 14 4:15 PM
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