cancel
Showing results for 
Search instead for 
Did you mean: 

Assigments for Hierarchy table

Former Member
0 Kudos

Dear MDM Experts

I would like to ask you for help with Assignments. I have to prepare assignments for hierarchy table . That gives me some problems.

Our hierarchy looks like that:

- Division, Division Name

- PL, Product Linie

- PCL, Product Class

- Stat No, Description

Example:

- Division, Division Name

- 01, Products_Group1

- 077, Products_Group2

- 09991, product_name

It is important for us to have assignment there we will have only number, in above case 0107709991. That number must have 10 digits in all.

How can I have such expression?

Thank you in advance.

BR

Rafal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

From the text you pasted, I can think of the following. If solution is not as per your requirement, please elaborate a bit more -

Each level should have a defined length for the code. Like Level 1 should be of length 2, Level 2 should be of length 3 etc. based on your requirement, so the total length of concatenated code is 10.

Add three fields for each record in the hierarchy table - Level, New Code, Concat Code

At each level of the hierarchy, you need to maintain a field called Level which stores the level value. Like 1 for the first level, 2 for the second and so on. Also at each level, maintain a additional field in which you can append additional zeros in beginning i.e. New Code. In Concat code, concatenate the New code from its upper level with the current level new code.

1) Based on the Level value, like for level 1 run an assignment and append "0" at the begining if the length of the code is less than 2.

For eg -

IF LEVEL = 1 AND LENGTH(code)=1 THEN CONCAT("0",code)

IF LEVEL = 1 AND LENGTH(code)=0 THEN CONCAT("00",code)

Similarly based on the code length at each level, run the assignment.

2) Another assignment should be used to concatenate the New code from upper level to the current level. For eg -

Concat Code = Concatenate(New Code, Hierarchy.parent.Concat Code)

3) At the lowest level, you should get the 10 digit concatenated code for the lowest level.

Make sure you run assignments from lowest level first and then to the next level. This needs to be run manually.

Thanks,

Shambhu.

Former Member
0 Kudos

Hi Shambhu

Thank you for your replay. I can see there s an possibility for that. Definatelly is not easy

Due to the fact that we are sending data on regular basis to SAP system we should have our assigment working automatically with no user action.

I think solution you proposed is nice, but I will try to provide few more example,. You can se how data looks like.

ex:

-| DN,Division Name1

---| 01,Product Line1

-


| 001, Product Class1

-


| 01001, Stat Number1

-


| 01002, Stat Number2

-


| 01003, Stat Number3

-| DA, Division Name2

---| 02,Product Line2

-


| 002, Product Class2

-


| 02001, Stat Number4

-


| 02002, Stat Number5

-


| 02003, Stat Number6

-| DB, Division Name3

---| 03,Product Line3

-


| 003, Product Class3

-


| 03001, Stat Number7

-


| 03002, Stat Number8

-


| 03003, Stat Number9

In that case we should have numbers from assigments:

0100101001

0100101002

0100101003

0200202004

0200202005

0200202006

0300303007

0300303008

0300303009

As you can see there are always for Product Line 2 digits for Product class 3 digits and for Stat Number always 5 digits. That will always give us 10 digits when we sum it. Therefore we do not need to secure if we miss 0 in front.

I hope that explain better the situation.If something is missing please let me know. I will do my best to explain.

Thank you very much in advance.

BR

Rafal

Edited by: Rafal Paczynski on Sep 6, 2011 9:37 AM

Edited by: Rafal Paczynski on Sep 6, 2011 9:39 AM

Edited by: Rafal Paczynski on Sep 6, 2011 9:43 AM

Former Member
0 Kudos

Hi,

In that case, try to merge the different levels into the same field during syndication or ask your ECC team to merge it while importing.

Refer this document for syndication of hierarchy fields into a flat file format - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f3057f-a2f1-2a10-d091-ffb7fd359...

Thanks,

Shambhu.

Former Member
0 Kudos

Hej Shambhu

