cancel
Showing results for 
Search instead for 
Did you mean: 

BPC 10: How to read the status of package

gorka_iborurea
Explorer
0 Kudos

Hi gurus,

I am in the following scenario. We have to load information (Master Data and Transaction Data) using differents package from the datamanager. We want to make a report with all the status of those packages. (name of the run package and the status). So I need to know:

     - if there is any table in BW which store the status of the logs. So we can make an ABAP program that give us all package status.

     - if I can make a report in BPC Excel for giving this information.

We are working with "very" final users, so we don't want they to go to datamanager and push view status. We just want a report to see the status, and it can be done in BW (with ABAP) or in a BPC report in Excel.

Thanks in advice.

Gorka I.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gorika,

You can see all the logs in SLG1. from there you can fetch the log and can show it as a report

Former Member
0 Kudos

Hello Krishna,

Could you please give more details on how to fetch the log from SLG1 and show it as a report.

Regards,

Shelly

former_member186338
Active Contributor
0 Kudos

Hi Shelly,

Not sure what log you are looking for, but please read:

Vadim

Answers (4)

Answers (4)

Former Member
0 Kudos

I was unable to find the solution, but maybe e-mail for user, who run the package will be an OK solution

former_member186338
Active Contributor
0 Kudos

Sorry, but what was "I was unable to find the solution" related to?

Former Member
0 Kudos

Hello, Vadim.

I mean that, i was looking for solution (as Gorka), which let me cover the scenario "click button to start package and receive msgbox when it will be finished". "One click for all".

Implied solution for receiving package status was with some help of Z dev and UJA_STATUS table. - use EPMCommentPartialContext(""TEST_CUBE"",""T_01"") - and receive "0"(at least one package not finished from current user) or "1"(all packages from current user are finished").By triggering it in VBA each 5 second trying to catch "end package status". But it works, only if we refresh this exact cell with this formula, and not from VBA, because not any VBA method exist for retrieving comment's values and "Evaluate("EPMCommentPartialContext(""TEST_CUBE"",""T_01"")")" doesn't perform actual query for backend.

former_member186338
Active Contributor
0 Kudos

In theory you can do the following:

1. Using VBA save some data to some dummy combination of members.

2. In write back badi intercept this saving

3. From write back badi - launch DM package (depending on value saved or...)

4. Wait for DM to finish looking on UJA_STATUS

5. Generate error message in write back with information about DM status

6. User will see message box with status info.

But it's too complex to my mind!

Vadim

Former Member
0 Kudos

Hello, Vadim.

Seems to be very complicated for this task, agree with you)

Former Member
0 Kudos

Hi Gorka,

You can use the table named UJD_STATUS which store all the status. There is a field called status which uses standard numbers to represent the status like 0-Running, 1-Success, etc.,

Leonardo,

You can achieve this using Macro. You can use the below thread to trigger the package using Button.

http://scn.sap.com/message/13505107

You can use the MNU commands to refresh the sheet in macro itself. Here  is the list of MNU commands:

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/f7/715647fa774763827084cd28ef3aff/content.htm

Thanks,

Suresh

kleos000
Explorer
0 Kudos

Hi Surekhumar.

thank you for your answer.

We have no problem in triggering package execution, our problem is how to understand when the execution is finished in order to automatically trigger a refresh.

Thanks again 

Leonardo

Former Member
0 Kudos

Hi Leonardo,

I have worked with identical requirements, triggering a package from VBA, passing parameters (to create and edit master data on the fly using a custom BAdI), followed by prompting the user to refresh.

I am very confident that it is not possible to gain access to the status of a package, so you can trigger a refresh.

What I suggest is that you use a Macro to trigger the package, combined with a form that displays for the user, saying 'Running Package... please [View Status], then [Refresh Sheet] or [Close].

These [Actions] are linked to other Macros / VBA that perform this task. Unfortunately you are unable to currently refresh data once a DM Package has completed. You will need to give guidance to the user instructing them to do so.

Nick

Former Member
0 Kudos

Hi Leonardo,

