‎2008 Oct 23 11:26 AM
Hi...
I Have two questions on New debugger..
1st:
My code is:
data: begin of itab occurs 0,
f1, f2,
end of itab.
itab-f1 = 'f1'.
itab-f2 = '1'.
append itab.
clear itab.
itab-f1 = 'f2'.
itab-f2 = '2'.
append itab.
clear itab.
write:/ itab[1]-f1,
itab[1]-f2.Why I am getting error for this like:
Field itab[1] is unkown....
Where as we can get values and 1 for above two variables, itab[1]-f1 and itab[1]-f2....in DEBUGGING MODE.
Let me know the reason ?
What are the additional functions loading in DEBUGGER to get values for these?
2 nd:
[Aswer my Question in this thread|;
Thanks,
Naveen.I
‎2008 Oct 23 12:03 PM
At the risk of incurring the wrath of Inuganti...
>
> Hi...
>
>...
>
> Why I am getting error for this like:
> Field itab[1] is unkown....
>
> Where as we can get values and 1 for above two variables, itab[1]-f1 and itab[1]-f2....in DEBUGGING MODE.
> Let me know the reason ?
> What are the additional functions loading in DEBUGGER to get values for these?
>
>
> Thanks,
> Naveen.I
There is some confusion in your post. Now, if I create a program like yours, in SE38 and syntax check it, I get the message:
The field "ITAB[1]" is unknown, but there is a field with the similar
name "ITAB". "ITAB".1) Are you puzzled about that?
OK, now I comment out the write statements, and run the program in the (New) debugger. When I get to Line 14, If I type ITAB[1]-F1 into the Variables list, I get the value 'f'. ( Because you've defined the field without type, so it defaults to type c length 1 ).
2) So what's the problem?
The debugger allows you record access to tables using the syntax [n]. But ABAP itself does not. It is not part of the language.
btw - don't use tables with header-lines . It's ambigous and therefore bad.
matt
‎2008 Oct 23 11:29 AM
Hi ,
Better use : Write : / itab-f1,
itab-f2.
as there is no table as itab[1] declared.
Rgds,
Sandeep
‎2008 Oct 23 11:31 AM
Hi Sandeep:
but my quetion is not only that...
Where as we can get values f1 and 1 for above two variables, itab[1]-f1 and itab[1]-f2....in DEBUGGING MODE...?
Thanks,
Naveen.I
‎2008 Oct 23 11:31 AM
hi sandeep,
You can either use loop at itab and then access the values of the fields or else read the table using the index keyword. You can access it using the debugger but not as an inline code.
Thanks
Nidhi
Edited by: Nidhi Jain on Oct 23, 2008 12:32 PM
‎2008 Oct 23 11:32 AM
u wont get itab[1]-f1, itab[1]-f2 in debugger...
to get the value of itab[1]...just type itab in debugger....
‎2008 Oct 23 11:34 AM
Please Dont reply with out understanding my question...
If anybody wants more clarifiaction I can explain detail....
Above answers not yet meet my question..
ok.. I am agree with above answers, but my question is on Debugging yaar.
I am aware of these READ statements., Take your own time provide some useful information,
&
What about my second question?
Thanks,
Naveen.I
‎2008 Oct 23 11:40 AM
Hello ,
Now i got ur question :
What itab[1] means is the first record in the itab table in the NEW DEBUGGER.
Hope this clears the confusion
Rgds,
Sandeep
‎2008 Oct 23 11:44 AM
first understand the difference of debugging mode and your frontend. In the debuggig we can get the values of any line by declaring it in [], but in front end we cant do like that. You must be knowing that which value is coming in which line, but this value will keep on changing depending on the where condition. Even then if your requirement is to get some values in a particulr line then you can only read statement with index.
‎2008 Oct 23 11:45 AM
Hi,
For your second question.
Yes in new debugger you can delete the rows from internal table...by selecting the required rows ...then right click and press delete.
‎2008 Oct 23 11:59 AM
Hi,
IN DEBUGGIND MODE If you see the SY-TABIX it has value which means record is read. so u can see the value for [1] record.
Where as in inline code u will get error b'coz without reading how can you write the first record.
Hope it is clear .
Rhea,
Edited by: rhea on Oct 23, 2008 1:00 PM
‎2008 Oct 23 12:04 PM
Please Dont reply with out understanding my question...Naveen i can understand your displeasure ,but please don't reply so harsh as others are trying to solve your problem it may be meet your requirement may not be,however they are atleast trying to meet your point.
but my question is on Debugging " yaar.use professional words instead of abbreviated Hindi.
Sorry if my words are hurt you.
Cheers.
‎2008 Oct 23 12:11 PM
Hi Amit.,
I will try to don't repeat abbreviated Hindi in my future postings.
And Sorry from my side, I dont want to hurt anybody. I just want to have concept related information in this thread.
Thanks,
Naveen.I
‎2008 Oct 23 12:29 PM
Hi Rhea,
You wrote:
>IN DEBUGGIND MODE If you see the SY-TABIX it has value which means record is read. so u can see the value for [1] record.
>Where as in inline code u will get error b'coz without reading how can you write the first record.
>Hope it is clear .
I can get last record's sy-tabix from abap coding also. Thats is only I can see in debugging mode.
So please come again what you wants to said..?
Thanks,
Naveen.I
‎2008 Oct 23 11:32 AM
hi:
write:/ itab[1]-f1,
itab[1]-f2.
are wrong the reason is here 1 indicates index number of the internal table.
if you have to display the 1st record, you can do likem
read itab index 1.
write:/ itab-f1,
itab[-f2.
Regards
Shashi
‎2008 Oct 23 11:40 AM
As there is no table as itab[1] declared...so you are getting this type of error message....
in dwbugging mode if you type itab[1]-<field1>
itab[1]-<field2>
it means that the value of the first row each field of the particular internal table.
If you type itab[2]-<field1>
itab[2]-<field2>
it means that the value of the second row each field of the particular internal table.
Arunima
‎2008 Oct 23 12:03 PM
At the risk of incurring the wrath of Inuganti...
>
> Hi...
>
>...
>
> Why I am getting error for this like:
> Field itab[1] is unkown....
>
> Where as we can get values and 1 for above two variables, itab[1]-f1 and itab[1]-f2....in DEBUGGING MODE.
> Let me know the reason ?
> What are the additional functions loading in DEBUGGER to get values for these?
>
>
> Thanks,
> Naveen.I
There is some confusion in your post. Now, if I create a program like yours, in SE38 and syntax check it, I get the message:
The field "ITAB[1]" is unknown, but there is a field with the similar
name "ITAB". "ITAB".1) Are you puzzled about that?
OK, now I comment out the write statements, and run the program in the (New) debugger. When I get to Line 14, If I type ITAB[1]-F1 into the Variables list, I get the value 'f'. ( Because you've defined the field without type, so it defaults to type c length 1 ).
2) So what's the problem?
The debugger allows you record access to tables using the syntax [n]. But ABAP itself does not. It is not part of the language.
btw - don't use tables with header-lines . It's ambigous and therefore bad.
matt
‎2008 Oct 23 12:21 PM
Hi Matt.,
You wrote:
> It is not part of the language.
Please come again on this.
We can clear the internal table body with empty square brackets...?
I am still having some confusion on this..
Thanks,
Naveen.I
‎2008 Oct 23 12:26 PM
In the ABAP language you can define a table itab with a header line. In those places where it's not clear whether you mean the table or its header - the two having the same name - the runtime inteprets itab on its own as the header, and itab[] as the body. So:
CLEAR itab. " Clears the header line
CLEAR itab[]. " Removes all entries from the tableBecause of this don't use tables with header lines. You should do things like
DATA: itab TYPE STANDARD TABLE OF t000 WITH UNIQUE KEY header_line,
wa LIKE LINE OF t000.
...
CLEAR wa. " Clears the workarea you use instead of a header-line
CLEAR itab. " Removes all entries from the tableIn the debugger, you can look at individual lines of an internal table using the form itab[3] to view the third line. You can't use this in ABAP. You have to use READ itab INTO wa INDEX 3. or other forms of the READ statement, or LOOP AT.
matt