Skip to Content
0

Need a java script to exclude this blank ID

Oct 19, 2016 at 10:18 AM

239

avatar image

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"))

uarwd.png (10.8 kB)
10 |10000 characters needed characters left characters exceeded

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?

...

0

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

0

Sorry, still not clear!

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

0

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

7lvy3.png (10.8 kB)
0

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

0

BW 0COSTELEMNT master data mapped to BPC F_ACCOUNT

0

Hi Satish,

Please use this primary tag going forward:

SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver

Thanks,

0
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Satish Kumar Oct 21, 2016 at 12:37 PM
0

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)

Share
10 |10000 characters needed characters left characters exceeded
Satish Kumar Oct 19, 2016 at 10:20 AM
0

Rejecting blank record shows as above


pisyc.png (10.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
Priyanka Jagtap Oct 19, 2016 at 10:37 AM
0

Hi Satish,

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

Regards,

JP

Share
10 |10000 characters needed characters left characters exceeded
Priyanka Jagtap Oct 19, 2016 at 11:05 AM
0

OR..in conversion file try with this

A_ *SKIP

Share
10 |10000 characters needed characters left characters exceeded
Satish Kumar Oct 19, 2016 at 01:36 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

JP

0
Vadim Kalinin Oct 21, 2016 at 01:31 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

rkzxs.png (4.7 kB)
0
Vadim Kalinin Oct 21, 2016 at 02:19 PM
0

Try conversion file with JavaScript

In transformation use:

DT_COSTELEMENTGROUP=ID

In the conversion use:

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0
0