Instead of running the package through Macro, Why don't you trigger the package inside the BAdI using ABAP code ->Run package method. So at the end of execution of BAdI it automatically refresh the sheet.

Thanks,

Suresh

kleos000
Explorer
0 Kudos

Hi Nick,

If there is no way to check the status of a package using a Macro, in my opinion this a serious lack. Probably you were lucky enough not to have end users that want not to be obliged to check when a package is ended to manually refresh data, but sadly we are not so lucky.

Thanks

Leonardo

kleos000
Explorer
0 Kudos

Hi Sureshkumar,

please could you explain better what are you meaning?

We run a package from a macro using RunPackage API, this package executes our logic that is in a BAdi. Sadly I was not able to find a way to run Package synchronously so we need to check the package status to perform a refresh of the workook.

Actually our flow is:

Button -> Macro -> Package -> Time Delay -> Refresh

It should be:

Button -> Macro -> Package -> End Package -> Refresh

Thanks again

Leonardo

former_member186338
Active Contributor
0 Kudos

Hi Leonardo,

We use different approach:

If the user is entering data using input schedule, then all calculations are done in default.lgf or write back badi. No buttons and DM packages.

If we want to calculate something significant (for example allocations) - yes, we have some Excel file with buttons to launch DM's and view status. But this file don't have any reports.

B.R. Vadim

Former Member
0 Kudos

Hi,

You cannot currently use a BAdI to refresh a BPC WorkSheet. The functionality does not exist as packages are triggered on the back-end and not directly linked to the EPM Add-in.

Former Member
0 Kudos

I suggest that you use the SAP Idea Space: https://ideas.sap.com/    to request the functionality, or a SAP Customer Message.

I can see the difficulty this lack of functionality is putting you in, but I still don't think that this feature would be very useful with how jobs are triggered in BW as background processes, they simply cannot interface with the EPM Add-in to call functions like refreshing.

I think that there are a few ways to deal with this;

1. Use Warnings and VBA to induce the user to refresh once the package has finished.
It could be 1 minute, it could be 1 hour - they need to check. I don't think a 'Time Delay' is a suitable option as users rely upon this automatic refresh but if the package failed or hasn't completed due to other system  - what happens then?

2. Use Default Logic to call calculations so that saving data will automatically update.

3. Train your users so they are understand how BPC Works, and that if they do a 'Calculation Run', they must refresh their data once it's complete. Especially if you use a VBA button to call this, it's not that hard.

Former Member
0 Kudos

Hi Leonardo,

I will explain the process in detail here:

You are using Excel to submit some amount of data and when you press the save button, that will trigger the BAdI automatically whether it is UJ_CUSTOM_LOGIC or UJR_WRITE_BACK it depends on you.

If that process ends the execution process come back to excel and then you need to run a package from excel using Macro, which will make changes in CUBE data and then you need to refresh the sheet to see the impact right?

Instead of running package through excel you can use some methods inside those BAdI at last steps to trigger the package so it will trigger automatically and it will wait till it complete, once it completed the execution process come back to the Excel and it will automatically refresh the sheet then you can see the impact of package directly. By doing this you don't want to use Macro here.

I implemented this before, there is a method called RUN_PACKAGE in the class CL_UJD_PACKAGE. so you can use that method to trigger the package through the BAdI itself.

Hope it gives you some idea!! Let me know if you still don't understand.

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Hi Suresh,

Your proposal looks a bit strange for me. If you want to do some calculations after data was send from input schedule you have 2 options (sometimes you can combine both):

1. Default.lgf script logic, and some custom logic badi call can also be included in this script.

2. Write back badi.

What is the benefit of calling extra DM package?

B.R. Vadim

Former Member
0 Kudos

Hi Vadim,

Good question. In our case why we implemented is, we have 4 different process and seperate packages. Assume 3 process are depends on category and one is just copying one category to another category.

If the copy BAdI execute we need to run all 3 process again because those are depends on the category. So we need to trigger all 3 packages once this package copied to new category.

Question 1: Why didn't we just include all 3 script logic into 1?

