on 03-01-2019 6:59 PM
Hi All,
I have a requirement for which I need to create a custom planning function based on COPY function provided by SAP. I'll be getting reference data and am using blocks as well.
Now, in planning function filter, I have 0COSTCENTER that is restricted by a variable. This variable is a single value variable and is mapped to the variable used in AO query. In other words, whatever value user enters in selection screen of AO, gets transferred to this variable.
In my code of custom planning function - I haven't touched a thing in any of the methods except - EXECUTE of interface - IF_RSPLFA_SRVTYPE_IMP_EXEC_REF.
In execute method, among some calculations, I now have to change the value of costcenter to some other value than what was there originally.
Additionally, if I do try to change costcenter value - I get this error:
"Value of characteristic 0COSTCENTER: Z0001 is not included in the selection"
Kindly advise.
Thanks.
Regards,
Sagar
PS: As broken as SCN has ever been - I'm unable to unBOLD the text. Miss you StackOverflow.
Hi Gregor,
I concur with the usage of FROM and TO in parameters just like standard COPY function. Buts that where the dilemma is. I do not know what should be in 2 - TO value of Cost Center can can be anything (as long as the value is in master data). Yes, I can give same variable in planning filter and in FROM of parameter. But what goes in 'TO' of parameter?
In fact my design is almost exactly as standard COPY function - apart from the EXECUTE method. Everything else is copied from standard copy function.
You said - the cost center variable used in TO should also be used in the filter.
So you mean - same variable used in Plan Filter, FROM and TO of Planning function?
Regards,
Sagar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sagar,
you can follow the approach of the standard copy function, i.e. if user should be able to set the FROM and TO cost centers your function has to support the corresponding parameters and there you use variables; the cost center variable used in TO should also be used in the filter.
Regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
Thank you for your answer.
Although my problem is that target cost center is not fixed and is dynamic in nature. I cannot know beforehand what value of target cost center will I get for every record. Similar is the case with cost center - whatever user enters I need to use that.
So, some examples would be -
You see? Total randomness.
So, to go back to your answer - use target cost center in filter and enter to and from values.
My follow up question is - what should I enter in "TO" value as I'm unaware what target cost center is going to be.
Thanks.
Regards,
Sagar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sagar,
I think it is pretty obvious.
If you do not know the exact target cost center value, you need to include all possible cost centers in your filter selection - could be by authorization variable, hierarchy nodes or whatever is appropriate.
Or do not use a filter selection for cost center at all.
regards
Cornelia
Hi Sagar,
the filter used to execute a planning function describes the data area where you can change data (records in the data area can be changed or created); observe that this data area is locked by the BW enqueue server.
As a result, the system checks whether data were changed that are not contained in the filter; in this case you get the error message you mentioned.
The solution is to include the 'target cost center' values in the filter as well. Observe that e.g. to copy values from cost center 4711 to 4712 you would model (in the standard planning function type copy): 4711 as from value and 4712 as target value (parameters of the planning function) and use only 4712 (!) in the filter. 4711 is used as reference data.
Regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.