NOT NULL THEN PASS VALUE [message #397670] |
Mon, 13 April 2009 05:24 |
|
Hi,
We have lot of division to our factory and their accounting are maintain separately for each division. We need to take the report for all Division or optional divisions accounts status.
In this report parameter user select the required divisions on
parameter Fields of P_A1, P_A2, P_A3, P_A4, there was select YES OR NO. Then the following Function run in After Parameter Form.
Ex:
Declare
U1 Number(3); /*Divison 1 */
U2 Number(3); /*Divison 2 */
U3 Number(3); /*Divison 3 */
U4 Number(3); /*Divison 4 */
C1 Char(1);
C2 Char(1);
C3 Char(1);
Begin
If :P_A1 = 'YES' and ((:P_A2 = 'YES') or (:P_A3 = 'YES') or (:P_A4 = 'YES')) Then
U1 := 1;
C1 := ',';
Elsif :P_A1 = 'YES' and :P_A2 = 'NO' and :P_A3 = 'NO' and :P_A4 = 'NO' Then
U1 := '1';
End if;
If :P_A2 = 'YES' and ((:P_A3 = 'YES') or (:P_A4 = 'YES')) Then
U2 := 2;
C2 := ',';
Elsif :P_A2 = 'YES' and :P_A1 = 'NO' and :P_A3 = 'NO' and :P_A4 = 'NO' Then
U2 := 2;
End if;
If :P_A3 = 'YES' and :P_A4 = 'YES' Then
U3 := 3;
C3 := ',';
Elsif :P_A3 = 'YES' and :P_A2 = 'NO' and :P_A1 = 'NO' and :P_A4 = 'NO' Then
U3 := 3;
End if;
If :P_A4 = 'YES' Then
U4 := 4;
End if;
Select Ledcode,Sum(Nvl(Clbalamt,0)) Opamt from BankAcctbal
Where Mthno = 04
and yrsno = 2009
and Rtrim(Ltrim(Unitid)) in (U1 || C1 || U2 || C2 || U3 || C3 || U4)
and Nvl(clbalamt,0) <> 0
Group by Ledcode;
End;
During the Run time the outputs are correctly selected, but the report is not work for multiple divisions and run only for single division.
Thanks,
C V S
|
|
|
|
Re: NOT NULL THEN PASS VALUE [message #398023 is a reply to message #397738] |
Tue, 14 April 2009 23:05 |
|
Hi Mr. LittleFoot,
The Function i given is run on After_Parameter_Form, the lexical Parameter are unable to use in After_Parameter_Form. If any other have to solve it.
Thanks & Regards,
C V S
|
|
|
|