Because user needs the status seperately for all packages and each package are selection dependent so we need to pass that user selection to all 3 package

Question 2: Why did we call the Package through BAdI?

Because these 4 process needs to take place in 2 model at a time. If user run a package in 1 model that will trigger the same package with same user selection in another model. That 1 package will trigger 3 process in both the model.

Hope you understood my case!!!

For Leanordo, I don't know his exact requirement, I am just letting him know that we have this kind of way to achieve this.

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Hi Suresh,

Still, I can't understand you completely.

1. It's possible to do everything in one script. If you have to do something with data in another cube you can use RUNLOGIC badi to launch script in another cube and pass to this script any selection.

2. If we are talking about some user input then only data depending on this input have to be recalculated. Example:

We want to copy user input from one category to another and then multiply the copied value by some other member with target category.

//Will loop all records saved to the cube by input schedule and for CAT1 will copy to CAT2

//We assume that user is unable to post directly to CAT2 (we use write back badi and property to prevent writing to some members with specific property to be saved by input schedule)

*WHEN CATEGORY

*IS CAT1

*REC(EXPRESSION=%VALUE%,CATEGORY=CAT2)

*ENDWHEN

//For example we have 10 records with CAT1->CAT2

//Multiplication by some specific account ACC1 also in CAT2. ACC1 is also blocked for direct input.

*WHEN CATEGORY

*IS CAT1 //loop on original data input!

*REC(EXPRESSION=[CATEGORY].[CAT2]*([ACCOUNT].[ACC1],[CATEGORY].[CAT2]),CATEGORY=CAT2)

*ENDWHEN

//All 10 records will be multiplied by ACC1

B.R. Vadim

Former Member
0 Kudos

Hi Vadim,

Basically my case only happens once in year or per quarter because it needs to run when the forecast moveing to actuals. And my 3 different process are seperate and complex calculations and that is frequintly used by users seperately.

Whatever you told is correct we can create a single script or we can use run logic but we planned to use existing one instead of combine everything into 1.

Its like a big process and hard to explain. Because I am using single badi that executes for 2 different models.

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Ups,

In you previous post the idea was to launch DM package with every data input... And in your system you are using some separate DM package?

Vadim

Former Member
0 Kudos

Hi Vadim,

Like I said earlier its very hard to explain the concept fully. We created seperate package for all the process and user can use it for their own unique concepts whenever the forecast is moving to actuals all the package needs to execute once to process newly copied records.

Its a kind of automatic and also I am triggering some packages in another model. And I wrote the single badi which will execute for 2 different model which will react depends on the model name.

Hope it doesn't clear you but I don't know how to explain more clearly.

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Hi Suresh,

We are doing exactly the same things:

1. We have different packages for different processes in different cubes (8 cubes)

2. We have some main packages that will launch number of packages from 1. in case some processes have to be compined at the same time.

3. We use RUNLOGIC to do all this things.

Vadim

Former Member
0 Kudos

Hi Vadim,

May be my explanation confusing you lot. Here is my simplified requirement, Just give your idea to simplify my process.

Requirement: Basically I have 2 models named Model1 and Model 2 in same Environment.

I have to create a BAdI to replace Category for both data and Comments but this badi needs to trigger by both Model1 and Model2, so I created a DM Package in both model which calls that same BAdI. In that package I gave all the dimension as User selection for source and only category for target.

If user run the package in Model1 by selecting some Time, Entity, Account and source Category and Target Category. The package needs to execute the BAdI for Model1 and once it completed it needs to trigger the package in Model2 with same user selection, so the same BAdI will execute now for Model2.

I hope we can achieve this through script logic itself but I don't know how to do. Please explain me how to achieve this through run logic.

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Ups, script logic is unable to work with comments...

Anyway, some custom logic badi is required to do the job with comments. This badi need to have a parameter - target category.

The script can replace category for data (actually script will copy data from one category to another and then delete original data).

The main script will be like:

//$TARGETCAT$ - DM variable, containing target category

//The scope is selected by user: Time, Entity, Account and source Category

//Process Model1

//Copy data from scope category to target category

*WHEN CATEGORY

