Change Data in BPS Layout: Exit Function

Hello everyone,
We are using BW-BPS and we need to make a sort of a certain characteristic in a Planning Folder. In the specific Planning Folder it was defined an exit function and it was assigned a function module.
We implement the following code:
FUNCTION Z_ORDENAR_CLASSIFICACAO_PLANO.
""Interface local:
*"  IMPORTING
*"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
*"     REFERENCE(I_PLEVEL) TYPE  UPC_Y_PLEVEL
*"     REFERENCE(I_METHOD) TYPE  UPC_Y_METHOD
*"     REFERENCE(I_PARAM) TYPE  UPC_Y_PARAM
*"     REFERENCE(I_PACKAGE) TYPE  UPC_Y_PACKAGE
*"     REFERENCE(IT_EXITP) TYPE  UPF_YT_EXITP
*"     REFERENCE(ITO_CHASEL) TYPE  UPC_YTO_CHASEL
*"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA
*"     REFERENCE(ITO_KYF) TYPE  UPC_YTO_KYF
*"  EXPORTING
*"     REFERENCE(ET_MESG) TYPE  UPC_YT_MESG
*"  CHANGING
*"     REFERENCE(XTH_DATA) TYPE  HASHED TABLE
  DATA:
    lr_area TYPE REF TO cl_sem_planarea_attributes,
    wa_hash_table type ref to data,
    l_sortfield type STRING,
    lr_t_data TYPE REF TO data.
  FIELD-SYMBOLS:
    <lt_data> TYPE STANDARD TABLE,
    <ht_head> TYPE ANY TABLE,
    <xth_data> TYPE HASHED TABLE,
    <ls_data> TYPE ANY,
    <wa_data> TYPE ANY,
    <fundo> TYPE ANY,
    <eco> TYPE ANY.
  CALL METHOD cl_sem_planarea_attributes=>get_instance
    EXPORTING
      i_area = i_area
    RECEIVING
      er_instance = lr_area.
  CREATE DATA wa_hash_table LIKE LINE OF xth_data.
  ASSIGN wa_hash_table->* TO <ht_head>.
  <ht_head> = xth_data.
  LOOP AT <ht_head> ASSIGNING <ls_data>.
This is the characteristic that we pretend to sort
    l_sortfield = 'S_CHAS-0CMMT_ITEM'.
    SORT <ht_head>
      BY (l_sortfield) DESCENDING.
  ENDLOOP.
  <xth_data> = <ht_head>.
  UNASSIGN: <ls_data>, <ht_head>.
ENDFUNCTION.
When execute this function, we get a DUMP (ASSIGN_TYPE_CONFLICT). Does anybody have any suggestion how to change a hash table or somehow make a sort in this hash table?
Thanks in advance.
Ilda

Hi,
After some changes in the code, it seems that xth_data table is assuming the “new content”. In debugging, we could see that the assignment was made and xth_data records are now in a different order. But when executing the BPS Layout assigned to this planning function, all the lines (records) still in the same place. The Layout doesn’t change.
This is the code:
FUNCTION Z_ORDENAR_CLASSIFICACAO_PLANO.
""Interface local:
*"  IMPORTING
*"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
*"     REFERENCE(I_PLEVEL) TYPE  UPC_Y_PLEVEL
*"     REFERENCE(I_METHOD) TYPE  UPC_Y_METHOD
*"     REFERENCE(I_PARAM) TYPE  UPC_Y_PARAM
*"     REFERENCE(I_PACKAGE) TYPE  UPC_Y_PACKAGE
*"     REFERENCE(IT_EXITP) TYPE  UPF_YT_EXITP
*"     REFERENCE(ITO_CHASEL) TYPE  UPC_YTO_CHASEL
*"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA
*"     REFERENCE(ITO_KYF) TYPE  UPC_YTO_KYF
*"  EXPORTING
*"     REFERENCE(ET_MESG) TYPE  UPC_YT_MESG
*"  CHANGING
*"     REFERENCE(XTH_DATA) TYPE  HASHED TABLE
  DATA:
  lr_area TYPE REF TO cl_sem_planarea_attributes,
  l_sortfield type STRING,
  data_ref TYPE REF TO data,
  lr_t_data TYPE REF TO data.
  FIELD-SYMBOLS:
  <lt_data> TYPE ANY TABLE,
  <ls_data> TYPE ANY,
  <ls_data_copy> TYPE ANY.
  CALL METHOD cl_sem_planarea_attributes=>get_instance
    EXPORTING
      i_area      = i_area
    RECEIVING
      er_instance = lr_area.
  CREATE DATA lr_t_data TYPE (lr_area->typename_t_data).
  ASSIGN lr_t_data->* TO <lt_data>.
  <lt_data> = xth_data.
  CLEAR xth_data.
  l_sortfield = 'S_CHAS-0CMMT_ITEM'.
  SORT <lt_data> BY (l_sortfield) DESCENDING.
  MOVE <lt_data> TO xth_data.
