0
Mar 01, 2011 at 06:42 AM

Calculate Actual and plan value

35 Views

Hello SDNERS,

I am working in FI Reports in one Reports Requirement is like that if user selects 003/2011; then the report should display Actuals for 001/2011 - 003/2011 and Plan for "004/2011 - 012/2011"

Means lay out should be :-

001/2011 002/2011 003/2011 004/2011 005/2011 006/2011 -

012/2011

Actualcost Actualcost Actcost Plancost Plancost Plancost Plancost

362 367 412 455 456 455 455

For that I have written user exit, It is giving sum for 001,002,003 for actual and 006 to 0012 for plan, but I need above layout Code is as below :-

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.

Data: v_loc(3) type c.

CASE I_VNAM.

*----

• to calculate "Actual cost user input is "FISCPER" Key Date

*----

WHEN 'ZCACTCST'.

IF I_STEP = 2. "after the popup

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'ZUSFISCPER'.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = '001'.

L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW+4(3).

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDLOOP.

ENDIF.

*----

Thanks

Chitra.

• To dervie Plan cost during reporting *****

WHEN 'ZCPLANCST'.

IF I_STEP = 2. "after the popup

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'ZUSFISCPER'.

CLEAR L_S_RANGE.

V_LOC = LOC_VAR_RANGE-LOW+4(3).

L_S_RANGE-LOW = V_LOC + 1.

L_S_RANGE-HIGH = '012'.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDLOOP.

ENDIF.

ENDCASE.

Edited by: Chitrakala Sankar on Mar 1, 2011 7:42 AM