cancel
Showing results for 
Search instead for 
Did you mean: 

Load Product Hierarchy from SAP R3 to SAP BI

Former Member
0 Kudos

Hi Experts,

I have searched a while around in this forum but couldn't find the right answer to my problem. As I am new to SAP BI, I also apologize if my questions don't make sense.

I created the standard ds in R3 for 0PROD_HIER_LPHR_HIER(to load hierarchies) and 0PROD_HIER_TEXT(to load texts).However, i want to make sure that i will not touch any of the customer infoobjects as I am working with z-infoobjects only. Now I have several questions to make sure that im going in the right way.

1. To generate the product hierarchies with their respective text, should I replicate both 0PROD_HIER_LPHR_HIER and 0PROD_HIER_TEXT datasources?

2. Can I install + match (x) copy the 0PROD_HIER, 0PRODH1,0PRODH2, 0PRODH3 and 0PRODH4 and then create 4 Z-infoobjects with a template to this 0PROD_HIER, 0PRODH1,0PRODH2, 0PRODH3 and 0PRODH4? By doing so, will it affect the current customer infoobjects at any way (replacing the standard 0PROD_HIER content with the new copied Z0PROD_HIER content?)  I don't want to change anything in the standard infoobjects (0PROD_HIER, 0PRODH1...), that's why i want to create template Z-infoobjects.

3. If this is not the right way of doing it, could you please suggest me a way to do the loading of Product Hierarchies and their Texts for the ds 0PROD_HIER_LPHR_HIER + 0PROD_HIER_TEXT, without touching or affecting any of the current standard InfoObjects Contents (0PROD_HIER, 0PRODH1.. etc.)? Please .pdf versions at best.

Thank you for your time and consideration.

Best Regards,

Regys M.

Accepted Solutions (1)

