cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Logic for Splitting one record with Validfrom and ValidTo into n numbers based on month

praveen_kumar334
Participant
0 Kudos

Hi Team,

Can someone please help me in getting the logic to split one record with ValidFrom and ValidTo into n number of records based on calmonth. Below is the one example 

Source :

ProductValidFromValidToAmount
P10012024010120240430100

Target : 

PRODUCTCALMONTHAmount
P1001202401100
P1001202402100
P1001202403100
P1001202404100

 

Regards,

Praveen.

Sandra_Rossi
Active Contributor
0 Kudos
Isn't it a loop from 01 to 04? It seems trivial. What is your issue? What did you try? Do you want us to code it for you?

Accepted Solutions (0)

Answers (1)

Answers (1)

GRI
Explorer
0 Kudos

You can put ValidFrom and ValidTo in a SPMON typped variables (spmon_from,spmon_to).

spmon_from = ValidFrom(6).

Increment of 1 for spmon_from until you reach spmon_to value.