Thank you for help. I think that open some options. I just tried that, results are really interesting. There is one think, I would like to see if that is possible in Syndicator.

Our results are (from txt file):

01...... 001..... 01001

01...... 001..... 01002

01...... 001..... 01003

(above dots are only because I can not have few spaces in row in that post, so they do not exist in syndicated file)

Is any change in MDM Syndicator to join them ? so the numbers are:

0100101001

0100101002

0100101003

If not I think maybe PI can join them.

BR

Rafal

Edited by: Rafal Paczynski on Sep 7, 2011 10:19 AM

Edited by: Rafal Paczynski on Sep 7, 2011 10:19 AM

Edited by: Rafal Paczynski on Sep 7, 2011 10:20 AM

Edited by: Rafal Paczynski on Sep 7, 2011 10:20 AM

Edited by: Rafal Paczynski on Sep 7, 2011 10:20 AM

Former Member
0 Kudos

Hi,

Go thru the Syndicator Reference guide - Custom Items -

http://help.sap.com/saphelp_mdm550/helpdata/en/ff/37e4c6857449388ddb6c77f160ac4f/frameset.htm

Also check this SDN Thread -

Thanks,

Shambhu.

Former Member
0 Kudos

Hi Rafal,

Yes it is possible to concatenate values of hierarchy during syndication.

Please set below properties in for your destination field in "Destination Items" tab of syndicator:-

Hierarchy Style :- Full Pathname

Path Delimiter:- (Remove Default value, keep this value blank)

Normalization:- Standard

Now map the Hierarchy Table name to the Destination field & see the result.

Hope this will solve ur problem

Thanks,

Mahi

Former Member
0 Kudos

Hi Rafal,

Our results are (from txt file):

01...... 001..... 01001

Is any change in MDM Syndicator to join them ? so the numbers are:

0100101001

In Syndicator, I would suggest in order to remove spaces, Go to Destination Items tab->Select this specific destination field for which you have output value as 01...... 001..... 01001, now in properties set property Normalization = Standard which would automatically taken care of all special chars including spaces. So, in this way i hope you would get rid of unnecessarily spaces and would get desired result.

For more details, please refer Syndicator reference guide, page 110/186 as given below:

http://help.sap.com/saphelp_nwmdm71/helpdata/en/4b/711def8a722593e10000000a42189b/MDMSyndicator71.pd...

Kindly revert with result.

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi

Thank you for suggestions. I have been trying them. All works as you described. Small problem is that we are also mapping text. In that case after removing spaces I have result. Example:

0102500101ABC123456DEF

And I must have:

0102500101 ABC 123456 DEF

So I do not know how to remove spaces only in joining 3 tables and other spaces can stay as there are needed to distinguish data send to BW.

Right now I am trying to use assigments and workflows but for some reason I can not have first two numbers example 01.

Do you have any ide how to remove spase only from 3 numbers and have a tab (as that is by default for other fields) ?

BR

Rafal

Former Member
0 Kudos

Hi Rafal,

Example:

0102500101ABC123456DEF

And I must have:

0102500101 ABC 123456 DEF

I am afraid to say may be this is not possible using MDM syndicator but still you can try some other properties in Destination Items like padding etc OR can try using Custom Item tab but I am not quite sure, you need to check on this.

So I do not know how to remove spaces only in joining 3 tables and other spaces can stay as there are needed to distinguish data send to BW.

How are you sending data to BW, using PI ? If you are using SAP PI then you can easily achieve it in PI by setting User Defined Function where you can append and prepend space character with alphabet. There are even more ways to achieve it in PI.

If you are not using PI, even in BW (Transformation), you can check is there any alternative for this in Transformation Mapping or not else can write some Abap code in Start Routine so that during reporting you would get desired result. But I would recommend if you are using PI, it is the best option to use for such cases.

Hope it helps..

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi Saini

I think we have found solution. Is exactly as yourecommend. We will use PI to join 3 first rows. As far as I am concern we cn use xml file for that.

Thanks all of you for help.

BR

Rafal

Answers (0)