Skip to Content
0
Former Member
Feb 12, 2007 at 05:14 PM

Concatenate String Issue

24 Views

Dear SAP Gurus,

I have one question.Please find below the scenario.

This is related to Concatenate.

In my internal table there are 4 Descriptions, let's take the example.

Line 1 - SIVARAM

Line 2 - RAMU

Line 3 - MYIT

Line 4 - 2007

Now I want to see the output like this.

SIVARAM, RAMU, MYIT, 2007 (For Each description I have to separate the , and SPACE).

I have did all kind of Research on this issue, but unfortunately I will not get the SPACE on my final string.

LOOP AT ITAB1.

CONCATENATE V-MAKTX ITAB1-DESC ',' SPACE INTO V_MAKTX.

ENDLOOP.

LOOP AT ITAB1.

CONCATENATE V_MAKTX ITAB1-DESC ',' ' ' INTO V_MAKTX.

ENDLOOP.

DATA : V_SPACE TYPE C.

CLEAR V_SPACE.

LOOP AT ITAB1.

CONCATENATE V_MAKTX ITAB1-DESC ',' V_SPACE INTO V_MAKTX.

ENDLOOP.

It is printing the ',' (comma) but not inserting the SPACE. I want space also to be in my final string.

I have tried all the options but it is not including the SPACE. Please suggest me how to proceed further.

Thanks & Regards

Sivaram. K