Create Virtual Keyfigure using BADI
Hi All,
I Am tring to implement a virtual keyfigure using BADI, here is what i did created a Enhancement for BADI RSR_OLAP_BADI but i am not sure how to write the code for methods DEFINE and COMPUTE, i am just trying to populate value 100 for Virtual Keyfigure ZVIRT (Just testing) and i am using this keyfigure in my ODS.
here is the define method i have:
METHOD IF_EX_RSR_OLAP_BADI~DEFINE .
DATA: l_s_chanm TYPE rrke_s_chanm,
l_kyfnm TYPE rsd_kyfnm,
l_s_chanm_used TYPE rschanm.
FIELD-SYMBOLS:
<l_s_chanm> TYPE rrke_s_chanm,
CASE i_s_rkb1d-infocube.
WHEN 'CUBEXYZ'.
ENDCASE.
ENDMETHOD.
Compute Method:
METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
ENDMETHOD.
found this code in other post thought this would be helpful for others, this works.
The coding for DEFINE is
DATA: l_s_chanm TYPE rrke_s_chanm,
l_kyfnm TYPE rsd_kyfnm.
FIELD-SYMBOLS:
<l_s_chanm> TYPE rrke_s_chanm.
CASE i_s_rkb1d-infocube.
WHEN 'MYCUBE'.
characteristic
l_s_chanm-chanm = 'ZVIRTUAL'.
l_s_chanm-mode = rrke_c_mode-no_selection.
APPEND l_s_chanm TO c_t_chanm.
l_s_chanm-chanm = 'ZPMORDER'.
l_s_chanm-mode = rrke_c_mode-read.
APPEND l_s_chanm TO c_t_chanm.
The coding for compute is:
field-symbols: <f_virt> type /bic/oizvirtual,
<f_ord> type /bic/oizpmorder.
if P_CHA_zvirtual > 0.
assign component P_CHA_zvirtual of structure C_S_DATA to <f_virt>.
if P_CHA_zpmorder > 0.
assign component P_CHA_zpmorder of structure C_S_DATA to <f_ord>.
<f_virt> = <f_ord>+2(3).
else.
clear <f_virt>.
endif.
else.
clear <f_virt>.
endif.
Similar Messages
-
Dear all,
My requirement is to create a virtual KF using BADI to populate a keyfigure ZWKDAY value in the bex query.
Condition - I need to read 0calday from the cube and find it whether its a workday or not.
If its working day then my KF ZWKDAY should have value 1 else 0.
I created a BADI ZCL_IM_TEST_VIRTUAL for this.
I defined attributes as
P_KYF_RB_WKDC Instance Attribute Public Type I
P_CHA_0CALDAY Instance Attribute Public Type I
*METHOD IF_EX_RSR_OLAP_BADI~DEFINE .
DATA: l_s_chanm TYPE rrke_s_chanm,
l_kyfnm TYPE rsd_kyfnm.
FIELD-SYMBOLS:
<l_s_chanm> TYPE rrke_s_chanm.
CASE i_s_rkb1d-infocube.
WHEN 'RB_RT_C01'.
characteristic Calendar day
l_s_chanm-chanm = '0calday'.
l_s_chanm-mode = rrke_c_mode-read. " rrke_c_mode-read / rrke_c_mode-no_selection
APPEND l_s_chanm TO c_t_chanm.
key figure DETERMINE WORKDAY
l_kyfnm = 'RB_WKDC'.
APPEND l_kyfnm TO c_t_kyfnm.
ENDCASE.
ENDMETHOD.
METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
FIELD-SYMBOLS:
<fs_wkdc> type any,
<fs_0calday> type any.
Data: lv_workday(1) type C,
lv_calday type sy-datum,
l_flag type char1 .
Assign component P_CHA_0CALDAY of structure c_s_data to <fs_0calday>.
Assign component P_kyf_RB_wkdc of structure c_s_data to <fs_wkdc>.
<fs_0calday> = sy-datum.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
CORRECT_OPTION = '+'
DATE = <fs_0calday>
FACTORY_CALENDAR_ID = '01'
IMPORTING
WORKINGDAY_INDICATOR = l_flag
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
if l_flag = '+'.
<fs_wkdc> = 0.
else.
<fs_wkdc> = 1.
endif.
When I execute my query in RSRT transactionI am getting the following error.
"The function call of DATE_CONVERT_TO_FACTORYDATE failed; a field may have been assigned to the parameter DATE whose type is not compacitable".
When I tried to debug the code I found the type of <fs_0calday> is structure of c_s_data but I dont know how to solve this error. Any help on this is appreciated.....
Regards..
BalaHi,
Instead of assigning type as any to your field symbol <fs_0calday>.
You will have to assign the same type as type of type of export parameter DATE of FM DATE_CONVERT_TO_FACTORYDATE.
Just change the attribute type and execute your query again.
Regards,
Durgesh. -
Create virtual infocube using function module
HI all, Searched lot of document to create virtual infocube using function module, I am not getting good one, If any one give PDF document step by step process it will be useful for me. thank u
Hi
Please refer this document.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9066d1fa-efc1-2b10-7b96-9ddee3b11b40?quicklink=index&overridelayout=true
Thanks
Suganya -
Hi everyone,
Is it possible to create a new BADI? Not an implementation I want to create a whole new BADI. Can anyone please let me know how to do it.
Thanks,
JohnHi John,
You can use the transaction SE18 to define a new BAdI definition which may be implemented by other developers later. It is not so challenging. Here is the roadmap:
A. BAdI Definition
1. SE18
2. Enter the name for the BAdI to be created in customer namespace and press "Create".
3. Enter a definition for your BAdI and on the interface tab enter a name for the BAdI interface. SAP proposes a name and it is pretty good. Meanwhile a BAdI class is also created which is not in our concern.
e.g for "ZTEST", SAP proposes "ZIF_EX_TEST" for the interface and "ZCL_EX_TEST" for the class.
4. Save your BAdI.
5. Double-click on the interface name. It will pass to a Class Builder session to make you implement your interface. If you are not familiar to the Class Builder; it's a bit like Function Builder and it will be easy to discover its procedure.
6. Save and activate your interface.
B. Calling your BAdI from an application program
1. Declare a reference variable with reference to the Business Add-In interface.
e.g. DATA exit_ref TYPE REF TO zif_ex_test.
2. Call the static method GET_INSTANCE of the service class CL_EXITHANDLER. This returns an instance of the required object.
e.g.
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
CHANGING instance = exit_ref .
3. After those two steps, you can now call all of the methods of the BAdI where it is required in your program. Make sure you specify the method interfaces correctly.
C. BAdI Implementations
1. SE19
2. Enter the name for the BAdI implementation to be created in customer namespace and press "Create".
3. It will request the BAdI definition name to which this implementation will be tied.
4. Enter a definition for your implementation and on the interface tab enter a name for the implementing class. Again SAP proposes a name and it is pretty good.
e.g for "ZIMPTEST", SAP proposes "ZCL_IM_IMPTEST".
5. Save your implementation.
6. To implement a method, just double-click on the method name and you will be taken to the Class Builder to write the code for it. Here you redefine the BAdI interface methods.
7. You must activate your implementation to make it executable. You can only activate or deactivate an implementation in its original system without modification. The activation or deactivation must be transported into subsequent systems
That's all. For further details, i.e. filter-dependence, multi-usage, menu nehancements etc... you can have a look at course materials of BC425 "Enhancements and Modifications".
Regards
Aneesh.
Source : SDN forum -
Issue with creating virtual provider using function module
Hello experts,
We are building virtual cube based on function module by following the SAP guideliness.
Upon execution of the virutal cube we get the following message:
CX_SY_DYN_CALL_PARAM_MISSING Infocube parameter missing
In method READ_DATA of class CL_RSDRV_VPROV_LOC_NOSID
Did anybody experienced this message and what was your resolution?
Thank you ahead for any assistanceHi Naveen,
In some cases where the cubes are build on FM, there can be a chance that the FM information gets missed out from the cube.
Can you please try the below steps:
a) RSDCUBE transaction and enter your cube name and Edit
b) Click on button i(Informatiuon)
c) Clieck on button 'Type/Attributes'
d) Click on button 'details'
e) in field 'FMOD/CLASS/HANA MOD', enter the FM you want for to use for the cube
f) Save and reactivate the cube.
Please let me know what happens?
BR
Prabhith -
Hello experts, please help make my life easier today !
Requirement: Need to create virtual keyfigure to calculating Rankings for all plants (cannot use thank ranking option in BEX cuz of sub-totals issue).
Issue: Seems like the virtual keyfigure is populating the value at the record level in the cube. I want to populate at the leve of query result based on the variable in query (days selection).
How could I take result of the query, possibly into an internal table and then calculate the rankings.
Please guide me through the code. Any guidance would be appreciated.Any help ???
-
Cannot create Virtual Directory in Windows Server 2008 R2 SP1 Environment
Dear all,
I am trying install Reporting Services 2005 on a Windows Server 2008 R2 SP1 Enterprise machine.
So far we successfully did the following steps
- Install SQL Server Reporting Services
- Configure Service Account (Domain-User)
After creating virtual Directory, we made several steps to avoid HTTP 400 Bad Request in Report Manager:
1. Disable LSA Loopback in Registry and restart server
2. Enhance Service Startup time to 60000ms and restart Server
3. Set Application Pool to ASP.NET 2.0 Classic Mode
4. Modify RSWebApplication.config and set These entries:
<ReportServerUrl>http://servername/ReportServer</ReportServerUrl>
<ReportServerVirtualDirectory></ReportServerVirtualDirectory>
After all the Reporting Services Configuration Manager still shows a red sign and we cannot continue creating the database.
How is it possible to solve this?
We appreciate any help.
Best regards,
Mark
Mark Kuschel
Blog
XingHi Mark,
As per my understanding, we can refer to the following methods to troubleshooting the issue you occurred.
Install SQL Server 2005 Service Pack 3.
Deleting the newly-created virtual directory using IIS manager and then rebooting the server.
In the Report Manager Virtual Directory dialog box, create a virtual directory for Report Manager, then change the Website to Reporting.
Enable Apply default settings.
The following link is for your reference:
http://www.mathgv.com/sql2005docs/SQL2005ReportingServicesInstall.htm
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
I want to create Virtual Machine used iso image (Oracle Enterprise Linux 5 update 3). I use one Shared pool master & Utility Server (in same machine), and 2 Virtual Machine Servers. I can't create Virtual Machine it display Error and log display My iso file doesn't exit! and Server Name display N/A.
and I have 1 question about topology
Once I create Server Pool I choose
- Shared Pool Master , Utility Server , Virtual Machine Server (by default) but when I add Server (choose Virtual Machine Server)
Then I deselect Virtual Machine Server in Server Pool
I'm not sure that Server Pool can be only Shared Pool Master and Utility Server OR Shared Pool Master , Utility Server , Virtual Machine Server (by default)
Thank you so much
Fujimaru
Edited by: user8810641 on 31 ส.ค. 2553, 2:59 น.Hi Fujimaru,
a.) In each server pool, each server can have different responsibilities. In a server pool there exists exactly one server pool master, multiple (at least one) utility servers and multiple VM servers.
These roles can be on one host or distributed. So yes one server with all three roles is possible (that is the standard if you only have 1 server in your server pool).
b.) There are 2 types to create virtual machines from installation media.
If you create a PVM (paravirutalized guest) which is recommended for Linux, then you have to use an NFS share with the .iso file extracted, and cannot use the ISO file directly.
If you create a HVM (hardware virutalized guest) you can use an ISO file.
However this ISO must be imported first into the OVM Manager (Under Resources, ISO Files).
For this the ISO have to be placed in a subfolder under the iso_pool folder (in an OVS repository, e.g. /OVS).
Sebastian -
I'm asked to deselect the GR indicator for ZNPP purchase orders using BADI.
Hi Experts,
I'm asked to deselect the GR indicator against ZNPP purchase orders created from SRM using BADIs
BAdI BBP_CREATE_BE_PO_NEW ,BBP_CREATE_BE_RQ_NEW and FILL_PO_INTERFACE1 and FILL_RQ_INTERFACE methods respectively.
Can you please give me idea what I can do with this..
Im unable to find the field name(WEPOS) for GR indicator.
Please help me out..today is the deadline for me.These BADI's are in SRM not in ECC. Check the interface parameters of those badi methods. you will find some option to pass. if not you have to do it in ECC only.
-
I can not create virtual machines =(
hi, I again
I can not create virtual machines using the oracle manager, andalusia creandolas time this occurs, an error which generates two logs. These are:
1.Get VNC Port: (XMachineX):
failed:<Exception: failed:<Exception: xm list 98_XP_es=>Error: Domain '98_XP_es' does not exist. > StackTrace: File "/opt/ovs-agent-2.2/OVSXXenStore.py", line 196, in xen_get_vnc_port vm_id = xen_get_vm_id(vm_path) File "/opt/ovs-agent-2.2/OVSXXenStore.py", line 35, in xen_get_vm_id stdout = run_cmd("xm list %s" % vm_name) File "/opt/ovs-agent-2.2/OVSCommons.py", line 87, in run_cmd raise Exception('%s=>%s' % (cmd, p.childerr.read())) > StackTrace: File "/opt/ovs-agent-2.2/OVSSiteXenStore.py", line 45, in get_vm_vnc_conn raise Exception(rs)
2. ParaInstallation: (XMachineX):
failed:<Exception: failed:<Exception: virt-install paravirt name=98_XP_es ram=512 vcpus=1 mac=00:16:3E:73:7D:45 bridge=xenbr0 file /OVS/running_pool/98_XP_es/System.img file-size=12 vnc vnclisten=0.0.0.0 vncpasswd=/tmp/tmpzYrJVG noautoconsole location=nfs:linuxvm:/el/EL5-x86 keymap=en-us=>ERROR: Invalid NFS location given: [Errno 2] No such file or directory: '/var/lib/xen/xennfs.ZceAYm/images/xen/vmlinuz' > StackTrace: File "/opt/ovs-agent-2.2/OVSXXenVMInstall.py", line 306, in xen_install_vm_para run_cmd(cmd) File "/opt/ovs-agent-2.2/OVSCommons.py", line 87, in run_cmd raise Exception('%s=>%s' % (cmd, p.childerr.read())) > StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVMInstall.py", line 184, in install_vm_para else: raise Exception(rs)
thanks for any help; as I am new in thishi,
i use vm 2.1.5, this upgrade from 2.1.2
but i can't create vm
err:
failed:<KeyError: 'vcaps'> StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVMInstall.py", line 77, in install_vm_hvm l = [ h for h, srv in cds.db_srv.items() if not "hvm" in srv["vcaps"] ]
help me plz... -
Using result of a Calculated Keyfigure as input for a Virtual Keyfigure
Hi experts,
is it possible, to use the result of a calculated keyfigure of a query for the input of a virtual keyfigure und use the virtual keyfigure within the same query?
My problem: depending on drilldown, I have a different percentage within the calculated keyfigure. And depending on that value, I would like to read a score out of a DSO and fill a virtual keyfigure with that, and show the score in the same query. In my opionion, the only way to calculate the score is on the fly, depending on the navigation step I do. Maybe there is another approach that I do not know.
I was glad for any ideas. Thank you in advance!
Regards
F.L.Hi,
Sorry but a calculated key figure result cannot be used in a virtual key figure calculation. The reason purely being that the CKF calculations happen after the Virtual KF/ Char calculations (through BAdI or CMOD).
The only solution i see here is that you will need to do the calculations in the VKF logic itself. Please do remember that VKF calculations and population happens for each record bein fetched into OLAP from the Infoprovider for the Filters put into the report.
Hope it helps.
Thanks,
Abhishek. -
Badi-Virtual keyfigure value not populating in query
HI all,
I am trying to populate a constant value into the virtual keyfigure when the query is executed but the value is not getting populated.
I followed the steps how to do this by looking into the step by step process for keyfigure article which i found in SDN.
When i execute my BADi in se19 i am able to get the value but not in the query.
Is there a special way to create keyfigures or is it the same way as we create a normal keyfigure.
Can someone tell me how to get the values in query.
Thanks in advance.
Regards,
HarishHi,
why dont you debug the badi while executing the report from RSRT t-code. This will give you some idea.
To debug, put a break point in 'define' as well as 'compute' function of your Badi-implementation, then go to RSRT t-code, enter your query name and then click generate. It will stop at the break-point. Here you can see what is the problem
Regards
akshay -
Is there a way to create a virtual network using C# and the Azure SDK/API?
I don't see a clear way to create an Azure Virtual Network using the SDK.
I have all the methods to create the virtual network configuration, but no way to submit it:
IList<string> VirtualNetworkAddressPrefixes = new List<string>();
IList<string> LocalNetworkAddressPrefixes = new List<string>();
IList<NetworkListResponse.DnsServer> DNSServers = new List<NetworkListResponse.DnsServer>();
IList<NetworkListResponse.Subnet> Subnets = new List<NetworkListResponse.Subnet>();
NetworkListResponse.Gateway Gateway = new NetworkListResponse.Gateway();
IList<NetworkListResponse.LocalNetworkSite> LocalSites = new List<NetworkListResponse.LocalNetworkSite>();
IList<NetworkListResponse.Connection> Connections = new List<NetworkListResponse.Connection>();
VirtualNetworkAddressPrefixes.Add("a.b.c.d/cidr");
DNSServers.Add(new NetworkListResponse.DnsServer() { Name = "TestDNS1", Address = "a.b.c.d" });
Subnets.Add(new NetworkListResponse.Subnet() { Name = "Subnet-1", AddressPrefix = "a.b.c.d/cidr" });
Subnets.Add(new NetworkListResponse.Subnet() { Name = "GatewaySubnet", AddressPrefix = "a.b.c.d/cidr" });
Connections.Add(new NetworkListResponse.Connection() { Type = LocalNetworkConnectionType.IPSecurity });
LocalNetworkAddressPrefixes.Add("a.b.c.d/cidr");
LocalSites.Add(new NetworkListResponse.LocalNetworkSite()
Name = "On-Prem",
Connections = Connections,
VpnGatewayAddress = "a.b.c.d",
AddressSpace = new NetworkListResponse.AddressSpace() { AddressPrefixes = LocalNetworkAddressPrefixes }
Gateway.Sites = LocalSites;
Gateway.Profile = GatewayProfile.ExtraLarge;
NetworkManagementClient netMgmtClient = new NetworkManagementClient(CloudCredentials);
NetworkListResponse netlistresp = GlobalSettings.mainWindow.netMgmtClient.Networks.List();
netlistresp.VirtualNetworkSites
.Add(new NetworkListResponse.VirtualNetworkSite()
Name = "TestVirtualNetwork",
AddressSpace = new NetworkListResponse.AddressSpace() { AddressPrefixes = VirtualNetworkAddressPrefixes },
DnsServers = DNSServers,
Subnets = Subnets,
AffinityGroup = "East US",
Gateway = Gateway,
Label = "LabelValue"
I have also created the entire XML response and sent it to the NetworkManagementClient -> Networks.SetConfiguration() method, but it appears this command expects the virtual network to already be in existence. If anyone could give guidance, it would be
appreciated.Hi,
As discuss above , we have to create the XML response ,before that first you have to
GetConfiguration() details of existing virtual network.
string.format("@<NetworkConfiguration xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration'>
<VirtualNetworkConfiguration>
<Dns />
<VirtualNetworkSites>
<VirtualNetworkSite name=""{0}"" Location=""{1}"">
<AddressSpace>
<AddressPrefix>10.0.0.0/8</AddressPrefix>
</AddressSpace>
<Subnets>
<Subnet name=""Subnet-2"">
<AddressPrefix>10.0.0.0/11</AddressPrefix>
</Subnet>
</Subnets>
</VirtualNetworkSite>",Networkname,location)+(@"<VirtualNetworkSite name=""demodsf1"" Location=""West Europe"">
<AddressSpace>
<AddressPrefix>10.0.0.0/8</AddressPrefix>
</AddressSpace>
<Subnets>
<Subnet name=""Subnet-1"">
<AddressPrefix>10.0.0.0/11</AddressPrefix>
</Subnet>
</Subnets>
</VirtualNetworkSite> </VirtualNetworkSites>
</VirtualNetworkConfiguration>
</NetworkConfiguration>")
you have to append the node for existing node with new values , i got it its adding new virtual network
Best regards, -
Hi there,
Could anyone explain me why we get hundreds of sub-vi's when I use the
vi "DAQmx Create Virtual Channel"? This can easily be seen by exploring
the hierarchy of Labview examples such as "Acq&Graph Voltage - Ext
Clk.vi"???
This multitude of vi's considerably slows down my computer, especially at loading. Is there any way to get rid off that???
Thanks in advance for you help!
JonasHi,
the easier you have to program, more subVI´s needed for your kind of application. Because the VI´s from DAQmx are polymorph, so many SubVI´s are included in the VI´s. In traditional DAQ you have several palettes for each kind of measuement method. Analog In, Analog Out, Digital, Counter, ...! In DAQmx you have one VI and that can all.
But, the performance of you application at runtime is not affected. Of course it takes some time to load, but just at development environment not as an application.
Figure 3. Polymorphic VIs simplify the NI-DAQmx API.
Link to Document:
http://zone.ni.com/devzone/conceptd.nsf/webmain/EE47B125BB9E053686256FBC0014C384
Hope this helps.
Alex
NI Switzerland -
Merge PR (same sales order) and Create PO using BADI
Hi,
How to merge PR (of same sales order) and create PO using Tcode ME59n.
Is this possible using BADI?
pls reply.
A Rahim.Hello Deepak
This kind of issue is probably related to your rescheduling settings. The PO is probably excluded from the rescheduling settings on customizing or it is outside the rescheduling horizon.
Please take a look on the following WIKI that explains the rescheduling and the related settings in detail:
What is rescheduling and how does it work - ERP Manufacturing (PP) - SCN Wiki
BR
Caetano
Maybe you are looking for
-
Which are the most popular reports in SAP BI for Purchasing and Sales
Hi Experts, I'm looking to work on one completed BI content flow. I wanted to work on 1 report from each module to activate the relevant objects. Can anyone please let me know which reports in Purchasing and Sales are frequently used in SAP BI. Thank
-
CUE "Service Module is failed"
Dears , i am getting this error on CUE .I reload the router but result is same .what should i do now?? .. #service-module service-engine 0/1 status Service Module is Cisco Service-Engine0/1 Service Module supports session via TTY l
-
HTML Escaping Regular Expression
Assume I have the following string: <font face="arial">this</font> is a <b>very nice</b> " <a href>String</a>Now say I want to allow everything above, except I want to escape certain tags... IE I want to allow: <b>,</b>,<font ...>,</font> and nothing
-
Hr Administrator processing of leave request
Hi Experts, We are implementing the leave request using WF WS12300111. We have a requirement in which we need to customize at TS12300104 which is for the HR Administrator to process in case the status change is not effected. The work item should come
-
About once every 2 hours, my keyboard goes into freak mode (for up to 30 minutes) where the keyboard frequently will stop working entirely for a few seconds at a time, or my input on keys is delayed anywhere from a couple seconds to about 10 seconds.