cancel
Showing results for 
Search instead for 
Did you mean: 

Need a java script to exclude this blank ID

Former Member
0 Kudos

Please let me know any one knows the javascript to exclude this blank ID

*MAPPING
ID=*STR(A_)+ID
ACCTYPE=*NEWCOL(EXP)
BW_A_ID=*STR(ID)
CO_AREA=*STR(9020)
DT_COSTELEMENTGROUP=*IF(ID(1:4)=*STR(9020) then ID; *STR())
DT_COSTELEMENT=*IF(ID(1:4)=*STR(9020) then *STR(); ID)

*CONVERSION
ID=F_ACCOUNT_MSTR_CONV.xls!CONVERSION
DT_COSTELEMENTGROUP=F_ACCOUNT_MSTR_CONV.xls!DT_ACCTGRP
DT_COSTELEMENT=F_ACCOUNT_MSTR_CONV.xls!DT_COSTELEMENT

Conversion file at present :

CONVERSION:
*IF(%external%=A_9020* then js:%external%.replace(/^(A_9020)?(.+)$/, "A_$2"))
DT_ACCGRP:
*IF(%external%=9020* then js:%external%.replace(/^(9020)?(.+)$/, "$2"))

former_member186338
Active Contributor
0 Kudos

Sorry, but your question is absolutely not clear!

Please spend some time to clearly explain what do you want to achieve!

You are loading ACCOUNT master data?

You want to exclude what?

...

Former Member
0 Kudos

Hi Vadim,

I wanted to exclude blank ID which is in BW account master data while loading in to BPC. I have tried A_ *SKIP in conversion file and also created a dummy member

ID=*IF(ID=*STR() THEN *STR(A_TEST);*STR(A_) + ID) then tried A_TEST *SKIP but still getting warning.

any sugesions to skip this balnk member??

Thanks,

Satish

former_member186338
Active Contributor
0 Kudos

Sorry, still not clear!

You are loading ACCOUNT master data! Do you want to skip accounts with empty COSTELMNT or???

Former Member
0 Kudos

i am loading COSTELMNT master data in to BPC and I wanted to skip blank member which is in BW.

Former Member
0 Kudos

BW 0COSTELEMNT master data mapped to BPC F_ACCOUNT

former_member186338
Active Contributor
0 Kudos

Ok, ID is ID of COSTELMNT, how it can be empty for master data???

JohnL
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Satish,

Please use this primary tag going forward:

SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All ,

I have updated transformation files *mapping section (Last two lines).

It skips the blank ID, no warnings at all and I have double checked the master data in BPC and it is working fine now.

Could you please explain this code for me?

Thanks,

Satish

*MAPPING (New)


ID=*STR(A_)+ID
ACCTYPE=*NEWCOL(EXP)
BW_A_ID=*STR(ID)
CO_AREA=*STR(9020)

DT_COSTELEMENTGROUP=*IF(ID=*STR( ) then *STR( ); ID(1:4)=*STR(9020) then ID; *STR( ))
DT_COSTELEMENT=*IF(ID=*STR( ) then *STR( ); ID(1:4)=*STR(9020) then *STR(); ID)

Old *MAPPING (Old)


ID=*STR(A_)+ID
ACCTYPE=*NEWCOL(EXP)
BW_A_ID=*STR(ID)
CO_AREA=*STR(9020)
DT_COSTELEMENTGROUP=*IF(ID(1:4)=*STR(9020) then ID; *STR())
DT_COSTELEMENT=*IF(ID(1:4)=*STR(9020) then *STR(); ID)

Answers (6)

Answers (6)

former_member186338
Active Contributor
0 Kudos

Try conversion file with JavaScript

In transformation use:

DT_COSTELEMENTGROUP=ID

In the conversion use:

* js:/^9020/.test(%external%.toString()) ? %external% : ''

former_member186338
Active Contributor
0 Kudos

But not sure that conversion file can generate empty values...

former_member186338
Active Contributor
former_member186338
Active Contributor
0 Kudos

Explanation:

In the original line:

DT_COSTELEMENT=*IF(ID(1:4)=*STR(9020) then *STR(); ID)

You are trying to get first 4 characters from ID and with empty ID it will generate error!

With

DT_COSTELEMENTGROUP=*IF(ID=*STR( ) then *STR( ); ID(1:4)=*STR(9020) then ID; *STR( ))

you first check for empty and only after - get first characters.

By the way it will still generate error if you get the ID with 1,2 or 3 characters

Former Member
0 Kudos

Thanks for your time Vadim,

Luckily we have all the master data with 4 characters 🙂
As per your suggest I have created 3 character master data (ID=123) in BW and loaded then getting below warning message,
It should be an issue on going so is there any permanent solution for this?

Regards,
Satish

Former Member
0 Kudos

Hi JP,

I have tried A_ *SKIP and also created a dummy member

ID=*IF(ID=*STR() THEN *STR(A_TEST);*STR(A_) + ID) then tried A_TEST *SKIP but still getting warning.

Many thanks,
Satish

Former Member
0 Kudos

Can you show the warning please? What is it that you are trying to achieve in javascript? logic?

JP

Former Member
0 Kudos

OR..in conversion file try with this

A_ *SKIP

Former Member
0 Kudos

Hi Satish,

But why do you want to use java script for ignoring blank??? why not through transformation?

Regards,

JP

Former Member
0 Kudos

Rejecting blank record shows as above