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

spaces in string

Former Member
0 Likes
472

hi

am using function module spell_amount n am coverting the integers into words, i had to split the output into two line,

but while spliting i had to make sure tht i wont split the word

for example billion .. bill in first line and lion in second line

like tht.. i want protect & endproctect kind of thing..

am trying on search command to catch the spaces in sy-fdpos

and later spliting the string but the search command is of no use as its not catching SPACE or ' '.

what to do

thanks in advance

uday

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
454

Hi,

U can use split command to seperate the string field by space.

SPLIT string variable name AT ' ' INTO h1.........hn

Thanks,

Arunprasad.P

3 REPLIES 3
Read only

Former Member
0 Likes
455

Hi,

U can use split command to seperate the string field by space.

SPLIT string variable name AT ' ' INTO h1.........hn

Thanks,

Arunprasad.P

Read only

Former Member
0 Likes
454

Hi Prakash,

Use Can use Split Command to achieve this.

Here is the sample Code Using Split Statement.

DATA: DATE TYPE STRING VALUE '31/6/2008'. " '21/02/2008'.

DATA : GV_YEAR(4) TYPE C,

GV_MONTH(2) TYPE C,

GV_DATE(2) TYPE C,

GV_YEAR1(4) TYPE N,

GV_MONTH1(2) TYPE N,

GV_DATE1(2) TYPE N,

GV_SDATE TYPE STRING.

  • End of Changes - DV1K924241

SPLIT DATE AT '/' INTO GV_DATE GV_MONTH GV_YEAR.

MOVE : GV_YEAR TO GV_YEAR1,

GV_DATE TO GV_DATE1,

GV_MONTH TO GV_MONTH1.

CONCATENATE GV_YEAR1 GV_MONTH1 GV_DATE1 INTO GV_SDATE.

CONDENSE GV_SDATE.

WRITE:/ GV_SDATE.

CLEAR : GV_YEAR, GV_YEAR1,

GV_DATE, GV_DATE1,

GV_MONTH, GV_MONTH1,

GV_SDATE.

Reward If Helpfull,

Naresh.

Read only

Former Member
0 Likes
454

thanks a lot