Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Iternal table fields in New debugger

naveen_inuganti2
Active Contributor
0 Likes
1,602

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

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
1,564

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

17 REPLIES 17
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,564

Hi ,

Better use : Write : / itab-f1,

itab-f2.

as there is no table as itab[1] declared.

Rgds,

Sandeep

Read only

0 Likes
1,564

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

Read only

Former Member
0 Likes
1,564

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

Read only

Former Member
0 Likes
1,564

u wont get itab[1]-f1, itab[1]-f2 in debugger...

to get the value of itab[1]...just type itab in debugger....

Read only

0 Likes
1,564

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

Read only

0 Likes
1,564

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

Read only

0 Likes
1,564

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.

Read only

0 Likes
1,564

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.

Read only

0 Likes
1,564

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

Read only

0 Likes
1,564
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.

Read only

0 Likes
1,564

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

Read only

0 Likes
1,564

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

Read only

Former Member
0 Likes
1,564

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

Read only

Former Member
0 Likes
1,564

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

Read only

matt
Active Contributor
0 Likes
1,565

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

Read only

0 Likes
1,564

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

Read only

matt
Active Contributor
0 Likes
1,564

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 table

Because 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 table

In 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