2009 Sep 14 2:14 PM
Hello,
I have a problem with the use of an internal table in my abap routine (in an update rule).
I create an internal table, after i load it, and when i want to read it i have a problem.
Here is my code :
Table Declaration
DATA : BEGIN OF t_ze_range occurs 0,
/BIC/OIZE_RANGE type /BIC/OIZE_RANGE,
/BIC/OIZE_TECHNO type /BIC/OIZE_TECHNO,
/BIC/OIZE_BU2 type /BIC/OIZE_BU2,
/BIC/OIZE_BU1 type /BIC/OIZE_BU1,
END OF t_ze_range.
loading
i load my table t_ze_range from the table /BIC/PZE_RANGE (info object)
SELECT
/BIC/ZE_RANGE /BIC/ZE_TECHNO /BIC/ZE_BU2 /BIC/ZE_BU1
FROM
/BIC/PZE_RANGE
APPENDING TABLE
t_ze_range
WHERE
OBJVERS = 'A'
GROUP BY
/BIC/ZE_RANGE /BIC/ZE_TECHNO /BIC/ZE_BU2 /BIC/ZE_BU1.
when i execute my update rule in debug mode, i have data in my internal table t_ze_range.
And when i want to access data in my update rule:
READ TABLE t_ze_range WITH KEY /BIC/OIZE_RANGE = 1
i have this errors :
E:In the OO context either an INTO or an ASSIGNING specification or the addition "TRANSPORTING NO FIELDS" must be used. addition "TRANSPORTING NO FIELDS" must be used.
Could you help me to solve it ?
Thanks a lot.
Best regards
Karol Walesch
2009 Sep 14 2:40 PM
ok, if i understand :
if i want to read data, i want to use statement INTO
and if a use TRANSPORTING NO FIELDS i can't read data from my internal table ?
In my case, i want to read only 1 row in my internal table :
if i write :
READ TABLE t_ze_range WITH KEY /BIC/OIZE_RANGE = range TRANSPORTING NO FIELDS.
if sy-subrc = 0.
RESULT = t_ze_range-/BIC/OIZE_TECHNO.
endif.
My result is empty.
If i want to use statement INTO, i don't know what is a workarea ???
Thanks,
Karol Walesch
Hello,
I have a problem with the use of an internal table in my abap routine (in an update rule).
I create an internal table, after i load it, and when i want to read it i have a problem.
Here is my code :
Table Declaration
DATA : BEGIN OF t_ze_range occurs 0,
/BIC/OIZE_RANGE type /BIC/OIZE_RANGE,
/BIC/OIZE_TECHNO type /BIC/OIZE_TECHNO,
/BIC/OIZE_BU2 type /BIC/OIZE_BU2,
/BIC/OIZE_BU1 type /BIC/OIZE_BU1,
END OF t_ze_range.
loading
i load my table t_ze_range from the table /BIC/PZE_RANGE (info object)
SELECT
/BIC/ZE_RANGE /BIC/ZE_TECHNO /BIC/ZE_BU2 /BIC/ZE_BU1
FROM
/BIC/PZE_RANGE
APPENDING TABLE
t_ze_range
WHERE
OBJVERS = 'A'
GROUP BY
/BIC/ZE_RANGE /BIC/ZE_TECHNO /BIC/ZE_BU2 /BIC/ZE_BU1.
when i execute my update rule in debug mode, i have data in my internal table t_ze_range.
And when i want to access data in my update rule:
READ TABLE t_ze_range WITH KEY /BIC/OIZE_RANGE = 1
i have this errors :
E:In the OO context either an INTO or an ASSIGNING specification or the addition "TRANSPORTING NO FIELDS" must be used. addition "TRANSPORTING NO FIELDS" must be used.
Could you help me to solve it ?
Thanks a lot.
Best regards
Karol Walesch
2009 Sep 14 2:20 PM
Hi,
If you use Transporting no fields, you can check only the existence of the record in the internal table
but if you want to use some data in the internal table(for the record found) later then you need to use INTO <workarea>
Hence based on your requirement, use the above.
READ TABLE t_ze_range WITH KEY /BIC/OIZE_RANGE = 1 [TRANSPORTING NO FIELDS]
OR
READ TABLE t_ze_range INTO [LS_ZE_REANGE] WITH KEY /BIC/OIZE_RANGE = 1
Hope this helps
Regards
Shiva
2009 Sep 14 2:22 PM
You have to add an INTO or Assiging construction oder you have to use the TRANSPORTING NO FIELDS clase in your read stametent.
But thats exactly what the error message told you.
2009 Sep 14 2:26 PM
Hi,
Are you reading the table data for any processing?
In the read statement add TRANSPORTING NO FIELDS.
2009 Sep 14 2:27 PM
if you use read statement then it will have to read a unique record if not , u just wanna check read entries are existing then transporting no fields needs to be provided else read the internal table into some work area is mandatory.
with cheers
s.janagar
2009 Sep 14 2:40 PM
ok, if i understand :
if i want to read data, i want to use statement INTO
and if a use TRANSPORTING NO FIELDS i can't read data from my internal table ?
In my case, i want to read only 1 row in my internal table :
if i write :
READ TABLE t_ze_range WITH KEY /BIC/OIZE_RANGE = range TRANSPORTING NO FIELDS.
if sy-subrc = 0.
RESULT = t_ze_range-/BIC/OIZE_TECHNO.
endif.
My result is empty.
If i want to use statement INTO, i don't know what is a workarea ???
Thanks,
Karol Walesch
2009 Sep 14 3:39 PM
Hi,
Can u declare the work area as
DATA : BEGIN OF wa_ze_range,
/BIC/OIZE_RANGE type /BIC/OIZE_RANGE,
/BIC/OIZE_TECHNO type /BIC/OIZE_TECHNO,
/BIC/OIZE_BU2 type /BIC/OIZE_BU2,
/BIC/OIZE_BU1 type /BIC/OIZE_BU1,
END OF wa_ze_range.
The work area can hold only one value, i.e what ever the record with key has been satisfied.
u can use above work area as like,
read table t_itab into wa_itab with key where xx = ' '.
Let me know any other info required.'
2009 Sep 14 3:40 PM
2009 Sep 14 3:45 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |