Application Development 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: 

select

Former Member
0 Kudos

SELECT matnr meins FROM mara INTO CORRESPONDING FIELDS OF TABLE gt_mara.

is this statement correct where gt_mara has two fields matnr and meins

DATA:BEGIN OF wa_trans.

INCLUDE STRUCTURE gt_trans.

DATA: END OF wa_trans.

wat does thios do

4 REPLIES 4

Former Member
0 Kudos

Hi,

Do like this

Types: Begin of ty_mara,

matnr type mara-matnr,

meins type mara-meins,

end of ty_mara.

Data: gt_mara type table of ty_mara, " This is Internal table gt_mara declaration.

wa_mara type ty_mara. "This is Work Area declaration

SELECT matnr meins FROM mara INTO TABLE gt_mara.

Regards,

Satish

Former Member
0 Kudos

HI

1)

IF GT_MARA has these two fields only no need to write corresponding fields of table as a optimization point of view

else the statement is correct


SELECT matnr meins FROM mara INTO TABLE gt_mara.

2)


DATA:BEGIN OF wa_trans.
INCLUDE STRUCTURE gt_trans.
DATA: END OF wa_trans.

This statement defines a line type having a same structure as

GT_trans..

as u have named it WA_trans

it is working as a work area only it is also right....

HTH

pls reward points

regards

rajan

Former Member
0 Kudos

Hi,

Try to do like this

Data : Begin of imara occurs 0, "internal table declartions

matnr like mara-matnr,

meins like mara-meins,

end of imara.

Data: gt_mara type table of imara, "Internal table gt_mara declaration.

wa_mara type imara. "Work Area declaration

SELECT matnr meins FROM mara INTO TABLE gt_mara.

Reward me Points,

By

Pari

prasanth_kasturi
Active Contributor
0 Kudos

hi,

if the order of fields in gt_mara is meins and matnr its necessary to use corresponding edition. otherwise its not

you can use

SELECT matnr meins FROM mara into TABLE gt_mara.

and the next one defines a work area of structure gt_trans.

reward if helpful

prasanth