abap.

SAP BW F4 BAdI to restrict hierarchy nodes

In our current project we had to deal with the requirement that the enduser only want to show a certain node of a hierarchy to filter. So we used the F4 restriction from the transaction spro. You find the entry under Business Warehouse >> Enhancements >> BAdI: Restricting the Value Help in the Variables Screen. We implemented it in the method GET_RESTRICTION_NODE.

 

At this time I had only experience with the method GET_RESTRICTION_FLAT and searched for implementation examples. I found a wiki entry on scn. In our case we had bookable nodes so we implemented it like this to get these node and all children of it.

 

l_s_node-nodename = 'NODE1'.

l_s_node-niobnjm      = 'ZZ_IO'.

Append l_s_node to c_t_node.

 

But it didn't work out. The debugging showed no error, but the restriction always showed the complete hierarchy. After a little digging we found our mistake, it have to look like the follwing:

 

l_s_node-nodename = 'LEAF1'.

Append l_s_node to c_t_node.

l_s_node-nodename = 'LEAF2'.

Append l_s_node to c_t_node.

 

And so on for all leafs. So we had to add all leafs and not the nodes. I didn't found any good explanation so here is the short article about it. Thanks to my collegue who had the problem.

Read More 0 Comments

Customer exit variable to hide hierachy node

In my current project we have the hide a position in a hierarchy, because it is a departmental requirement. The hierarchy is used by many departments so we cannot change it and we also don't want to have the same hierarchy two times (except for the one position). So we first excluded the position in the query.

Read More 0 Comments

SAP BW DTP Filter with Routine

In my current project I have to filter data with a lot of logic. So I build some ABAP routines in a DTP filter to receive the necessary data. First you have to open the DataTransferProcess (DTP) in change mode and select the Filter button on the Extraction tab.

Read More 4 Comments

SAP BW Decode String during Import

In my current project I have a file to import, which only delivers me a string with a length of 1000. I also get a description what is in this file. Like the following points:

  • Customer from 1 to 10
  • City from 11 to 50

The file looks like: 0000123456London............................ So I have a file and a description how to decode this file. Now I need to find a way to separate this information into InfoObjects. I build a Z-Table which contains the decode information.

Read More 0 Comments

SAP BW Create own reversal entry

Lately, all my posts started with "In my current project", so now something else, even if it was developed in the current project. The problem we are facing with is that we get a data extraction which deliver us only the new data records, not the reverse data record.

Read More 0 Comments

SAP BW: Keyfigure to Account Model

In my current project we have a lots of source systems which delivers our data in a key figure model. In a normal case is this not a problem. But we need the values of the key figures in a hierarchy. So there are two ways to realize it. First way would be we build a structure with restricted key figures and get our hierarchy. Here is the problem, the customer will need different queries to realize his needs. If there is a change, we need to adjust different queries (each has a light different hierarchy) and the maintainace is immense.

Read More 0 Comments

SAP BW Use Pattern in Variable with Customer Exit

In my current project I created with a collegue a really cool function to analyze a string with 1333 characters. We are using a BW 7.4 SP 17 on HANA. First we have to build an Advanced DataStoreObject with a Field which has a length of 1333. For further understanding, we call the field Field_1333. As data type I used SSTRING.

Read More 0 Comments

SAP BW ABAP remove symbols

From time to time it happens that the source system delivers special characters and the Business Warehouse system can not handle it. So the loading process may be crashed.

 

One solution is the following ABAP code:

 

DATA:

zeichen(1) TYPE c,

muster(2) TYPE c,

field TYPE c LENGTH 000060.

field = SOURCE_FIELDS-YYSTREET.

 

DO.

IF field CO

' !"%&()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜßabcdefg' & & 'hijklmnopqrstuvwxyzäöü '.

EXIT.

ELSE.

zeichen = field+sy-fdpos(1).

muster+0(1) = zeichen.

muster+1(1) = space.

TRANSLATE field USING muster.

ENDIF.

ENDDO.

RESULT = field.

Read More 0 Comments