Fuel Consumption Report Modification - 21

Hi Experts
I am working on fuel consumption modification. can anyone help me how to get max and min value for this program
I am getting one row correct with equipment no is enter but when I enter the range of equipment no it is taking long time and the result is repeating for each row
please correct my report
Thnaks in advanced
Piroz
REPORT Z_ESLP_FUEL2 LINE-SIZE  250 LINE-COUNT 75
         NO STANDARD PAGE HEADING.
TABLES : equi,
         equz,
         imptt,
         imrg,
         eqkt,
         iloa.
TYPES: BEGIN OF ty_equi," occurs 0,
       equnr type equi-equnr,
       END OF ty_equi.
TYPES: BEGIN of ty_eqkt," occurs 0,
       equnr type eqkt-equnr,
       eqktx type eqkt-eqktx,
       END OF ty_eqkt.
TYPES: BEGIN of ty_iloa ,"occurs 0,
       iloan type iloa-iloan,
       eqfnr type iloa-eqfnr,
       END OF ty_iloa.
TYPES: BEGIN of ty_imptt," occurs 0,
       mpobj type imptt-mpobj,
       END of ty_imptt.
TYPES: BEGIN of ty_imrg ,"occurs 0,
       idate type imrg-idate,
       recdv type imrg-recdv,
       recdu type imrg-recdu,
       END of ty_imrg.
TYPES: BEGIN OF ty_data  ,
       equnr      type equnr,         " Euipment no
       eqktx      type eqkt-eqktx,    " Equipment Text
       eqfnr       type iloa-eqfnr,     " Equipment Sort field
       idate      type imrg-idate,    " Measuring Date
       recdu      type imrg-recdu,    " Unit of measuring ='KM','L','H'
       recdv      type imrg-recdv,    " Counter reading data
       END OF ty_data.
TYPES: BEGIN OF ty_final,
       equnr           type equnr,            "  Equipment no
       eqktx           type eqkt-eqktx,       "  Equipment Text
       eqfnr           type iloa-eqfnr,       "  Equipment Sort field
       min_date        type imrg-idate,       "  Min Date
       min_km          type imrg-recdv,       "  Max Km
       max_km          type imrg-recdv,       "  Min km
       t_max_min_km    type i,                "  Total min_km-max_km
       max_date        type imrg-idate,       "  Max Date
       min_hr          type imrg-recdv,       "  Max hr
       max_hr          type imrg-recdv,       "  Min hr
       t_max_min_hr    type i,                "  Total min_hr-max_hr
       min_lit         type imrg-recdv,       "  Max lit
       max_lit         type imrg-recdv,       "  Min lit
       t_max_min_lit    type i,                "  Total min_lit-max_lit
       fuel_con        type p decimals 2,     "  Total_hrs / t_max_min_hr
       km_l            type p decimals 2,     "  km / L
       lit_per_hr      type i           ,     "  fuel comsumed / t_max_min_hr
       END OF ty_final.
DATA: i_equi TYPE TABLE OF ty_equi,   "internal table
      wa_equi TYPE ty_equi, " work area
      i_eqkt TYPE TABLE OF ty_eqkt,   "internal table
      wa_eqkt TYPE ty_eqkt, " work area
      i_iloa TYPE TABLE of ty_iloa,   "internal table
      wa_iloa TYPE ty_iloa, " work area
      i_imptt TYPE TABLE of ty_imptt, "internal table
      wa_imptt TYPE ty_imptt,
      i_imrg  TYPE TABLE of ty_imrg,  "internal table
      wa_imrg TYPE ty_imrg,
      i_data TYPE TABLE OF ty_data,   "internal table
      wa_data TYPE ty_data, " work area
      i_final TYPE TABLE OF ty_final, " internal table
      wa_final TYPE ty_final. " work area
DATA :  max_date type date ,
         min_date type date,
         max_km TYPE p DECIMALS 2,
         min_km TYPE p DECIMALS 2,
         max_hr TYPE p DECIMALS 2,
         min_hr TYPE p DECIMALS 2,
         max_lit TYPE p DECIMALS 2,
         min_lit TYPE p DECIMALS 2,
         t_max_min_km  TYPE p DECIMALS 2,
         t_max_min_hr TYPE p DECIMALS 2,
         t_max_min_lit TYPE p DECIMALS 2.
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_equnr FOR equi-equnr, "no-extension no intervals,
                p_idate FOR imrg-idate.  "NO-EXTENSION NO INTERVALS OBLIGATORY,
               " p_recdu FOR imrg-recdu." NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk.
