on 09-24-2008 2:29 AM
Friends,
I am trying to populate context attribute with values from database table MARC in WDDOINIT code.
I posted this question in Abap dictionary forum, but the answers received were not applicable to OO context. Hence posting it here.
This is my code:
data:begin of t_marc occurs 0,
strgr type marc-strgr,
end of t_marc.
select strgr from marc into table t_marc.
I am getting the error:
"Tables with headers are no longer supported in OO context"
Please let me know what is missing.
Thanks and Regards.
Hi,
I think the error message give you clear information.
In Abap OO we can not use internal table with header line. You have to create internal table WITHOUT header line.
Here sample code:
data:begin of ls_marc,
strgr type marc-strgr,
end of ls_marc,
lt_marc like table of ls_marc.
select strgr from marc into table lt_marc.
loop at lt_marc into ls_marc.
....
endloop.
Regards,
$=====$
Are you newbie? Check this out: [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all, although you were working within WDA there is not really anything Web Dynpro specific about this question. In the future please make sure that your questions are posted in the correct forum. I would think this question really should have been in the ABAP OO forum.
Second it is strongly advised not to perform SQL directly within WDA methods. You should always have your SQL abstracted out to a Model Class and only call methods of the model from WDA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In general, even when you're not working inside OO coding, try to erradicate the use of OCCURS and header lines in internal tables. Get used to declare and use either a separate workarea or a field symbol for accessing/modifying table data instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.