RE:Passing Value from Versions to Routine

  • emushaija
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
14 years 6 months ago #7459 by emushaija
Hello All

I have writen a version routine which will need to take entered LD number from the version ,then using that value in the routine that is attached to that version,and then give results back to the version.

When i run the version i get the error record not found as shown on the below routine .

Below is the routine

*
* <Rating>-3</Rating>
*
SUBROUTINE VERSION.FTRINTEREST
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_ENQUIRY.COMMON
$INSERT I_F.LD.SCHEDULE.DEFINE
$INSERT I_F.LMM.ACCOUNT.BALANCES
$INSERT I_F.LD.LOANS.AND.DEPOSITS
$INSERT I_F.DATES
***
FN.SD = "F.LD.SCHEDULE.DEFINE"
F.SD = ""
CALL OPF(FN.SD,F.SD)

FN.LMM = "F.LMM.ACCOUNT.BALANCES"
F.LMM = ""
CALL OPF(FN.LMM,F.LMM)

FN.DATE="F.DATES"
F.DATE=""
CALL OPF(FN.DATE,F.DATE)

***Getting LD number from the version(LD.LOANS.AND.DEPOSITS) --I am getting error on the below *code for LD.CONTRACT.NO throwing an error RECORD NOT FOUnd

CONTRACT.ID=R.NEW(LD.CONTRACT.NO)

*****

*** Below Procedure extract future interest for months excluding the current month
CALL F.READ(FN.SD,CONTRACT.ID,R.SD,F.SD,LAB.SD)
INSTALLMENT.AMOUNT=R.SD<LD.SD.AMOUNT>
FUTURE.INTEREST=0

Z = DCOUNT(R.SD<LD.SD.SCHED.AMT.DUE>,VM)

FOR I = 1 TO Z
PRINCIPAL.AMOUNT=R.SD<LD.SD.SCHED.AMT.DUE,I>

INTEREST.AMOUNT=INSTALLMENT.AMOUNT - PRINCIPAL.AMOUNT

FUTURE.INTEREST =FUTURE.INTEREST + INTEREST.AMOUNT

NEXT I

****Below Procedure extract future interest for the CURRENT month
TEMP.ID='00'
CONTRACT.ID=CONTRACT.ID:"":TEMP.ID
CALL F.READ(FN.LMM,CONTRACT.ID,R.LMM,F.LMM,LMM.ERR)
CRT LMM.ERR
CURRENT.MONTH.INTEREST=R.LMM<LD27.COMMITTED.INT>
ACCRUED.INTEREST.1=R.LMM<LD27.INT.AMT.TODATE,1>
ACCRUED.INTEREST.2=R.LMM<LD27.INT.AMT.TODATE,2>
FUTURE.INT.CUR.MONTH=CURRENT.MONTH.INTEREST - ACCRUED.INTEREST.1 - ACCRUED.INTEREST.2
***** Summation of Future interest for current month and subsequent months

FUTURE.INTEREST =FUTURE.INTEREST - FUTURE.INT.CUR.MONTH

R.NEW(LD.CHRG.AMOUNT)=FUTURE.INTEREST


RETURN
***
END

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #7478 by kripesh
Replied by kripesh on topic Re: RE:Passing Value from Versions to Routine
If you are inputting an LD record using the Version then just replace the line

CONTRACT.ID=R.NEW(LD.CONTRACT.NO)

with

CONTRACT.ID= ID.NEW

Have a great day !

Please Log in or Create an account to join the conversation.

  • emushaija
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
14 years 6 months ago #7494 by emushaija
Replied by emushaija on topic Re: RE:Passing Value from Versions to Routine
Thanks Kripesh

It worked perfectly fine!

Be blessed for your time

Elisha

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #7503 by Lars
Beside the correct solution from kripesh,
there is no field in definition file (I_F.LD.LOANS.AND.DEPOSITS) like CONTRACT.ID...

Please Log in or Create an account to join the conversation.

Time to create page: 0.039 seconds