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: 

want to create a type at runtime

Former Member
0 Kudos

Hi all ,

I am trying to create a type at run time within my scheme by making use of a table loop.

[code]

Report test_data.

data :

llv_imp type table of RSIMP,

gt_imp_par type string occurs 0.

Field-Symbols :

<fs_imp_par> like RSIMP,

<fs_struct> type string.

Form inst_par_types

Changing

lv_imp like llv_imp

lt_imp_par like gt_imp_par.

Data :

lv_str(72) type c ,

lv_line type I ,

lv_delim type C value ',' .

Describe table lv_imp lines lv_line.

Loop at lv_imp assigning <fs_imp_par>.

if sy-tabix = lv_line.

lv_delim = '.'.

endif.

if <fs_imp_par>-default is not initial.

concatenate <fs_imp_par>-parameter 'TYPE' <fs_imp_par>-typ

'VALUE' <fs_imp_par>-default lv_delim into

lv_str SEPARATED BY space.

else.

concatenate <fs_imp_par>-parameter 'TYPE' <fs_imp_par>-typ

lv_delim into lv_str SEPARATED BY space.

endif.

append lv_str to lt_imp_par.

clear lv_str.

endloop.

Types :

Begin of l_tabname ,

<b><i>{T$lt_imp_par$$$&lt_imp_par&$$}</i></b>

End of l_tabname.

EndForm.

[/code]

But when i instantiate this scheme it dumps as the highlighted line creates 2 different definitions of same variable lt_imp_par (1 as var & another one as table).

What shall I do to get the solution?

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please do not post multiple treads for the same question.

Please refer to other thread.

Regards,

Rich Heilman

0 Kudos

please check the question. its not the same. earlier i asked to generate an internal tab dynamically but that was by mistake. Actually my requirement is to create a type that is being highlighted in the code and that to by making use of schemas.

Moreover I don't know if we can delete a thread that has already been generated...