*IS *

*REC(EXPRESSION=%VALUE%,CATEGORY=$TARGETCAT$)

*ENDWHEN

//Clear data with scope category

*WHEN CATEGORY

*IS *

*REC(EXPRESSION=0)

*ENDWHEN

//Run badi to change category in comments

*START_BADI COMMENTCAT //badi will work on the original scope

WRITE=ON

QUERY=ON

DEBUG=OFF

TARGETCATEGORY=$TARGETCAT$ //badi parameter

*END_BADI

//Process Model2

//Use RUNLOGIC to lanch script CHANGECAT.LGF in Model2

*START_BADI RUNLOGIC

WRITE=ON

QUERY=OFF

LOGIC=CHANGECAT.LGF

APP=Model2

DIMENSION CATEGORY=%CATEGORY_SET%

DIMENSION TIME= %TIME_SET%

DIMENSION ENTITY = %ENTITY_SET%

DIMENSION ACCOUNT = %ACCOUNT_SET%

//$TARGETCAT$ variable will be passed automatically!

DEBUG=OFF

*END_BADI

Then in Model2 the CHANGECAT.LGF will be:

//Process Model2

//Copy data from scope category to target category

*WHEN CATEGORY

*IS *

*REC(EXPRESSION=%VALUE%,CATEGORY=$TARGETCAT$)

*ENDWHEN

//Clear data with scope category

*WHEN CATEGORY

*IS *

*REC(EXPRESSION=0)

*ENDWHEN

//Run badi to change category in comments

*START_BADI COMMENTCAT //badi will work on the original scope

WRITE=ON

QUERY=ON

DEBUG=OFF

TARGETCATEGORY=$TARGETCAT$ //badi parameter

*END_BADI

B.R. Vadim

former_member186338
Active Contributor
0 Kudos

P.S. It's better to open new discussion, this one is too big and is not directly related to the subject.

Vadim

Former Member
0 Kudos

Hi Vadim,

Yeah you are correct but the process has to be vice versa. Your explanation will work only when the user run DM package in Model1. What if user run through Model2?

I mean user can run DM package in Model2 first and then it needs to automate the DM package in Model1. That is the kind of flexibility right? User can run through both model, If they run Model1 then the Model2 will trigger automatically but if they run Model2 means Model1 needs to run automatically.

To achieve this we can include the Run logic in Model2 also but it is goes to Infinite loop right?

Hope you understood the logic behind our implementation now!!!

Thanks,

Suresh

former_member186338
Active Contributor
0 Kudos

Not an issue at all:

In both models you will have practically same 2 scripts:

Main:

//Run the script for this Model

*INCLUDE CHANGECAT.LGF //will include script from the current model

//Process other Model

//Use RUNLOGIC to lanch script CHANGECAT.LGF in Model2

*START_BADI RUNLOGIC

WRITE=ON

QUERY=OFF

LOGIC=CHANGECAT.LGF

APP=Model2 //or Model1 for script in Model2

DIMENSION CATEGORY=%CATEGORY_SET%

DIMENSION TIME= %TIME_SET%

DIMENSION ENTITY = %ENTITY_SET%

DIMENSION ACCOUNT = %ACCOUNT_SET%

//$TARGETCAT$ variable will be passed automatically!

DEBUG=OFF

*END_BADI

The script CHANGECAT.LGF (actually doing the job)

This script is described in my previous post!

B.R. Vadim

kleos000
Explorer
0 Kudos

Hi Gorka did you find a solution for this problem.

We need to run a package triggered by a button and refresh the workbook at the end the package.

Thanks for any help.

Leonardo

Former Member
0 Kudos

Hi Gorka,

I would not recommend implementing the suggested ABAP functionality. It may well be possible, but would be such an incredible amount of customisation for such little value, I don't think it would be in the Client's best interests.

Pushing back to them with other options could include the use of an EPM API Macro that displays the package status could be better, although you are only saving them 2 clicks.

Also, if they are technical enough to execute the package, they should be technical enough to read view the status.

I would definitely not go down the ABAP route!

Nick