can someone please help me on what this code is about?

reddy.jde92

Member
PO jdTO_Date = date_today()
VA rpt_CurrentDay = date_day([PO jdTO_DATE])
VA rpt_CurrentDay = [VA rpt_CurrentDay] - 1
Convert Date to Julian
VA rpt_DateInJulian = [VA rpt_DateInJulian]- [VA rpt_CurrentDay]
Convert Date to Julian

Please help me in undersatnding this code.
 

Larry_Jones

Legendary Poster
Since you didn't show all of the code (should have expanded the BSFNs) here's my guess:
Its calculating the date for the first day of the week.
 

peterbruce

Legendary Poster
reddy.jde92,

Without the parameters of the two occurrences of the "Convert Date to Julian" business function it's not easy to give the full detail. The context of the code could well be important too - what is done with the variables before and/or after the code snippet. The version of JDE may have an impact too. For example, if this code snippet contains a bug, it may have been corrected in a later release.

What is the purpose of your question? Why do you want to find out "what this code is about"? Is there a problem caused by this code? What have you done to help yourself in understanding the code snippet?

It is apparent that the code snippet is from a UBE (Report/Batch process). Which UBE is the code snippet from?

It looks like it is setting up three date related variables: PO jdTO_Date, VA rpt_CurrentDay, VA rpt_DateInJulian. The PO jdTO_Date is set to the date the code is executed. It would appear that VA rpt_CurrentDay is set to the day in the month before PO jdTO_Date. It is difficult to tell what VA rpt_DateInJulian is set to because it is not known what the original value is for the variable. A guess would be that VA rpt_DateInJulian set to the first day of the month in which the code was executed.
 

reddy.jde92

Member
Hi,

One of our customized report has this code. This code is being executed when we don't provide any FROM DATE value in the report's processing option.
Once the below code is executed successfully then PO jdTO_DATE is being populated/assigned with today's date(I can see in report's output). But we are not sure how exactly it is assigning the value to PD jdTO_Date variable since there is no assignment.
And also we are not passing any parameters to Convert Date to Julian function other than what is mentioned below.
It will be very helpful if you can provide us what is line by line code is doing here. Is there any significance for the brackets mentioned in the above code.?

I am not able to copy the complete code, but the below is the main code where we are facing difficulty in understanding.

If PO jdTO_DATE is equal to <Null Date>
PO jdTO_Date = date_today()
VA rpt_CurrentDay = date_day([PO jdTO_DATE])
VA rpt_CurrentDay = [VA rpt_CurrentDay] - 1 --- any specific significance for brackets[] here.
Convert Date to Julian
VA rpt_DateInJulian = [VA rpt_DateInJulian]- [VA rpt_CurrentDay]
Convert Date to Julian
End If
//Just using PO jdTo_Date variable. unluckily, not sure how to debug the code.

Thanks for all your help here.
 

Larry_Jones

Legendary Poster
You said "But we are not sure how exactly it is assigning the value to PD jdTO_Date variable since there is no assignment."
Line 2 of your code: PO jdTO_Date = date_today()
Peter is right about day of month rather than day of week :(

and, yes, there are parameters passed to the "Convert Date to Julian" functions. In the ER Editor Double click on the line to view. Or print the code to file with BSFN call expanded option on.
 

peterbruce

Legendary Poster
As Larry said the PO jdTO-DATE is assigned on the 2nd line of the code you provided and the business function Convert Date to Julian has 2 parameters. The parameters are the JDE Date to convert (in JDE Date data type) and the resulting Julian Date in the form YYYYDDD (in a math numeric data type).

The square brackets [] basically indicate a variable used in an expression that is evaluated at runtime as the right hand side of an assignment.
 
Top