cancel
Showing results for 
Search instead for 
Did you mean: 

Comments save sequence

Former Member
0 Kudos

Environment: SAP EPM 10.0  NW

We submit  dimension member information as comment from workbook along with data, which will be used in the custom logic BADI to do further processing on that data.

We trigger the custom logic BADI in the default logic to process incoming data on the fly as they get submitted.

Even when data and comments get submitted , BADI doesn't see the latest comment when queried for processing from comment table.

Looks like the comment is not saved by the time default logic is triggered.  Is our understanding correct, if so, how to read the in flight comment.

Appreciate your help and suggestions

~Dilkins

Accepted Solutions (0)

Answers (2)

Answers (2)

lucas_costa3
Active Contributor
0 Kudos

Hi Andrew,

If I remember well comments are saved before the custom logic badi code is executed.

What I believe is happening in your case is that you may have more than one entry for the same region, and your select is getting the first one (Oldest comment). Remember that comments are saved with a timestamp, which means it will keep all comments entered for that region. In that case, you need to get last timestamp. Therefore, select from the commentary table and then SORT by TIMESTAMP DESCENDING...


Cheers,

Lucas

former_member186338
Active Contributor
0 Kudos

Hi Lucas,

"If I remember well comments are saved before the custom logic badi code is executed." - after!

Vadim

lucas_costa3
Active Contributor
0 Kudos

You're right... I did not remember well.

But I knew I had achieve this in the past.. Looking at my stuff I found what I did to workaround this. I used a macro to "save twice the data" without the user notice... Andrew, you'll need to save a different value so I recommend using a "dummy" account to do this.

Private Sub saveData()

    EPM.SetUserOption "HideSubmitWarning", True

    EPM.SaveWorksheetData

   

    Range("L58").Value = Range("L58").Value + 1

   

    EPM.SetUserOption "HideSubmitWarning", False

    EPM.SaveAndRefreshWorksheetData

   

End Sub

former_member186338
Active Contributor
0 Kudos

Some issues with this approach:

For the second save you don't have a scope of original save.

Timestamp has to be compared with current time with some tolerance... (unpredictable!)

...

lucas_costa3
Active Contributor
0 Kudos

Nope,

If he saves it using the same region (Entity, Categ, Time...) only replacing account by the dummy account...

About the timestamp I did not get your point. Timestamp will be used only to get the latest version of comment within a data region...

When I used this approach, I used comments to update dimension members description through excel. So the users would type the description - that would be saved as comment and in the badi I'd update the member description.

If the point here is to use comments to send dimension properties to use in the calculation, there are better and more efficient ways using ABAP.

former_member186338
Active Contributor
0 Kudos

"I used comments to update dimension members description through excel" - for this specific case my comment is not relevant.

But if you want to use comments to change calculation logic - then it's an issue!

former_member186338
Active Contributor
0 Kudos

P.S. even in case "update dimension members description"

How to determine the list of members to update descriptions?

lucas_costa3
Active Contributor
0 Kudos

How come is an issue? Once in ABAP with the info from IT_CV you can select whatever you want...

It's not the best world but it is totally feasible and I have done it before.

lucas_costa3
Active Contributor
0 Kudos

"Once in ABAP with the info from IT_CV you can select whatever you want..."

former_member186338
Active Contributor
0 Kudos

IT_CV is not related to the comments saved in previous save

lucas_costa3
Active Contributor
0 Kudos

Of course not, and don't need to be..

As I said, "Use a dummy account"..

The dummy account is the trigger having all filters necessary to retrieve the rest of the information. The accounts with the comments are the accounts used in the calculation...

> Save the data and comments

> Skip the calculation (badi) if not trigger acc

> Save the trigger (dummy acc)

> Retrieve the data for the accounts needed in the calculation

> Retrieve comments from commentary table

> Calculate

former_member186338
Active Contributor
0 Kudos

Sorry but incorrect.

Sample:

You have report with 100 rows of Products with EPMSaveComment for each row.

User changed comments for 5 rows and launched VBA Save procedure.

5 comments will be saved.

Then dummy account for some single row will be incremented and saved.

BADI will not know the 5 Products to be updated.

lucas_costa3
Active Contributor
0 Kudos

Sorry but can be easily handled with vba as well... putting the dummy account in the expansion and using local members to identify the changed products.

After refresh -> copy values local members

After first save -> check which products are different then before

                       -> save against dummy to perform calculation

BADI "will know the 5 products".

Again, not ideal but possible. Things get more complicated if the input form has a big expansion.

former_member186338
Active Contributor
0 Kudos

Absolutely "not ideal" Better then nothing

But BPC code enhancement to add code after comment save is also bad.

lucas_costa3
Active Contributor
0 Kudos

Well, ideal would have the comment saved before, or even a way to capture in the custom logic badi, but... sometimes we need to come up with this "bad" ideas... c'est la vie.

former_member186338
Active Contributor
0 Kudos

"Looks like the comment is not saved by the time default logic is triggered.  Is our understanding correct, if so, how to read the in flight comment."

It's correct and there is no badi to trigger when comment is saved.

The only way is to modify BPC code but I don't like this idea

P.S. And this question was discussed already in this forum...

Former Member
0 Kudos

Vadim,

Thanks for your clarification

~Dilkins