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

error in modify statement

Former Member
0 Likes
1,922

hi,

i have to modify the table.my coding is

form update_table.

clear it_header.

loop at gi_header_temp into it_header.

vekp-brgew = it_header-brgew.

modify vekp from it_header where exidv = it_header-exidv.

endloop.

endform.

but i am getting syntax error'. expected after it_header'.

i have to update the data using where condition

6 REPLIES 6
Read only

former_member404244
Active Contributor
0 Likes
881

Hi,

u r passing value to vekp ,so directly u can modify it.

form update_table.

clear it_header.

loop at gi_header_temp into it_header.

vekp-brgew = it_header-brgew.

modify vekp index sy-tabix

endloop.

endform.

Regards,

Nagaraj

Read only

Former Member
0 Likes
881

Check if structure of vekp and it_header are same.They must be similar.

whats the use of following statement


vekp-brgew = it_header-brgew

You have not used that

Read only

Former Member
0 Likes
881

Hi

Try this .

clear it_header.

loop at gi_header_temp into it_header.

vekp-brgew = it_header-brgew.

modify vekp from it_header TRANSPORTING brgew

where exidv = it_header-exidv.

End Loop

From SAP help for Modify statement "

. The WHERE addition can only be specified together with the TRANSPORTING addition. After WHERE, any logical expression can be specified in which the first operand of each individual comparison is a component of the internal table"

Regards

Beena

Edited by: Beena Prabha on Nov 4, 2008 5:35 AM

Read only

Former Member
0 Likes
881

Hi,

You cannot use 'WHERE' clause with MODIFY statment ( when you updating database tables). I would suggest you to use Update instead of modify. Modify statment is dangerous. Unless you want that If an entry is not found in the table VEKP for that EXIDV then it should be created.

regards,

Advait

Edited by: Advait Gode on Nov 4, 2008 11:42 AM

Edited by: Advait Gode on Nov 4, 2008 11:42 AM

Read only

Former Member
0 Likes
881

You cannot use WHERE condition while modifying a database table.

Read only

Former Member
0 Likes
881

Hi,

Use 'Transporting' option with modify statement.

Thanks & Regards,

Sudheer