Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

assign fields dynamicly

Hello all,

I have 2 tables: the first :

TYPES:BEGIN OF ty_qmel,

icon TYPE icon_d,

qmnum TYPE qmel-qmnum,

qmart TYPE qmel-qmart,

ernam TYPE qmel-ernam,

erdat TYPE qmel-erdat,

qmdab TYPE qmel-qmdab,

qmgrp TYPE qmel-qmgrp,

qmcod TYPE qmel-qmcod,

ltrmn TYPE qmel-ltrmn,

ltrur TYPE qmel-ltrur,

iloan TYPE qmih-iloan,

qmnum1 TYPE qmnum,

qmnum2 TYPE qmnum,

qmnum3 TYPE qmnumt,

END OF ty_qmel.

TYPES: tt_qmel TYPE STANDARD TABLE OF ty_qmel .

DATA:gt_qmel TYPE TABLE OF ty_qmel.

the second :

TYPES: BEGIN OF qmnum_struct,

qmnum TYPE qmnum,

END OF qmnum_struct.

DATA: qmnum_lt TYPE STANDARD TABLE OF qmnum_struct,

qmnum_ls TYPE qmnumt_struct,

I want to loop at qmnum_lt 3 times and each time assign qmnum

to field qmnum 1-3 dynamicaly.

Is it poosibel ?

Regards

Yifat

replied

loop at qmnum_lt.

n = 0.

case n.

when 0.

qmnum1 = qmnum.

n = n + 1.

when 1.

qmnum2 = qmnum.

n = n + 1.

when 2.

qmnum3 = qmnum.

clear n.

endcase.

endloop.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question