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: 

supress leading chars

Former Member
0 Kudos

Hello!

How can I suppress the leading places

if I want to output only the last

three chars in sap script.

Defined is variable like:

data gv_s_menge(10) type c,

Now I need in the output only

the last 4 chars.

Regards

ilhan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Just use Z along with the field

/ <b>&ITAB-NETWR(Z) </b> this will remove leading zeros in that field

You can use Offset for the field also

/ &ITAB-NAME+7(3)& - for last 3 Char

Reward points for useful Answers

Regards

Anji

Message was edited by:

Anji Reddy Vangala

5 REPLIES 5

Former Member
0 Kudos

Hi

Just use Z along with the field

/ <b>&ITAB-NETWR(Z) </b> this will remove leading zeros in that field

You can use Offset for the field also

/ &ITAB-NAME+7(3)& - for last 3 Char

Reward points for useful Answers

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Former Member
0 Kudos

Hi,

Simply do it like this,

take one more variable as A

A = gv_s_menge+7(3).

And in SAP Script print &A&

Reward if useful!

rodrigo_paisante3
Active Contributor
0 Kudos

hi

try this

write gv_s_menge+6(4).

Regards

Former Member
0 Kudos

Small correction as 4 charachters required,

A = gv_s_menge+6(4).

Former Member
0 Kudos

Hi,

just use the below code,

write gv_s_menge+6(4).

This statement helps you to display the characters after 6th character to the next 4 positions.

Regards,

Pavan P.