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

seperator

Former Member
0 Likes
1,432

how to seperate number .....

for eg 'hsl01'

menas i need to seperate hsl / 01

11 REPLIES 11
Read only

Former Member
0 Likes
1,412

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.

Read only

Former Member
0 Likes
1,412

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

Read only

Former Member
0 Likes
1,412

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.

Read only

Former Member
0 Likes
1,412

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

Read only

0 Likes
1,412

if suppose hsl13 means i need to seperate

hsl/13

Read only

Former Member
0 Likes
1,412

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

Regards,

Aparna.

Read only

0 Likes
1,412

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.

Read only

Former Member
0 Likes
1,412

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

Read only

Former Member
0 Likes
1,412

use SPLIT.

Regrds,

flavya.

Read only

Former Member
0 Likes
1,412

Hi,

Use sy-abcde & split.

Thanks,

Krishna..

Read only

JanStallkamp
Advisor
Advisor
0 Likes
1,412

Hi.

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

Best regards,

Jan Stallkamp