Accepted Solutions (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Regys,

Let me try to answer your questions.

Q1. To generate the product hierarchies with their respective text, should I replicate both 0PROD_HIER_LPHR_HIER and 0PROD_HIER_TEXT datasources?

A1. Yes.

Q2. Can I install + match (x) copy the 0PROD_HIER, 0PRODH1,0PRODH2, 0PRODH3 and 0PRODH4 and then create 4 Z-infoobjects with a template to this 0PROD_HIER, 0PRODH1,0PRODH2, 0PRODH3 and 0PRODH4? By doing so, will it affect the current customer infoobjects at any way (replacing the standard 0PROD_HIER content with the new copied Z0PROD_HIER content?)  I don't want to change anything in the standard infoobjects (0PROD_HIER, 0PRODH1...), that's why i want to create template Z-infoobjects.

A2. No, do not install the Business Content InfoObjects as it can overwrite settings of the currently installes InfoObjects. I suggest to create new custom Z-InfoObjects with the respective Business Content InfoObject as a template. Then you can display the Business Content version of the respective InfoObject (e.g. using t/code RSD1) to look for differences between "active" version and "content" version. If any differences exist, then manually apply the changes in your custom Z-InfoObjects.

Q3. If this is not the right way of doing it, could you please suggest me a way to do the loading of Product Hierarchies and their Texts for the ds 0PROD_HIER_LPHR_HIER + 0PROD_HIER_TEXT, without touching or affecting any of the current standard InfoObjects Contents (0PROD_HIER, 0PRODH1.. etc.)? Please .pdf versions at best.

A3. Please see also A2. Please note that for the hierarchy, the Business Content InfoObjects are "embedded" in the DataSource. You can look at the PSA data to see for which fields it is the case. I strongly recommend to use 7.0 data staging technology (available for hierarchies as of release 7.3). You can write a small ABAP routine to replace the Business Content InfoObjects by the custom Z-InfoObjects. You can refer to discussion for a detailed approach.

Best regards,

Sander

Former Member
0 Kudos

Hi Sander van Willigen,

thank you very much for the reply. The thing is that I created a ZIOPROD_H(similar to 0PROD_HIER) and then 4 other Z-infoobjects(similar to 0PRODH1..etc) as external characteristics of ZIOPROD_H.

Meanwhile, the 0PRODH1,2 etc are not installed yet from the business content, but the 0PROD_HIER was already installed. After making the transformations everything mapped automatically to the 0PROD_HIER_LPRH_HIER ds but when I load I get the following error: Please see the screenshot below.

Do you think that I should do the ABAP routine when mapping IOBJNM to 0H_IOBJNM? If so could you please let me know the ABAP routine for this mapping. Also, do I need to change any mappings beside doing the above mentioned ABAP routine.

Thank you in advance for your time and consideration.

Best Regards,

Regys M

sander_vanwilligen
Active Contributor
0 Kudos

Hi Regys,

When it comes to hierarchies, life has become easier with the "new" hierarchy framework as introduced in BW release 7.3. You can use 7.0 data staging technology with transformations and DTPs. In the transformation there are some new hierarchy rule types and on top of that, you can even write routines.

Most of the mapping is done automatically. If you have a look at your PSA data, then you will normally see what you have to do and whether or not to write a tiny routine (e.g. to map to another InfoObject).

There are basically 2 cases to determine the Hierarchy Characteristics:

  • FIELDNAME is available in hierarchy structure (e.g. G/L account number);
  • Only IOBJNM is available in hierarchy structure (e.g. Material Hierarchy).

In the first case, you can use the transformation rule type Derive Hierarchy Characteristic. In the second case, you can use the transformation rule type Hierarchy Split for NODENAME and a simple ABAP coding for the InfoObject. You have to program any replacement of BCT InfoObjects (e.g. 0PROD_HIER by ZPRODHIER). You can check the PSA data of segment Hierarchy Nodes to determine all BCT InfoObjects to be replaced.

More information can be found in the following blog The new SAP NetWeaver BW 7.30 hierarchy framework. Also you can refer to SAP Help:

In your case you have to write an ABAP routine in segment Hierarchy Structure for IOBJNM to H_IOBJNM. It should look similar like this:


CASE source_fields_3-iobjnm.

  WHEN 'HIER_NODE'.

    result = 'HIER_NODE'.

  WHEN '0PROD_HIER'.

    result = 'ZPRODHIER'.

  WHEN '0PRODH1'.

    result = 'ZPRODH1'.

  WHEN '0PRODH2'.

    result = 'ZPRODH2'.

  WHEN '0PRODH3'.

    result = 'ZPRODH3'.

  WHEN '0PRODH4'.

    result = 'ZPRODH4'.

  WHEN OTHERS.

    "should not be possible

ENDCASE.

Furthermore, I think that the Hierarchy Split should also be applied to the InfoObject ZPRODHIER. This rule is now missing. It should be similar to the other rules, e.g. ZPRODH1.

Best regards,

Sander

Former Member
0 Kudos

HI Sander,

thank you very much for all the help. I will try this solution on Monday and let you know if that will work out.

Thanks again.

Best Regards,

Regys M.

Former Member
0 Kudos

Hi Sander,

I actually tried as you suggested me but I dont know why it is still not working. Please see the screenshot below.

Could you please let me know if I need another routine to solve this issue? The routine you suggested works fine. No errors there. At the 0LOGSYS at hierarchy header, I set it as constant and left the value empty, as it will take the value of the source system when DTP executes. So there are no errors at the transformation according to the transformation check. The PSA already has exctracted successfully the data from the source system. I already deleted the previous requests and reloaded them but still not working.

Thanks in advance for your time.

Best Regards,

Regys M.

sander_vanwilligen
Active Contributor
0 Kudos

Hi Regys,

The InfoObjects used in the routine are not correct. Please adjust all custom InfoObjects to match exactly the technical names you used (e.g. Z0PRODH1 instead of ZPRODH1). Besides that, please correct also '0HIER_NODE' (by mistake I forgot the 0).

Best regards,

Sander

Former Member
0 Kudos

Hi Sander,

thank you very much for the reply. I also didn't realised them. I will try it and hopefully this time will work fine. Thank you very much!

Best Regards,

Regys M.

Answers (0)