Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write code to make summary

swarup_modak
Explorer
0 Kudos
DATA : BEGIN OF it_afru1 OCCURS 0,
       werks LIKE afru-werks,         "Plant"
       budat LIKE afru-budat,         "Posting date"
       bpm LIKE afru-bpm,             "Bottles per Minute" "Machine Speed"
       avgwt LIKE afru-avgwt,         "Average weight of bottles(gms)" "Average Actual Weight"
       shifttime LIKE afru-shifttime, "Shift Time(Minutes)"
       runtime LIKE afru-runtime,     "Run Time(MIN)"
       downtime LIKE afru-downtime,   "Down time(Min)"
       lmnga LIKE afru-lmnga,         "Yield to Be Confirmed" "Draw"
       xmnga LIKE afru-xmnga,         "Scrap to Be Confirmed" "Draining"
       grund LIKE afru-grund,         "Reason for Variance" "Shift"
       aufnr LIKE afru-aufnr,         "Order Number" "Production Order Number"
       arbid LIKE afru-arbid,         "Object ID" "Equivalent to crhd-objid"
       wablnr LIKE afru-wablnr,       "Number of Material Document" "Production Document Number"
       rmzhl LIKE afru-rmzhl,         "Confirmation counter"
       vornr LIKE afru-vornr,         "Operation/Activity Number - Production Planning"
       stzhl LIKE afru-stzhl,         "Operation/Activity Number - Production Planning"
       stokz LIKE afru-stokz,         "Indicator: Document Has Been Reversed"
       arbpl LIKE crhd-arbpl,         "Work center" "IS Machine Number"
       matnr LIKE qals-matnr,         "Material Number"
       ktextmat LIKE qals-ktextmat,   "Short Text for Inspection Object"
       END OF it_afru1.

In the table there will be one record for each datemachineshift.

For 13 no machines there will be 3 records for each shift.

For a day there will be total 39 records.

For 5 days there will be tatal 195 records.

I need to append data into the following table.

DATA : BEGIN OF ittank_sum1 OCCURS 0,
       arbpl LIKE crhd-arbpl,         "IS Machine Number"
       budat LIKE afru-budat,         "First Date"
       budat LIKE afru-budat,         "Last Date"
       bpm LIKE afru-bpm,             "Minimum Speed"
       bpm LIKE afru-bpm,             "Maximum Speed"
       avgwt LIKE afru-avgwt,         "Minimum Weight"
       avgwt LIKE afru-avgwt,         "Maximum Weight"
       lmnga LIKE afru-lmnga,         "Draw" "To be summed up"
       END OF ittank_sum1.

In the aforesaid table there will be a record for each machine.

Please help, since I am new in ABAP.

This will enable me to write code for the following :

Tank+Machine

TankMachineShift

Tank+Itemcode

etc.

Thanks in advance.

4 REPLIES 4

former_member1259992
Participant
0 Kudos

Hi There,

To summarise your data, I'd suggest you take a look at the help for the COLLECT statement.

If you use COLLECT instead of APPEND to build your summary table, the quantitative fields will be totalled automatically.

The thing you must watch out for is if there are any numeric fields which you don't want totalled - if so declare them as character fields in your summary table.

The documentation should explain it.

Hope this helps.

Regards

Robin

swarup_modak
Explorer
0 Kudos

Hi Robin Wix,

I expect some code since I am new in ABAP. Hope you understand.

For your information I could explain you more.

Initially there is no record in ittank_sum1. After entering data into it the output should be like following:

arbpl budat1 budat2 bpm1 bpm2 avgwt1 avgwt2 lmnga

MC1 01/04/2009 05/04/2009 380 395 140.95 141.32 600.65

MC2 01/04/2009 05/04/2009 286 300 120.34 120.12 553.85

MC3 01/04/2009 03/04/2009 75 76 115.96 125.16 297.87

and like this.

Hope this help.

Thank you for your help.

0 Kudos

>

> I expect some code since I am new in ABAP. Hope you understand.

But this is not a forum to teach ABAP Basics. Hope you understand. Meanwhile, you can type in the collect in the ABAP editor, place the cursor on it and read the online help. You can find some code fragements there.

0 Kudos

Hi, Rainer Hübenthal

At the outset I thank you very much for your reply.

Since childhood we are taught that it is immaterial for the ocean to be bothered if a few drops of water are taken out. Knowledge is sharable.

In my question I did not ask to teach me the whole ABAP.

God bless you.

With best Regards