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

splitting a record...

aris_hidalgo
Contributor
0 Likes
590

Hello experts,

I am currently modifying a report where in I must split bkpf-awkey where ekbe-gjahr is equal to the last 4 digits and ekbe-belnr is equal to the first 10 digits from bkpf-awkey. How do I go about this guys? I have pasted below a sample record from bkpf-awkey. Thanks guys and take care!

sample 1:

0200000000GLOB1999

sample 2:

50000000081999

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
535

Hi,

Try this..


data: w_len type i,
      w_off type i.

w_len = strlen(bkpf-awkey).
w_off = w_len - 4.
ekbe-gjahr = bkpf-awkey+w_off(4).
ekbe-belnr = bkpf-awkey+0(10).

Regards,

Suresh Datti

2 REPLIES 2
Read only

Former Member
0 Likes
535

Hi ,

try this :

Data : Strlegth type sy-tabix,

offset type sy-tabix.

ekbe-belnr = bkpf-awkey+0(10).

Strlegth = strlen( bkpf-awkey ).

Offset = Strlegth - 4.

ekbe-gjahr = bkpf-awkey+Offset(4).

Hope this may work for you.

Regards,

Lanka

Read only

suresh_datti
Active Contributor
0 Likes
536

Hi,

Try this..


data: w_len type i,
      w_off type i.

w_len = strlen(bkpf-awkey).
w_off = w_len - 4.
ekbe-gjahr = bkpf-awkey+w_off(4).
ekbe-belnr = bkpf-awkey+0(10).

Regards,

Suresh Datti