TOP-OF-PAGE.
  FORMAT INTENSIFIED ON.
  WRITE:/1(40) ' INVESTMENT LIMITED  '.
  WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED   ,
          2 'Page', sy-pagno.
  FORMAT INTENSIFIED OFF.
  WRITE:/50(40) '----
' CENTERED .
  FORMAT INTENSIFIED ON.
  WRITE:/2 sy-datum COLOR 3, sy-uzeit .
  "WRITE:/1 S903-SPMON ."p_yearf.
  ULINE.
  "CENTERED.
  write: /2 'Date From     :'.
  write: /2 'Equipment No  :'.
  write: /2 'Unit          :'.
  SKIP.
  ULINE.
  WRITE:/1 sy-vline,
    2   'EQUIP NO',              10 sy-vline,
    11  'NAME',                  40 sy-vline,
    41  'SORT',                  60 sy-vline,
    61  'MIN DATE',              74 sy-vline,
    75  'MIN KM',                87 sy-vline,
    88  'MAX DATE',                100 sy-vline,
    101  'MAX KM' ,              113 sy-vline,
    114 'TOTAL MAX-MIN',                126 sy-vline,
    127  'MIN HR',               139 sy-vline,
    140 'MAX HR',                152 sy-vline,
    153 'TOTAL MAX-MIN' ,               167 sy-vline,
    168 'MIN LIT',               180 sy-vline,
    181 'MAX LIT',               193 sy-vline,
    194 'TOTAL LIT',             206 sy-vline,
    207 'FUEL CON',              219 sy-vline,
    220 'KM L',                  232 sy-vline,
    233 'LIT PER KM',            246 sy-vline.
  FORMAT COLOR 3 ON.
  ULINE.
END-OF-PAGE.
START-OF-SELECTION.
select a~equnr d~eqktx f~eqfnr e~idate e~recdu e~recdv
into corresponding fields of table i_data
from equi AS a
inner join equz as b
on a~equnr = b~equnr
inner join iloa as f
on b~iloan = f~iloan
inner join imptt as c
on a~objnr = c~mpobj
inner join eqkt as d
on a~equnr = d~equnr
inner join imrg as e
on e~point = c~point
where a~equnr in p_equnr
and
e~idate in p_idate and
e~recdu in ('KM','L','H').
"e~recdu in p_recdu.
equi
*select equnr from equi into table i_equi
*for all entries in I_DATA
**where objnr = i_equnr-mpobj.
*where equnr = i_data-equnr.
*endselect.
eqkt
*select equnr eqktx into table I_eqkt
*from eqkt
*FOR ALL ENTRIES IN I_DATA
*where equnr = i_data-Equnr.
*endselect.
iloa
*select eqfnr into table I_iloa
*from equz
*FOR ALL ENTRIES IN I_DATA
*on equziloan = iloailoan
*where iloan = i_data-iloan .
*endselect.
imrg
*select idate recdv recdu into table I_imrg
*from imrg
*FOR ALL ENTRIES IN I_DATA
*where imrg~objnr = i_date-mpobj.
*endselect.
loop  at i_data into wa_data.
CLEAR: wa_final.
  READ TABLE i_final into wa_final
           with key equnr = wa_data-equnr.
    if sy-subrc EQ 0.
     PERFORM prepare_get_equi.
     PERFORM prepare_get_eqkt.
     PERFORM prepare_get_iloa.
     PERFORM prepare_get_imptt.
     PERFORM prepare_get_imrg.
      PERFORM prepare_final_rec USING'M'. " Modify Existing Record
      ElSE.
      PERFORM prepare_final_rec USING'A'. " Append New Record.
    ENDIF.
    ENDLOOP.
    LOOP AT i_final into wa_final.
      SORT i_final by equnr  descending.
    at new equnr.
    read table i_final into wa_final index sy-tabix.
