cancel
Showing results for 
Search instead for 
Did you mean: 

Function in SAP BFC 10.0

Former Member
0 Kudos

hi Experts,

We need a help in writing function in SAP BFC rule. We are using SAP BFC 10.0 SP16.

We have a consolidation in which dataentryperiod is 2015.10 and multi-periods 2016.01 to 2016.12 are used.

We need to write a function data to fetch data of an account for each period.

we have tried below function codes to fetch data for 2016.01, but both of them does not work. Please let me know in case any details are required.

If any details are attached here.

Thanks & Regards,

Shalini

Codes are attached below

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi All,

I am passing 2015.10 in the consolidation and I need to fetch data for 2016.01, 2016.02 and so on till 2016.12. Here 2016.01, 2016.02 to 2016.12 are periods whereas 2015.10 is dataentryperiod.

now I could achieve this using below period expression :

for 2016.01 - -> period =[UPDPER]+188416

2016.02 --> period = [UPDPER]+196608

2016.03 --> period = [UPDPER]+204800

Thanks & Regards,

Shalini

Answers (2)

Answers (2)

olivier_gentile
Explorer
0 Kudos

Hello Shalini,

I have a question regarding your data :

- does the amount on your MXPROP account / F99 flow exist in your consolidated data before the execution of the function (maybe on another period) and your objective is to populate target periods with the source amount ?

- or are your willing to insert amounts on MXPROP account / F99 flow on target periods for a fixed value (or maybe coming from another source, for example another account) ?

Regards,

Olivier

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Shalini

The id for 2016.01 is 30416896

In SQL you can get the period_id based on period (2015.03 etc.) with this:

@period_id = (convert(int,LEFT(@period,CHARINDEX('.',@period)-1))-1900)*262144+convert(int,RIGHT(@period,LEN(@period)-CHARINDEX('.',@period)))* 8192

Thanks

Marc

Former Member
0 Kudos

hi Marc,

Can you please let me know how can pass [UPDPER] that is dataentryperiod into it.

I replaced @period by [UPDPER], but it gives error - invalid length parameter passed to the left function.

Can you please help me to correct this?

Thanks & Regards,

Shalini

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Shalini

Not sure what you are trying to do. [UPDPER] is already in the 'integer' format, so no need to convert it

All 'period' fields in FC are stored as integers, and the code I provided is simply a way of converting the 'readable' code to its equivalent integer

So, for example if you run this code:

DECLARE @period char(7)

DECLARE @period_id int

SELECT @period = '2016.01'

SELECT @period_id = (convert(int,LEFT(@period,CHARINDEX('.',@period)-1))-1900)*262144+convert(int,RIGHT(@period,LEN(@period)-CHARINDEX('.',@period)))* 8192

SELECT @period_id

The result would be: 30416896

Marc