‎2008 Dec 12 10:42 AM
hi experts,
select single MIN( punchdate ) from pa9777 into (r_punchdate)
where pernr = peras-pernr and
punchdate gt P_WA_TEVEN_LDATE
group by punchdate.
i m using this select single statement in my report ,i want to know that will it give me right result,means here i m using select single n MIN function together.
‎2008 Dec 12 10:51 AM
hi,
according to my knowledge,adding MIN wont affect select statement,but ORDER BY cannot be used with select single.
regards
Arjun
‎2008 Dec 12 10:46 AM
May be you can consider adding the ORDER BY punchdate as well.
regards,
Advait
‎2008 Dec 12 10:54 AM
Hi Rajat!!
I think it wont work.
Select single fetches only one record at a time.SO how will MIN function work.
So :
select MIN( punchdate ) from pa9777 into (r_punchdate)
where pernr = peras-pernr and
punchdate gt P_WA_TEVEN_LDATE
group by punchdate.
Hope this helps.
‎2008 Dec 12 10:51 AM
hi,
according to my knowledge,adding MIN wont affect select statement,but ORDER BY cannot be used with select single.
regards
Arjun
‎2008 Dec 12 10:59 AM
Hi Rajat,
I think it is not logically correct to use both MIN and SINGLE. Selecting single means getting a first hit where the condition is true (and only one). As this will result only in one hit you cannot tell the system to get MIN value of this(these). To do this there has to be at least two hits, which you would get by using select but without single addtion.
Regards
Marcin
‎2008 Dec 12 10:54 AM
Dear Rajat,
Clarify your doubt by this link http://help.sap.com/saphelp_nw04/helpdata/en/bb/db00cb4a3011d189490000e8323c4f/frameset.htm
Regards,
Flavya
‎2008 Dec 12 10:59 AM
Hi....
Please check this ...
DATA: l_blanz TYPE blanz.
SELECT SINGLE MIN( blanz )
FROM mara
INTO l_blanz
WHERE ersda LE sy-datum
GROUP BY ersda.
It is working successfully. No problem using select single min and group by together.
Edited by: Subhankar Garani on Dec 12, 2008 12:05 PM
‎2008 Dec 12 11:10 AM
from ur answer what i came to know that if we use punchdate = P_WA_TEVEN_LDATE group by punchdate ,then the select single and MIN function will work but if we use punchdate gt P_WA_TEVEN_LDATE group by punchdate then it wont work.
correct me if i m wrong,