2009 Aug 31 7:57 PM
Hi,
I have a Z table ZTAB with PSPID,PSTRT & POSKI as Primary keys.
I have 6 entries for a record PSPID= 251194004 & PSTRT =08/24/2009.
PSPID, PSTART, POSKI
251194004, 08/24/2009, 1010-02
251194004, 08/24/2009, 1010-03
251194004, 08/24/2009, 1010-05
251194004, 08/24/2009, 1010-10
251194004, 08/24/2009, 1010-11
251194004, 08/24/2009, 1010-14
REPORT x.
TABLES: ztab.
DATA: it_itab TYPE STANDARD TABLE OF ztab,
wa_itab TYPE ztab.
PARAMETERS:
p_pspid LIKE ztab-pspid,
p_pstrt LIKE ztab-pstart.
SELECT * FROM ztab INTO CORRESPONDING FIELDS OF TABLE it_itab
WHERE pspid = p_pspid
AND pstart = p_pstrt.
LOOP AT it_itab INTO wa_itab.
WRITE:/10 wa_itab-pspid , wa_itab-poski.
ENDLOOP.When I execute this report I am getting only 5 records .What could be the mistake? I definetlly need these 2 where conditions.
If I comment S_PSPRT it brings up all 6 entries..
rgds
Vara
Edited by: Vara K on Aug 31, 2009 8:58 PM
2009 Aug 31 8:43 PM
Hi Vara,
This seems to problems of data, review records are stored as column PSTART, record can be followed by a space or character or another date format that is not taken in the condition pstart = p_pstrt.
Hope this information is help to you.
Regards,
José
Hi,
I have a Z table ZTAB with PSPID,PSTRT & POSKI as Primary keys.
I have 6 entries for a record PSPID= 251194004 & PSTRT =08/24/2009.
PSPID, PSTART, POSKI
251194004, 08/24/2009, 1010-02
251194004, 08/24/2009, 1010-03
251194004, 08/24/2009, 1010-05
251194004, 08/24/2009, 1010-10
251194004, 08/24/2009, 1010-11
251194004, 08/24/2009, 1010-14
REPORT x.
TABLES: ztab.
DATA: it_itab TYPE STANDARD TABLE OF ztab,
wa_itab TYPE ztab.
PARAMETERS:
p_pspid LIKE ztab-pspid,
p_pstrt LIKE ztab-pstart.
SELECT * FROM ztab INTO CORRESPONDING FIELDS OF TABLE it_itab
WHERE pspid = p_pspid
AND pstart = p_pstrt.
LOOP AT it_itab INTO wa_itab.
WRITE:/10 wa_itab-pspid , wa_itab-poski.
ENDLOOP.When I execute this report I am getting only 5 records .What could be the mistake? I definetlly need these 2 where conditions.
If I comment S_PSPRT it brings up all 6 entries..
rgds
Vara
Edited by: Vara K on Aug 31, 2009 8:58 PM
2009 Aug 31 8:04 PM
try this
select PSPID
PSTART
POSKI
from zitab
into table gt_itab
where WHERE pspid = p_pspid
AND pstart = p_pstrt.
2009 Aug 31 8:12 PM
Nop! it did not work
I am still getting only 5 entries as output instead of 6.
rgds
Vara
2009 Aug 31 8:14 PM
then try this.
select PSPID
PSTART
POSKI
from zitab
into table gt_itab
where WHERE pspid = p_pspid.
delete gt_itab where pstart NE p_pstrt.
2009 Aug 31 8:21 PM
I want to do that only if we don't have any other options.
because why to select unnecessary data first and delete the same.. As I will have lot of entries..
rgds
Vara
2009 Aug 31 8:25 PM
what i'd do:
- check if the problem is in the select statement or at the loop at statement.. debug it if you won't
- i do not use corresponding fields.. and as i don't know how the others fields in your table are... i'd remove the * from your select statement and specify the fields you want.
select PSPID PSTART POSKI
into ...
- and i didn't understand what you comment to get the right result.. where is S_PSPRT ?
at the first look, i cannot see any problem.. and this kind of problem, for me, are the worst ones.
Good luck!
2009 Aug 31 8:43 PM
Hi Vara,
This seems to problems of data, review records are stored as column PSTART, record can be followed by a space or character or another date format that is not taken in the condition pstart = p_pstrt.
Hope this information is help to you.
Regards,
José
2009 Aug 31 9:36 PM
Perfect jose.
that's what it.I have awarded you full points.
rgds
Vara
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |