cancel
Showing results for 
Search instead for 
Did you mean: 

Get package name in work status Badi

0 Kudos

Hello,

I am implementing a BPC 10.0 NW Consolidation application and am trying to setup work status in a more granular way

The standard BPC setup only allows to define work status settings for Manual Input, Journal, Data Manager, ...

The problem is that the Data Manager part includes all possible packages made available to the user, in my case an import package (done locally per entity) and some other financial calculations (currency conversion, cash flow).

I would like to be able to control more specifically what packages can be executed when the work status is for example set to"Submitted" (no import allowed, but can still run a currency conversion). I can of course use the Owner/Manager settings to prevent the local user from running calculations, but the Manager could then still perform an import and the local users need to be able to run some packages.

The requirement is the following:

When the works status is set to "submitted", the data cannot be changed anymore with "Manual Input" or "Data Import" (neither owner nor manager should be able to change the data), but journals can still be posted locally by the users (and that means that some data manager still needs to be executed like currency conversion, cash flow, ...)

I have setup the work status Badi, but could not find a way to get more information about which Data Manager Package has been executed (can only get the module information), is there a way to get the actual name of the package that was executed in the work status Badi ?

Rgds,

Marcel

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Marcel,

Do you think it's a good idea to rely on package name?

There are a lot of packages in the system having any possible name...

Vadim

0 Kudos

Hi Vadim,

Yes,name is not ideal. But there are only couple of packages that are available to the end users (10 maximum) and out of these only 2 need a different treatment than the standard work status rules.


Regards,


Marcel

former_member186338
Active Contributor
0 Kudos

It's today situation... tomorrow you may have more...

In some other case we use small badi launched at the beginning of the script that just set memory variable to enable writing controlled by write back badi:

method IF_UJ_CUSTOM_LOGIC~EXECUTE.
" Allow write to ACT
DATA l_importact TYPE C.

   l_importact = 'X'.
   EXPORT importact = l_importact TO MEMORY ID 'Z_VALIDATOR_IMPORTACT'.

   cl_ujk_logger=>empty_line( ).
   cl_ujk_logger=>log( '=========================================================' ).
   cl_ujk_logger=>log( '# Access to ACT is allowed now!                         #' ).
   cl_ujk_logger=>log( '=========================================================' ).

endmethod.


The variable will be set for the current user for current session (current script file)


Vadim

0 Kudos

Hi Vadim,

Thanks a lot for this great suggestion, I have tried to set some global variables but never managed to get it working...

For somebody else's reference, I have used the following code to import the variable in the work status badi.

DATA l_logic_name TYPE CHAR5.

IMPORT l_logic_name = l_logic_name FROM MEMORY ID 'Z_LOGIC_NAME'.

It is working very nicely, I just would like to understand the scope of this IMPORT/EXPORT.


I have a custom process chain I use for import (basically calls several import steps in sequence). Process1 is a logic script, Process 2 is an import, Process 3 another import, ...

If I set this variable in the badi called by the logic script in Process, will It by available when the work status check is done for the data imported by Process 2 ?

Regards,


Marcel

former_member186338
Active Contributor
0 Kudos

Hi Marcel,

Just test yourself

We use this method in the following scenario:

ACT member is blocked for writing for everybody using write back badi.

But to import data (we use direct import from SAP ECC tables) we use the following script:

//*************************************************** ALLOW WRITE TO ACT

*START_BADI WRITE2ACT // will set the variable

WRITE=OFF

QUERY=OFF

DEBUG=OFF

*END_BADI

//*************************************************** Clear data in ACT

*XDIM_MEMBERSET PERIODS=%PERIODS_SET%

*XDIM_MEMBERSET BE=%BE_SET%

*XDIM_MEMBERSET PLANTYPE=ACT

*WHEN INACCT

*IS *

   *REC(EXPRESSION=0) // write back will check variable and allow write

*ENDWHEN

//*************************************************** Import data in ACT from SAP ERP

*XDIM_MEMBERSET CORPDIR=DIRECT

*START_BADI IMPORTACT

WRITE=ON

QUERY=OFF

DEBUG=OFF

ENFORCEDIM=PLANTYPE,CORPDIR

*END_BADI

Vadim

0 Kudos

Thank you, will test and post my results.

Answers (0)