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

Dynamic selection

0 Likes
479

Hi,

can any body repaire this code...

Tables:mara.

FIELD-SYMBOLS: <WA_FIELD> TYPE ANY.

ASSIGN 'MTART' TO <WA_FIELD>.

SELECT <b>matnr (<WA_FIELD>)</b> from mara

into mara.

WRITE:/ mara-matnr,mara-mtart.

ENDSELECT.

3 REPLIES 3
Read only

Former Member
0 Likes
454

TABLES : MARA.
DATA : NAME(30) TYPE C VALUE 'MTART'.

SELECT MATNR (NAME) FROM MARA INTO MARA.
  WRITE : MARA-MATNR, MARA-MTART.
ENDSELECT.
Read only

Former Member
0 Likes
454

Hi,

Tables:mara.

FIELD-SYMBOLS: <WA_FIELD> TYPE ANY.

ASSIGN 'MTART' TO <WA_FIELD>.

SELECT matnr from mara into mara where......

move <WA_FIELD> to mara-matnr.

WRITE:/ mara-matnr,mara-mtart.

........

..........

Regards,

Azaz Ali.

Read only

uwe_schieferstein
Active Contributor
0 Likes
454

Hello Reddy

A field cannot exist without its table/structure or data variable. Thus, your ASSIGN statement cannot work:

ASSIGN 'MTART' TO <WA_FIELD>.  " not correct

Here is the correct version:

ASSIGN COMPONENT 'MTART' OF STRUCTURE mara TO <wa_field>.

Regards

Uwe