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

reports

Former Member
0 Likes
1,691

hi experts,

can any body help me , in my report am getting 12 char of the filed (EKKN-NPLNR) lenth in that i want to print only last 7 chars. the first 5 chr are zeros. i want elemenate them.

just i want to print last 7chars.

advance thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,663

W_NPLNR = '120001578928'

W_NPLNR = W_NPLNR+6(7)

W_NPLNR = '1578928'

dear this is lihe mid function

this mean get 7 characters from index 6 like dat

Rewards if helpful.

14 REPLIES 14
Read only

Former Member
0 Likes
1,663

use fm to remove leading zreos'

CONVERSION_EXIT_ALPHA_OUTPUT

Read only

Former Member
0 Likes
1,663

hi

Use the fm CONVERSION_EXIT_ALPHA_OUTPUT.

DATA: P(10) VALUE '0000000001'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = P

IMPORTING

OUTPUT = P.

write p.

it would show.. only 1...

hope this helps...

<b>reward if useful...</b>

regards

dinesh

Read only

0 Likes
1,663

hi

i want to print last 7 degits only. whether the first 5 degits r 0's or any num.

i want to elemenate then print only last 7 degits only what ever it is.

plse help me.

Read only

0 Likes
1,663

hi

i want to print last 7 degits only. whether the first 5 degits r 0's or any num.

i want to elemenate then print only last 7 degits only what ever it is.

plse help me.

Read only

Former Member
0 Likes
1,663

Hi,

You can use shift command..

Ex.



data: v_input(12) value '000001234567'.

shift v_input left deleting leading '0'.

WRITE: / v_input.

Thanks

Naren

Read only

0 Likes
1,663

hi

i want to print last 7 degits only. whether the first 5 degits r 0's or any num.

i want to elemenate then print only last 7 degits only what ever it is.

plse help me.

Read only

Former Member
0 Likes
1,663

hi Puram

thy with this

when you loop or how ever getting value i assume it call W_NPLNR

W_NPLNR = '000001578928'

shift W_NPLNR left deleting leading '0'

W_NPLNR = '1578928'

Rewards if Helpful.

Read only

Former Member
0 Likes
1,663

Hi,

You can work on 2 ways.

1.Use the fm CONVERSION_EXIT_ALPHA_OUTPUT.

DATA: number(10) VALUE '0000000001'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = P

IMPORTING

OUTPUT = P.

2. DATA: number(10) VALUE '0000000001'.

number = number+5(12).

Don't forget to reward if useful...

Read only

0 Likes
1,663

hi murali,

as per ur logic as per my req. i write like

tables : ekkn.

i1 type c.

data: it_ekkn like ekkn occurs 0 with header line.

select * from ekkn into table it_ekkn.

xstring = it_ekkn-nplnr.

i1 = strlen( xstring ).

i1 = i1+5(12).

but am getting error

offsety specification error.

plse help me

advace thaks

Read only

0 Likes
1,663

Hi,

The code should be like this:

tables : ekkn.

data: it_ekkn like ekkn occurs 0 with header line.

select * from ekkn into corresponding fields of it_ekkn.

it_ekkn-pelnr = it_ekkn-pelnr+5(12).

append it_ekkn.

endselect.

Then loop at it_ekkn and write the records.

Regards,

Himanshu

Message was edited by:

Himanshu Aggarwal

Read only

Former Member
0 Likes
1,663

Hi,

For this use below code.

2. DATA: number(10) VALUE '123456789012'.

number = number+5(12).

write number.

Don't forget to reward if useful...

Read only

Former Member
0 Likes
1,663

Hi,

In ur case use SHIFT statement.

SHIFT field1 BY 5 PLACES LEFT.

In this case field1 will contain only the last 7 characters whatever be the first five digits.

Regards,

Himanshu

Read only

0 Likes
1,663

hi

thanks yaar..

Read only

Former Member
0 Likes
1,664

W_NPLNR = '120001578928'

W_NPLNR = W_NPLNR+6(7)

W_NPLNR = '1578928'

dear this is lihe mid function

this mean get 7 characters from index 6 like dat

Rewards if helpful.