cancel
Showing results for 
Search instead for 
Did you mean: 

Return a date in BRFplus

0 Kudos

Hi,

I have a BRFplus function with a date in the import signature, type DATUM. I want this date returned in the return structure of the BRFplus function (move from input date variable to output date variable). When I do a simulation, date is returned, but when I execute it from ABAP, BRFplus does not return any date.

I have been debugging the BRFplus generated code class and it seems that this date is converted internally by BRFplus to type  IF_FDT_TYPES=>ELEMENT_TIMEPOINT. This type is not a plain type, but a structure, with fields DATE, TIME, TIMESTAMP, OFFSET_TIME, OFFSET_SIGN and TYPE. This date is not properly returned by BRFplus to the ABAP code, although type of the return date is IF_FDT_TYPES=>ELEMENT_TIMEPOINT. If I set a direct value to the return date neither is returned properly to ABAP.


How can I return a date from BRFplus to ABAP?


Best regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Btw  If you are curious you might also get some more clues from the classes:

CL_FDT_DATE_TIME (for timepoints)

CL_FDT_AMOUNT_CONV for amount/currency

CL_FDT_QUANTITY_CONV for quantity/uom

These are classes that underpin many of the formulas and provide a number of conversions themselves.

christianlechne
Active Contributor
0 Kudos

Hi,

if you have a date of the type DATUM it has the format YYYYMMDD. Theis corresponds to the component if_fdt_constants=>gc_tp_date of the BRFplus structure for a date

I have created a small BRFplus function that has two dates as input (both reference to the DATUM), comapre them and returns the greater date in the result parameter (a third date).

When you call the function you have to specifiy correctly which type of input parameter you use namely which component shall be adresses. As mentioned above it is if_fdt_constants=>gc_tp_date. You can see that in the screenshot below:


The result is successfully returned:

Hope that helps

BR

Christian