R42565 -> X0302 Compute Due Date usage

  • Thread starter Adrian_Chimirel
  • Start date


Legendary Poster
In B7321, I'm trying to get the R42565 print the Due Date on its Header; could somebody help?
PS I tried using the BSFN X0302 Compute Due Date with unreliable results. It seems the AR System Setup is not done properly.
Thank you very much,

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix
Hi Adrian,

Here's how I handled computing/showing Due Date on the Group Header of the Sales Invoice in B73.3.1. However it does assume that the A/R system is properly setup. If thas you issue then sorry - cannot help.

EVENT: Do Section


0793 // ===================================================
0794 // Calculate the Net Due Date
0795 // ===================================================
0796 //
0797 // Determine if Advanced Payment Terms apply
0798 Calculate Advanced Payment Terms Due Date
VA evt_cIsAdvancedPT_EV01 <- cIsAdvancedPT
RV Payment Terms Code (Gbl) WF -> szPaymentTermsCode01
RV Invoice Date (Gbl) WF -> jdDateInvoiceJ
UNDEFINED X jdDateServiceTaxDate
UNDEFINED X mnDiscountTaken
RV Invoice Date WF -> jdTransactionDate
UNDEFINED X mnAmountGross
RV Net_Due_Date <- jdDateDueJulian
UNDEFINED X jdDateDiscountDueJulian
0799 If VA evt_cIsAdvancedPT_EV01 is not equal to "1"
0800 Due Date Calculate
RV Payment Terms Code (Gbl) WF -> szPaymentTermsCode
UNDEFINED X jdDateDiscountDueJulian
RV Net_Due_Date <- jdDateNetDueJulian
RV Invoice Date (Gbl) WF -> jdTransactionDate
0801 End If

Larry Jones
[email protected]
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP13
Hello Larry,

Thank you VERY much for your prompt reply; using your code I discovered that we are using Advanced Payment, therefore cldAdvancedPT returned is 1 :)

Now, my second (hidden) problem is the 4DigitYear format displayed; there is a Convert 2 digit year date field to 4 digit year date string NER business function implemented prior to my arrival here. This conversion assumes there is a 2Year digit format to be converted (this is true at the Ent. Server side, but false for my NT developer wkstn, of course)!
Therefore, when I run the UBE locally I get a different (but very interesting, otherwise) year date (2020) versus the ... hum ... current year date (2001), when UBE is run on the Server :(

We'll have to decide
-if Another business function is to be implemented (that will format the To_Be_Printed_Date based on the JULIAN date instead of the Six_digits_date ... ) OR
-to Modify the existing one ... accordingly :(
Thank you again for your really helpful reply!

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix

we seem to have similar requirements :)

We needed to change our dates so that they would be less U.S. specific since over half of our customers are outside U.S. Our solution was to write a little NER BSFN that accepted a standard JDE date and returned dd-Mmm-YYYY. The BSFN is built into our own custom Library/DLL.

Here's the code if you're interested:
NAMED ER: Reformat Standard JDE Date to String
0001 If BF jdDate01 is equal to <Null Date>
0002 BF szWAGInternationalDate = ""
0003 Else
0004 VA evt_szMonthList = "JanFebMarAprMayJunJulAugSepOctNovDec"
0005 VA evt_mnTempNum = date_day([BF jdDate01])
0006 VA evt_szDateOutput = concat([VA evt_mnTempNum],"-")
0007 VA evt_mnTempNum = date_month([BF jdDate01])
0008 VA evt_mnTempNum2 = ([VA evt_mnTempNum]-1)*3
0009 VA evt_szMonth = substr([VA evt_szMonthList],[VA evt_mnTempNum2],3)
0010 VA evt_szDateOutput = concat([VA evt_szDateOutput],[VA evt_szMonth])
0011 VA evt_szDateOutput = concat([VA evt_szDateOutput],"-")
0012 VA evt_mnTempNum = date_year([BF jdDate01])
0013 VA evt_szDateOutput = concat([VA evt_szDateOutput],[VA evt_mnTempNum])
0014 BF szWAGInternationalDate = VA evt_szDateOutput
0015 End If

Larry Jones
[email protected]
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP13
Thank you AGAIN, Larry!
BUT it seems that I missed the point :)
What I was trying to say is that we already have in place a (VERY similar) function that receives a JDE DATE and returns a mm/dd/yyyy date format; the problem we encounter (with it) is, when run on the Server (rememeber, UNIX), the JDE Date is 6 digits, therefore the result will be OK. However, when you run the UBE locally (and that's a good question - > Why would you do such a thing? And the answer comes; because this is how I test it, firsthand), on my NT4, where I modified the Regional Settings for the Date, in the Control Panel, to display the year in 4 digits ... :)
We need an Other business function, that receives the Julian Date and returns the mm/dd/yyyy; and I guess it's not going to be very difficult to create it.
Thx again

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix
Adrian, Larry

Larry, I was able to guess the fields in the data structure of your BSFN :)

