cancel
Showing results for 
Search instead for 
Did you mean: 

Need SAP Crystal Report formula for Blance Quantity

Former Member
0 Kudos

Hi,

     i really need a formula for SAP Crytal report my requirement is

    i have group 2 Groups  one on sale order and another one on Invoice

   Example:

        ================================================================

          Order No:100001 

         Order Quantity:1000

      =================================================================

      Detail Area invoice group

      INV#        INVQty   CreditNoQty        Balance

     10002       100               0                       900

     10003        500             100                    500   

    

       i need formula for balance quantity . the balance quantity subtract from order quantity and plus with credit note quantity.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Safeer,

Are 'Order Qty' and 'Inv Qty' summaries calculated on the report? Or are they simply pre-calculated database fields?

If they're database fields calculated in the query, then create a formula with this code and place it beside CreditNoQty:

({Order Qty} - {InvQty}) + {CreditNoQty}


-Abhilash

Former Member
0 Kudos

Dear Abhilash,

this is not a database field.it is a formula in crystal report.if i apply your formula.

then the result will be

Deatail area :1>1000-100+0   =900     this is correct

Deatail area :2>1000-500+100=600       but i need it on previous 900 like 900-500+100=500

abhilash_kumar
Active Contributor
0 Kudos

Try this:

1) Modify the code above to:

Whileprintingrecords;

Numbervar x := x +1;

If x = 1 then

(

Numbervar t := ({Order qty} - Invqty) + {Credit};

)

Else

(

t := ({Order qty} - t) + {credit}

)

2) Create a reset formula and place this on the group header 1:

Whileprintingrecords;

Numbervar x := 0;

Numbervar t := 0;

-Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Sorry the first formula should be :

Whileprintingrecords;

Numbervar x := x +1;

If x = 1 then

(

Numbervar t := ({Order qty} - Invqty) + {Credit};

)

Else

(

t := (t - Invqty) + {credit}

)

Former Member
0 Kudos

Thank you so much. it's work for me.

Answers (0)