E9.2 Calculate AEXP Total

Aadesh Dukhande

Member
I am working on F4311 table. I have created F/B form for data browse and Header/detail form for add&update multiple record.
while adding the data by using H/D form, AEXP value should be calculate in grid column and display on Order Total(FC Column).
SO! Any one have a idea or logic to make this,share your valueable knowledge. order Calculation.PNG
 
Add up the totals as the records are read and assign to the order total field. easy peasy.
 
Are you worried the user maybe in line line 2 and go back to line 1 and change the QTY (AEXP) etc?

Just have a hidden button that loops through ALL grid rows and SUMS them. Call this in event Grid Row is Exited Line
There are plenty of examples on here that do that.
Note this code only works on the THIN client local web


// init variables
evt_iLineIn_INT01 = "0"
evt_iLineOut_INT01 = "0"
// get first row
Get Next Selected Row(FC Grid, <Before First Row>, evt_iLineOut_INT01)
While evt_iLineOut_INT01 is greater than evt_iLineIn_INT01
Get Grid Row(FC Grid, evt_iLineOut_INT01)
// do something with the GC (add and SUM AEXP)
evt_iLineIn_INT01 = evt_iLineOut_INT01
Get Next Selected Row(FC Grid, evt_iLineIn_INT01, evt_iLineOut_INT01)
End While
FC AEXP total = add and SUM AEXP
 
For cases of amount getting changed on the line the best method is to save the original AEXP on the Row is Entered event. On the Row Exit and Changed event compare the values to see if the changed. Find the difference and it to the FC. Works great and is faster than looping through all lines on the grid.
 
Add up the totals as the records are read and assign to the order total field. easy peasy.
Can u explain more on it?
I know it's simple but I couldn't get idea of which event rule and what logic I have to use.
because my Aim is that while entering data in grid, extended price value should be calculate and show in Order total (FC)
 
Are you worried the user maybe in line line 2 and go back to line 1 and change the QTY (AEXP) etc?

Just have a hidden button that loops through ALL grid rows and SUMS them. Call this in event Grid Row is Exited Line
There are plenty of examples on here that do that.
Note this code only works on the THIN client local web


// init variables
evt_iLineIn_INT01 = "0"
evt_iLineOut_INT01 = "0"
// get first row
Get Next Selected Row(FC Grid, <Before First Row>, evt_iLineOut_INT01)
While evt_iLineOut_INT01 is greater than evt_iLineIn_INT01
Get Grid Row(FC Grid, evt_iLineOut_INT01)
// do something with the GC (add and SUM AEXP)
evt_iLineIn_INT01 = evt_iLineOut_INT01
Get Next Selected Row(FC Grid, evt_iLineIn_INT01, evt_iLineOut_INT01)
End While
FC AEXP total = add and SUM AEXP
No!John I am not worried.
It's my practice task and I have Demo JDE Machine for practice purpose.
So!I hope u can understand help me on this.Thanks
 
Add up the totals as the records are read and assign to the order total field. easy peasy.
I have also same doubt that I want Total of AEXP field from Grid as order total on form control. So, can you give some brief idea that on which event rules will I have to write logic and what logic should I write??
 
Back
Top