Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

summarizing a running field.

Hi guys. Please help. Im creating a report and i do have this formula

@proc_days

WhilePrintingRecords;

DateVar Array Holidays;

Local DatetimeVar Start := {@Adjusted Item Create Timestamp};

Local DatetimeVar End := {@zzLast Edit Date};

local numbervar days;

Local NumberVar i;

For i := 1 to Count(Holidays) do

(

    if DayOfWeek (Holidays[i]) in 2 to 7 and Holidays[i] in [Start to End] then

         days := days + 1;

);

Datediff("d", Start, End) - Datediff("ww", Start, End, crSunday) - days;

ir computes days of processing of orders excluding the holidays and sundays.

the problem is how can i summarize this @proc_days?

I want to total the orders with 0-3days processing , 4-7days, and 7-15 days.

i tried using running fields but @proc_days dont have on the field list.

my idea is to create a formula like this

            if  {STORER.SUSR2} = 'FSS' then

                 (if {@proc_days2}<=3 then 1)

               else 0

where @proc_days2 code is:

if{@proc days}>0 then

    {@proc days} else

0

the formula is showing orders with 3days and below processing.

i just need to summarize all of those for my report to be finish.

-karlo

Former Member
replied

Hi Karlo,

Please see if this works:

1) Create a formula (@proc_days3) with this code:

whileprintingrecords;

numbervar count_3;

if {STORER.SUSR2} = 'FSS' AND ({@proc_days} IN [1 to 3])

   then count_3 := count_3 + 1;


2) Create a formula (@proc_days7) with this code:


whileprintingrecords;

numbervar count_7;

if {STORER.SUSR2} = 'FSS' AND ({@proc_days} IN [4 to 7])

   then count_7 := count_7 + 1;


3) Create a formula (@proc_days15) with this code:

whileprintingrecords;

numbervar count_15;

if {STORER.SUSR2} = 'FSS' AND ({@proc_days} IN [8 to 15])

   then count_15 := count_15 + 1;


Place all these formulae on the same section as the @Proc_days formula


4) Create one last formula on the Report Footer with this code:


whileprintingrecords;

numbervar count_3;

numbervar count_7;

numbervar count_15;


"Total Orders in 0 - 3 days :"&count_3;

"Total Orders in 4 - 7 days :"&count_7;

"Total Orders in 8 - 15 days :"&count_15;


Right-click this field > format field > common tab > check the 'Can Grow' option


-Abhilash

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question