on ‎2019 May 22 2:53 PM
Hi all,
We have a load file supplied to us from a separate HR system that supplies data in the format "dd/mm/yyyy". We need to load this into the system as yyyy.dd so that BPC can store it as a numerical value.
I am comfortable with how I would convert dd/mm/yyyy to yyyy/mm through javascript in the conversion file (see example at https://jsfiddle.net/31c7ywdp/). However, whenever I run or validate this against the data file, it just always throws an error saying Line5 :Dimension:SIGNEDDATA member:06/05/2019 is non-numerical in line 5; rejected.
Now, I'm worried that the transformation/conversion process perhaps does an initial check that any "AMOUNT" column is already in numerical format - but am hoping that someone out there can suggest a way of getting around this? It makes sense to me that you could receive something not necessarily in a numerical format and convert it to a numerical format. Anyone done this in BPC before?
I know that I could either go back to the team running the HR system and ask if they can provide it in a different format (not convinced they can) or instead just either manually manipulate the file in Excel before upload or even write a bit of VBA that will do this for the end users, I'd just prefer it if we didn't have these steps.
I've uploaded a screenshot of both the transformation file I'm trying to use and the javascript in the conversion file.


Thanks
Joe
Request clarification before answering.
Hi Joe,
I had a similar requirement a while ago and noticed that if you use SIGNEDDATA the numeric data type validation doesn't occur so that, following Vadim's example:
AMOUNT=*COL(10,2:2) doesn't work
but
SIGNEDDATA=*COL(10,2:2) does (tested on BPC 10.1 NW, BW 7.5 SP7)
You can't use javascript conversion but can potentially write the same in the mapping section:
SIGNEDDATA=*IF(ACCOUNT=*STR(HRDB2083) THEN DATE(7:10) + *str(.) + DATE(4:5);DATE)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By the way, when I want to store date as signeddata in BPC, I prefer to store it as integer calculated based on Excel rules - number of days since 01.01.1900. In this case in the report the column can be formatted as date.
Sample JavaScript calculation is:
var Value = "06/05/2019";
alert( Date.parse(Value.substr(6,4)+"-"+Value.substr(3,2)+"-"+Value.substr(0,2))/86400000 + 25569);
same calculation can be done in ABAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Agreed Vadim - we actually have both. But the data in the HR system won't work with Excel values and they can't output them - so another thing I am trying to do is convert from dd/mm/yyyy to the Excel number. Funnily enough I had already been experimenting with js and we came up with something very similar to yours (but explicitly showed the js Date function of 01/01/1900 to try to make it that little bit clearer).
We have both types (excel value and YYYY.MM) as we found it easier to use the former in Excel input forms/schedules (obviously) and the latter in script logic (we have phasing that tries to check if the BPC month is less than or equal to start date etc - it just seemed easier to store YYYY.MM and compare it against the time member ID than messing around with Excel etc).
So - got to join all these pieces together now but seems like you and Ibai have pretty much got me there 🙂
joe.mitchell
Script logic like:
*REC(EXPRESSION=(%VALUE%>%PER%) ? ...
where %PER% is like 2019.05 ...
resulting in FOR/NEXT loop if multiple periods... can be slow!
I recommend using Custom logic badi in this case instead of script logic. In custom logic badi it's easy to compare Excel integer date with time member.
Thanks Vadim.
Out of interest have you got your Javascript to convert dates to excel to work in practice? For me, if I use Date.parse(...) it returns NAN, if I just use Date(...) it returns null and if I use new Date(...) it throws an evaluation error.
Finding it strange because I can get these working on javascript testers, but wondering if BPC maybe uses some type of js that doesn't accept the Date function.
Thanks
Joe
I can confirm that there is no way except START ROUTINE badi to perform conversion of some string to numeric value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use this badi to debug:
method IF_UJD_ROUTINE~RUNROUTINE.
* DEBUG =====================================================================
DATA i_d TYPE C. " for bg debug.
CLEAR i_d.
WHILE i_d IS INITIAL.
ENDWHILE.
* DEBUG =====================================================================
er_data = ir_data.
endmethod.Then in SM50 find the endless loop and start debugging.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Haha nice work Vadim. May be easier for you than me with zero BADI knowledge.
Will take a read of the doc and have a stab myself - thanks as ever.
Just for clarity, the BADI gets the text file into the above format (with "06/05/2019") and I would continue to use javascript in the conversion file as I already am? Or are you also suggesting using the BADI to then get "06/05/2019" into 2019.05?
Thanks for the hints
Joe
I suspect that transformation routine perform check for numeric data type before using conversion!
You can use ROUTINE badi to perform conversion in abap.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
joe.mitchell
It's very simple!
You have to use:
STARTROUTINE = BADIFILTERNAME
in transformation Options
Read:
https://www.sap.com/documents/2015/08/20211f55-557c-0010-82c7-eda71af511fa.html
Also, using this badi you can debug the process...
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.