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

move fields

Former Member
0 Likes
643

Hallow I doing a program and I wont to move id number to perner but not the last number ex. Id num <b>123456</b> perner have to be <b>12345</b> id num <b>1234</b> perner <b>123</b> I try to do it in my loop but it cut the first num like 23 any suggestion thanks .

LOOP AT itab1.

SPLIT itab1 AT ',' INTO:

itab-id_number

itab-hagbla

itab-date_open_hagbla

itab-date_start_hagbl

itab-date_stop_hagbla

itab-date_open_hamora

itab-date_close_hamor.

move itab-id_number to itab-pernr.

APPEND itab.

ENDLOOP.

LOOP AT itab.

MODIFY yhr_ex_mushlach FROM TABLE itab.

ENDLOOP.

<b>Id num is numc 9 and pernr is numc 8</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
603

Do the following instead of move itab-id_number to itab-pernr.

itab-pernr = itab-id_number+0(8).

Regards,

Ravi

Note - Please mark all helpful answers

4 REPLIES 4
Read only

Former Member
0 Likes
604

Do the following instead of move itab-id_number to itab-pernr.

itab-pernr = itab-id_number+0(8).

Regards,

Ravi

Note - Please mark all helpful answers

Read only

0 Likes
603

hallow ravikumar i try it but its good just when u have id number with 9 numbers

what can i do if i have ex. 5 or 6 number like 123456 or 12345 what can i do thankes

Read only

0 Likes
603

In that case

DATA : W_LENGTH TYPE I.

W_LENGTH = STRLEN( itab-id_number ).
W_LENGTH  = W_LENGTH - 1.

ITAB-PERNR = ITAB-ID_NUMBER+0(W_LENGTH).

Regards,

Ravi

Read only

anversha_s
Active Contributor
0 Likes
603

hi,

try this.

itab-pernr =  itab-id_number+0(8).

rgds

Anver