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

concantenate with even space between strings

Former Member
0 Likes
680

Hi fellow abapers

I need to concatenate 3 words of type c to a variable type c, with even space between them in all the rows ,when i tried it ,i'm gettin the following output

TOM...........20.03.2008.......... 02 : 37 : 40

HARRY............20.03.2008........... 01 : 37 : 40

DICK........... 20.03.2008......... 00 : 37 : 40

how to bring even space between then in all rows.

like

TOM.............20.03.2008.......... 02 : 37 : 40

HARRY.........20.03.2008.......... 01 : 37 : 40

DICK............ 20.03.2008.......... 00 : 37 : 40

(no dots , its only to represent blanks)

i've tried with SEPARATED BY SPACE, RESPECTING BLANKS, CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

nothing works.

Plz help

Regards

Prabumanoharan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
650

Hi Prabhu,

DATA: w_txt TYPE char60.

write : w_name to w_txt(30),

w_date TO w_txt+35(10),

w_time TO w_txt+50(10).

regards,

Sachin

Hi Prabhu,

DATA: w_txt TYPE char60.

write : w_name to w_txt(30),

w_date TO w_txt+35(10),

w_time TO w_txt+50(10).

regards,

Sachin

4 REPLIES 4
Read only

Former Member
0 Likes
650

You can use OFFSET operations. Eg:

DATA: l_text TYPE char255.

LOOP AT itab INTO <wa>.
   CLEAR l_text.
   MOVE: <wa>-name TO l_text(20),
         <wa>-date TO l_text+20(10),
         <wa>-time TO l_text+30(10).
   WRITE:/ l_text.
ENDLOOP.

Read only

Former Member
0 Likes
651

Hi Prabhu,

DATA: w_txt TYPE char60.

write : w_name to w_txt(30),

w_date TO w_txt+35(10),

w_time TO w_txt+50(10).

regards,

Sachin

Read only

Former Member
0 Likes
650

hey

i had the same issue a few weeks ago

i do a loop with this

LOOP AT ITAB

WRITE:/(20) VARIABLE 1.

WRITE (15) VARIABLE 2.

WRITE (15) VARIABLE 3.

ENDLOOP

regards

Read only

Former Member
0 Likes
650

Thks for answers, closing the thread