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: 

seperator

Former Member
0 Kudos

how to seperate number .....

for eg 'hsl01'

menas i need to seperate hsl / 01

11 REPLIES 11

Former Member
0 Kudos

hi,

Search for sy-num in string.

and find the posiition and use split command tp split the string at that position.

Hope it will help you.

Regards

Manjari.

Former Member
0 Kudos

Search SCN with the search term: SPLIT, And from Now on make it a habit of searching in SCN before posting a question.

Former Member
0 Kudos

hi,

Declare the variable of type N and move the value to the variable. Only number get moved.

Data : Value(2) TYPE N,

Value1(10) TYPE C.

Value = Value1 ='Test01'.

Write value.

REPLACE ALL OCCURRENCES OF value IN VALUE1 WITH ''.

Write value1.

Former Member
0 Kudos

Hi,

Use the following logic



data : text type string value 'HSL01'.

data : g_text1 type string,
       g_text2 type string,
       g_text3 type string.

data : g_sep type c value '/'.

start-of-selection.

split text at '0' into g_text1 g_text2.

concatenate g_text1 g_sep g_text2 into g_text3.         " the g_text3 will contain the string as required

Regards,

Mansi.

Edited by: SAP USER on Dec 9, 2008 12:00 PM

Edited by: SAP USER on Dec 9, 2008 12:01 PM

0 Kudos

if suppose hsl13 means i need to seperate

hsl/13

Former Member
0 Kudos

Check sy-abcde in string and separate alphabets and numbers.

Regards,

Aparna.

0 Kudos

hi,

Declare the variable of type N and move the value to the variable. Only number get moved.

Data : Value(2) TYPE N,

Value1(10) TYPE C.

Value = Value1 ='Test01'.

Write value.

REPLACE ALL OCCURRENCES OF value IN VALUE1 WITH ''.

Write value1.

former_member1245113
Active Contributor
0 Kudos

Hi

If you have always HSL as the first three chars then try this one

data : var1 type string

var2 type string

and lets say var = HSL01

then

var1 = var+0(3) gives you HSL

var2 = var+3(2) gives you 01

concatenate var1 '/' var2 into var (gives you HSL/01)

Regards

Ramchander Rao.K

Former Member
0 Kudos

use SPLIT.

Regrds,

flavya.

Former Member
0 Kudos

Hi,

Use sy-abcde & split.

Thanks,

Krishna..

JanStallkamp
Employee
Employee
0 Kudos

Hi.

As other mentioned before: Please search before you ask basic questions in the SCN. I will lock this thread.

Best regards,

Jan Stallkamp