‎2010 Jan 28 7:09 AM
hi masters,
i have requirment where i need to fetch all the classification data.
i used a function moudle to get it and i got it into a table OBJECT_DATA.
so for a single characterisctic there are 3 values assinged to it.
ex : characteristic : CC-NOTES
-
TABIX | SMBEZ | ZAEHL | AUSP1 | ATNAM |POSNR
-
|--
1 | CommodityNotes | 002 | 303 | CC-NOTES | 001
1 | CommodityNotes | 003 | 333 | CC-NOTES | 001
1 | CommodityNotes | 001 | TAR083| CC-NOTES | 001
For CC-NOTES I have 3 values as we see. so i have to display 3 of them on my screen
so when i issue statement like this
ex : loop at object_data into wa.
READ TABLE object_data INTO wa WITH KEY atnam = 'CC-NOTES'.
it always looks only the first record so HOW CAN I MAKE MY STATEMENT TO READ THE SECOND RECORD?
CAN ANYONE HELP ME PLS?
THANK YOU,
PASALA.
‎2010 Jan 28 7:14 AM
Hello,
READ statement will read only the first record it satisfies. But i dont see a reason why you are using a READ statement on the same internal table you are looping at . Either try the following
loop at object_data into wa.
if object_data-atnam = 'CC-NOTES'.
---
endif.
endloop.
else
loop at object_data into wa where atnam = 'CC-NOTES' .
---
-----
endloop.
Vikranth
‎2010 Jan 28 7:13 AM
Hi,
In the read statement you give all the primary keys.
Regards,
pravin
‎2010 Jan 28 7:14 AM
Hello,
READ statement will read only the first record it satisfies. But i dont see a reason why you are using a READ statement on the same internal table you are looping at . Either try the following
loop at object_data into wa.
if object_data-atnam = 'CC-NOTES'.
---
endif.
endloop.
else
loop at object_data into wa where atnam = 'CC-NOTES' .
---
-----
endloop.
Vikranth
‎2010 Jan 28 7:16 AM
‎2010 Jan 28 7:15 AM
hi
Try this
loop at object_data into wa.
loop at object_data into wa where where atnam = 'CC-NOTES' .
endloop.
endloop.
‎2010 Jan 28 7:17 AM
You only have to use
Loop at OBJECT_DATA into wa where atnam = 'CC-NOTES' .
...
....
Endloop.
‎2010 Jan 28 7:17 AM
Hi,
Why ru looping the same internal table.
If u want to print the 3 records just
loop the interanal table where characteristic value is CC-NOTES
write the what ever fields u require.
endloop.
Regards
Jai
‎2010 Jan 28 7:20 AM
Hi,
In this case you need to loop on ur table.
Use parallel cursor concept, to enhance the performance.
‎2010 Jan 28 7:20 AM
Please specify uour requirement.
You are looping table 'OBJECT_DATA' and reading the same table.
if you use the loop like below then you will get all the 3 records sequentially in the work area.
Loop at OBJECT_DATA into wa where atnam = 'CC-NOTES'.
-
---
endloop.
Hope this helps.
‎2010 Jan 28 7:36 AM
hey if u want to read only second record then u can add 1 more condition ...
READ TABLE object_data INTO wa WITH KEY atnam = 'CC-NOTES'
zaehl = '003' .
else do loop for all 3 record ...
Regards,
Prakash Patel
‎2010 Jan 28 8:38 AM
‎2010 Jan 28 9:12 AM
Hi,
The only solution for this is
loop at object_data into wa where atnam = 'CC-NOTES'
-
endloop.
‎2010 Jan 28 11:14 AM
‎2010 Jan 28 11:18 AM
‎2010 Jan 28 11:36 AM