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: 

Split Logic in HR ABAP

thirus11
Participant
0 Kudos

Hi Experts,

I need to a code snippet or a sample program which has the split logic functionality.

I know that in HR ABAP we have a standard functionality using PROVIDE and ENDPROVIDE which performs the split based on the records in the specific period from the infotypes.

Need the same functionality but I don't want to use PROVIDE and ENDPROVIDE.

Kindly help me in this requirement or share me your knowledge if have gone through this requirement.

Regards,

Thirumoorthy R

1 ACCEPTED SOLUTION

jrg_wulf
Active Contributor
0 Kudos

Hi,

the major advantage of PROVIDE - ENDPROVIDE ist it's greatest disadvantage as well.

The fields fencing the validity (usually BEGDA and ENDDA) for each involved table, will be set according to each resulting split-interval.

If this is, what you're trying to avoid, you'll have to do a nested loop.

Assuming you have two internal table A and B, both having BEGDA and ENDDA.

You then could do something like:

LOOP AT A into wa_a.

     LOOP AT B into wa_b where begda LE wa_a-endda and endda ge wa_a-begda.

*       Do something clever here

     ENDLOOP.

ENDLOOP.

Note, how the intervals are built by comparing the fields overcross, thus giving you in the inner loop, all entries that are at least one day valid within the interval set by the outer loop.

Hope it helps.

Best regards - Jörg

3 REPLIES 3

Former Member
0 Kudos

what do you mean 'split' logic - I assume you are meaning delimitation.

reading delimited records in HR, by and large, is all about the start and end dates... datbi and endda and the key date you want to compare against.

so to some extent that will govern any method you use whether it be a open sql syntax against the base table or infotype read function or internal table processing...


former_member184569
Active Contributor
0 Kudos

You could use loop endloop with suitable conditions.

jrg_wulf
Active Contributor
0 Kudos

Hi,

the major advantage of PROVIDE - ENDPROVIDE ist it's greatest disadvantage as well.

The fields fencing the validity (usually BEGDA and ENDDA) for each involved table, will be set according to each resulting split-interval.

If this is, what you're trying to avoid, you'll have to do a nested loop.

Assuming you have two internal table A and B, both having BEGDA and ENDDA.

You then could do something like:

LOOP AT A into wa_a.

     LOOP AT B into wa_b where begda LE wa_a-endda and endda ge wa_a-begda.

*       Do something clever here

     ENDLOOP.

ENDLOOP.

Note, how the intervals are built by comparing the fields overcross, thus giving you in the inner loop, all entries that are at least one day valid within the interval set by the outer loop.

Hope it helps.

Best regards - Jörg