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

Compress field gap

Former Member
0 Likes
1,216

Hi,

Is there is any function module which can suppress the gaps b/w string.

like

I have one field T1-F1 = Jack M

I wanted to remove the gap b/w the string i.e. needs to see the output like JackM

If any FM is not available then pls suggest me any other way to do it.

Hi,

Is there is any function module which can suppress the gaps b/w string.

like

I have one field T1-F1 = Jack M

I wanted to remove the gap b/w the string i.e. needs to see the output like JackM

If any FM is not available then pls suggest me any other way to do it.

8 REPLIES 8
Read only

Former Member
0 Likes
1,082

Hi..

THIS IS SuFFICIENT..

<b>Condense T1-F1 no-gaps.

WRITE T1-F1.</b>

Ram

Read only

Former Member
0 Likes
1,082

Hi,

You can use CONDENSE NO-GAPS.

Ex..

DATA: V_CHAR(10) VALUE 'Jack M'.

CONDENSE V_CHAR NO-GAPS.

WRITE: / V_CHAR.

Thanks,

Naren

Read only

Former Member
0 Likes
1,082

Hai,

If you have sevaral strings to be compressed do like this:

Declare a internral table.

DATA:

BEGIN OF FS_STRING,

STRING1 TYPE STRING.

END OF FS_STRING.

DATA:

T_TABLE LIKE TABLE OF FS_TABLE.

/*Populate strings into internal table

DESCRIBE T_TBALE LINES N_LINES.

LOOP AT T_TABLE INTO FS_TABLE.

CONDENSE FS_TABLE-STRING1 NO-GAPS.

WRITE:

/ FS_TABLE-STRING1.

ENDLOOP..

<b>Reward points if ot helps you.</b>

Regds,

Rama.Pammi

Read only

Former Member
0 Likes
1,082

Hi ,

Now I wanted to exclude the last entry i.e. M & I wanted to read the entries before gap.

suppose T1-F1 = Jack M

Now i condense it so i m getting JackM.

Now I wanted to read the only Jack.

But remember the field having different lengths. i. one entry is Jack M

other is Michal J

Pls reply me asap.

Read only

0 Likes
1,082

Hi Neha..

u shopuld do it..before condensing...

data:

w_str1 type string,

w_str2 type string.

<b>split T1-F1 into w_str1 w_str2 at SPACE</b>.

NOW <b>condense T1-F1 no-gaps</b>.

w_str1 will have ur "JACK'.

write w_str1.

Read only

Former Member
0 Likes
1,082

Thanks

Read only

0 Likes
1,082

Neha..

reward points for the helpful answers....which motivates and cheers

the answering people...

Cheers.

Ramu

Read only

Former Member
0 Likes
1,082

Hi,

Please make sure to reward points for helpful answers..

Thanks,

Naren