05-31-2007 1:44 AM
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....
05-31-2007 1:48 AM
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
05-31-2007 1:45 AM
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..
05-31-2007 1:47 AM
05-31-2007 1:48 AM
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
05-31-2007 2:55 AM
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
05-31-2007 3:05 AM
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)
05-31-2007 3:54 AM
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