Skip to Content
0
May 05, 2009 at 11:33 AM

How to write code to make summary

59 Views

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.