cancel
Showing results for 
Search instead for 
Did you mean: 

Exit in BW-BPS

Former Member
0 Kudos

Hi,

We tried to use an exit function in bps to make some specific calculation when copying data from one planning area (actual) to another (plan data).

We included the exit in a multiplanning area(level including both planning area). Unfortunaltely, we didn't get any records from planning area with actuals data. Do you know the way (or an example)to get data from several planning areas in an exit function ?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member93896
Active Contributor
0 Kudos

Boujema,

you probably have the (virtual) characteristic "Planning area" in the field list of the exit planning function. Move it to the "fields to be changed". Then you will get actuals and plan data in the same function call (in XTH_DATA).

Regards,

Marc

SAP NetWeaver RIG, US BI

Former Member
0 Kudos

Thanks Marc,

I'll try asap.

Regards

Former Member
0 Kudos

Can anyone recommend a good FM for this sort of Exit Function.

Working with an ABAPer new to BPS and having issues transferring ( copying ) plan values from one planning area into another. Using Exit zFunction for mapping of different data models structures.

Any help greatly appreciated.

matt
Active Contributor
0 Kudos

Really, you should post this as a new question. A question marked as "answered" is less likely to get responses.

I'm not quite sure what you're after. What precise problems are you facing?

Most of the dealing with bps objects (e.g. reading from a planning level programatically) are dealt with through classes and interfaces, the most important of which are:

cl_sem_planarea_attributes

if_sem_chalev

if_sem_kyflev

if_sem_chasel

if_sem_data

Here is some sample code, where i_area is the planning area, it_cha is the characteristic list, it_chasel are the characteristic selections and it_kyf are the key figures. eth_data is an internal table of type HASHED TABLE. I'm not sure where this sample code came from, so I can't give credit, but I think it is pretty generic, and I adapted it for my requirements.

  field-symbols: <lth_data> type hashed table.

  data: lr_chalev type ref to if_sem_chalev,
        lr_kyflev type ref to if_sem_kyflev,
        lr_chasel type ref to if_sem_chasel,
        lr_plarat type ref to cl_sem_planarea_attributes,
        lr_data   type ref to if_sem_data.

  data: lp_th_data type ref to data.


* create objects

*Planning area
  lr_plarat = cl_sem_planarea_attributes=>get_instance( i_area ).
* Planning level
  lr_chalev = lr_plarat->r_factory->create_chalev( it_cha ).
* Selection
  lr_chasel = lr_plarat->r_factory->create_chasel( it_chasel ).
* Key figures
  lr_kyflev = lr_plarat->r_factory->create_kyflev( it_kyf ).


* Plan data (Returns type ref to if_sem_data, so need to cast to if_sem_data_internal )
  lr_data ?= lr_plarat->r_factory->create_data(
                  ir_chalev = lr_chalev
                  ir_chasel = lr_chasel
                  ir_kyflev = lr_kyflev ).

* Clear buffer (comment out to use buffered reads)
    lr_data->r_plarat->r_buffer->refresh( ).

* Read data into buffer
  call method lr_data->read
    exporting
      i_enqmode    = ' '
    exceptions
      foreign_lock = 4.

* Create data object to which LP_TH_DATA points
  create data lp_th_data type (lr_plarat->typename_th_data).
* Assign data object to field symbol
  assign lp_th_data->* to <th_data>.
* get data from buffer and store in field symbol
  call method lr_data->get_data
    importing
      eth_data = <th_data>.

  eth_data = <th_data>.

matt

Former Member
0 Kudos

Hi, Matt

Thanks very much for your quick response. I will pass the details along to the developer, as I am sure they will be very helpful.

Basically, we are doing a 'copy' of one planning area into another ( Cost center plan to P&L plan ). The data models are different between the two.

We will be doing it as an Exit, but for now - it's a basic transfer. The transfer will get complex , with many records, but for now, the fields that are currently different are 0COSTELMNT, 0GL_ACCOUNT, and AREA____.

The FOX formula would be

( #, 0GL_ACCOUNT, AREA____(P&L) ) =

( 0COSTELMNT, #,_AREA_____(Cost Plan ) .

Because of the number of cost elements and gl accounts, we do not want to 'hardcode' the values in the Fox.

ex. ( #, 800000000, AREA____(P&L) ) = ( 800000000, #,_AREA_____(Cost Plan ).

I basically want the value for Cost Element to dynamically populate the P&L account.

Can we do in Fox or forced to use Exit for this?

As I mentioned - the mapping will get more complex but a proof of concept formula in FOX would also be great.

Any experience with this?

matt
Active Contributor
0 Kudos

I don't know FOX - I started my SAP life as an ABAP programmer, so I just write exits... although we've found that for simple stuff, FOX formulae usually perform better...

But to me - this looks like something that can be done by FOX. You get your programmer properly trained, however, and he'll be able to do ABAP as quickly as you'd do FOX.

Answers (0)