ENDFUNCTION.
Does anybody understand this behavior, why the changes in the user-exit are not assumed in the BPS Layout?
Thanks,
Ilda

Similar Messages

  • To Identify changed data in planning layout in BPS

    We have a planning layout  in BPS which user can change data on individual cell.  We also have an EXIT function to distribute data to this layout.
    User changes data on cells then executes the EXIT function to distribute data. During debugging, we see the changed entry with delta amount in the XTH_DATA table. However, there are many entries with similar characteristics; hence we cannot identify the particular changed data, i.e., the changed sales amount, in XTH_DATA of EXIT function. 
    Is there any configuration and/or function to show only the changes data? Any comments/hints are greatly appreciated.
    Best regards,
    Sam

    Hi,
    When you enter for a particular characteristic and remaining characteristic if you left bank , it will store as #  in layout and samething will also in cube. you can check it cube also.
    for eg.
    profitcenter com.code  sales revenue
    100              #              10
    if you want to avoid this then you have to enter all characteristic values.
    Regards,
    Siva.

  • Data in BPS layout columns

    Hi,
       I have two data columns in my BPS layout called price and margin with one lead column material, the layout looks like this when it initially display:
       Material    Price   margin
          1          1.25
          2
          3
          4
    The requirments is if user input date in the margin column and the price should be calculated by the following logic
         second  material price = (first price ) + (first margin) and so on.
         if we input margin column 0.50,0.40 0.30  for material 1,2,3,4 respectively, we will get the following price result:
        Material    Price   margin
          1          1.25    0.50
          2          1.75    0.40
          3          2.15    0.30
          4          2.45   
    I am tried to use the excel formula for achieve this, but as much as I know the excel formula can not been saved when we configure the BPS layout,beside since the number of material display under different data selection criteria is vary, it's diffculty to hard code the formula in the excel.
    Anybody have any suggestion how to do it?

    Hi JW,
    BPS is designed in a way that layouts and planning functions are completely independent of each other (otherwise you would have to build a layout for each function or something like that).
    The data in the layout is sorted according to the lead column. So if you use FOREACH in FOX with the same characteristic, the data will be processed in the same order as the lead column.
    Alternatively, you can do it with an exit function. All you need to do in an exit is copy XTH_DATA into an internal table and then use the SORT statement with the same sort key as the lead column.
      DATA:
        lr_aera     TYPE REF TO cl_sem_planarea_attributes,
        lr_t_data   TYPE REF TO data.
      FIELD-SYMBOLS:
        <lt_data>   TYPE STANDARD TABLE.
      CALL METHOD cl_sem_planarea_attributes=>get_instance
        EXPORTING
          i_area      = i_area
        RECEIVING
          er_instance = lr_area.
      CREATE DATA lr_t_data TYPE (lr_area->typename_t_data).
      ASSIGN lr_t_data->*   TO <lt_data>.
      <lt_data> = xth_data.
      sort <lt_data> by ...
    your logic here
      xth_data = <lt_data>.
    Regards,
    Marc
    SAP NetWeaver RIG

  • Locking data in BPS layout

    Hi Guys,
    I have  one Planing Layout which different users will access for planning  but for different Cost centers. But as of Now when User1 is loggining in it is fetching all Cost Centers and User2 is getting Locked . he is not able to change any plan data .
    Now I want that when user1 will logon in BPS Layout ,he/she should fetch up the data for Cost centers for which he/she is authorized . So, other users should not be locked. they should continue to plan for other Cost centers.
    your Suggessions will be hIghly Appreciated.
    Thanks
    Pankaj.

    Hi Pankaj,
       I suppose you want an input variable for 'User Group' based on which you would write an exit variable for Cost Center. I am a bit out of touch of BPS but as far as I think, you cannot do that because you cannot include a nav. attr. in a planning level. If you can think of some other way other than an input var. for 'User Group' then it might help. One way could be to include 'User Group' as a separate characteristic in the planning level.
    In Integrated Planning, this is definitely possible, because in an input ready query, the nav. attr is accessible like any other characteristic on which we are able to apply an input variable.
    Maybe somebody else can throw more light on this particular scenario in BPS.

  • BW-BPS and Exit function on a variable

    I have a variable that has 2 characteristics.  I have an exit function to fill the variable.  I am getting a short dump when executing the functional module.  Here is the code I am using and the error message.  Any help would be appreciated.
      ls_varsel-seqno = '0000'.
      ls_varsel-chanm = 'ZLOCBRAND'.
      ls_varsel-sign = 'I'.
      ls_varsel-opt = 'EQ'.
      LOOP AT lt_chavl INTO ls_chavl.
        if ls_chavl-/BIC/ZLOCBRAND <> ''.
          ls_varsel-seqno = ls_varsel-seqno + 1.
          ls_varsel-low = ls_chavl-/BIC/ZLOCBRAND.
          APPEND ls_varsel TO eto_charsel.
        endif.
      ENDLOOP.
      ls_varsel-chanm = 'ZBUS_UNIT'.
      ls_varsel-sign = 'I'.
      ls_varsel-opt = 'EQ'.
      LOOP AT lt_chavl INTO ls_chavl.
        if ls_chavl-/BIC/ZBUS_UNIT <> ''.
          ls_varsel-seqno = ls_varsel-seqno + 1.
          ls_varsel-low = ls_chavl-/BIC/ZBUS_UNIT.
          APPEND ls_varsel TO eto_charsel.
        endif.
    ENDLOOP.
    error : ITAB_ILLEGAL_SORT_ORDER
    \CLASS=CL_SEM_VARIABLE\METHOD=GET_VALUE\DATA=RTO_VALUE

    Hi Rich,
    looks like the table is defined as sorted table. Try to replace your two APPEND statements by INSERT ls_varsel INTO TABLE eto_charsel.
    Hope that helps
    Stephan

  • Ugrent help. User exit- Read data from BW BPS layout and write to ODS

    Hi,
    I am new to BW BPS and have a req. where i need to read data from BPS layout (EXCEL) and write it to ODS.
    Is there any function module or user exit which read data from excel layout and upload it to ODS. Or can any one help me out how can i write a code for this.
    It is urgent and i need your help.
    Appreciate any kind of input.
    Thanks
    Mamatha

    Dear Mamatha,
    read following documents. i hope it will work for you.
    [http://www.geocities.com/cynarad/reference_for_bps_programming.pdf]
    [Accessing BW Master Data in BPS Functions using ABAP ( Exit Function )|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3dcc423-0b01-0010-4382-aa3e0784b61e]
    Regards,
    Malik
    Give me points if its helpful for you.

  • BPS Exit Function Error

    Hi Experts,
    I am new to BPS. I am developing FM for Unit Convertion. Can some body please direct me the procedure to correct the following error? This error is being generated at the time of execution. I am working on BI 7.0.
    Please let me know if this is not enough info.
    Thanks in advance.
    Regards,
    Nimesh
    Error generating the test frame
    Message no. FL819
    Diagnosis
    The system could not generate a syntactically correct test frame for function module Z_BPS_EXIT_UNIT_CONV. You therefore cannot test the function module using the test environment. You have probably used an ABAP feature in the interface definition that is not yet supported in the test environment.
    The error message is:
    "ANY TABLE" expected, not "HASHED TABLE".
    System Response
    Procedure
    Check whether you can change the interface of the function module so that it is possible to generate the test frame. If this is not possible,you will have to write your own utility for testing the function module.

    Nimesh,
    Welcome to the forum.
    You can not test an SEM exit function from ABAP workbench rather it has to be tested from BPS.
    Exit function requires hash table XTH_DATA which is supplied from BPS.
    I think you are testing funciton module from SE37 that leads to error message posted by you.
    Have some test data in the planning cube & test it from Planning function exit function.
    There is a How-To Document "How-To Loop over reference data in FOX formulas".
    Though this function doesn't explain about exit function but it depicts execution of a planning funtion which will give you some insights.
    Hope it helps.
    Hari Immadi
    http://immadi.com
    SEM BW Analyst

  • BPS-Exit function

    Hi experts,
    I am tring to load flat file in BPS using EXIT function.
    For that i am using two function modules where one is main function module
    and another one is Init.Function.In function moduled there is no errors but
    while upload flat file records are not get generated.
    Kindly give me some tips to resolve this.
    If i case anyone want that FM means i will attcah those FM.
    Regards,
    Kiruthika

    Nimesh,
    Welcome to the forum.
    You can not test an SEM exit function from ABAP workbench rather it has to be tested from BPS.
    Exit function requires hash table XTH_DATA which is supplied from BPS.
    I think you are testing funciton module from SE37 that leads to error message posted by you.
    Have some test data in the planning cube & test it from Planning function exit function.
    There is a How-To Document "How-To Loop over reference data in FOX formulas".
    Though this function doesn't explain about exit function but it depicts execution of a planning funtion which will give you some insights.
    Hope it helps.
    Hari Immadi
    http://immadi.com
    SEM BW Analyst

  • Creation and Change Date for Tcode and Function Groups

    Hello All,
    I need to display the Creation and Change Dates for Custom Tcodes and Function Groups in a Report. Can anyone please let me know the logic of retrieving it.
    regards,
    Mahesh

    Hi,
    TADIR and TRDIR is the tables where you can find all these data
    Regards
    Sudheer

  • How to apply Excel formula in BPS layout

    Hi ,
       I need to apply the following logic in my BPS layout.
    There are three data columns called C,D,E respectivelt
    redord 1   user input data for all the columns,
    Record 2   C2 = D1 + E2.
    Record 3   C3 = D2 + E3.
    Record n   Cn = D(n-1) + En.
      n is the number of record in teh layout.
    1: Can we use Excel formula to achive this?
    2: If the anser is yes, how can we configure the BPS layout? I am not sure if we can do it at the last step of change layout.
    3: If the answer is no, what is the other choice? I have tried to use user exit, but had some problem in passing the data to xth_data table in the orginal order sequence.
    thanks in advance.

    JW,
    please see my answer to your original post "data in BPS layout columns"
    Regards,
    Marc
    SAP NetWeaver RIG

  • Parameter Exit Function in Planning Folder

    Hi all,
    I created the planning function in SEM BPS using exit function. And then I added the parameter exit function 0VERSION to this function. After that, I tried to put this function in the planning folder.
    Does anybody know how to put the parameter exit function to the planning folder?
    Because I need the user to fill the value of the 0VERSION before they run the function.
    I assume this should work as the selection screen.
    Currently, Every time I run this function, there is no selection screen or the place that I could fill the value for this field. So, the system always receives no value for this field.
    Or Maybe you have another approach to get the user's value without restrict the data before run the exit function.
    Thanks a lot for your help,
    -Martin Darmawi-

    This behaviour is quite normal. You should use different approach.
    Parameters in exit functions can be filled in parameter group only and only with fixed values.
    You should create a planning variable, put it to the folder and then read value of this variable in your exit function with 'API_SEMBPS_VARIABLE_GETDETAIL' for example.

  • Planning function to change date field value in layout

    Hello experts,
                          I have 1 BPS layout with 2 date fields ( Start date, End date ). With a filter conditions, set of data comes in BPS layout on execution and 2 date fields also contain some value...I want to change values of these 2 dates...both the date fields are char infoobjects..in BPS layout, in planning function I got only 1 function ( Repost function ) to change the value of char infoobject based on some condition. but date field value is not the status field...i want to enter new date instead of old date..if i right exit function in that also i can change only keyfigs values..so please help me to solve this problem..
    Thanks & Regards,
    Priyanka Joshi

    Hi Priyanka,
    As of now master data planning is not so flexibly supported.
    Still u can refer the below link which is enhancement of standard Repost function,and can be used to change master data.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10d2b273-0e12-2c10-fab3-a34bde559f92]
    As far as my knowledge goes u cannot directly input date in rows.
    regards,
    Rajendra

  • How to access reference data in BPS Exit Function

    Hi Experts,
    Can any please tell me how to access reference data in BPS Exit function. I am creating a copy function using ABAP Exit Function (Std copy and fox formula doesn't work for my requirement).
    Please suggest,
    Thanks in advance,
    Shiwesh

    Hi Deepti,
    Thanks a lot for your reply. xth_data contains all the data based on package filteration. Let me explain you,
    Say, I have a characteristic char and whose value is 'A', I want to change it to 'B' in my copy function, while keeping the original record with 'A' as well. So now I want my xth_data to contain two records, one with A and other with 'B'. I mean to say from value is 'A' and to value is 'B'. Now my package contains 'B' (the to value) as the allowed value, but not A because in the package I am setting this using a BPS variable. There are two types of variables, one is to variables other is from variable. There could be two scenarios,
    1. If I set from varibale in the package: if I do so, I will have the data in xth_data containing 'A' as char value. But in this case when I change it to 'B' and try to save both the records, package won't recognize the record with value 'B' and reject it.
    2. If I set to variable in the package: In this case the xth_data itself will not contain anything and I can not loop over xth_data because there is no record with 'B'. Only record available in the system is with 'A' values.
    That is why I am thinking about having reference daya somewhere. I could loop over reference data and then pass it to xth_data. Package will contain to variable so it will allow all my modifications to get saved.
    Thanks and regards,
    Shiwesh

  • Date convertion function in BPS layout

    Hi,
       At the user's request, I have created a key figure with date type "date". The purpose of this is to allowed the user can input the date for each of the material displayed at the BPS layout.
       when I use the listcube to display the date key figure, I notice that it is not display as the regular date instead it has benn converted to a number for example 01/12/2005 is dispaly as 731,959. when I delete the date from the layout and save it,now the cube has add a 731,959- record. this is comply with how the infocube deal with ket figure data.
       There should be an function which convert the date 01/10/2005 to 731.595 in the BPS back end, anybody know the function name.
    Thanks,

    Hi JW,
    If you simply want to generate a new date from an existing one, there are several options using only FOX. But again, maybe you want to look at the original intention of the application and your data modelling options before researching into this specific issue.
    William

  • Reading Data From a Different Planning Package in a Exit Function

    Hi,
    Is it possible to read data from a planning level / package other than the package that the exit function was executed with?  I want to read data into an internal table from another package and use that data in combination with the data in the current package to create new records.  If this is possible sample code for how to read data from a different package would be appreciated.
    Thanks!
    Mel Waldner

    Hi,
    As an example lets say you have restricted 0calmonth in your package to 6.2007. In the planning layout to fetch values for 5.2007 (read only), you can take 0calmonth in data columns, and for this column restrict it as 5.2007.
    Similarly in Planning functions, you can mark 0calmonth as field to be changed and fetch data for 5.2007.
    Hope this helps.

Maybe you are looking for

  • Creator 2 Problem - Docked Windows Keep Popping Up

    I'm having an issue with the released version 2. I have all of my windows, i.e. Palette and Navigator on the left and Projects and Properties on the right, docked and minimized. Then, when I move to the tab of another file, these windows pop to the f

  • Time Machine: Cannot access old backups after migrating to a new mac

    Hello, I have bought a new Mac (With Snow Leopard installed on it). I have used it for about half an hour to have fun with it. Then, I have decided to use Time Machine & Migration Assistant to restore all my files from my old Mac (Leopard). The resto

  • Setting time in x-axis for waveform

    i would like to make the waveform to shows data within 10 minutes time frame. I've  tried the property and change with different scales but that didn't work as wanted. Is there a setting values for offset and multiplier that i should be aware of?

  • Finding Active Profit Centers

    Hey Everyone, I have question about finding active profit centers.  I am able to see if a profit center is active by using transaction KE54 and entering the correct company area and profit center.  My requirement is to validate if a profit center is

  • How can I change the display name of a contact in my address book?

    If I open one of my contacts in the Address Book, the display name is the name of the organization. I want it to be the last name of the individual. How can I change that?