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

How delete first two characters ?

Former Member
0 Likes
14,360

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,495

SHIFT str by 2 places

8 REPLIES 8
Read only

Former Member
0 Likes
6,496

SHIFT str by 2 places

Read only

Former Member
0 Likes
6,495

add this

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

Read only

Former Member
0 Likes
6,495

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.

Read only

former_member156446
Active Contributor
0 Likes
6,495

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).

Read only

Former Member
0 Likes
6,495

Hi,

Sai, Will TRIM work in your case..

Regards,

Sai

Read only

Former Member
0 Likes
6,495

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

Read only

Former Member
0 Likes
6,495

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

Read only

Former Member
0 Likes
6,495

Thank u for all