Modification on Application ?

lisachew

Active Member
Hello,

I have a question which I need some answer to urgently. Please help if anyone have any idea either its little or lots.

WEll, currently I need to make some modification to an application form. As usual the entry point of each application will be the Find/Browse Form. So, below is the example:

------------------------------------------
Document Number | Amount | (added column)|
------------------------------------------
10002..............100.00..........140.00
10002..............120.00..........140.00
10002...............20.00..........140.00
10003...............10.00...........10.00

Question:
CAn I total up all the amount based on the same document number? If yes, is there any references or example that I can refer too? Or anyone that can guide me? *This modification is on the Find/Browse Form*

The modification coding should be done on the grid event rules or form event rules?

Please help as this is quite urgent. Need to feedback to my user.
I am not familiar with the designing form.

Thank you very much.

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
yes it is possible, where r u based

----Original Message Follows----
From: lisachew <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: Modification on Application ?
Date: Wed, 30 Jan 2002 20:11:56 -0800 (PST)

Hello,

I have a question which I need some answer to urgently. Please help if
anyone have any idea either its little or lots.

WEll, currently I need to make some modification to an application form. As
usual the entry point of each application will be the Find/Browse Form. So,
below is the example:

------------------------------------------
Document Number | Amount | (added column)|
------------------------------------------
10002..............100.00..........140.00
10002..............120.00..........140.00
10002...............20.00..........140.00
10003...............10.00...........10.00

Question:
CAn I total up all the amount based on the same document number? If yes, is
there any references or example that I can refer too? Or anyone that can
guide me? *This modification is on the Find/Browse Form*

The modification coding should be done on the grid event rules or form event
rules?

Please help as this is quite urgent. Need to feedback to my user.
I am not familiar with the designing form.

Thank you very much.

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2


--------------------------
Visit the forum to view this thread at:
http://www.jdelist.com/cgi-bin/wwwthreads/showflat.pl?Cat=&Board=OWDEV&Number=27774
+ - - - - - - - - - - - - - - - - - - - - - - - -+
This is the JDEList One World® / XE Developers mailing list / forum.
Archives and information on how to SUBSCRIBE, and
UNSUBSCRIBE can be found on the JDEList Forum at
http://www.JDEList.com

JDEList is not affiliated with JDEdwards®

+ - - - - - - - - - - - - - - - - - - - - - - - -+


===================================
Siddhartha Arya

+65-90670625
===================================
In three words I can sum up everything I've learned about life: It goes on
-- Robert Frost
 
Lisa,

i am trying to post this reply through the Forum as it seems to be very slow through the list.

i replied to your previous Post with a suggestion, but it did not come through yet.

My suggestion: in the event Rules "Grid REcord is Fetched" use table IO to
Select from your file matching your criteria
While SV File IO Status = CO SUCCESS
Fetch Next (get the amount to add up)
Add up the amount to the Grid Value
end do

