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: 

displaying values of one columns into different columns

Former Member
0 Kudos

Hi

how to display values of a column as different columns. for example getting the values of Master Inspn char (VERWMERKM) u2013 UTS , YS , EL , Hardness and displaying it as different headers i.e uts , ys,el, hardness.

3 REPLIES 3

Former Member
0 Kudos

Hi,

u can use the SPLIT command.

If there are any seperators in the data, u can split at the separator.

Else, you need to split at the number of char for each field.

Regards,

Teja.

former_member222860
Active Contributor
0 Kudos

Here's one-way to do that:

data: begin of itab occurs 0,
        word(100),
        word1(100),
       end of itab.

data: begin of jtab occurs 0,
        word(100),
        word1(100),
       end of jtab.

itab-word = 'field1'.
append itab.

itab-word = 'field2'.
append itab.

itab-word = 'field3'.
append itab.

itab-word = 'field4'.
append itab.

 loop at itab.
   write:/ itab-word, 20 itab-word1.
 endloop.


loop at itab.
   concatenate jtab-word itab-word into jtab-word separated bY SPACE.
   concatenate jtab-word1 itab-word1 into jtab-word1 separated bY SPACE.
endloop.
  append jtab.

skip.

*write: 'Transposed Rows'.

 loop at jtab.
   write:/ jtab-word,  jtab-word1.
 endloop.

Former Member
0 Kudos

Hi,

Either use Dynamic Internal Table for this.

or

Declare an Internal Table with One Field for each of these values.

Like :

DATA : BEGIN OF ITAB OCCURS 0,

MAIN FIELDS .....,

FIELD1 TYPE C, " FOR UTS

FIELD2 TYPE C, " FOR YS

FIELD3 TYPE C, " FOR EL

FIELD4 TYPE C, " FOR Hardness

END OF ITAB.

Regds,

Anil