cancel
Showing results for 
Search instead for 
Did you mean: 

MetaData about a Particular InfoPackage

Former Member
0 Kudos

I have 5 spreadsheets that I need to upload to a cube. The spreadsheets are identical except for the key figure, in one case it is an amount, another case it is a unit, etc.

If I have one InfoSource/DataSource, and 5 Infopackages for those, can I, through some sort of query of meta data in an transfer routine, determine which Infopackage is running, and thusly assign the key figure the correct value type?

In other words, if the InfoPackage being run is ZBUDGET_AMOUNT, assign '0' to 0VALTYPE, if ZBUDGET_UNIT, assign '1' to 0VALTYPE.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jerry,

Another two methods.

Suppose you supply in your flat file some chars and one field for a KF.

1. Add to comm structure additional field which will be fed by a flag (0 - , 1 - etc.).

2. If description (text) of the infopackage is unique and hardcoded, then using the following scheme:

In the start routine of the TRs insert the following logic.

Select single LOGDPID from RSLDTDONE where RNR = G_S_MINFO_REQUNR into XXX

(comment: instead of RSLDTDONE table RSREQDONE table may be used).

Select single TEXT from RSLDPIOT where LOGDPID = XXX into AAA.

AAA contains the text of the infopackage.

In both cases you can analize further either a flag or a text and build the logic needed, i.e.

if flag = 0 (or text = 'AAA') then

( MOVE TO DATAPAK-CHAR1

MOVE 0 TO DATAPAK-CHAR2

MOVE '' TO DATAPAK-CHAR3

elseif flag = 1 (or text = 'BBB')

etc.)

Best regards,

Eugene

Former Member
0 Kudos

I have been trying to avoid messing with the flat files because they are complicated, and I already process them with an update routine and return table where I turn 52 columns for weekly budgets into 52 rows. The structure of the data is sensitive.

I guess I could insert a header row in the file, and then read that, set a global variable, and continue.

Thanks for all the thoughtful responses.

Answers (2)

Answers (2)

Former Member
0 Kudos

Jerry,

<b>METHOD 1</b>

I can suggest a method, not very sophisticated though. I assume that only one of these infopackages is run at any given time.

Table REREQDONE stores the details of all the requests along with the infopackage ID.

Lets say that the IDs of your infopackages are like this.

ZBUDGET_AMOUNT - ZPAK_A1

ZBUDGET_UNIT - ZPAK_U1

You need to hardcode these IDs in your start routine.

In the start routine,

SELECT LOGDPID DATUM UZEIT FROM RSREQDONE

WHERE DATUM = SY-DATUM

and LOGDPID = ZPAK_A1 OR ZPAK_U1.

This will give u all the requests that are loaded today including the one that is running right now.

Reverse SORT them on UZEIT. The first one in the list is the one that should be running now, save this in a global variable.

Now in the transfer routine for 0VALTYPE, assingn the value using a case statement.

<b>SECOND METHOD:</b>

You can modify the files such that the keyfigure is divided into 5 keyfigures.

Like this,

KEYFIG1, KEYFIG2, KEYFIG3, KEYFIG4 and KEYFIG5. Only one of these fields is populated in each file and the remaining KEYFIGs contain null values. (KEYFIG1 is populated in file1, 2 is populated in file2 etc)

In the transfer rules you can say,

BW KeyFigure =KEYFIG1KEYFIG2KEYFIG3KEYFIG4KEYFIG5

and in the routine for value type, you can have a case stament to see which KEYFIG has the non-null value.

Let me know if it works.

Former Member
0 Kudos

Jerry,

Since the underlying data structures are different, this should be done through transfer structures. Create different transfer structures for each data structure.

InfoPacks are freely definable and can be created in any system directly. What happens if someone creates a new InfoPack or deletes one that you are using in the transfer rules?

It is possible to link the request number to the InfoPack through table RSREQDONE.

Cheers

Aneesh