Our practice is also to write our conversion BSFNs only once (From/To String/Date/Numeric - To/From String/Date/Numeric) and use many times in our input/output interfaces and/or where it could be useful.

Many years ago I have specified a "Convert Date to String Flexible" BSFN as one of the first task for a talented beginner guys of us who is now a very experienced one.
It is really very flexible, using free form pattern text, so it can convert date to string really very flexible e.g. to convert January month to: 1, 01, Jan, January or to the Hungarian equivalents and you can put it anywhere in a free form text marking the desired month representation with: @M1, @M2, @M3 or @M4. For example, you can produce an output easily whith it like these:
"The due date is 6 April in year 2001" as well as "04/06/2001", "2001.04.06" or "6.4.01"

Unfortuntely, we have lost the original NER version of this BSFN (let me do not detail why)
the fortune in misfortune is that once upon a time I had to reproduce this BSFN at one of our B7321 client site, so I preserved:
* the Data Structure in an Excel sheet
* the ER as printed (.txt) and as B7321 Clipboard file
* the description (in English!) of the BSFN as Clipboard file of the attachmnet (and now converted it to .txt too).

Adrian, your living platform is B7321 so you can easy to use the CLP files (I hope, SP level do not matter). Unfortunately, ERs isn't transportable via CLP files between B7321 and B733x.
I will attach the mentioned files in a ZIP to this post.
* You can find the attachment of the BSFN in the N5501004_DOC.clp as attachment format and in N5501004_DOC.txt as converted to .txt. Read it first.
If you decide that you want to reproduce it on your site then:
* You can find the DSTR definition on the D5501004 sheet of the "export.xls" file, create this first (I know, it is obvious)
* You can find the work variables for the BSFN on the beginning of the N5501004.txt file. Create them with the same name, DD item and in the same order (or in reverse order???, currently I amn't sure)
* paste the body ER from the N5501004.clp into your NER Designer
* To be on the safe side, check all lines opening and comparing them whith the printed list of ER.

Before you begin, consider to use a larger string DD for the pattern input and for output than DS01 and DS02.
You can also easily extend it to present month abbreviation and full names on other languages than English and Hungarian too (e.g. Indian :)), French or Romanian).

Hope, it could be useful for you or for somebody else.


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)


  • 3-8836-N5501004.zip
    18.3 KB · Views: 103
Servus Zoltán,

I am really pleased my topic went so high; maybe it is because of spring, hormones, ... who knows?
Your very useful code, I'm speaking about the clipboards and the spreadsheet ('cause the text didn't make it BUT till the 84th column, the rest got truncated out) should be published on the Forum's Download site, being a very flexible solution!

Unfortunately I couldn't find THE answer to my question (your attached business function accepts the JDE Date as my old one and Larry's): remember, "Who/What makes the UBE's JDE Date print in 2 years digits format on the RS/6000 Ent. Server BUT in 4 digits format on any workstation with Regional Settings for Date changed accordingly? I still see the JDE Date(DATE01) has a size of 6! Where are the other 2 coming from?"
But this is life, you can't have them all; or, what is good is either scarce or illegal, but it definitely makes you fat ... :)

Now, even if I like it, I won't shoot our birds with the cannon you provided, but I'll use the FromJulian_To_4DigitYear function I created, and if anybody wants it, I'll make it available, too :)

Thank you very much!

PS I can't resist Zoldy; "I've never met a human being who would want to read 17000 pages of documentation, and if there was, I'd kill him to get him out of the gene pool." Joseph Costello, President of Cadence

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix
Hi Adrian,

About the previously attached documentations (not only for you, for all interested listener):
1.) The NER code clipboard file had been copied from B7321 and by my experiences, unfortunately not possible to paste in B733x.
2.) Under B7321 there wasn't the feature to print ER into a file just via printing it on Generic Text Only printer which output is directed into FILE. When I have made that .txt (more years ago) then I haven't figured out yet that I can set the largest paper size (A3 instead of A4) preventing truncations (as much as possible). I just tried to set Landscape but in this case I always got an empty output .txt file.
3.) Use the .txt just to figure out the work variables.
4.) You can produce an untruncated printed list copying the .clp into a text editor (e.g. NotePad) and print it.
5.) Consider to use a larger string DD for the pattern input and for output than DS01 and DS02 in the Data Structure.
6.) Of course, you can use any other object name then ours.

Continuing in response to your problem:

You problem is really confusious for me but I have some suggestion, maybe one of hem could help. (Unfortunately, I haven't acces to B7321 systems long time ago in the office).

1.) I copy here a part of OTT-00-0028 document:
Data Dictionary Century Changed
In OneWorld software, the data dictionary item is CENTCHG. We send it out with a value of 10. If the user enters a fiscal year greater then 10, it is written with the century value of 19. If the user enters a fiscal year less then 10, it is written with a century value of 20. The value of 10 can be changed to a higher value if necessary.
Maybe the JITIed CENTCHG Data Item is out of synch on your machine relative to the server (or inversely). Somehow you can check it. Maybe it can cause different year values (but supposly not 2020 instead of 2001. Who knows?)

