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

Remove first 13 characters

Former Member
0 Likes
598

Hi,

I have an Infoobject where we load 16 character long records like - AB12345678912001.

I have to transfer everything to a new Infoobject but not the first 13 character. Could you please let me know the best code with all the details...Sorry I am not an ABAPer.

Tahnks for you help.

4 REPLIES 4
Read only

Former Member
0 Likes
557

Hi,

DATA:

BEGIN OF fs_tab ,

field TYPE char16,

END OF fs_tab,

fs_tab1 LIKE fs_tab,

itab LIKE STANDARD TABLE OF fs_tab,

jtab LIKE STANDARD TABLE OF fs_tab.

fs_tab-field = 'ABC23SCF45KKNS45'.

APPEND fs_tab TO itab.

fs_tab-field = 'XYC456SCF45KKNS4'.

APPEND fs_tab TO itab.

fs_tab-field = 'UT9BF23F45KKNS45'.

APPEND fs_tab TO itab.

LOOP AT itab INTO fs_tab.

MOVE fs_tab-field+13(3) TO fs_tab1-field.

APPEND fs_tab1 TO jtab.

ENDLOOP.

LOOP AT jtab INTO fs_tab1.

WRITE:/ fs_tab1-field.

ENDLOOP.

Hope this code will help you to resolve your problem.

Thanks,

Phani Diwakar.

Read only

Former Member
0 Likes
557

Hi,

if f1 = 'AB12345678912001'.

then to get the last three characters:

ws_f1 = f1+13. "Chars from 14,15,16 will be copied to variable ws_f1.

regards,

Subramanian

Read only

Former Member
0 Likes
557

Thanks for the quick reply , I solved it using a formula in the update rule.

Thanks much. Also assinged points as well.

Read only

Former Member
0 Likes
557

no comments