cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem loading hierarchy from BW to BPC + Javascript

Former Member
0 Likes
779

Hello experts,

I've been facing an issue trying to load a hierarchy (0COSTCENTER) from BW to BPC. The ID of the nodes are 0CO_AREA + " " + 0COSTCENTER. That space is an error on productive system, and cannot be changed on ERP side, so we want to handle it in the BPC layer.

First of all, in the first chain (/CPMB/IMPORT_IOBJ_MASTER), I constructed artificially the same structure 0CO_AREA + 0COSTCENTER (the space is already there) for both costcenter and hierarchy nodes (created at base level initially). Here, in order to remove the space, I applied the well-known statement in my CF (and works like a charm):

EXTERNALINTERNAL
*js:%external%.toString().replace(/\s+/g,"")

But, when I'm trying to load the hierarchy (/CPMB/IMPORT_IOBJ_HIER chain), I try to apply the same CF rule to the field NODENAME, but it's like is not taking it, throwing the following error:

As you can see, it tries to lookup for the original nodes (with space), but my expected behavior would be that once the NODENAME is treated by CF, just after that would be the moment for lookup for the nodes and create the hierarchy. I tried to put any other rule like:     *    "hello", but it doesn't enter into any CF rule.

I attach SS from my TF and CF:

Any sugestions? Since 0COSTCENTER it's an standard InfoObjetc, I wouldn't like to touch any transformations from BW side in order to make it work.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

Ups, what about conversion for PARENT to remove spaces?

Same as for NODENAME!

Vadim

Former Member
0 Likes

Hello Vadim,

Thanks for your response. And yes, before posting this topic yesterday I tried that, but got same results. The only thing is that I pointed to the same sheet NODE_ID for both NODENAME and PARENT fields. I'll try with 2 different conversion sheets but anyway it should work if I point to the same and it doesn't.

former_member186338
Active Contributor
0 Likes

Ups! I see typo error!

Not NODE_NAME but NODENAME in CONVERSION section!!!

Vadim

Former Member
0 Likes

Lol no way hahahaha... I'll correct and I'll tell you

Thanks!!

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Andres,

Try to use the attached java script.

Best Regards,

Sudhir

former_member186338
Active Contributor
0 Likes

Sorry, Sudhir!

Why do you think that the code:

js:%external%.split(' ').join('')

is better then:

js:%external%.toString().replace(/\s+/g,"")

Both codes are equivalents! Please read some JavaScript tutorial...

Vadim

Former Member
0 Likes

Hi Vadim,

Thanks for the clarification. I am not very handy with JS.

Will surely go through few JS notes

Best Regards,

Sudhir

Former Member
0 Likes

Hello Sudhir,

As I mentioned in my post, the load is not taking any rule.

BTW I tried that, and works but only for my first load (master data, not hierarchy data)

Thanks

UmaArjunan
Active Participant
0 Likes

If you don't want to modify BW transformations , there is another option in BPC.

You can implement UJD_ROUTINE to write a start routine.  Data from BW will be captured through the implemenation of this BADI IR_DATA and you can cleanse the data, i.e remove line feed, carriage feed etc., using abap statements before importing to BPC . Please check with the ABAP guy.

Call this start routine in the transformation file in  the options sections :

OPTIONS:

STARTROUTINE=<BADIFilter name>


Pl. try this option

former_member186338
Active Contributor
0 Likes

ROUTINE BADI just to remove space from ID?? Absolutely strange idea...

UmaArjunan
Active Participant
0 Likes

Not only for removing spaces. Other transformation logic can also written ( if required ) to cleanse or modify the data just the way the BW transformation does.

former_member186338
Active Contributor
0 Likes

Any complex transformation logic can be programmed in the routine badi, but this is not related to the topic author's case!