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

Regarding total year sales

I am getting actual sales for month customer wise from s001-ummenge field.

i want to accumlate the every month sales for year for customer wise.

my year wise sales is not directly coming from the system.

it is coming with following way...

suppose i am getting january 100

february 200

march 300

april 450

like that upto december i will get differnt quantity.

final i want to display total from january to decemeber.

that means 100 + 200 + 300 + 450 + ..... = 950 ..

i want to display my total target per year is 950.

how to write code for above logic.

pls suggest me..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:32 AM

    Hi,

    U have not mentioned how it is printing?

    through itab or any other?

    If it is in itab just use the staments.

    loop at itab.

    at last .....

    sum.

    write:field1 field2 .....

    endat.

    endloop.

    Regards,

    Subbu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 11:35 AM

    hi

    use control break statements like the following

    REPORT zinternaltable.

    TYPES:BEGIN OF itab,

    num TYPE i,

    name(10) TYPE c,

    amt type i,

    END OF itab.

    DATA : wa_itab TYPE itab,

    it_itab TYPE STANDARD TABLE OF itab.

    DATA : v_lines TYPE i.

    wa_itab-num = 1.

    wa_itab-name = 'nag'.

    wa_itab-amt = 1000.

    append wa_itab TO it_itab.

    wa_itab-num = 1.

    wa_itab-name = 'nag'.

    wa_itab-amt = 2000.

    append wa_itab TO it_itab.

    wa_itab-num = 1.

    wa_itab-name = 'nag'.

    wa_itab-amt = 1500.

    append wa_itab TO it_itab.

    wa_itab-num = 2.

    wa_itab-name = 'sri'.

    wa_itab-amt = 500.

    append wa_itab tO it_itab.

    wa_itab-num = 2.

    wa_itab-name = 'sri'.

    wa_itab-amt = 600.

    append wa_itab TO it_itab.

    wa_itab-num = 2.

    wa_itab-name = 'sri'.

    wa_itab-amt = 700.

    append wa_itab TO it_itab.

    wa_itab-num = 3.

    wa_itab-name = 'ganesh'.

    wa_itab-amt = 1200.

    append wa_itab TO it_itab.

    wa_itab-num = 3.

    wa_itab-name = 'ganesh'.

    wa_itab-amt = 1300.

    append wa_itab TO it_itab.

    wa_itab-num = 3.

    wa_itab-name = 'ganesh'.

    wa_itab-amt = 1400.

    append wa_itab TO it_itab.

    wa_itab-num = 4.

    wa_itab-name = 'suresh'.

    wa_itab-amt = 900.

    append wa_itab TO it_itab.

    wa_itab-num = 4.

    wa_itab-name = 'suresh'.

    wa_itab-amt = 300.

    append wa_itab TO it_itab.

    sort it_itab.

    LOOP AT it_itab INTO wa_itab.

    at first.

    write :/ 'details of sales order:'.

    uline.

    endat.

    at new num.

    write :/ 'serial num:', wa_itab-num.

    uline.

    endat.

    WRITE :/ wa_itab-num , wa_itab-name , wa_itab-amt.

    at end of num.

    uline.

    sum.

    write :/ 'total amount:',wa_itab-amt.

    uline.

    endat.

    *

    at last.

    sum.

    uline.

    write:/ 'grand total:',wa_itab-amt.

    endat.

    ENDLOOP.

    describe table it_itab lines v_lines.

    reward for use ful points

    Regards

    Nagesh.Paruchuri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:37 AM

    SELECT SUM( ummenge ) INTO net FROM s001 WHERE periv EQ '2007' AND kunnr EQ p_kunnr.

    You can run this query for different years by changing periv

    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.