You are on page 1of 4

ZPROD_CC_DA_REP1 ========== report zprod_cc_da_rep no standard page heading line-count 65(8) line-size 90. tables: lips , likp.

types:begin of tz_lips, vbeln type vbeln_vl, erzet type erzet, erdat type erdat, end of tz_lips . types: begin of tz_likp, vbeln type vbeln_vl, * erzet type erzet, erdat type erdat, zzccno type zzccno, zzprod type zzprod, zzdesstn type zzdesstn, end of tz_likp. data: begin of wa_final, zzccno type zzccno, zzprod type zzprod, zdacnt type i, zzdesstn type zzdesstn, end of wa_final. data:i_lips type standard table of tz_lips initial size 0, i_likp type standard table of tz_likp initial size 0, i_final like standard table of wa_final initial size 0. data:wa_lips type tz_lips, wa_likp type tz_likp, wa_final2 LIKE wa_final. data:count sl(4) sl1 sl2 sl3 sl4 sl5 sl6 sl7 sl8 sl9 sl10 var var1 var2 var3 var4 var5 var6 var7 var8 type type type type type type type type type type type type type type type type type type type type type i, c, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, "vbeln->delivery "Erzet->Entry time

"vbeln->delivery "vbeln->delivery "

var9

type i.

select-options: s_date for lips-erdat obligatory, s_ccno for likp-zzccno, "Rake no include on 29.11.2010 s_time for lips-erzet. end-of-page. start-of-selection. select vbeln erdat into corresponding fields of table i_lips from lips where erdat in s_date and spart = '01'. if i_lips[] is not initial. select vbeln erdat zzccno zzprod zzdesstn from likp into corresponding fields of table i_likp for all entries in i_lips where vbeln = i_lips-vbeln and erdat = i_lips-erdat and zzccno in s_ccno "Rake no included on 29.11.2010 and ERZET IN S_TIME and lfart in ('ZDCD','ZSFD','ZDIP','ZDIC'). else. write 'No data found'. endif. clear:var. sort i_likp by zzprod. delete i_likp where zzprod = ''. loop at i_likp into wa_final-zzccno = wa_final-zzprod = wa_final-zzdesstn wa_likp. wa_likp-zzccno. wa_likp-zzprod. = wa_likp-zzdesstn.

append wa_final to i_final. clear:wa_final. endloop. sort i_final by zzccno . loop at i_final into wa_final. wa_final2 = wa_final. if wa_final-zzprod = 'HRCD'. var1 = var1 + 1. sl1 = sl1 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod = 'HRP'. var2 = var2 + 1.

sl2 = sl2 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var3 = var3 + 1. sl3 = sl3 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var4 = var4 + 1. sl4 = sl4 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var5 = var5 + 1. sl5 = sl5 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var6 = var6 + 1. sl6 = sl6 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var7 = var7 + 1. sl7 = sl7 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var8 = var8 + 1. sl8 = sl8 + 1. sl10 = sl10 + 1. var = var + 1. endif. if wa_final-zzprod var9 = var9 + 1. sl9 = sl9 + 1. sl10 = sl10 + 1. var = var + 1. endif.

= 'HRS'.

= 'HRLST'.

= 'CRC'.

= 'CRS'.

= 'GPC'.

= 'GPS'.

= 'GCS'.

at end of zzccno. sl = sl + 1. condense sl. write: /1(2) sl, 4(5) wa_final-zzccno,11(5) wa_final2-zzdesstn, 17(8) var1, 24(8) var2, 31(5) var3, 38(5) var4, 45(5) var5, 52(5) var6, 59(5) var7, 66(5) v ar8, 73(5) var9, 80(5) var. uline. clear: var1, var2, var3,var4, var5, var6, var7, var8, var9, var. at last. write:/3 'Total Recs: ',17(8) sl1, 24(8) sl2, 31(5) sl3, 38(5) sl4, 45(5) sl5, 52(5) sl6, 59(5) sl7, 66(5) sl8, 73(5) sl9, 80(5) sl10. endat.

endat. endloop. top-of-page. write: /15(35) 'RAKE & PRODUCT wise DA Report from ', s_date-low, 'To',s_datehigh. write: /45 'Time:', s_time-low, 'To', s_time-high. if s_time-low write: /55 '(A elseif s_time-low write: /55 '(B elseif s_time-low write: /55 '(C elseif s_time-low write: /55 '(G endif. >= '060101' shift)'. >= '140202' shift)'. >= '220202' shift)'. >= '080101' shift)'. and s_time-high <= '140101'. and s_time-high <= '220101'. and s_time-high <= '055901'. and s_time-high <= '170101'.

write: /15(60) sy-uline. skip. write: /1 'Sl',5(11) 'Rake/Destn', 22(8) 'HRCD', 29(4) 'HRP', 33(3) 'HRS', 38( 5) 'HRLST', 47(3) 'CRC', 54(4) 'CRS', 61(4) 'GPC', 68(4) 'GPS', 76(4) 'GCS', 81 (5) 'Total'. uline.

You might also like