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

structure conversion

Former Member
0 Likes
478

Hi All,

I have a small problem here.

I have two internal tables itab1 and itab2.

itab1 having the following structure

DATA: BEGIN OF itab1 OCCURS 0.

DATA: tcode TYPE tstct-tcode,

ttext TYPE tstct-ttext,

flag TYPE c.

DATA: END OF itab1.

in this itab1 i have some values.

My itab2 is of type range. i mean it is having the structure of sign, option, low, high.

now i need to transfer itab1 content to itab2.

how can it be possible?

can anybody suggest .

thanks & regards

naidu

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
456

Hi there

you have three values in itab1 and ranges has only one place to hold.. what are u planning exactly... but still check this sample code:

loop at itab1 into wa_itab1.
  s_erdat-high   = wa_itab1-value1.
  s_erdat-low    = wa_itab1-value2.
  s_erdat-option = 'BT'.
  s_erdat-sign   = 'I'.
  APPEND s_erdat.

clear: wa_itab1.
endloop.

Read only

0 Likes
456

Hi jay,

Thank you for the immediate reply.

here my requirement is i need to call a function module. in that function module one tables parameter is there which is of type range.

noe i have to pass itab2 into this tables parameter. but before passing this i need to transfer the itab1 contents to itab2.

this is my main requirement.

can you suggest me please.

thanks & regards

naidu

Read only

0 Likes
456

Hi there..

my above post is the solution to update the range tables.. which values to pass you know it better..

loop at itab1 into wa_itab1.
  s_erdat-high   = wa_itab1-value1.
  s_erdat-low    = wa_itab1-tcode.
  s_erdat-option = 'BT'.
  s_erdat-sign   = 'I'.
  APPEND s_erdat.
 
clear: wa_itab1.
endloop.

Read only

Former Member
0 Likes
456

Thank you j@y

Its working.