Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Trailing spaces after data

Hi,

I have a requirement in my code where I need to keep trailing spaces after the value.

Say, the value is ABC with 2 spaces before ABC and 4 spaces after ABC.

' ABC '

I want to remove the spaces before ABC but want the spaces that exist after ABC.

Thanks,

Sim

Former Member
Former Member replied

Hi,

You can use SHIFT statement.

data: v_var type char6 value ' ABC '

SHIFT v_var LEFT DELETING LEADING space.

write:/ v_var.

Output will be ABC .

Regards,

Nikhil

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question