Skip to Content
author's profile photo Former Member
Former Member

general

Hey Folks,

I have a req.. where i have to sum up the records and display at the footer in a classical report for example

matnr price

a 1

b 2

c 3

d 4

i have to get

matnr price

a 1

b 2

c 3

d 4

-


10

could somebody write me a sample codew for this as it is urgent and i m stuck with it.

Regards

Rock

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:51 PM

    LOOP it INTO wa.

    WRITE <field1>,<field2>.

    AT LAST.

    WRITE: 'Sum:', 20 sum(t2),

    ENDAT.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:42 PM

    Use the control Break AT LAST with in the ITAB loop and then use the SUM command. It sums all numaric fields only. But ur MATNR is of CHAR type. So, u have to convert CHAR to NUM type.

    then, after printing the ITAB, u can use uline and then print the SUM

    Narendra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:43 PM

    IF YOU ARE USING INTERNAL TABLE THEN

    SUM = 0.

    START-OF-SELECTION.

    LOOP AT INTERNAL_TABLE INTO WA.

    SUM = SUM + MATNR_PRICE.

    ENDLOOP.

    WRITE: ULINE.

    WRITE: SUM.

    REWARD POINTS IF HELPFUL,

    KUSHAGRA

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:43 PM

    Use the control Break AT LAST with in the ITAB loop and then use the SUM command. It sums all numaric fields only. But ur MATNR is of CHAR type. So, u have to convert CHAR to NUM type.

    then, after printing the ITAB, u can use uline and then print the SUM

    Narendra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:44 PM

    Use the control Break AT LAST with in the ITAB loop and then use the SUM command. It sums all numaric fields only. But ur MATNR is of CHAR type. So, u have to convert CHAR to NUM type.

    then, after printing the ITAB, u can use uline and then print the SUM

    Narendra

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.