Skip to Content
avatar image
Former Member

adding numbers in report

hi guru,

i developed a report.

IF S_BGPRO = 'X'.

SELECT AUFNR GMNGA FROM

AFRU INTO CORRESPONDING FIELDS OF TABLE IT_AFRU12 WHERE WERKS = 'PD01'

AND BUDAT IN S_BUDAT.

IF NOT IT_AFRU12[] IS INITIAL.

SELECT AUFNR KTEXT PLNBEZ INTO CORRESPONDING FIELDS OF

TABLE IT_CAUFV1 FROM CAUFV

FOR ALL ENTRIES IN IT_AFRU12

WHERE AUFNR = IT_AFRU12-AUFNR.

IF SY-SUBRC <> 0.

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

ENDIF.

ENDIF.

ENDIF.

LOOP AT IT_AFRU12 INTO WA_AFRU12.

LOOP AT IT_CAUFV1 INTO WA_CAUFV1 WHERE AUFNR = WA_AFRU12-AUFNR.

WA_AFRU12-KTEXT = WA_CAUFV1-KTEXT.

WA_AFRU12-PLNBEZ = WA_CAUFV1-PLNBEZ.

MODIFY IT_AFRU12 FROM WA_AFRU12.

ENDLOOP.

ENDLOOP.

IN THE ABOVE COADING :

GMNGA value is in numbers . i want to add all the no.s and

displayed to last in my alv report.how to do this..

please help me.

thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 18, 2008 at 06:40 AM

    Hi,

    Use COLLECT statement.

    loop at itab1.

    gs_itab2-fld1 = itab1-fld1.

    gs_itab2-fld2 = itab1-fld2.

    gs_itab2-fld3 = itab1-fld3.

    collect gs_itab2 into gt_itab2.

    endloop.

    Regards,

    Narendra.

    Reward points if helpful!!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 18, 2008 at 06:51 AM

    In the field catalog set do_sum to 'X' for GAMNG...

    it will display the total quantity at the end...

    Add comment
    10|10000 characters needed characters exceeded