WRITE:/1 sy-vline,
2  wa_final-equnr                                                 , 10 sy-vline,
11 wa_final-eqktx                                                 , 40 sy-vline,
41 wa_final-eqfnr                                                 , 60 sy-vline,
61 wa_final-min_date                                              , 74 sy-vline,
75 wa_final-min_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED           , 87 sy-vline,
88 wa_final-max_date EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED         , 100 sy-vline,
101 wa_final-max_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED          , 113 sy-vline,
114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED    , 126 sy-vline COLOR 2,
127 wa_final-min_hr EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED          , 139 sy-vline,
140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline,
168 wa_final-min_lit EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED         , 180 sy-vline,
181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline,
194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2.
*168 wa_final-min_lit EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED         , 180 sy-vline,
*194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2,
*207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
*220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
*233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
uline.
uline .
endloop.
FORM prepare_final_rec  USING    p_mode TYPE char1.
select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
into  corresponding fields of (wa_final-max_date,wa_final-min_date, wa_final-max_km , wa_final-min_km)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate and
e~recdu =  'KM' .
"group by aequnr deqktx feqfnr eidate erecdu erecdv.
"endselect.
select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
into corresponding fields of (wa_final-max_date, wa_final-min_date, wa_final-max_hr, wa_final-min_hr)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate and
e~recdu =  'H'.
"group by aequnr deqktx feqfnr eidate erecdu erecdv.
"endselect.
select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv ) SUM( e~recdv )
into (wa_final-max_date,wa_final-min_date, wa_final-max_lit, wa_final-min_lit ,  wa_final-t_max_min_lit )
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate and
e~recdu =  'L' .
"group by aequnr deqktx feqfnr eidate erecdu erecdv.
"endselect.
         wa_final-t_max_min_km   = ( wa_final-max_km - wa_final-min_km ).
         wa_final-t_max_min_hr  =  ( wa_final-max_hr - wa_final-min_hr ).
         "wa_final-t_max_min_lit   = ( wa_final-max_lit - wa_final-min_lit ).
        wa_final-fuel_con =
        fuel_con        type p decimals 2,     "  Total_hrs / t_max_min_hr
        km_l            type p decimals 2,     "  km / L
        lit_per_hr      type i           ,     "  fuel comsumed / t_max_min_hr
  IF p_mode = 'A'.
    wa_final-equnr = wa_data-equnr.
    wa_final-eqktx = wa_data-eqktx.
    wa_final-eqfnr = wa_data-eqfnr.
    APPEND wa_final TO i_final.
  ELSE.
    MODIFY i_final FROM wa_final
      TRANSPORTING
          max_date
          min_date
          max_km
          min_km
          max_hr
          min_hr
          max_lit
          min_lit
          t_max_min_km
          t_max_min_hr
          where equnr = wa_data-equnr.
  ENDIF.
"endselect.
ENDFORM.                    " PREPARE_FINAL_REC

Hi,
  I don't think so that there is such report which will give you operation wise consumption but you can make that fuel consumption as a activity type in ur standard value key and make some std value to put it in the routing, then if you go for operation wise confirmation then in that screen you will be able to put the consumption details in it.
you can take a report of that also in COOIS.
order wise consumption you can get from order report itself
reward poits if you find it useful.

