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

Split the Ticket Number

Former Member
0 Likes
827

Hi Guy's,

I want to split the ticket number as 13 character '2207033425657' i want only 12 character Ticket Number

means i want to delete the 1st character 2207033425657 friends how to work this senario.

Thanks,

Sai.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
783

Hi,

DATA:
  w_char(13) TYPE c,
  w_char1(12) TYPE c.
  
w_char = '2207033425657'.
w_char1 = w_char+1(12).

WRITE: w_char1.

Regards

Adil

6 REPLIES 6
Read only

Former Member
0 Likes
783

you can pass it into another variable using OFFSET. or you can go for SPLIT command.

Read only

Former Member
0 Likes
784

Hi,

DATA:
  w_char(13) TYPE c,
  w_char1(12) TYPE c.
  
w_char = '2207033425657'.
w_char1 = w_char+1(12).

WRITE: w_char1.

Regards

Adil

Read only

Former Member
0 Likes
783

Hello

Use SHIFT var LEFT

Read only

Former Member
0 Likes
783

hii

you can do it simply using offset .like

wa_str = '2207033425657'.
w_final = wa_str+1(12).

or use



data: str1(13) type n value '2234567689'.
split str1 at str1+0(1) into str1 output_string.

write:/ output_string.

regards

twinkal

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
783

hi Sai ,

DATA : lv_ticket(13) TYPE c VALUE '2207033425657'.

DATA : lv_tic1 TYPE c,
       lv_tic2(12) TYPE c.

lv_tic1 = lv_ticket+0(1).
lv_tic2 = lv_ticket+1(12).

WRITE : /  lv_tic2.

With Regards.

Always Learner

Read only

0 Likes
783

Hi Guy's,

Thanks you very much your quick replay. I solved my problem.

Thanks,

Sai