Application Development 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: 

please explain about " itab-field+0(2)" ......wht does this 0(2) mean

Former Member
0 Kudos

hi can anyone please explain or reference me some material about how to understand this concept of itab-field+0(2) what does this 0 and (2) mean here .....how many characters it is referencing here and so on.

thanks in advance....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

in itab-field+0(2)...0 is the starting index and 2 is the length..

Let's say if the value is 101...The value of itab-field+0(2) = 10..

Thanks,

Naren

6 REPLIES 6

Former Member
0 Kudos

itab-field+0(2) means it will have only first 2 charcters.

one more example : itab-field+0(10) means it will have 10 char..

Former Member
0 Kudos

0 means the position to where to start and 2 is the length

Former Member
0 Kudos

Hi,

in itab-field+0(2)...0 is the starting index and 2 is the length..

Let's say if the value is 101...The value of itab-field+0(2) = 10..

Thanks,

Naren

Former Member
0 Kudos

hi,

the general form is like variable+offset(length).

offset - character number in the string of characters

length - no. of characters starting from offset.

First character is considered at offset 0.

here 0 is offset and 2 is length.

So it will be a substring with first 2 characters from itab-field

0 Kudos

another example would be:

assume value of itab-field = 'srinivas'.

And i want to get value 'niv' into other variable then i would write as:

itab-field+3(3)

former_member196280
Active Contributor
0 Kudos

Answer to your question.

0--> OFFSET

2 --> Lenght

Now let me give you one example

Suppose itab-field = 'ABCDEFGHIJKL'.

itab-field+0(2) will hold 'AB'.

itab-field+4(5) will hold 'EFGHI'.

I think now you are clear with concept.

Reward points to all useful answers.

Regards,

SaiRam