Skip to Content
avatar image
Former Member

Split the Ticket Number

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 07:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 07:20 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 07:27 AM

    Hello

    Use SHIFT var LEFT

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 07:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 07:31 AM

    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

    Add comment
    10|10000 characters needed characters exceeded