0
Former Member
Mar 22, 2008 at 12:27 PM

# grand total.

13 Views

hi guru,

in my alv report the output of one field is

net value(GMNGA)

22.000

1.000

1.000

5.000

10.000

10.000

1.000

1.000

1.000

1.000

1.000

1.000

1.000

1.000

150.000

6.675

100.000

0.000

7.000

0.000

25.000

40.000

10.000

15.000

1.000

1.000

1.000

4,000.000

9.500

10.000

1.000

1.000

1.000

5.000

3.000

50.000

50.000

0.250

25.000

1.000

1.000

2.000

20.000

0.000

4.000

3.000

250.000

150.000

250.000

17.000

33.000

11.000

30.000

10.000

7.000

10.000

5,368.425 (HERE i want the written test subtotal)

then i have one more value .

then final grand total.

how to do this???

IF P_DISPER = 'X' .

SELECT AUFNR GMNGA

INTO CORRESPONDING FIELDS OF TABLE IT_AFRU1 FROM AFRU

WHERE BUDAT IN S_BUDAT .

IF NOT IT_AFRU1[] IS INITIAL.

SELECT AUFNR KTEXT PLNBEZ INTO CORRESPONDING FIELDS OF

TABLE IT_CAUFV1 FROM CAUFV

FOR ALL ENTRIES IN IT_AFRU1

WHERE AUFNR = IT_AFRU1-AUFNR AND PLNAL EQ '02'.

IF SY-SUBRC <> 0.

MESSAGE E000(ZPP) WITH 'VALUE NOT EXISTING '.

ENDIF.

ENDIF.

LOOP AT IT_CAUFV1 INTO WA_CAUFV1.

WA_AFRU12-AUFNR = WA_CAUFV1-AUFNR.

WA_AFRU12-KTEXT = WA_CAUFV1-KTEXT.

WA_AFRU12-PLNBEZ = WA_CAUFV1-PLNBEZ.

APPEND WA_AFRU12 TO IT_AFRU12.

ENDLOOP.

LOOP AT IT_AFRU12 INTO WA_AFRU12.

LOOP AT IT_AFRU1 INTO WA_AFRU1 WHERE AUFNR = WA_AFRU12-AUFNR.

WA_AFRU12-GMNGA = WA_AFRU1-GMNGA.

MODIFY IT_AFRU12 FROM WA_AFRU12.

ENDLOOP.

ENDLOOP.

DELETE IT_AFRU12 WHERE PLNBEZ = 'OSPP'.

ENDIF.

IF P_DISPER = 'X' .

SELECT AUFNR GMNGA

INTO CORRESPONDING FIELDS OF TABLE IT_AFRU1 FROM AFRU

WHERE BUDAT IN S_BUDAT .

IF NOT IT_AFRU1[] IS INITIAL.

REFRESH IT_CAUFV1.

SELECT AUFNR KTEXT PLNBEZ INTO CORRESPONDING FIELDS OF

TABLE IT_CAUFV1 FROM CAUFV

FOR ALL ENTRIES IN IT_AFRU1

WHERE AUFNR = IT_AFRU1-AUFNR AND PLNAL EQ '01'.

IF SY-SUBRC <> 0.

MESSAGE E000(ZPP) WITH 'VALUE NOT EXISTING '.

ENDIF.

ENDIF.

LOOP AT IT_CAUFV1 INTO WA_CAUFV1 .

WA_AFRU12-AUFNR = WA_CAUFV1-AUFNR.

WA_AFRU12-KTEXT = WA_CAUFV1-KTEXT.

WA_AFRU12-PLNBEZ = WA_CAUFV1-PLNBEZ.

APPEND WA_AFRU12 TO IT_AFRU12.

ENDLOOP.

LOOP AT IT_AFRU12 INTO WA_AFRU12.

LOOP AT IT_AFRU1 INTO WA_AFRU1 WHERE AUFNR = WA_AFRU12-AUFNR.

WA_AFRU12-GMNGA = WA_AFRU1-GMNGA.

MODIFY IT_AFRU12 FROM WA_AFRU12.

AT END OF

ENDAT.

ENDLOOP.

ENDLOOP.

DELETE IT_AFRU1 WHERE PLNBEZ = 'OSPP'.

ENDIF.

help me?????