Application Development 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: 

Delete last 10 characters of a field

Former Member
0 Kudos

Hi All,

I have a field which is of type char and length 50.

I have to delete the last 10 charcters of the field and store the same to internal table.

Kindly help me on this.

Thanks,

Neha

Moderator Message: Basic question on string operations. Thread locked.

Message was edited by: Suhas Saha

2 REPLIES 2

jack_graus2
Active Contributor
0 Kudos
DATA:
  internal_table TYPE STANDARD TABLE OF char50,
  work_area      TYPE REF TO char50.
......
LOOP AT internal_table REFERENCE INTO work_area.
  CLEAR work_area->*+40(10).
ENDLOOP.
Regards Jack

yogendra_bhaskar
Contributor
0 Kudos

hi neha ,

TRY THIS :

parameter : p_char(30) type c.

data :      lw_string(30) type c.

lw_string = p_char.

shift lw_string right by 10 PLACES.            " Removes last 10 character

condense lw_string.                            " condensing the space after shifting it to right

WRITE lw_string.     

regards ,

Yogendra Bhaskar