You then have to manage the change of Order Value (Compare
GC Order Number and PC Order Numer (the later is the value on the previous Business View record)

Hope this helps

Cheers

Philippe

One World B7333 SP16 AS400
 
Philippe,

Thanks for your kind help. Thanks again for your suggestion.

Well, from your suggestion you mentioned that I need to fetch next?
But then in that Find/Browse Form I see that the amount column is taken straight away from the business view. Means its a BC. So I still needs to fetch next? If I fetch next the table will be same as the business view. Can this be done? If I can do like that then I will proceed.

Anyway, I tried one of my way in doing it. I just create a VA document number to be equal to the BC document number. And if VA is = to BC then I will total up the amount and assign it to the added column.
Eg:
VA document number = BC document number
If BC document number = VA document number
VA total = VA total + BC Amount
End IF
GC Added column = VA Total
* I find this method the added column will gets the amount exactly like the amount column. It wont total up. Is there anything to improve it?*

------------------------------------------
Document Number | Amount | (added column)|
------------------------------------------
10002...............100.00............140.00
10002...............120.00............140.00
10002................20.00............140.00
10003................10.00.............10.00

Thanks a lot for your kind help.


Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Lisa,

With your method you should see:

------------------------------------------
Document Number | Amount | (added column)|
------------------------------------------
10002...............100.00............100.00
10002...............120.00............220.00
10002................20.00............240.00
10003................10.00.............10.00

As the added column will add the amount to the total for
each line.
Right now, i doesn't add up probably because your VA total
has a range of "Event". If you want it to be persistant as
you get the records, declare it as global ("Form"). Go to
the place were you define Variable and if you are in B7332
sp11 onwards you can change that by selecting the variable
and changing the range from "Event" to "Form". (the
vocabulary can be wrong but I hope you get the idea... my
system is down so I can't check).

In short, your method will work except that your added
column will display a "progressive" sum of the amount as
you get the records, so that the total will display
correcly only on the last line of the given order.

What i explained was a way to read all the records for the
given order when you get the first record on the grid. This
way you can display the Sum on all lines.

BTW, yes, you can do a table IO on the same table as the
one used on the BSVW.


Cheers

Philippe



One World B7333 SP16 AS400
 
Lisa,

Once again, i use the forum to post a reply. I sent an email with a more comprehensive reply to your question but it still didn't get through.
The answer to your problem with your solution is that the variable as the wrong SCOPE (in the reply to come, I wrote "Range"...)
Change your scope to "Form" so that your variable "Total" will no be lost when you go from one record to the next (if the scope is "Event", that means that your variable will exist only during the "Grid Record is Fetched" event and will be re-initialized the next time the event runs...)

Cheers

Philippe

One World B7333 SP16 AS400
 
Thank you very much.

Best Regards;
Lisa Chew
Energistic Sdn Bhd
Fromosa Prosonic
Tel: 3176 2700 ext: 349

*Wishing you a Happy New Year 2002*




Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Hello again,

Well, from your previous reply, you stated that I need to change to 'FORM'.

From the event rules itself, I can see that it let us check on a check box. Either choosing the EVENT or FORM or GRID(which is under the FORM). I checked on the GRID and I see that it only total up twice using your fetch next suggestion.

Eg:
-----------------------------------------
Doc No | Amount | add column
----------------------------------
111.........10.00........20.00
111.........20.00........40.00
123.........11.00........22.00

What i needed is :
-----------------------------------------
Doc No | Amount | add column
----------------------------------
111.........10.00........30.00
111.........20.00........30.00
123.........11.00........11.00

*this is the coding that i included*
F43121.Open
F43121.Select
While SV File_IO_Status is equal to CO SUCCESS
F43121.Fetch Next
VA frm_TotalAmountReceived = [VA frm_TotalAmountReceived]+[VA frm_AmountReceived]
End While
GC Total AmountReceived = VA frm_TotalAmountReceived
F43121.Close

Thanks for your help. Appreciated it very much.

If you think that you have difficulty on replying through this post again, pls let me know as maybe you can send it directly to my mail.



Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Lisa,

We are on the right track. i was just a little bit too fast in my coding example.
From the original I gave you, you can see that when you reach the last record of the list, SV FILE IO Status is still TRUE and therefore you run through the while loop one more time, thus counting the last line twice.

So try this

F43121.Open
F43121.Select
F43121.Fetch Next
While SV File_IO_Status is equal to CO SUCCESS
VA frm_TotalAmountReceived = [VA frm_TotalAmountReceived]+[VA frm_AmountReceived]
F43121.Fetch Next
End While
GC Total AmountReceived = VA frm_TotalAmountReceived
F43121.Close

That should fix the double accounting of the last line.
From there you can experiment more...

Cheers

Philippe


One World B7333 SP16 AS400
 
Philippe,

Thanks for your kind help.

Anyway, I tried to create those logics in the event rules but it seems like when I try running the application it takes a very long time to display the entry form. Actually, I think it hangs. Is it because of the way I have done that caused the report to loops and hangs?

F43121.Open
F43121.Select
F43121.Fetch Next
While SV File_IO_Status is equal to CO SUCCESS
VA frm_TotalAmountReceived = [VA frm_TotalAmountReceived]+[VA frm_AmountReceived]
End While
GC Total AmountReceived = VA frm_TotalAmountReceived
F43121.Close

When I disable the logic above the report runs as normal. (normally is also take sometime to display the entry form)

Well, now I need to perform the same modification on another application P0413M. On its Manual Payment Entry.
I would have..

Payment Number: 333

DOC No | Payment Amount | added total column
123.................100.00..............300.00
123.................200.00..............300.00
444.................100.00..............100.00

but when I perform the same method on this application it seems to get the total of whole Payment Number. Not doing like the above.

It comes like:
DOC No | Payment Amount | added total column
123..................100.00..............400.00
123..................200.00..............400.00
444..................100.00..............400.00

Please advice.
Thanks again

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Lisa,

first, on the F43121 report, do not forget to do a Fetch.next IN the While loop, that is the one that will return SV FILE IO STATUS = CO ERROR and get you out of the loop.

On your second report, you have to test that your document number changed (use PC Document Number - that stores the previous record's doc number and compare it to BC Document Number. If they are different, reset yor total)

Cheers

Philippe

One World B7333 SP16 AS400
 
Philipe,
Sorry for the silly mistake. But I did include the the fetch next to the while loop(i forgoten to put it there on the last reply).

And yet it still hangs.

PLease advice.


As for the second application. I cant find any PC command as I think in the application does not have this PC command like report base. Are you just giving an exmaple based on this PC command or is it really exist in application also? If yes, on which form and under which event rule as I tried to find the whole application and yet I dun see it.

Please help

Thank you very much.

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Hi Lisa,

My mistake this time. In application PC does not exist. You can use GB the grid buffer.
The code would look like this ("Grid Record is Fetched")

if GB document <> BC Document
VA Form total =0
F43121.open
F43121.select (pass the Order number ... and all required parameter to select only one order)
F43121.fetch next (get the amount)
while SV FILE IO STATUS = CO SUCCESS
VA Form Total = VA Form Total + VA evt Amount
F43121.FetchNext (get the amount)
End While
GC Total amount = VA Form Total
F43121.close
End If
GB Document = BC Document

Some advice: use the Event Rules debugger to see what happens (menu GH902)
Use UTB to look at F43121 and see what records you get if you pass the Document Type only (I think you have to look at MATC ...)

Cheers

Philippe

One World B7333 SP16 AS400
 
Philippe,

I am confuse, your suggestion on the previous post is actually replying to my first question or to the second? Sorry.

Coz now I am actually doing on 2 application =P43214 and P0413M.

The table that I am using F43121 is for P43214 (Find/Browse Form), where else for P0413M where I need to link F0414 to the business view (F0413).

If your previous suggestion of the grid buffer is according to F43121 means its based on P43214.

*************************************************************
Anyway, let me see whether I get you right or not.

You are saying that I still do all the logic in the Grid Record is Fetched? And the logic will be if the previous doc is not same as the BC doc then only i perform all the select, fetch to total up the amount and then only i set the previous doc to BC doc?

************************************************************

logic apply to both application? Just a thought.

ANyway thank you very much for you kind help.

Thanks again

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Lisa,

The logic should apply to your 2 applications (with different table and possibly different breaks)

I just realize that there is another problem in the code I gave you:
you perform the Select - Fetch next logic in "Grid Record is Fetched" only whn the order number changes. However the display of the total to the new column has to be done for all lines, so take that instruction out of the "If GB Document <> BC Document" condition.

Cheers

Philippe

One World B7333 SP16 AS400
 
Philippe,

Thanks for your suggestion.

Yes I do plan to let the total to be printed line by line as thats the only way.

As you say so that the if statement should be taken away but how bout the statement after the close file?

Coz by using this GB command I am not sure which part of the event rule need i put in. Is it on the same place or the Write Grid Line After? Is there any references that I can refer too about this GB command to have the total break on order no? Coz here I am confuse.

VA Form total =0
F43121.open
F43121.select (pass the Order number ... and all required parameter to select only one order)
F43121.fetch next (get the amount)
while SV FILE IO STATUS = CO SUCCESS
VA Form Total = VA Form Total + VA evt Amount
F43121.FetchNext (get the amount)
End While
GC Total amount = VA Form Total
F43121.close
>>>>GB Document = BC Document

Thank you very much.

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Lisa,

the If statement remains. Just move the instruction
GC total = VA Form Total
after the "End If"
This way you print the total on each line, but perform the calculation only on the first one... a better approach for performance

GB is the Grid Buffer, I suggested using it just to save time. it avoids having to declare a variable to hold the previous order number

Cheers

Philippe


One World B7333 SP16 AS400
 
Philipe,

I found some difficulties in this P0413M.

You see in the form its using F0413 as the business view whereelse in teh Grid its using F0414 as the business view. When I look into the UTB on both table. I found that F0413 consist only the payment number DOCM which link to F0414 consist of many order number.

F0413
PYID = 722
DOCM = 777

F0414
PYID = 722
DOC = 123,123,123,444

*meaning it links with PYID*

now i need to fetch next the F0414 into the GRID RECORD is FETCHED (business view F0413) to get the total for same order no. But then it accumulate the whole Payment Number amount. And I find I couldnt break it according to different order no.

Please advice.

Thanks very much. Hope that the request is not too overwhelming.

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
lisa,

I had a quick look at P0413M. Are you working on "Work With Payments"?
This uses a view on F0413 on the grid...

Could you give me more details on what you are trying to do?

Cheers

Philippe

One World B7333 SP16 AS400
 
Philippe,

Whew! I am getting a headache on this.


Anyway, ok yes I am working on that Manual Payment Entry form. And it is using 2 business view. One is V0413A whcih is in the Form and V0414A whcih is in the Grid. So I am assuming that both Form and Grid has 2 table linking to it.

Now, I need to add in a column(Total Payment Amount) in the grid based on same Documnet Number.
-------------------------------------------------------------
DOCUMENT NUMBER | PAYMENT AMOUNT | TOTAL PAYMENT AMOUNT (ADDED)
-------------------------------------------------------------
6644......................200.00.................800.00
6644......................500.00.................800.00
6644......................100.00.................800.00
1387......................500.00.................500.00
1234.......................80.00.................180.00
1234......................100.00.................180.00

But then when i tried to apply the fetch next logic in the GRID RECORD IS FETCHED the total will be the whole total of all the docmunet number. TOTAL = 1480 ,DOC NO=(6644+1387+1234).

If GB DocumentNumber is not equal to BC Document (Voucher, Invoice, etc.) (F0414)
F0414.Open
F0414.Select (PYID only)
F0414.Fetch Next (PAAP)
While SV File_IO_Status is not equal to CO ERROR
VA grd_TotalPaymntAmount = [VA grd_TotalPaymntAmount]+[VA grd_PaymntAmount]
F0414.Fetch Next (PAAP)
End While
GC = VA TOTAL
F0414.Close
Else
End If

PLease advice.

I really apprreciate your kind help. Thanks a lot.



So I assume that it

Best regards;
Lisa
OneWorld XE B733.3
SP 13
Intel NT4-service pack 6A
SQL 7
Service Pack 2
 
Back
Top