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

HELP WITH MODIFY STATEMENT

Former Member
0 Likes
534

Hi all,

I HAVE A MODIFY STATEMENT IN PROGRAM

IT SAYS MODIFY ZTEST FROM TABLE ITAB.

tHE STRUCTURE OF ITAB AND ZTEST ARE NOT IDENTICAL.

i HAVE AN EXTRA FIELD IN ITAB . iTS WORKING FINE NOW DOES THAT MAKES ANY DIFFERENCE.

THANKS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

Hi kajol,

1. NOW DOES THAT MAKES ANY DIFFERENCE.

Yes, it makes very much difference.

2. The workarea length

should be >= database table length .

It will work.

3. Further,

if the field sequence, or length is different,

then DATA will not go properly in each field,

hence, it may give incorrect results.

4. If the extra field is in the last,

then usually, no problem.

regards,

amit m.

4 REPLIES 4
Read only

Former Member
0 Likes
508

Hi kajol,

1. NOW DOES THAT MAKES ANY DIFFERENCE.

Yes, it makes very much difference.

2. The workarea length

should be >= database table length .

It will work.

3. Further,

if the field sequence, or length is different,

then DATA will not go properly in each field,

hence, it may give incorrect results.

4. If the extra field is in the last,

then usually, no problem.

regards,

amit m.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
507

I assume that the extra field comes at the end of the ITAB structure, which is why it works. It will fill left to right, the entire row string, not field by field.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
507

this is from SAP help

1. The data is read from left to right in internal table structure.

2. the length of itab should be more than databasetable

3. alignment of fields should be same as that of database table

Read only

Former Member
0 Likes
507

Hi Kajol,

If you have all fields of ZTEST in ITAB in the same order as in ZTEST then your MODIFY statement will work without giving errors.

Mostly if you have any additional fields in the end of ITAB then it will work.

Thanks,

Vinay