Similar Messages

  • Fuel Consumption Report Modification - 2

    Hi Experts
    I am working on fuel consumption modification. can anyone help me how to get max and min value for this program
    I am getting one row correct with equipment no is enter but when I enter the range of equipment no it is taking long time and the result is repeating for each row
    please correct my report
    Thnaks in advanced
    Piroz
    REPORT Z_FUEL2 LINE-SIZE  232 LINE-COUNT 75
             NO STANDARD PAGE HEADING.
    TABLES : equi,
             equz,
             imptt,
             imrg,
             eqkt,
             iloa.
    TYPES: BEGIN OF ty_equi," occurs 0,
           equnr type equi-equnr,
           END OF ty_equi.
    TYPES: BEGIN of ty_eqkt," occurs 0,
           equnr type eqkt-equnr,
           eqktx type eqkt-eqktx,
           END OF ty_eqkt.
    TYPES: BEGIN of ty_iloa ,"occurs 0,
           iloan type iloa-iloan,
           eqfnr type iloa-eqfnr,
           END OF ty_iloa.
    TYPES: BEGIN of ty_imptt," occurs 0,
           mpobj type imptt-mpobj,
           END of ty_imptt.
    TYPES: BEGIN of ty_imrg ,"occurs 0,
           idate type imrg-idate,
           recdv type imrg-recdv,
           recdu type imrg-recdu,
           END of ty_imrg.
    TYPES: BEGIN OF ty_data  ,
           equnr      type equnr,         " Euipment no
           eqktx      type eqkt-eqktx,    " Equipment Text
           eqfnr       type iloa-eqfnr,     " Equipment Sort field
           idate      type imrg-idate,    " Measuring Date
           recdu      type imrg-recdu,    " Unit of measuring ='KM','L','H'
           recdv      type imrg-recdv,    " Counter reading data
           END OF ty_data.
    TYPES: BEGIN OF ty_final,
           equnr           type equnr,            "  Equipment no
           eqktx           type eqkt-eqktx,       "  Equipment Text
           eqfnr           type iloa-eqfnr,       "  Equipment Sort field
           min_date        type imrg-idate,       "  Min Date
           min_km          type imrg-recdv,       "  Max Km
           max_date        type imrg-idate,       "  Max Date
           max_km          type imrg-recdv,       "  Min km
           t_max_min_km    type i,                "  Total min_km-max_km
           min_hr          type imrg-recdv,       "  Max hr
           max_hr          type imrg-recdv,       "  Min hr
           t_max_min_hr    type i,                "  Total min_hr-max_hr
           min_lit         type imrg-recdv,       "  Max lit
           max_lit         type imrg-recdv,       "  Min lit
           t_max_min_lit    type i,                "  Total min_lit-max_lit
           T_fuel_con        type p decimals 2,     "  Total_hrs / t_max_min_hr
           T_km_l            type p decimals 2,     "  km / L
           lit_per_hr      type i           ,     "  fuel comsumed / t_max_min_hr
           END OF ty_final.
    DATA: i_equi TYPE TABLE OF ty_equi,   "internal table
          wa_equi TYPE ty_equi, " work area
          i_eqkt TYPE TABLE OF ty_eqkt,   "internal table
          wa_eqkt TYPE ty_eqkt, " work area
          i_iloa TYPE TABLE of ty_iloa,   "internal table
          wa_iloa TYPE ty_iloa, " work area
          i_imptt TYPE TABLE of ty_imptt, "internal table
          wa_imptt TYPE ty_imptt,
          i_imrg  TYPE TABLE of ty_imrg,  "internal table
          wa_imrg TYPE ty_imrg,
          i_data TYPE TABLE OF ty_data,   "internal table
          wa_data TYPE ty_data, " work area
          i_final TYPE TABLE OF ty_final, " internal table
          wa_final TYPE ty_final. " work area
    DATA :  max_date type date ,
             min_date type date,
             max_km TYPE p DECIMALS 2,
             min_km TYPE p DECIMALS 2,
             max_hr TYPE p DECIMALS 2,
             min_hr TYPE p DECIMALS 2,
             max_lit TYPE p DECIMALS 2,
             min_lit TYPE p DECIMALS 2,
             t_max_min_km  TYPE p DECIMALS 2,
             t_max_min_hr TYPE p DECIMALS 2,
             t_max_min_lit TYPE p DECIMALS 2.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: p_equnr FOR equi-equnr, "no-extension no intervals,
                    p_idate FOR imrg-idate.  "NO-EXTENSION NO INTERVALS OBLIGATORY,
                   " p_recdu FOR imrg-recdu." NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    TOP-OF-PAGE.
      FORMAT INTENSIFIED ON.
      WRITE:/1(40) ' INVESTMENT LIMITED  '.
      WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED   ,
              2 'Page', sy-pagno.
      FORMAT INTENSIFIED OFF.
      WRITE:/50(40) '----
    ' CENTERED .
      FORMAT INTENSIFIED ON.
      WRITE:/2 sy-datum COLOR 3, sy-uzeit .
      "WRITE:/1 S903-SPMON ."p_yearf.
      ULINE.
      "CENTERED.
      write: /2 'Date From     :'.
      write: /2 'Equipment No  :'.
      write: /2 'Unit          :'.
      SKIP.
      ULINE.
      WRITE:/1 sy-vline,
        2   'EQUIP NO',              10 sy-vline,
        11  'NAME',                  40 sy-vline,
        41  'SORT',                  60 sy-vline,
        61  'MIN DATE',              74 sy-vline,
        75  'MIN KM',                87 sy-vline,
        88  'MAX DATE',              100 sy-vline,
        101 'MAX KM' ,               113 sy-vline,
        114 'TOTAL KM',              126 sy-vline COLOR 2,
        127 'MIN HR',                139 sy-vline,
        140 'MAX HR',                152 sy-vline,
        153 'TOTAL HR' ,             167 sy-vline COLOR 2,
        168 'MIN LIT',               180 sy-vline,
        181 'MAX LIT',               193 sy-vline,
        194 'FUEL CON',              206 sy-vline  COLOR 2,
        207 'KM L',                  219 sy-vline,
        220 'LIT PER HR',            232 sy-vline.
      FORMAT COLOR 3 ON.
      ULINE.
    END-OF-PAGE.
    START-OF-SELECTION.
    select a~equnr d~eqktx f~eqfnr e~idate e~recdu e~recdv
    into corresponding fields of table i_data
    from equi AS a
    inner join equz as b
    on a~equnr = b~equnr
    inner join iloa as f
    on b~iloan = f~iloan
    inner join imptt as c
    on a~objnr = c~mpobj
    inner join eqkt as d
    on a~equnr = d~equnr
    inner join imrg as e
    on e~point = c~point
    where a~equnr in p_equnr
    and
    e~idate in p_idate and
    e~recdu in ('KM','L','H').
    "e~recdu in p_recdu.
    equi
    *select equnr from equi into table i_equi
    *for all entries in I_DATA
    **where objnr = i_equnr-mpobj.
    *where equnr = i_data-equnr.
    *endselect.
    eqkt
    *select equnr eqktx into table I_eqkt
    *from eqkt
    *FOR ALL ENTRIES IN I_DATA
    *where equnr = i_data-Equnr.
    *endselect.
    iloa
    *select eqfnr into table I_iloa
    *from equz
    *FOR ALL ENTRIES IN I_DATA
    *on equziloan = iloailoan
    *where iloan = i_data-iloan .
    *endselect.
    imrg
    *select idate recdv recdu into table I_imrg
    *from imrg
    *FOR ALL ENTRIES IN I_DATA
    *where imrg~objnr = i_date-mpobj.
    *endselect.
    loop  at i_data into wa_data.
    CLEAR: wa_final.
      READ TABLE i_final into wa_final
               with key equnr = wa_data-equnr.
        if sy-subrc EQ 0.
         PERFORM prepare_get_equi.
         PERFORM prepare_get_eqkt.
         PERFORM prepare_get_iloa.
         PERFORM prepare_get_imptt.
         PERFORM prepare_get_imrg.
          PERFORM prepare_final_rec USING'M'. " Modify Existing Record
          ElSE.
          PERFORM prepare_final_rec USING'A'. " Append New Record.
        ENDIF.
        ENDLOOP.
        LOOP AT i_final into wa_final.
         SORT i_final by equnr  descending.
          at new equnr.
            read table i_final into wa_final index sy-tabix.
                WRITE:/1 sy-vline,
    2  wa_final-equnr                                                 , 10 sy-vline,
    11 wa_final-eqktx                                                 , 40 sy-vline,
    41 wa_final-eqfnr                                                 , 60 sy-vline,
    61 wa_final-min_date                                              , 74 sy-vline,
    75 wa_final-min_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED           , 87 sy-vline,
    88 wa_final-max_date EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED         , 100 sy-vline,
    101 wa_final-max_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED          , 113 sy-vline,
    114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 color 3 LEFT-JUSTIFIED    , 126 sy-vline COLOR 2,
    127 wa_final-min_hr EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED          , 139 sy-vline,
    140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline,
    153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2 color 3 LEFT-JUSTIFIED   , 167 sy-vline COLOR 2,
    168 wa_final-min_lit EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED         , 180 sy-vline,
    181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline,
    *194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 color 3 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2,
    194 wa_final-T_fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 206 sy-vline,
    207 wa_final-t_km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 219 sy-vline,
    220 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 232 sy-vline.
    *168 wa_final-min_lit EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED         , 180 sy-vline,
    *194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2,
    *207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
    *220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
    *233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
    *207 wa_final-T_fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
    *220 wa_final-t_km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
    *233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
    uline.
        "endat.
    *at end of equnr.
           read table i_final into wa_final index sy-tabix.
              WRITE:/1 sy-vline,
    *2  wa_final-equnr                                                 , 10 sy-vline,
    *11 wa_final-eqktx                                                 , 40 sy-vline,
    *41 wa_final-eqfnr                                                 , 60 sy-vline,
    *88 wa_final-max_date EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED         , 100 sy-vline,
    *101 wa_final-max_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED          , 113 sy-vline,
    *140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline.
    **181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline.
    *114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2   LEFT-JUSTIFIED    , 126 sy-vline COLOR 2,
    *140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline.
    *153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED   , 167 sy-vline COLOR 2,
    *181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline,
    *194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2,
    *207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
    *220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
    *233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
    uline .
       WRITE:/1 sy-vline,
    *2  wa_final-equnr                                                 , 10 sy-vline,
    *11 wa_final-eqktx                                                 , 40 sy-vline,
    *41 wa_final-eqfnr                                                 , 60 sy-vline,
    *61 wa_final-min_date                                              , 74 sy-vline,
    *75 wa_final-min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED           , 87 sy-vline,
    *88 wa_final-max_date EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 100 sy-vline,
    *101 wa_final-max_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 113 sy-vline,
    *114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED    , 126 sy-vline COLOR 2,
    *127 wa_final-min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 139 sy-vline,
    *140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline,
    *153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED   , 167 sy-vline COLOR 2,
    *168 wa_final-min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 180 sy-vline,
    *181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline,
    *194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline COLOR 2,
    *207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
    *220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
    *233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
    *ULINE.
    endloop.
    FORM prepare_final_rec  USING    p_mode TYPE char1.
    KM
    select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
    into  corresponding fields of (wa_final-max_date,wa_final-min_date, wa_final-max_km , wa_final-min_km)
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate and
    e~recdu =  'KM' .
    "group by aequnr deqktx feqfnr eidate erecdu erecdv.
    "endselect.
    HOUR
    select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
    into corresponding fields of (wa_final-max_date, wa_final-min_date, wa_final-max_hr, wa_final-min_hr)
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate and
    e~recdu =  'H'.
    "group by aequnr deqktx feqfnr eidate erecdu erecdv.
    "endselect.
    LIT
    select MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv ) SUM( e~recdv )
    into (wa_final-max_date,wa_final-min_date, wa_final-max_lit, wa_final-min_lit ,  wa_final-t_max_min_lit )
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate and
    e~recdu =  'L' .
    "group by aequnr deqktx feqfnr eidate erecdu erecdv.
    "endselect.
            wa_final-max_date = wa_final-max_date + wa_data-idate .
            wa_final-min_date  = wa_final-min_date + wa_data-idate .
            wa_final-max_km  = wa_final-max_km + wa_data-recdv.
            wa_final-min_km  = wa_final-min_km + wa_data-recdv.
            wa_final-max_hR  = wa_final-max_hr + wa_data-recdv.
            wa_final-min_hR  = wa_final-min_hr + wa_data-recdv.
            wa_final-max_lit = wa_final-max_lit + wa_data-recdv.
             wa_final-t_max_min_km   = ( wa_final-max_km - wa_final-min_km ).
             wa_final-t_max_min_hr  =  ( wa_final-max_hr - wa_final-min_hr ).
             "wa_final-t_max_min_lit   = ( wa_final-max_lit - wa_final-min_lit ).
              wa_final-t_fuel_con = wa_final-t_max_min_lit.
              wa_final-t_km_l = wa_final-t_max_min_km / wa_final-t_max_min_lit.
              wa_final-lit_per_hr  = wa_final-t_max_min_lit / wa_final-t_max_min_hr .    "  fuel comsumed / t_max_min_hr
      IF p_mode = 'A'.
        wa_final-equnr = wa_data-equnr.
        wa_final-eqktx = wa_data-eqktx.
        wa_final-eqfnr = wa_data-eqfnr.
        APPEND wa_final TO i_final.
      ELSE.
        MODIFY i_final FROM wa_final
          TRANSPORTING
              max_date
              min_date
              max_km
              min_km
              max_hr
              min_hr
              max_lit
              min_lit
              t_max_min_km
              t_max_min_hr
              where equnr = wa_data-equnr.
      ENDIF.
    "endselect.
    ENDFORM.                    " PREPARE_FINAL_REC

    Hi Ankit,
    If your quantity depends on your material movement type, then you can create a condition in Calculated Keyfig / Formula.
    That means as per your situation if the material movement type is 101 then quantity is incoming(+) and if the material movement type is 120 then outgoing(-).This can be done if the material movement type is fixed.
    Correct the logic if it is not right.
    Rgs,
    I.R.K

  • Operation wise fuel consumption details.

    Dears,
    How can we get the operation wise raw material consumption details. For example in an order I am having 5 operations. Each operation requires some fuel consumption. Fuel is my BOM component. I need to issue the quantity of fuel for each operation. Again in the report also... I need the details of fuel consumption operation wise. How can we divide the total quantity of fuel to different routing operations. one way is I can maintain different line items in BOM. Is there any other way of doing it? How can get it in report?
    Regards,
    Surya.

    Hi,
      I don't think so that there is such report which will give you operation wise consumption but you can make that fuel consumption as a activity type in ur standard value key and make some std value to put it in the routing, then if you go for operation wise confirmation then in that screen you will be able to put the consumption details in it.
    you can take a report of that also in COOIS.
    order wise consumption you can get from order report itself
    reward poits if you find it useful.

  • Fleet Managment - Fuel consumption & Mileage in MCIZ

    Hi,
    In MCIZ, the output shows only the following
    1. Fuel Volume (Fuel consumption )
    2. Miles /km   (Distance Travelled)
    3. Consump Dist (Fuel consumption per 100 km)
    4.Costs per Route
    5.Total actual costs
    I  want the following also.
    Mileage
    Miles per Litre
    Km per Litre
    Fuel Consumption
    Litres/ km
    Litres / mile
    Litres per 100 mile
    Can i add these in the standard report MCIZ ? If yes, how it can be done?
    Thanks

    Alagesan,
      Some of them are already there.
    MCI1_GET_FIGURE_IAFUELDIST    
    MCI1_GET_FIGURE_IAFUELDIST_US 
    MCI1_GET_FIGURE_IAFUELTIME    
    MCI1_GET_FIGURE_IAFUELTIME_US 
    MCI1_GET_FIGURE_IAKOSIST      
    MCI1_GET_FIGURE_IAMASSDIST    
    MCI1_GET_FIGURE_IAMASSDIST_US 
    MCI1_GET_FIGURE_IAMASSTIME    
    MCI1_GET_FIGURE_IAMASSTIME_US 
    MCI1_GET_FIGURE_IATTLCDIST    
    MCI1_GET_FIGURE_IATTLCDIST_US 
    MCI1_GET_FIGURE_IATTLCOPTM    
    You just need to a ssign them.
    For others ,You can copy the existing ones and just change as appropriate.
    Regards
    Narasimhan

  • Fuel Comsumption report

    Hi Gurus
    Did anyone developed a report which will show the fuel consumption
    for starting and ending date range which will be taken from IK03 and IK17 t code.
    I want to developed a query linking with EUQIEQUZEQKTILOAIMRG all the links are correct but I am unable to link EQUI+EQUZ with IMRG from which all my vehical readings are there
    Equipno,function location,sort field, start reading, km,hours,end reading and rest calculation.
    The more important is I have to select the Date range
    ie 01.03.2008 to 31.03.2008  and I have to calculate starting meter reading minus end of meter reading to get the total km used for that equipment (vehical no).
    Regards
    Piroz

    Dear Rao,
    Check these reports,
    MCRJ                 Prod. Cost Analysis: Repetitive Mfg
    MCRK                 Prod. Cost Analysis: Repetitive Mfg
    MCRO                 Matl consumptn anal.: repetitive mfg
    MCRP                 Matl consumptn anal.: repetitive mfg
    Regards
    Mangalraj.S

  • Excess Material Consumption Report - For a Particular Period

    Hi,
    For a particular Time Period, say 30 days, I require excess material consumption report. This report is for the materials ( say ROH, or HALB) that are confirmed through co11n. Taking MTS into consideration with Strategy Group 40, please suggest a standard report (if there is any).
    Regards,
    Pavan

    The T code for viewing the standard report for
    Material Analysis - MCP5.
    Production Order - MCP3.
    Material Usage Analysis - MCRE.
    Please try it.
    Regards
    R.Brahmankar

  • Item Wise Consumption Report

    Hello Friends,
    i want to get the consumption report item wise.
    IN GL Line item display i am not getting the same and through MB51 by using Movement Type 201 and 261 is not fruitfull.
    Actly while preparing of Balance Sheet i need to give the Consumption Detail Item Wise.
    Could any one please help me out on this issue.
    Thanks
    Nitin Jindal

    Hi Nitin,
    You can develop SAP query T code SQ01 by joining Material and GL Account table to get consumption report output.
    Regards,
    Santosh

  • Material consumption report for sales made artcle wise - help urgent

    Hi Folks,
    My client need a report which consist of
    The raw material consumption report
    1. Article wise (material group)
    2. QTY
    3. Value
    4. or all sales made for foreign customers
    5. Business area
    Please help me
    Thanks
    Narasim

    Hi,
    Check COOIS report.
    It will show the consumption order wise just filter Movement type 261.
    Regards,
    Shayam

  • ME57 report modification.....

    Below i clearly mentioned the detials pls anyone tell the solution asap...
    1. Copy the existing program (ME57) RM06BZ00 in a new program ZRM06BZ00.
    2. Create a Role table, this would essentially be to enable us to find the role of a buyer based on either of Material group, Plant, acct assignment category, T# .The structure of the same would be as follows.
    Plant Material Group Accnt Assign Cat Role T# Material type
    3. Provide a transaction to maintain the Table entry.
    4. Provide select option in the selection screen to choose the T# of a person responsible below the purchasing group field.
    5. Create logic to select the documents relevant to the T# provided in input and where role assigned is PR to PO conversion. This would call the role table to identify the material group, plant and acct assignment for which the person having T# is responsible and has role of PR to PO conversion. Further logic of the reports would be same as original.
    6. Provide T# in the Report output.
    Report modifications
    1. Select all Purchase Requisitions based on selection criteria into internal table ban.
    2. Perform checks on selected entries.
    3. For each entry in table ban do following.
    Select T# from table ZBUYERROLE table
    where plant = ban-plant
    material grp = ban-material grp
    Accnt Assign Cat = ban-Acct assign cat
    And T# is in select option s_tuser.
    If record found.
    Display ban.
    Display T# obtained.
    Else.
    Delete ban entry.
    Endif.
    End Do.
    This is very very urgent ..correct solution will be reqwarded....
    Thanks in advance.....

    The problem may not be due to CALL TRANSACTION.
    Before you click on the requisition, go into debug mode. After you get into the requisition program look at the SY structures. See if either the program name or transaction code is actually your custom development.
    Rob

  • Material yearly consumption report

    Hi,
    I have gone through many topics on getting the yearly consumption report of material but still could not get it.
    We have just implemented SAP in our company and all transactions are being done from 1st Jan 2011. In Material Master we have added the consumption (under Forecast tab) month wise for the last four years.
    Is there a way to see a report based on that, as I would like to accumulate the data year wise and see the last four years consumption.

    Hi ,
    I would give you suggestion based on your question "Is there a way to see a report based on that, as I would like to accumulate the data year wise and see the last four years consumption."
    1st , are you using any PP related Production order ?
    This is very simple issue with movement type 261 if you are using PP.
    Since you would like to see accumulate the date year wise for last four years consumption , my suggest is based on the plan date from the last 4 years with 261 movement type for the raw material / semi finished in those order.
    Standard report
    COOIS Report - with movement type 261 based on order also possible to view.
    or
    MCRP- exact material consumption datewise or order wise.
    MC45 ,MCRE alternative report.
    For customize solution with abap,
    Please check with Table MVER -  Material Consumption , MSEG (MENGE) and S026 (ENMNG)
    Pls restrict the selection condition for material with movement type 261 in table MSEG.
    If you using MRP area, perhaps you need check in table DVER - Material Consumption for MRP Area.
    Hope is clear and can help you.
    TQ

  • Material Consumption Report

    Hi Guys,
    I have to develop a custom report intended for use by our factories and is design to give them detail  information on raw materials actual usage relative to how much should have been used (standard usage) by an individual product or product group. 
    The column of the report that is probably the most challenging to determine by taking the BOM quantities for each product in the product group under consideration and multiplying them by the actual output achieved for the respective products in order obtain the standard usage. 
    I have been looking at doing the following. Substracting the fields of txn COR3(Display process order material list), from txn CORT(Process order confirmation display: goods movement). Is this the right approach.
    Any screens, transactions, tables, structures for me to do this report would be greatly appreciated.
    Thank you for the help.
    Sumit.

    Hi,
    Have you tried looking at the standard material consumption report - Transaction MCRE?
    Rgds.

  • Consumption report for nn stockable material

    hi
    i want to see the consumption report for non stockable material like A,K,

    Hi
    Check it in MB51
    Thanks
    Regards,
    Raman

  • Demand ~ Consumption report

    Hi All,
    Is there any way I will get Demand versus Consumption report. My client wants that. But i do not know if there is any standard transaction for that.
    Client put demand as per forcasting say 10 qty for Jan . But sales order comes for 5 qty. so demand for 5 qty is still open. Next month again client will put demand for say15. The stock will increase to 20. So is there any method he can see the demand~consumption report so that he will put demand for
    15 - 5 = 10 only.
    Regards,
    Samar

    Please look into MC87..
    Hope it will definitely help..
    karthick

  • Consumption report Date to date ,Group & itemwise

    Dear Sap Expets,
    Can you please advise me that i want to make consumption report Date to date ,Group & itemwise ,in summary report (Total Qty and Value consumed).How is the possible it?
    Thanks
    mohit

    Hi,
    Use MB5B report for the same, it will give you qty & values for overall receipts and issues for certain period or else refer report MC.2
    Hope this will resolve your issue.
    Thanks & Regards,
    Sandesh Sawant

  • Consumption report showing old purcahse orders

    Hello experts,
    I am executing a consumption report. It is showing old purchase requisitions.
    I do not need them.
    How do i make it not to appear inthe report
    please advise,
    Thanks in advance
    Sanjeev

    Hi,
    Set the deletion indicator or the close indicator using ME52N.
    Regards,
    Santosh

Maybe you are looking for

  • Can't open project after rebuilding Folders in Project Manager

    I had a corrupted project so I renamed the cpd file.  A lot of Folders in Project Manager were lost, so I recreated the folders and imported all the topics back in.  I added one last Folder back in and RH was having a problem with it (I didn't write

  • Firefox will not load for me. I have been trying since last night. Help me, PLEASE!!!

    Unable to connect

  • Adobe Photoshop Elements 11 Text

    My tool options bar at the bottom of the screen all of a sudden disappeared.  I need to change the font size.  How do I get the tool options bar back?

  • Cursor.HAND  not displaying.

    Hai folks, i have two javafx custom components. i'll show one component at a time. i'll show another component based on the user selection. in my first component ,i set cursor to Cursor.HAND . it shows initially perfect. after showing the second comp

  • Accounting on PIX

    Hello, Guyz, i am trying to implement ONLY accounting on PIX. The main puprose is only to log the commands/changes made on pix by users. But i am unable to find any sort of configuration which do this. i have tried capturing Telnet on local interface