‎2008 Aug 13 11:58 AM
Dear Gurus,
I am using Field-Symbols in my report progm. Though I am assigning the table type to the declared field-symbol, my program is going to dump saying tht "GETWA_NOT_ASSIGNED".
My Code is as below:
FIELD-SYMBOLS: <f_itab1> TYPE vbak,
<f_itab2> TYPE vbap.
.
.
.
.
.
.
LOOP AT it_vbak ASSIGNING <f_itab1>.
READ TABLE it_vbap ASSIGNING <f_itab2>
WITH KEY vbeln = <f_itab1>-ww206.
.
.
.
.
.
ENDLOOP.
In debugging mode I see <f_itab1> is assigned but <f_itab2> is not being assigned and getting an error msg as "ERROR: Field symbol <f_itab1>is not yet assigned".
Please help me in fixing the issue.
Regards,
Shano
‎2008 Aug 13 12:10 PM
Hi,
Use
FIELD-SYMBOLS: <f_itab1> TYPE any,
<f_itab2> TYPE any.
‎2008 Aug 13 12:03 PM
hi
U ll be appending fieldnames of the internal table into fieldcatalog table rite....
Check if the field names are correct(as in output internal table), written in caps in both the field catalog tables......
If ur using sort table check dat also..
thanks
reply for give prob. again.
‎2008 Aug 13 12:09 PM
Hi Mukesh,
Thanks for the reply. Everything is fine with Field-Catalog.And before looping I am sorting both the tables.But I don't understand why <f_itab1> is getting assigned and it's not happening with <f_itab2>.
‎2008 Aug 13 12:06 PM
Hi,
FIELD-SYMBOLS: <f_itab1> LIKE line of it_vbak,
<f_itab2> LIKE line of it_vbap.
This will solve the issue.
Regards,
Mohaiyuddin.
‎2008 Aug 13 12:13 PM
Hi Mohaiyuddin,
I tried in that way also but still it is the same problem. And one more thing I forgot to add is I am using ECC 6.0.
Regards,
Ravi
‎2008 Aug 13 12:21 PM
Hi,
Are you checking sy-subrc after READ TABLE ?
If READ TABLE fails and you are trying to access second field symbol <f_itab2> it will go to dump.
Regards,
Mohaiyuddin
Edited by: Mohaiyuddin Soniwala on Aug 13, 2008 4:51 PM
‎2008 Aug 13 12:27 PM
‎2008 Aug 13 12:31 PM
Sorry for the obvious, but thought worth mentioning.
It will be good if you can post complete code. (along with definition of IT_VBAK and IT_VBAP)..The segment you are posting seems correct.
Regards,
Mohaiyuddin
‎2008 Aug 13 12:10 PM
Hi,
Use
FIELD-SYMBOLS: <f_itab1> TYPE any,
<f_itab2> TYPE any.
‎2008 Aug 13 12:17 PM
Hi Amit,
It is giving syntax error when I tried as you mentioned. I tried as below also:
FIELD-SYMBOLS: <f_itab1> TYPE ANY TABLE,
<f_itab2> TYPE ANY TABLE.
But still it <f_itab2> while using READ is getting assigned.
Regards,
Shano
‎2008 Aug 13 12:20 PM
Hello,
I have some doubts on this stmt
vbeln = <f_itab1>-ww206
Can you tell me whats WW206 field ??
May be ur READ TABLE is failing & so <f_itab2> is not getting assigned. If u try to use this FS, you will get a dump.
BR,
Suhas
Edited by: Suhas Saha on Aug 13, 2008 1:21 PM
‎2008 Aug 13 12:25 PM
Hi Suhas,
Sorry, it's actually vbeln. The code is as below.
FIELD-SYMBOLS: <f_itab1> TYPE vbak,
<f_itab2> TYPE vbap.
.
Select * from vbak into table it_vbak.
.
select * from vbap into table it_vbap.
.
.
LOOP AT it_vbak ASSIGNING <f_itab1>.
READ TABLE it_vbap ASSIGNING <f_itab2>
WITH KEY vbeln = <f_itab1>-vbeln.
.
.
.
.
.
ENDLOOP.
Regards,
Shano
‎2008 Aug 13 12:40 PM
Hello,
Please provide the definition of ITAB1 & ITAB2. I think ur READ TABLE is failing. Did you check SY-SUBRC, is ur READ TABLE OK?
BR,
Suhas
‎2008 Aug 13 12:16 PM
Hi,
Syntavtically your program is correct. The way I see it you must have declared the field symbols wrongly . Send your detailed code
Ram
‎2008 Aug 13 12:25 PM
HI Shano,
One more thing I want to share with you is, You need to UNASSIGN the field symbol after coming out of loop.
More or less its like a clear or refresh we use for our internal table and variables.
Warm regards,
Abhishek
‎2008 Aug 13 12:53 PM
Hi Shano,
you should try this:
loop....
read table it_vbap assigning <f_itab2> with key vbeln = <f_itab1>-ww206.
if <f_itab2> is assigned.
* do your stuff here
endif.
endloop.
if you want to react on a not present key in it_vbap
or
loop....
read table it_vbap assigning <f_itab2> with key vbeln = <f_itab1>-ww206.
check <f_itab2> is assigned.
* do your stuff here
endloop.
if you just want to skip a loop cycle if the key is not present in it_vbap.
Ah and don't forget to unassign <f_itab2> after doing your stuff. If you had it assigned in the cycle before and in the current it's not possible to assign it to a new line it keeps the old one and you overwrite the fields.
Regards,
Benny
Edited by: Benjamin Matten on Aug 13, 2008 2:24 PM