cancel
Showing results for 
Search instead for 
Did you mean: 

Creating several records pr. row in a layout

Former Member
0 Kudos

We are building a BPS solution on an existing BW implementation. In the BPS solution the users will enter adjustments to the data already existing in a BW cube. The adjustments will be stored in a new transactional cube, while keeping the old BW cube.

Our problem is this: We will need to create several records for each row in the layout(s). For example, all entered records should automatically be reversed in the next period.

How can we create additional records? Is an Exit function (ABAP) the only option?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

By "automatically reversed" I mean that the amount (the most important, but not the only, key figure) will be negated. That is not possible with a copy function.

But the problem is even more complicated. 'Activity' is a characteristic. Based on an entered record we will need to create one or more derived records with a different activity, but with the activity will be based on the activity of the original record. In some cases we will also need to make calculations on the amount of such derived records.

And both the original record and the derived records will need to be reversed in the next period, i.e. negated amount and period change, which will again double the number of records to write per row in the layout.

The copy function can't both change Activity AND use the Activity of the original record as a condition.

But if we find a way to use the copy function, we would still need to use a FOX formula for changing the amounts (and also some other key figures as well) when necessary. Planning sequences are linear, so I assume it could be difficult for a planning function to execute for several records derived in an earlier step in the same planning sequence.

We have decided to look deeper into the FOX programming language and see if it's flexible enough to solve all of these tasks.

Former Member
0 Kudos

Christoffer,

I had the same requirement and used fox code to resolve it. New entries are added in the current period, and reversed in the next one.

We use the 'revtype' to tag the type of adjustment (original entry, or automatically-created entry). I think it corresponds to your 'Activity' characteristic. Activity would not be in the list of fields to be changed.

The user runs this in a planning function at end of month (or could be everytime they save, whatever.)

Let me know if it works for you.

Aaron

DATA LS_ZDOADJIN2 TYPE ZDOADJIN2.

DATA CUR_PER TYPE 0FISCPER.

DATA LS_NEWPER TYPE 0FISCPER.

DATA REVTYPE TYPE ZDOADJIN2.

REVTYPE = '701'.

FOREACH LS_ZDOADJIN2.

IF LS_ZDOADJIN2 = '200' OR

LS_ZDOADJIN2 = '101'.

CUR_PER = VARV('ZLSCURFP').

  • Create new entries in next period.

LS_NEWPER = TMVL(CUR_PER,1).

*Set adj ind to 701 for posting in new period.

{LS_NEWPER, REVTYPE} = {CUR_PER, LS_ZDOADJIN2} * -1.

ENDIF.

ENDFOR.

Former Member
0 Kudos

We solved this using a FOX-formula in a similar way as you did:

DATA CURRPER TYPE 0FISCPER3.

DATA NEXTPER TYPE 0FISCPER3.

DATA CURRYEAR TYPE 0FISCYEAR.

DATA NEXTYEAR TYPE 0FISCYEAR.

    • Get current period from the variable PERIOD

    • and calculate the next period

CURRPER = VARV('PERIOD').

CURRYEAR = VARV('YEAR').

IF CURRPER >= '012'.

NEXTPER = '001'.

NEXTYEAR = TMVL(CURRYEAR,1).

ELSE.

NEXTPER = TMVL(CURRPER,1).

NEXTYEAR = CURRYEAR.

ENDIF.

  • Create record that will reverse the adjustments

  • in the next period

{DIPVALUE,NEXTPER,NEXTYEAR,R} = (-1)*

{DIPVALUE,CURRPER,CURRYEAR,N}.

Former Member
0 Kudos

Hallo

I want to also add that you could use exit function, for example to copy data. but as mentioned yuo have lots of standard function like copy, reposting, forecast, distribution and so on and also have function type exit for example to copy data.

as far as i know usually performance are better than standard copy function

Mike

Former Member
0 Kudos

Christoffer,

It is the standard funcitonality of BPS. You don't need to go for ABAP.

Create a copy planning function that copies from current period to next period.

All the records of the current period will be created into next period.

But, what do u mean by "Automatically be reversed"?

If you don't want to create new set of records, rather point the current period records to next period, simply use REPOST planning function that changes the current period to next period.

hope it helps.