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

Delete last 10 characters of a field

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.



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

Message was edited by: Suhas Saha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 03, 2012 at 05:39 AM
    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
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 03, 2012 at 05:44 AM

    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

    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.