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

Defining Structure through Table

Former Member
0 Likes
391

Hello Gurus.... Please check the Following code I want to have a Structure based on the Table MBEW, but I have the FOLLOWING SYNTAX ERROR...

<b>"i_mbew" cannot be a table,a reference, a string,or contain any of these objects</b>

DATA: i_mbew TYPE TABLE OF mbew,

wa_mbew TYPE mbew.

SELECT * FROM mbew INTO i_mbew.

LOOP AT itab INTO wa_itab.

READ TABLE i_mbew INTO wa_mbew WITH KEY

mtrnr = wa_itab-artnr.

IF wa_mbew-vprsv = 'V'.

wa_itab-price = wa_mbew-verpr.

ELSE.

wa_itab-price = wa_mbew-stprs.

ENDIF.

MODIFY itab FROM wa_itab.

WRITE itab.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
360

hi,

try this

SELECT * FROM mbew INTO table i_mbew.

bye

enzo

3 REPLIES 3
Read only

Former Member
0 Likes
361

hi,

try this

SELECT * FROM mbew INTO table i_mbew.

bye

enzo

Read only

Former Member
0 Likes
360

>>SELECT * FROM mbew INTO i_mbew.

SELECT * FROM mbew INTO table i_mbew.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
360

Hi,

Since I_mbew is a table,you should give

SELECT * FROM mbew INTO <b>table</b> i_mbew.