05-27-2008 10:37 PM
Hi All,
I am new to ABAP and I have a situation and don't know why it is erroring out. Could anyone point it out for me.
DATA: BEGIN OF allper,
mbegda TYPE hrp1001-begda,
mendda TYPE hrp1001-endda,
mpos TYPE hrp1001-objid,
morg TYPE hrp1001-sobid,
mper TYPE hrp1001-sobid,
mmgr_id TYPE hrp1008-btrtl,
END OF allper.
DATA: itab_allper1 LIKE TABLE OF allper.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT DISTINCT abegda aendda aobjid asobid bsobid cbtrtl
FROM HRP1001 AS a
LEFT OUTER JOIN HRP1001 AS b ON aobjid = bobjid AND
b~subty = 'A008' AND
b~sclas = 'P'
LEFT OUTER JOIN HRP1008 AS c ON aobjid = cobjid
WHERE a~subty = 'A003' AND
a~sclas = 'O'.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE itab_allper
PACKAGE SIZE 1000.
I get a shohrt dump in the FETCH statment. Looks to me some fields don't match? any clues?
Thx,
Alex.
05-27-2008 10:42 PM
What does the short dumpo says.
The table is declared as itab_allper1 but your sentence says
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE itab_allper
PACKAGE SIZE 1000.
maybe that's the problem
05-27-2008 10:55 PM
Ramiro,
Thank you for looking at this. I do have an internal table as itab_allper as well as itab_allper1 both are of the type allper structure.
Do you think the syntax and the way the variable declarations are correct? I am not sure of those..
Thankx again.
Alex.
05-27-2008 11:00 PM
I don't see nothing wrong.
What does the dump says? Can you post it?
What I do find weird is the join on the same table
05-28-2008 1:45 PM
Ramiro,
I found the cause for the ABEND because it was not on a development client, after copying to the correct client it does not abend but the cursor fetches only 0's. Is my declaration of structure, table, cursor and FETCH are all correct? Can I Fetch into an internal table?. I am concerned about the declaration part. The SQL is correct and it works right now when I have it with out cursor when I load it in to an internal table. Please let me know my validations are correct?
Thanks,
Alex.
06-02-2008 5:01 PM
06-27-2008 4:21 PM
HI Alex,
Can u tel me, how you have solved the issue? Even i facing the same problem...
Thanks
Ram