cancel
Showing results for 
Search instead for 
Did you mean: 

Start/End Routine to convert 0FISCPER to 0CALQUARTER

0 Kudos

Hello,

I have a DSO that contains 0FISCPER but no references at all to any calendar dates. I am using fiscal variant K0 and have added 0CALQUARTER to the InfoProvider. I now need to write a start/end routine to transform 0FISCPER to 0CALQUARTER. I have never written an ABAP routine outside of the 2 introductory ABAP classes I took several months ago. Can someone give me an example of what the start/end routine code should look like to accomplish this?

Thanks.

Derrick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try this:

This is with the assumption that your fiscal year is same as the calender year.

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

IF <RESULT_FIELDS>-FISCPER(4)+3 = '1' OR '2' OR '3'.

<RESULT_FIELDS>-CALQUARTER = '1'.

ELSEIF <RESULT_FIELDS>-FISCPER(4)+3 = '4' OR '5' OR '6'.

<RESULT_FIELDS>-CALQUARTER = '2'.

ELSEIF <RESULT_FIELDS>-FISCPER(4)+3 = '7' OR '8' OR '9'.

<RESULT_FIELDS>-CALQUARTER = '3'.

ELSEIF <RESULT_FIELDS>-FISCPER(4)+3 = '10' OR '11' OR '12'.

<RESULT_FIELDS>-CALQUARTER = '4'.

ENDIF.

ENDLOOP.

There might be a function module that might calculate this automatically. Anyway, see if this code helps.

Please check the syntax.

Thanks

0 Kudos

Hi,

Your assumption is correct. Our fiscal year is the same as calendar year. I will give the code a try and see what happens. Thanks.

Derrick

Answers (1)

Answers (1)

former_member589105
Participant
0 Kudos

issue solved or not.....i know this is long back one.