Skip to Content
author's profile photo Former Member
Former Member

How delete first two characters ?

Hi all,

i have problem like this i want to delete first two (~~) characters . i am written concatenate statement in the loop so v_string taking spaces

so i want to remove this ~~ .

plz any tell how to do this.

this is code in the loop.

CONCATENATE v_string ','

itab-arktx

itab-vrkme

total

total1

itab-vat_rate

itab-matkl

total2

INTO v_string SEPARATED BY '~~'.

present ouput:

~00500000123~ 2~0003000963~~~test6

~00500000123~ 2~0003000963~~~test6

act output :

00500000123~~ 2~0003000963~~~test6

00500000123~~ 2~0003000963~~~test6

thaks for advance

regards

sai

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 04:58 AM

    SHIFT str by 2 places

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 04:59 AM

    add this

    shift v_string by 2 places left deleting '~~'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 05:07 AM

    hi sai,

    you better use the SHIFT command.

    i.e., Shift v_string by 2 places

    see the below code.

    CONCATENATE v_string ','

    itab-arktx

    itab-vrkme

    total

    total1

    itab-vat_rate

    itab-matkl

    total2

    INTO v_string SEPARATED BY '~~'.

    SHIFT str by 2 places left deleting '~~

    i didn't see the syntax.but check the syntax also.

    if it is useful Reward me.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 18, 2008 at 05:12 AM

    Hi Sai

    CONCATENATE v_string ','

    itab-arktx

    itab-vrkme

    total

    total1

    itab-vat_rate

    itab-matkl

    total2

    INTO v_string SEPARATED BY '~~'.

    lv_len = strln (v_string).

    v_string = v_string+2(lv_len-2).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 05:22 AM

    Hi,

    Sai, Will TRIM work in your case..

    Regards,

    Sai

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 05:24 AM

    Sai

    CONCATENATE v_string ','   "--> Guess at this point v_string is EMPTY, try to avoid this and check the result
       itab-arktx
       itab-vrkme
       total
       total1
       itab-vat_rate
       itab-matkl
       total2
       INTO v_string SEPARATED BY '~~'.
    

    Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 05:30 AM

    hi,

    u can do like this:

    DATA: str(10) TYPE c VALUE '1234567890'.

    DATA: str1(10) TYPE c.

    str1 = str+2(8).

    This means that take character from third position, and 8 characters from the point. You can specify it as your field's length minus 2.

    Where str can be ur string.

    Regards,

    Renjith Michael.

    Edited by: Renjith Michael on Jan 18, 2008 11:00 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 12:12 PM

    Thank u for all

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.