2008 Oct 19 4:25 AM
Hi Gurus,
I am a newbie to ABAP how has spent far to much of my weekend time trying to solve the following problem;
when trying to insert data from table cdpos into my internal table, I only get the two object* fields, the other 3 are not even part of the internal table according to the debugger.
my select code is:
-
SELECT fname tabkey changenr objectclas objectid
FROM cdpos
INTO CORRESPONDING FIELDS OF i_cd_index
WHERE tabname = 'XXX'
AND fname = 'XXX'
AND chngind = 'U'
ENDSELECT.
IF sy-subrc <> 0.
ENDIF.
-
- If I use a wa like line of i_cd_index the other fields will show up.
- I have tried with including 'TABLE' in the INTO statement, same result.
Please help out, getting very frustrated here....
/Mike
2008 Oct 19 4:32 AM
Hi Magdic,
Check the below logic
DATA: ITAB LIKE CDPOS OCCURS 0 WITH HEADER LINE.
SELECT * FROM CDPOS INTO ITAB.
APPEND ITAB.
ENDSELECT.
LOOP AT ITAB.
WRITE: ITAB.
ENDLOOP.
Copy paste and check the code data is fetching into my internal table.
Cheers!!
Balu
2008 Oct 19 4:32 AM
Hi Magdic,
Check the below logic
DATA: ITAB LIKE CDPOS OCCURS 0 WITH HEADER LINE.
SELECT * FROM CDPOS INTO ITAB.
APPEND ITAB.
ENDSELECT.
LOOP AT ITAB.
WRITE: ITAB.
ENDLOOP.
Copy paste and check the code data is fetching into my internal table.
Cheers!!
Balu
2008 Oct 19 4:46 AM
Hi,
Is your issue solved, if there are any issues revert back someone will you.
Cheers!!
Balu
2008 Oct 19 12:17 PM
No, it didn't help, still the same behaviour.
cdpos is a clustered table, can that have an effect?
2008 Oct 19 12:56 PM
Hi Magdic,
I have completely coded for but i have taken as parameters rather direct values (XXXX). Under stand the code and select statement you will get it. Program which i have shown is working fine.
Do one thing first go the table CDPOS take one entry of Objectid, Tabname, fname and chngind and then enter in the selection and find whether the values are fetched correctly or not.
To my knowledge there might be no data in your table.
Anyhow try the below code.
TABLES: CDPOS.
DATA: ITAB LIKE CDPOS OCCURS 0 WITH HEADER LINE.
parameters: p_CHGID like CDPOS-chngind,
p_TAB like CDPOS-TABNAME,
P_FNAM LIKE CDPOS-FNAME.
SELECT OBJECTID TABNAME FNAME CHNGIND FROM CDPOS INTO CORRESPONDING FIELDS OF ITAB WHERE OBJECTID = P_CHGID
AND TABNAME = P_TAB
AND FNAME = P_FNAM.
APPEND ITAB.
ENDSELECT.
WRITE: ITAB-OBJECTID, ITAB-TABNAME, ITAB-FNAME, ITAB-CHNGIND.
Cheers!!
Balu