cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting leading zeros

Former Member
0 Kudos

Hi Gurus,

I want to remove the leading Zeros from the Customer ID and while transferring the values in BPC, I want to prefix the value (after removing the zeros) with 'CC_'. eg: 000012345 so I want to transfer that as 'C_12345'.

In transformation file, I had done the mapping as

ID=*str(C_)+ID

which works fine, if I dont have to remove the zeros but i want to remove zeros and concatenate "CC_"

Thanks in advance

Ram

Accepted Solutions (1)

Accepted Solutions (1)

former_member190501
Active Contributor
0 Kudos

Hi,

Easiest way is convert your data in BW side if your source is BW

or

Try BADI for [Start/End|http://help.sap.com/saphelp_bpc75_nw/helpdata/en/28/b66863b41f47589b9943f80b63def6/content.htm] routine .

[How to doc..|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50c39fa1-6f95-2d10-2a95-b594de8e1bb7]

hope it helps...

regards,

Raju

Former Member
0 Kudos

Hi Vara,

I am a lay man in ABAP. is there someting we can do in transformation and conversions files.

thanks in advance

Ram

former_member190501
Active Contributor
0 Kudos

Hi,

Can you try as follows in conversion file:

External  Internal 
*              js:parseInt(%external%)

Thanks,

Raju

Edited by: VaraPrasadraju Potturi on Jun 21, 2011 5:39 AM

Former Member
0 Kudos

Hi Vara,

I tried using BADI looking at the How to guide for doing the conversion. I got a dump when i ran the DM Pack.

"The remote Procedure Call failed"

comented out the error maessage part and made <lv_profit_center> to <lv_id>



     SHIFT <lv_id> LEFT DELETING LEADING '0'.
     CONCATENATE 'PC_' <lv_id> INTO <lv_id>.
     
     APPEND <ls_data> TO <lt_data_ex>

regards

Ram

former_member190501
Active Contributor
0 Kudos

Hi,

I hope you are extracting data from BW infocube/DSO. right?

To remove leading zeros write following logic in transformation of respective char:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = SOURCE_FIELDS-<Info object>

IMPORTING

OUTPUT = RESULT.

Save Transformation and reload the data. After data load you can find the data with out leading zeros.

In BPC transformation just maintain ID = *STR(C_)+<Info object>

hope it works...

regards,

Raju

Former Member
0 Kudos

Hi raju,

I am doing a master data load from BW Info object into BPC dim.

I am getting the error at


ASSIGN lo_dataref->* TO <lt_data_ex>.

thanks

Ram

former_member190501
Active Contributor
0 Kudos

Hi Ram,

I think its better to check with ABAPer to correct syntax errors in BADI.

Regards,

Raju

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ram,

Try this.

In Transformation file,

ID=*str(CC_~)+ID

It will concatenate your prefix, 'CC_', with an additional symbol '~', which is later used while removing the leading zeros in Conversion File.

Conversion File:

js=%extenal%.split('~0000').join('').split('~000').join('').split('~00').join('').split('~0').join('').split('~'),join('')

The above code in Conversion File, it will remove the leading zeros anywhere the count of zeros is in between 0 to 4. You can add as many number of Zeros that you want. So, if your ID is prefixing 000 and other ID is prefixing 00, it will remove the respective zeros, without removing the main concatenation or part of the ID.

Hope this solution helps.

Thanks,

Abhishek

Former Member
0 Kudos

Hi Gurus,

Really appreciate your quick replies.

after setting up the BADI and calling it from the transformation file, DM package is sucessfull but no records are being loaded.

Can any one please let me know how to debug the BADI.

This is the what I am getting in the status log.


No 1 Round:
Start routine is called in convert
Record count: 3
Accept count: 0
Reject count: 0
Skip count: 0
Submit count: 0
Application: TEST Package status: SUCCESS

Thanks in advance

Ram

former_member190501
Active Contributor
0 Kudos

Hi,

Try to debug your start routine BADI as explained at [blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/18300] [original link is broken] [original link is broken] [original link is broken];

Check whether internal table consist data or not after your logic execution.

Regards,

Raju