2.) Check your User Profile settings in OneWorld. I do not remember that under B7321 is it possible to set Date Format and Date Separator Character in user Profile. If yes then try to play with some combination and later variated with some Regional Settings too.
If B7321 does not contain these settings in User Profile then maybe this feature could be in your jde.ini. Please, check it in your .ini and/or in your B7321 documentation (as far as I remember, there is an Appendix about jde.ini in the System Configuration documentation).
If it is in jde.ini then try the same that I suggested with User Profile.

3.) I very well remember (will never forget) that I have entered some large folder of Y2K paper Fixes on B7321 (and B7331 ;-) and have to reproduce them at many of our client site. That was a "great" and "interesting" job.
Maybe, some Fix wasn't applied on your system or isn't in synch on the workstation and on the server. I know, hard to figure out after years.
That time Tony StPierre had the best collection of Y2K Paper Fixes 8mainly for B7321) collected them in an Excel file.

That's all from me and now.
If you ask me, my bet is on No 2.

I wish you sincerely Good Luck in your issue.

P.S.: I know, you will share your results here :))

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
Do not so pleased your topic went so high, it is not enough high because it is not reached the solution yet.

Please, report us that:
* What kind of Date related settings exist in User Profile under B7321
* What kind of values acceptible there (e.g. for Date Format)
* Did you find any Date related settings in jde.ini. If yes, please describe it for us.

An other suggestion: try with blank values in date related settings too in User Profile (if exists) and/or to comment out jde.ini settings too.

Waiting curiously...

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
Hi Hi Sir, Dear Curious Sir,
Sir Yes Sir, Adrian reports to You Sir,

Now that I'm done with (the attached BSFN I mean), allow me to answer Your questions SIR, in the same order they were asked, Sir:

* The DATE related setting in my User Profile is blank (the default) described as System (I guess the ... hum ... Operating System takes over, on my NT Dev wkstn OR on the Unix Ent. Server)
* The other three different values deal with sequences of the DD, MM, and YY groups.
NB There is no YYYY group in any of them, Sir!
* Except from the Julian Date, there is NO Other Date occurrence in my jde.ini, Sir.

That was not that difficult, was it?

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix


  • 3-9013-N554DYR.txt
    1.8 KB · Views: 87
Sir CanAdrian,

The pronounced "Sir" sounds/means like bristle/hair in Hungarian language. I could be a long haired dog with so much "Sir", don't you think? :)))
Thanks for your report anyway.

1.) Have you made some experiments with various settings in the User Profile and Regional settings? If yes, what did you experience?
2.) Did your issue resolved already or is it open yet?

At last here is an other silly hint. Add the following entry:
Code: "DME"
Description: "Day, Month, 4-digit Year"
to the 00/DF UDC table and use it in the User Profile (... and of course, let us know what happened :))

Read You Again!

P.S. No 1.: The Cartoon must go on! :)))
P.S. No 2.: Tomorrow evening I will have my dinner with some of my colleauges in medieval style knightly restaurant named as "Sir Brian". It is really true. Don't you believe it?
P.S. No 3.: Forum/List, excuse me this personalities. Thanks in advance.

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)

After I re-read your "report" with "Sir"-s, I really hope that I haven't offended you.
Maybe somtimes I don't choose the appropriate word or phrase, you know ... my English.
I didn't want to be provocative, my only purpose was to know as much info about your issue as it is possible to help in your issue more effectively.

About your issue again.
Last night I wasn't careful enough, so I haven't noticed that there are more 4 Years entry in 00/DF UDC table under B733x.

I know, you have an XE sand box, so you can check them. My suggestion is to eneter all entry under B7321 which are missing there but exist under XE. After this is done, try to play with them in the user profile.

Good luck,

P.S.: I really hope, the final solution is near.

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
Dear Zoltán,

No offended Adrian here! Just accommodating to your rhythm AND humor, I hope ;-)
And no sensible person could consider ANY of your remarkable replies as provocative; and your English is better developed than mine was (when I was your age :)

The test you suggested will be done as soon as my desk will get unloaded of some of the current but URGENT projects (you know, business priority first, the more elegant solution, later, IF time to implement it is available; and I'd have that time, anyway, after the Easter :)

Thank You AND Larry, again!
Warm regards,
PS Using Larry's code and my new NER, I was able to fix the issue, on our B7321. It works fine now, both locally & on the server!

LIVE: B732.1 SP12.2, Oracle 806
SANDBOX: Xe SP15, Oracle 8i
RS/6000, Citrix