Trasnporting EXIT_SAPMRSRU_001 INCLUDE ZXRSRU02
Hi Gurus,
I have written code in this virtual KF exit and in its components INCLUDE LXRSRTOP and in INCLUDE ZXRSRZZZ for our virtual KF/ chars. This code is currently in development box.
My question is how do I transport this to Acceptance box. How do I collect? etc. and what to send?
I would appreciate any help.
Regards,
Reddy
Hi,
nomally these includes go directly into a transport order. If you decided to have them as temporary objects, then you need to go to SE80, chose Paket $TMP, find your includes and with a right mouse click on the include you go to 'more functions' and then to change paket asignment. Then you need to assign a new development class (paket) that will be transported and automatically the includes are posted to a transport order.
regards
Siggi
Similar Messages
-
I am trying to use user exit EXIT_SAPMRSRU_001 for one of the requirement but while trying to write code in the include ZXRSRU02. I am getting below. any one of you can help me.
Program names ZX... are reserved for includes of exit function groups
Message no. DS027
Diagnosis
You attempted to create a program name beginning with ZX but this name range is reserved only for includes of exit function groups (function groups containing only function exits).
If you want to create a program ZXaaabbb, note the following for program type I (Include).
1. The program is an include of the function group Xaaa:
In this case, the INCLUDE ZXaaabbb statement should not be inserted in the main program SAPLXaaa, but in the program ZXaaaZZZ .
2. The program is not an include of the function group Xaaa:
Since the syntax check for includes of this name range searches for the global data in the program LXaaaTOP (not ZXaaaTOP), you may not be able to check the include in isolation (--> check main program).
Procedure
Choose a different program name.hi,
just press Enter, it will go to next screen.
it just a 'warning' ....
you may need to create include zxrsrtop first if you haven't done, and zxrsrzzz later. -
When routine will called in the include ZXRSRZZZ
Hi,
I created one virtual Characterstic, I wanted display constant value in the report for that Virtual characterstics, I included virtualcharacter in the rows I didn't assigned any variable to that characterstics.
Do I need to assign any variable for that Characterstics.
I am writing code like below
*& Include ZXRSRTOP
DATA: s_t_var_range TYPE rrrangeexit.
DATA: s_t_busarea TYPE rrrangeexit.
DATA: it_busarea TYPE rrs0_t_var_range.
DATA: g_pos_democube_date TYPE i.
*& Include ZXRSRU02
DATA: l_s_chanm TYPE rrke_s_chanm.
CASE i_s_rkb1d-infocube.
WHEN 'ZODS_TST'.
l_s_chanm-chanm = 'ZFISCPER'.
l_s_chanm-mode = rrke_c_mode-no_selection.
APPEND l_s_chanm TO e_t_chanm.
ENDCASE.
*& Include ZXRSRZZZ
FORM USER_ZODS_TST USING I_S_RKB1D TYPE RSR_S_RKB1D CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_DATE>.
ASSIGN COMPONENT G_POS_DEMOCUBE_DATE OF STRUCTURE C_S_DATA TO <L_DATE>.
<L_DATE> = '2006012'.
ENDFORM.
When I put a break point the ZXRSRU02 and ZXRSRZZZ, the cursor is reaching to ZXRSRU02. But cursor never reaches to ZXRSRZZZ this include.
Please let me know when exactly the sub-routine will be called in the ZXRSRZZZ include. Otherwise do I need to any thing extra rather than this.
Thanks,
VenkatHello Venkat,
Please see this OSS Note 891029 - RSR00002: Virtual chars and key figures in reporting.
Thanks
Chandran -
Hi Experts,
I want to display current date in the query in one of the time characterstic which i am including in the data target but i don't want to load anything in the data target but still i want to display the current date in the query only.
how can i achieve this.
thanks and regardsHi,
It's a real fcahllenge or a non ABAPer.You have to create a project in cmod and to assign enhancement RSR00002.
In component EXIT_SAPMRSRU_001 you will find a couple of includes.
Please add attached code. Replace YOURCUBE by the name of your info provider and YOURIO by the name of desired info object.
*& Include ZXRSRTOP
DATA: G_POS_YOURCUBE_ YOURIO TYPE I.
*& Include ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
DATA: L_SUBRC1 TYPE SY-SUBRC. "execute only, if key figure really used
CASE I_S_RKB1D-INFOCUBE.
WHEN 'YOURCUBE'.
L_S_CHANM-CHANM = 'YOURIO'.
L_S_CHANM-MODE = RRKE_C_MODE-NO_SELECTION.
APPEND L_S_CHANM TO E_T_CHANM.
ENDCASE.
*& Include ZXRSRZZZ
FORM USER_YOURCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_YOURIO>.
ASSIGN COMPONENT G_POS_YOURCUBE_YOURIO OF STRUCTURE C_S_DATA TO <L_YOURIO >.
<L_YOURIO >.= SY-DATUM.
ENDFRORM.
Hope it works.
Good Luck
Joe -
Hello Everyone,
I have few questions related to BEx .
1. Can we use a function module in BEx so that ABAP code can be called while executing Bex query/report in BEx Analyzer.
2. Can someone tell me how to use multiple structures / variables in query based on conditions.
3. Could someone tell me how to invoke/refresh a macro in BEx automatically on executing a query in BEx Analyzer.
Thanks.Hi here a short description for virtual key figure or characteristics and own variables (what Klaus means):
1. Virtual Characteristics and Virtual Key figures
- A virtual characteristic / key figure is an object of the InfoCube. The values are derived at query run time.
- Examples:
The SalesRep is derived from Product and Customer. This assignment changes frequently. Therefore the value for the characteristic SalesRep can not be stored in the Cube.
You want to calculate with key figure-type attributes of an InfoObject. E.g. Price is an attribute of Product. Sold-quantity is an object of the InfoCube. You want to see the revenue (Sold-quantity * Price) in your query.
You have an "Open-order-InfoCube". One InfoObject is the Orderdate. You need a list with the number of days btw. the orderdate and today.
How to program a corresonding Include:
1. You must firstly define the characteristics, or key figures within the InfoCube
2. Call up transaction CMOD in the Admin. Workbench
Create a Project
3. Select Enhancement Components
4. Select Enhancement RSR00002
5. Double-click on Exit EXIT_SAPMRSRU_001
6. Double-click on include ZXRSRU02 within the Exit
7. Display or change coding
8. Maintain include ZXRSRTOP
9. Maintain include ZXRSRZZZ
10. Don't forget to activate the Project
Interface Importing/Exporting:
IMPORTING:
I_S_RKB1D -> Information about Reporting-Object; here Query (Queryname, InfoCube, ...)
EXPORTING:
E_T_CHANM -> Table with the name of the virtual characteristics
E_T_KYFNM -> Table with the name of the virtual key figures
Remarks:
- You should note that the data records transferred can be on a different aggregation level depending on read procedure and drilldown.
- Moreover, compound information is not automatically changed with compounded characteristics after changing a higher-level characteristic. In addition, the compound characteristic must also be defined in the mode RRKE_C_MODE-NO_SELECTION.
- Furthermore, the fiscal year (0FISCYEAR), the fiscal year period (0FISCPER) and the fiscal year variant (0FISCVARNT) cannot be read or changed in the enhancement. (*)
- Enhancement 999 may not be changed. Calling up serves to update information via the structure C_S_DATA. This functionality is completely taken over by form USER_INIT_GLOBALS.
2. User Exit for variables:
-Enhancement: RSR00001
- The component for the enhancement is the function module EXIT_SAPLRRS0_001.
How to program a corresponding Include:
- Create variable with corresponding type for User Exit
- Call up transaction CMOD in the Admin. Workbench
- Create a Project
- Select Enhancement Components
- Select Enhancement RSR00001
- Double-click on Exit EXIT_SAPLRRS0_001
- Double-click on include ZXRSRU01 within the Exit
- Add or change coding
- Don't forget to activate the Project
- Use the variable in a query
Interface - Importing:
I_VNAM --> Name of the Variable; without &-signs
I_VARTYP -->
1: Characteristic Value
2: Hierarchy node(s)
3: Text
4: Formula
5: Hierarchy
I_IOBJNM --> Name of the InfoObject
I_S_COB_PRO --> Information about InfoObject(Dataelement, CheckTable, Length, Number of Decimals, ...)
I_S_RKB1D --> Information about Reporting-Object; here Query (Queryname, InfoCube, ...)
I_PERIV --> Fiscal year variant
I_T_VAR_RANGE --> Table with all Variables and their values
I_STEP
1: Before Variable Pop up
2: After Variable Pop up
E_T_RANGE --> Table to return the values
fields: low, high, sign, opt
E_MEEHT --> Unit of measure
E_MEFAC --> Number of Decimals for Unit
E_WAERS --> Currency Code
E_WHFAC --> Number of Decimals for Currency Value
You can do many amazing things in BW. Well if you like you can use also ABAP in TableInterface for Web or JavaScript in Web. VBA in BEx Analyzer and many more interesting things. Just surf to http://hel.sap.com and find out!
Regards,
Adem -
Virual Key figure exit does not work
Hi,
Detail - We are trying to build a logic for a virtual key figure.
We have created a VKF (Virtual key figure) and added that in cube and respective multi-provider.
We also added that VKF into the query .
Now we are using following approach and it doesnot work -
Approach 1 -
We created BADi called ZBIVAR_IMP based on RSR_OLAP_BADI using SE19 transaction. In this definition , we included our class - ZCL_IM_BIVAR_IMP
We activated this BADi definition and then in our Z Class - we have 3 methods, define, initialize and compute. We activated break-point .
We wrote a code there and followed sample code of CL_EXM_IM_RSR_OLAP_BADI class.
Now when we try to excute our query from RSRT, system doesnot stop at our break-point. In another words, this BADi is not getting called.
We also observed following settings if that matters --
1) When we go to RSRT for the query name and click on option, "No paraller processing" is on.
2) When we go to RSRT and click on technical info, we see "Virtual key Figure" property is set to NO. If this needs to be changed then how do we do that?
3) We activated BADi definition but not sure if we need to activate BADi implementation , if yes then how?
Approach 2 -
We develop code in one of the BEx user exit called EXIT_SAPMRSRU_001
In this exit , we have include called INCLUDE ZXRSRU02 .
We donot have any other includes such as ZXRSRZZZ or ZXRSRTOP. To be frank , we donot know how to use these includes and where are those available to be used?
Problem of this approach is we cannot use C_S_DATA that gets final logic of key figure to be used in BEx report.
Both of these approaches doesnot work..
Your help in this regard will be highly appreciated.
Thanks,
Raj.Hi BI technical folks..
I also have simillar issue at my place. Can someone help?
Thanks
A -
Delivery Vs Invoice Data Source !
Hi
We are facing an issue with our On time report. We have to get the nr of days between two dates which is Est Goods Movement Date - Act goods movement Date
If it gives 0 which is Ontime , <0 then its an Early , > 0 then Late...
I have both the dates available in my delivery data source 2LIS_12_VCITM and the Invoice amount I want to show from invoice data source 2LIS_13_VDITM . I dont see the dates in my 2LIS_13_VDITM.
We have separate cubes for deliveries and Invoices and deliveris only have qty and invoice has value....these both cubes are combined in a multi cube. Can anybody give me an idea of how to get the dates in my Invoice cube ?
Do I need to create a DSO to merge delivery and Invoice data ?
without the date fields I cant get my Ontime report and with dates from Delivery data source I cant show the invoice amount...
Please advice...Hi Sam,
Follow the below precedure for implementing virtual characteristics:
BW: Virtual characteristics and key figures in Reporting
Enhancement: RSR00002
With this enhancement, you can define and evaluate user-specific virtual
characteristics and key figures.
Components
The components for the enhancement are the function modules
EXIT_SAPMRSRU_001 and EXIT_SAPMRSRU_999.
Using enhancement 001
You must firstly define the characteristics, or key figures within the
InfoCube.
You deposit the customer-specific code in include reports. The include
ZXRSRU02 is intended for function module EXIT_SAPMRSRU_001. In this
include, the fields still to be processed must be listed. The name of a
characteristic in field CHANM and of the processing mode in the field
MODE is located in the table E_T_CHANM. Characteristics can either be
processed reading (constant RRKE_C_MODE-READ) or writing (constant
RRKE_C_MODE-NO_SELECTION). Table E_T_KYFNM contains the name for the key
figures to be processed.
In the include ZXRSRTOP, a global variable must be created for each
InfoCube for each characteristic. Field information for the structure to
be changed is stored in these variables. The name of the variables is
formed from the prefix G_POS_, the name of the InfoCube,_ and the name
of the InfoObject all together.
In the include ZXRSRZZZ, a form (routine) must be created for every
InfoCube. The name of this form must be made up of USER_ and the
technical name of the InfoCube. The specific code for the virtual
characteristics, or key figures, for this InfoCube is stored in this
form. The individuals fields of the structure C_S_DATA to be changed are
accessed using field symbols.
You should note that the data records transferred can be on a different
aggregation level depending on read procedure and drilldown. Moreover,
compound information is not automatically changed with compounded
characteristics after changing a higher-level characterisic. In
addition, the compound characteristic must also be defined in the mode
RRKE_C_MODE-NO_SELECTION.
Furthermore, the fiscal year (0FISCYEAR), the fiscal year period
(0FISCPER) and the fiscal year variant (0FISCVARNT) cannot be read or
changed in the enhancement.
Using enhancement 999
Enhancement 999 may not be changed. Calling up serves to update
information via the structure C_S_DATA. This functionality is completely
taken over by form USER_INIT_GLOBALS.
Example
InfoCube DEMOCUBE has the characteristic PRODUCT PRICE_TP and the key
figure ACT_PRICE and QUANTITY. In the enhancement, the product from the
current price for PRODUCT and the key figure QUANTITY should be
determined. If successful, the characteristic PRICE_TP should contain
the characteristic value '1'.
The include ZXRSRU02: Definition
***INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
CASE I_S_RKB1D-INFOCUBE.
WHEN 'DEMOCUBE'.
L_S_CHANM-CHANM = 'PRODUCT'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
L_S_CHANM-CHANM = 'PRICE_TP'.
L_S_CHANM-MODE = RRKE_C_MODE-NO_SELETION.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ACT_PRICE' TO E_T_KYFNM.
APPEND 'QUANTITY' TO E_T_KYFNM.
ENDCASE.
The include ZXRSRTOP: global data
***INCLUDE ZXRSRTOP .
DATA: G_POS_DEMOCUBE_PRODUCT TYPE I.
DATA: G_POS_DEMOCUBE_PRICE_TP TYPE I.
DATA: G_POS_DEMOCUBE_ACT_PRICE TYPE I.
DATA: G_POS_DEMOCUBE_QUANTITY TYPE I.
Das Include ZXRSRZZZ: Changing the data
***INCLUDE ZXRSRZZZ .
FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_PRODUCT>.
FIELD-SYMBOLS <L_PRICE_TP>.
FIELD-SYMBOLS <L_ACT_PRICE>.
FIELD-SYMBOLS <L_QUANTITY>.
ASSIGN COMPONENT G_POS_DEMOCUBE_PRODUCT
OF STRUCTURE C_S_DATA TO <L_PRODUCT>.
ASSIGN COMPONENT G_POS_DEMOCUBE_PRICE_TP
OF STRUCTURE C_S_DATA TO <L_PRICE_TP>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ACT_PRICE
OF STRUCTURE C_S_DATA TO <L_ACT_PRICE>.
ASSIGN COMPONENT G_POS_DEMOCUBE_QUANTITY
OF STRUCTURE C_S_DATA TO <L_QUANTITY>.
Routine to get the price
PERFORM GET_PRICE USING <L_PRODUCT>
CHANGING <L_ACT_PRICE>.
IF <L_ACT_PRICE> GT 0.
<L_ACT_PRICE> = <L_ACT_PRICE> * <L_QUANTITY>.
<L_PRICE_TP> = '1'.
ENDIF.
ENDFORM.
use the below link for understaning in detail:
Virtual Characteristic
DONT FORGET TO ASSING POINTS IF IT IS HELPFUL.
Regards,
S P. -
Short Dump ASSIGN_TYPE_CONFLICT in Virtual KF implementation
Hi
Iam getting a short dump in my virtual KF code. Here is the code that I have written. If I have only bill date it works fine. The minute I add company code it gives the short dump. Can you pls let me know what is it that Iam doing wrong. any help will be greatly useful. Thanks.
INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
DATA: L_SUBRC1 TYPE SY-SUBRC. "execute only, if key figure really used
CASE I_S_RKB1D-INFOCUBE.
WHEN '0SD_C03'.
L_S_CHANM-CHANM = '0BILL_DATE'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
L_S_CHANM-CHANM = '0COMP_CODE'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ZCOUNT1' TO E_T_KYFNM.
ENDCASE.
*Include ZXRSRTOP*
DATA : G_POS_0SD_C03_0BILL_DATE TYPE I.
DATA : G_POS_0SD_C03_0COMP_CODE(4).
DATA : G_POS_0SD_C03_ZCOUNT1 TYPE I.
Include ZXRSRZZZ
FORM USER_0SD_C03 USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
DATA: l_zcount1 TYPE int4.
FIELD-SYMBOLS <L_0BILL_DATE>.
FIELD-SYMBOLS <L_0COMP_CODE>.
FIELD-SYMBOLS <L_ZCOUNT1>.
ASSIGN COMPONENT G_POS_0SD_C03_0BILL_DATE
OF STRUCTURE C_S_DATA TO <L_0BILL_DATE>.
ASSIGN COMPONENT G_POS_0SD_C03_0COMP_CODE
OF STRUCTURE C_S_DATA TO <L_0COMP_CODE>.
ASSIGN COMPONENT G_POS_0SD_C03_ZCOUNT1
OF STRUCTURE C_S_DATA TO <L_ZCOUNT1>.
IF <L_0COMP_CODE> = 'AB99'.
CALL FUNCTION 'ZCALC_WDAYS_BETWEEN_DATES'
EXPORTING
P_DATE1 = <L_0BILL_DATE>
P_DATE2 = SY-DATUM
P_CAL_ID = 'Z1'
IMPORTING
P_DAYS = l_zcount1.
<L_ZCOUNT1> = l_zcount1.
ELSEIF <L_0COMP_CODE> = 'DC99'.
CALL FUNCTION 'ZCALC_WDAYS_BETWEEN_DATES'
EXPORTING
P_DATE1 = <L_0BILL_DATE>
P_DATE2 = SY-DATUM
P_CAL_ID = 'Z2'
IMPORTING
P_DAYS = l_zcount1.
<L_ZCOUNT1> = l_zcount1.
ENDIF.
The short dump:
ASSIGN_TYPE_CONFLICT
"CL_IM_RSR_OLAP_BADI===========CP" or "CL_IM_RSR_OLAP_BADI===========CM002"
"IF_EX_RSR_OLAP_BADI~INITIALIZE"
get field postions for characteristics in structure
LOOP AT i_th_sfc ASSIGNING <l_s_sfc>
WHERE user_exit NE rrke_c_mode-none.
field name in structure is keyreturnnm
name of the global variable
CONCATENATE '(SAPLXRSR)G_POS' i_s_rkb1d-infocube <l_s_sfc>-chanm
INTO l_global_name
SEPARATED BY '_'.
fill the global variable
UNASSIGN <l_global>.
>>>>>>>> ASSIGN (l_global_name) TO <l_global>.My suggestion is that you review the how-to papers on SDN regarding exit RSR00002 or RSR_OLAP_BADI. These are alternative methods of accomplishing virtual characteristics and key figures. The code you have given is for exit RSR00002 (although it is full of syntax errors so is not executable), but the short dump you are getting refers to RSR_OLAP_BADI, so you must have implemented that Class as well, but incompletely.
Which method are you attempting to use? -
Usage of virtual Charcterstic.
Hi gurus,
I have a scenario where in need to populate ZINDICATOR with different status depending on the values in ZSTATUS.
And i want to do it at the time of the query execution and i have preferred to do it in Virtual Characterstic
i am giving the code below which i have copied from SDN and made some changes eventhough without much knowledge in ABAP, so kindly if somebody can guide me whether i am in right track or not....
***INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
CASE I_S_RKB1D-INFOCUBE.
WHEN 'DEMOCUBE'.
L_S_CHANM-CHANM = 'ZINDICATOR'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ZSTATUS' TO E_T_KYFNM.
ENDCASE.
The include ZXRSRTOP: global data
***INCLUDE ZXRSRTOP .
DATA: G_POS_DEMOCUBE_ZINDICATOR TYPE I.
DATA: G_POS_DEMOCUBE_ZSTATUS TYPE I.
The Include ZXRSRZZZ: Changing the data
***INCLUDE ZXRSRZZZ .
FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_ZINDICATOR>.
FIELD-SYMBOLS <L_ZSTATUS>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ZINDICATOR
OF STRUCTURE C_S_DATA TO <L_ZINDICATOR>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ZSTATUS
OF STRUCTURE C_S_DATA TO <L_ZSTATUS>.
Routine to get the ZINDICATOR
PERFORM GET_ZINDICATOR USING <L_ZSTATUS>
IF <ZSTATUS> EQ 1.
<L_ZINDICATOR> = 'ACCEPTED'.
ELSE
<ZSTATUS> EQ 2.
<L_ZINDICATOR> = 'REJECTED'.
ELSE
<ZSTATUS> EQ 3.
<L_ZINDICATOR> = 'INPROCESS'.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
thanks and regards
Neel
Message was edited by:
Neel KamalHi,
As far as creating constant variables are concern its very simple..pls. go through
the below code which would not only tells you how to declare a constant variable
and it's usage..
coming to your second question you can also see how to handle the conditions..
Check the Blod Parts of the code;
***INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
<b>Constant variable Delcaration EX:
DATA : L_ACCEPTED(8) TYPE C VALUE 'ACCEPTED',
L_REJECTED(8) TYPE C VALUE 'REJECTED',
L_INPROCESS(9) TYPE C VALUE 'INPROCESS'.</b>
CASE I_S_RKB1D-INFOCUBE.
WHEN 'DEMOCUBE'.
L_S_CHANM-CHANM = 'ZINDICATOR'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ZSTATUS' TO E_T_KYFNM.
ENDCASE.
The include ZXRSRTOP: global data
***INCLUDE ZXRSRTOP .
DATA: G_POS_DEMOCUBE_ZINDICATOR TYPE I.
DATA: G_POS_DEMOCUBE_ZSTATUS TYPE I.
The Include ZXRSRZZZ: Changing the data
***INCLUDE ZXRSRZZZ .
FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_ZINDICATOR>.
FIELD-SYMBOLS <L_ZSTATUS>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ZINDICATOR
OF STRUCTURE C_S_DATA TO <L_ZINDICATOR>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ZSTATUS
OF STRUCTURE C_S_DATA TO <L_ZSTATUS>.
Routine to get the ZINDICATOR
PERFORM GET_ZINDICATOR USING <L_ZSTATUS>
IF <ZSTATUS> EQ 1. <b>instead IF <ZSTATUS> EQ '1' or IF <ZSTATUS> EQ '001'.</b>
<L_ZINDICATOR> = 'ACCEPTED'. <b>instead <L_ZINDICATOR> = L_ACCEPTED.</b>
ELSE
<ZSTATUS> EQ 2. <b>instead IF <ZSTATUS> EQ '2' or IF <ZSTATUS> EQ '002'.</b>
<L_ZINDICATOR> = 'REJECTED'. <b>instead <L_ZINDICATOR> = L_REJECTED.</b>
ELSE
<ZSTATUS> EQ 3.
<L_ZINDICATOR> = 'INPROCESS'. <b>instead <L_ZINDICATOR> = L_INPROCESS.</b>
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
Hope it helps..
assign points if useful..
Cheers,
Pattan.
Message was edited by:
Nasiroddin Pattan -
Hi Guys,
I have some questions about virtual key figures/Characteristics . Could anyone help me, please?
In a query you can change the columns and delete some of those . If you do that the "query" has to recalculate the value of key figure column because if you delete a characteristic key column, the query have to change the value of the other columns, hasn't it?
The other doubt is.
If you do a "query1" with a virual key figure "key_fig1" and you do another query called "query2" in the user exit
EXIT_SAPMRSRU_001--> Include ZXRSRZZZ you can choose that only query1 use the virtual key figure??, because "query1" has the same definition of "query2".
Thanks a lot ,
best regards.
AnaHi Ana,
1. When you remove a column from a BEx report in Analyzer, the query aggregates the value of the key figures to the appropriate level. Similarly, when you add a new column into the result set, the key figures are disaggregated.
2. Yes you can code a condition in your exit so that only query 1 executes the code for customer exit. Do a check on
IF I_S_RKB1D-COMPID = '<query1 name>'.
write you code for calculation of VKF here *
ENDIF. -
Virtual Key Figures - Field Symbol
Dear guru's,
We had obtained an ABAP error in the execution of a query when obtaining a virtual key figure. We analyzed the problem and identified the error. We fixed it in our dev system and tested ok.We then transported the includes ZXRSRU02, ZXRSRTOP, ZXRSRZZZ to our quality system and the problem persisted. The error occurs because the structure c_s_data has not updated to include the added object and therefore assigns the structure to the field symbol and not its value.
I have checked the versions of these includes and they are identical. What could be the possible causes for this problem and solutions?
Thanks and Kind Regards,
AlexWe transfered many times the corrected code and still the probem persisted. If my understanding is correct the structure c_s_data is created by BW according to the appends you make in the code (...RU02).
The problem was resolved when we regenrated the queries. If anyone can explain why this is so, please let me know so that I may have a better understanding of this process.
Thanks and Kind Regards,
Alex -
Virtual Char/KF not populated in the query ????
Hi,
Can anybody suggest why Virtual char/KF are not populated in Query. I just want to populate the value from existing cube characterstics/KF value.
Code as follows:
Cube : ZDEBC01
Virtual Char: ZVIRTUAL1
Virtual KF : ZVIRTUALK
*& Include ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
CASE I_S_RKB1D-INFOCUBE.
WHEN 'ZDEBC01'.
L_S_CHANM-CHANM = '0SOLD_TO'.
L_S_CHANM-MODE = rrke_c_mode-READ.
APPEND L_S_CHANM TO E_T_CHANM.
L_S_CHANM-CHANM = 'ZVIRTUAL1'.
L_S_CHANM-MODE = rrke_c_mode-NO_SELECTION.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND '0INVCD_QTY' TO E_T_KYFNM.
APPEND 'ZVIRTUALK' TO E_T_KYFNM.
ENDCASE.
*& Include ZXRSRTOP
DATA: G_POS_ZDEBC01_ZVIRTUAL1 TYPE /BIC/OIZVIRTUAL1.
DATA: G_POS_ZDEBC01_ZVIRTUALK TYPE I.
DATA: G_POS_ZDEBC01_0SOLD_TO TYPE /BI0/OISOLD_TO.
DATA: G_POS_ZDEBC01_0INVCD_QTY TYPE I.
*& Include ZXRSRZZZ
FORM USER_ZDEBC01 USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_ZVIRTUAL1>.
FIELD-SYMBOLS <L_ZVIRTUALK>.
FIELD-SYMBOLS <L_0SOLD_TO>.
FIELD-SYMBOLS <L_0INVCD_QTY>.
ASSIGN COMPONENT G_POS_ZDEBC01_0SOLD_TO
OF STRUCTURE C_S_DATA TO <L_0SOLD_TO>.
ASSIGN COMPONENT G_POS_ZDEBC01_0INVCD_QTY
OF STRUCTURE C_S_DATA TO <L_0INVCD_QTY>.
ASSIGN COMPONENT G_POS_ZDEBC01_ZVIRTUAL1
OF STRUCTURE C_S_DATA TO <L_ZVIRTUAL1>.
ASSIGN COMPONENT G_POS_ZDEBC01_ZVIRTUALK
OF STRUCTURE C_S_DATA TO <L_ZVIRTUALK>.
<L_ZVIRTUAL1> = <L_0SOLD_TO>+0(3).
<L_ZVIRTUALK> = <L_0INVCD_QTY> + 1000 .
ENDFORM. "USER_ZDEBC01
Thanks,
Debasish
nullHi,
in your code all variables:
DATA: G_POS_ZDEBC01_ZVIRTUAL1 TYPE /BIC/OIZVIRTUAL1.
DATA: G_POS_ZDEBC01_ZVIRTUALK TYPE I.
DATA: G_POS_ZDEBC01_0SOLD_TO TYPE /BI0/OISOLD_TO.
DATA: G_POS_ZDEBC01_0INVCD_QTY TYPE I.
must be of type i.
regards
Siggi -
I have already searched for and could not find the basic steps of Creating a Virtual KeyFigure, Can someone provide these?
ThanksHi,
User Exit Virtual Characteristics and Key figures
Example: InfoCube DEMOCUBE has the characteristic PRODUCT PRICE_TP and the key figure ACT_PRICE and QUANTITY. In the enhancement, the product from the current price for PRODUCT and the key figure QUANTITY should be determined. If successful, the characteristic PRICE_TP should contain the characteristic value '1'.
The include ZXRSRU02: Definition
INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
CASE I_S_RKB1D-INFOCUBE.
WHEN 'DEMOCUBE'.
L_S_CHANM-CHANM = 'PRODUCT'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
L_S_CHANM-CHANM = 'PRICE_TP'.
L_S_CHANM-MODE = RRKE_C_MODE-NO_SELETION.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ACT_PRICE' TO E_T_KYFNM.
APPEND 'QUANTITY' TO E_T_KYFNM.
ENDCASE.
The include ZXRSRTOP: global data
INCLUDE ZXRSRTOP .
DATA: G_POS_DEMOCUBE_PRODUCT TYPE I.
DATA: G_POS_DEMOCUBE_PRICE_TP TYPE I.
DATA: G_POS_DEMOCUBE_ACT_PRICE TYPE I.
DATA: G_POS_DEMOCUBE_QUANTITY TYPE I.
The Include ZXRSRZZZ: Changing the data
INCLUDE ZXRSRZZZ .
FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS <L_PRODUCT>.
FIELD-SYMBOLS <L_PRICE_TP>.
FIELD-SYMBOLS <L_ACT_PRICE>.
FIELD-SYMBOLS <L_QUANTITY>.
ASSIGN COMPONENT G_POS_DEMOCUBE_PRODUCT
OF STRUCTURE C_S_DATA TO <L_PRODUCT>.
ASSIGN COMPONENT G_POS_DEMOCUBE_PRICE_TP
OF STRUCTURE C_S_DATA TO <L_PRICE_TP>.
ASSIGN COMPONENT G_POS_DEMOCUBE_ACT_PRICE
OF STRUCTURE C_S_DATA TO <L_ACT_PRICE>.
ASSIGN COMPONENT G_POS_DEMOCUBE_QUANTITY
OF STRUCTURE C_S_DATA TO <L_QUANTITY>.
Routine to get the price
PERFORM GET_PRICE USING <L_PRODUCT>
CHANGING <L_ACT_PRICE>.
IF <L_ACT_PRICE> GT 0.
<L_ACT_PRICE> = <L_ACT_PRICE> * <L_QUANTITY>.
<L_PRICE_TP> = '1'.
ENDIF.
ENDFORM. -
Can some one provide me the links for blogs and threads on
"maintaing delta" for custom fields, which are populated by custom abab code in user exit.
I couldn't find any blogs on this issue.
Thankshi go to the SAP market place you will find examples and a presentation
https://websmp202.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000682177&
go to Exits and find docts
· User Exits Examples (doc)
· User Exits in SAP BW (ppt)
here is the content of the first doc for the presentation go the link I provide and downoad it.
User Exit Examples (doc)
1. Extending Business Content - EXIT_SAPLRSAP_001
data: l_s_icctrcst like icctrcst,
l_s_icctract like icctract,
l_s_icctrsta like icctrsta,
l_tabix like sy-tabix.
case i_isource.
when '0CO_OM_CCA_1'.
loop at c_t_data into l_s_icctrcst.
l_tabix = sy-tabix.
select single * from z0001 where kokrs = l_s_icctrcst-kokrs
and kostl = l_s_icctrcst-kostl.
if sy-subrc = 0.
l_s_icctrcst-zfield1 = z0001-zfield1.
l_s_icctrcst-zfield2 = z0001-zfield2.
modify c_t_data from l_s_icctrcst index l_tabix.
endif.
endloop.
when '0CO_OM_CCA_2'.
when '0CO_OM_CCA_3'.
when others.
exit.
endcase.
2. User Exit after Data loading
(a) Delete old request
REPORT Z_RSSM_START_SECOND_PROCESS_1 .
TABLES: RSREQDONE, " Request-Data
RSSELDONE, " Selection for current Request
RSICCONT. " Request posted to which InfoCube
DATA: L_T_SELDONE LIKE RSSELDONE OCCURS 0 WITH HEADER LINE.
DATA: L_T_ICUBE LIKE RSICCONT OCCURS 0 WITH HEADER LINE.
DATA: L_LOGSYS LIKE RSSELDONE-LOGSYS.
DATA: L_SOURCE LIKE RSSELDONE-SOURCE.
DATA: L_SELDATE LIKE RSSELDONE-SELDATE.
DATA: L_SELTIME LIKE RSSELDONE-SELTIME.
DATA: BEGIN OF L_T_RNR_DEL OCCURS 0,
ICUBE LIKE RSICCONT-ICUBE,
RNR LIKE RSSELDONE-RNR,
END OF L_T_RNR_DEL.
PARAMETER I_RNR LIKE RSREQDONE-RNR.
SELECT SINGLE * FROM RSSELDONE WHERE
RNR = I_RNR.
IF SY-SUBRC <> 0. "new rquest does not exist, wrong rnr !!!
EXIT.
ENDIF.
SELECT * FROM RSICCONT INTO TABLE L_T_ICUBE WHERE
RNR = I_RNR.
IF SY-SUBRC <> 0. "New request is not posted to any IC
EXIT. "nothing will be deleted
ENDIF.
L_SOURCE = RSSELDONE-SOURCE.
L_LOGSYS = RSSELDONE-LOGSYS.
L_SELDATE = RSSELDONE-SELDATE.
L_SELTIME = RSSELDONE-SELTIME.
SELECT * FROM RSSELDONE INTO TABLE L_T_SELDONE WHERE
SOURCE = L_SOURCE AND
LOGSYS = L_LOGSYS.
DELETE L_T_SELDONE WHERE
RNR = I_RNR. "new request will be deleted
DELETE L_T_SELDONE WHERE "delete younger requests
SELDATE > L_SELDATE OR
( SELTIME > L_SELTIME AND
SELDATE = L_SELDATE ).
*Sort
SORT L_T_SELDONE BY SELDATE DESCENDING SELTIME DESCENDING.
REFRESH L_T_RNR_DEL.
LOOP AT L_T_SELDONE. " Requests to be deleted
LOOP AT L_T_ICUBE. " Request existing in InfoCubes
SELECT SINGLE * FROM RSICCONT WHERE
ICUBE = L_T_ICUBE-ICUBE AND
RNR = L_T_SELDONE-RNR. "check if posted to IC's
IF SY-SUBRC = 0.
L_T_RNR_DEL-ICUBE = L_T_ICUBE-ICUBE.
L_T_RNR_DEL-RNR = L_T_SELDONE-RNR.
APPEND L_T_RNR_DEL.
ENDIF.
ENDLOOP.
IF NOT L_T_RNR_DEL[] IS INITIAL. " something found for rnr
EXIT.
ENDIF.
ENDLOOP.
LOOP AT L_T_RNR_DEL.
CALL FUNCTION 'RSSM_DELETE_REQUEST'
EXPORTING
REQUEST = L_T_RNR_DEL-RNR
INFOCUBE = L_T_RNR_DEL-ICUBE
EXCEPTIONS
REQUEST_NOT_IN_CUBE = 1
INFOCUBE_NOT_FOUND = 2
REQUEST_ALREADY_AGGREGATED = 3
REQUEST_ALREADY_COMDENSED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
open for error-handling
ENDIF.
ENDLOOP.
(b) Send Mail after data load
data: document_data like sodocchgi1,
object_content like solisti1 occurs 0 with header line,
receivers like somlreci1 occurs 0 with header line.
concatenate tstatus 'Request' rnr 'uploaded'
into document_data-obj_descr
separated by space.
concatenate 'Request' rnr 'for Infosource' source 'uploaded'
into object_content-line separated by space.
append object_content.
concatenate 'from sourcesystem' logsys into object_content-line
separated by space.
append object_content.
move 'METTEJ' to receivers-receiver. append receivers.
move 'D020095' to receivers-receiver. append receivers.
all function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = document_data
document_type = 'RAW'
put_in_outbox = ' '
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
tables
OBJECT_HEADER =
object_content = object_content
OBJECT_PARA =
OBJECT_PARB =
receivers = receivers
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
3. User Exit for Variables
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
DATA: LOC_YEAR LIKE T009B-BDATJ,
LOC_POPER LIKE T009B-POPER,
LOC_DATE LIKE SY-DATUM.
CASE I_VNAM.
*-- SINGVAR - Variables: Variable SalesOrg, User-Exit, SingleValue
WHEN 'SINGVAR'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = '4000'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
*-- INTVAR - Variables: Variable SalesOrg, User-Exit, Interval
WHEN 'INTVAR'.
L_S_RANGE-LOW = '1000'.
L_S_RANGE-HIGH = '4000'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
*-- HIERVAR - Variables: Variable SalesOrg, User-Exit, Hierarchy
WHEN 'HIERVAR'.
L_S_RANGE-LOW = 'SD_DEMO5_SAL_HIER'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
*-- HNODEVAR - Variables: Variable SalesOrg, User-Exit, Hierarchy
WHEN 'HNODEVAR'.
L_S_RANGE-LOW = 'EUROPE'.
L_S_RANGE-HIGH = '0HIER_NODE'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
*-- DMDATEFR - Variables: User-ExitExample, I_T_VAR_RANGE,
*-- determine the end of the period for a day
WHEN 'DMDATETO'.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'DMDATEIN'.
CLEAR L_S_RANGE.
LOC_YEAR = LOC_VAR_RANGE-LOW(4).
CONCATENATE '0' LOC_VAR_RANGE-LOW+4(2) INTO LOC_POPER.
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = LOC_YEAR
I_PERIV = '01'
I_POPER = LOC_POPER
IMPORTING
E_DATE = LOC_DATE
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4.
L_S_RANGE-LOW = LOC_DATE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
(4) User Exit Virtual Characteristics and Key figures
Example: InfoCube DEMOCUBE has the characteristic PRODUCT PRICE_TP and the key figure ACT_PRICE and QUANTITY. In the enhancement, the product from the current price for PRODUCT and the key figure QUANTITY should be determined. If successful, the characteristic PRICE_TP should contain the characteristic value '1'.
The include ZXRSRU02: Definition
***INCLUDE ZXRSRU02
DATA: L_S_CHANM TYPE RRKE_S_CHANM.
CASE I_S_RKB1D-INFOCUBE.
WHEN 'DEMOCUBE'.
L_S_CHANM-CHANM = 'PRODUCT'.
L_S_CHANM-MODE = RRKE_C_MODE-READ.
APPEND L_S_CHANM TO E_T_CHANM.
L_S_CHANM-CHANM = 'PRICE_TP'.
L_S_CHANM-MODE = RRKE_C_MODE-NO_SELETION.
APPEND L_S_CHANM TO E_T_CHANM.
APPEND 'ACT_PRICE' TO E_T_KYFNM.
APPEND 'QUANTITY' TO E_T_KYFNM.
ENDCASE.
The include ZXRSRTOP: global data
***INCLUDE ZXRSRTOP .
DATA: G_POS_DEMOCUBE_PRODUCT TYPE I.
DATA: G_POS_DEMOCUBE_PRICE_TP TYPE I.
DATA: G_POS_DEMOCUBE_ACT_PRICE TYPE I.
DATA: G_POS_DEMOCUBE_QUANTITY TYPE I.
The Include ZXRSRZZZ: Changing the data
***INCLUDE ZXRSRZZZ .
FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
CHANGING C_S_DATA TYPE ANY.
FIELD-SYMBOLS .
Routine to get the price
PERFORM GET_PRICE USING <L_PRODUCT>
CHANGING <L_ACT_PRICE>.
IF = '1'.
ENDIF.
ENDFORM.
or go for http://www.ko-india.com/content/weblogs from Ajay Das
(thanks Ajay)
Hope this could help you
regards
Boujema -
hello,
if i write a code for user exit rsr0002 in BW how would i transport that, can anyone please help me with that.
thanks
Laura.You would be transporting the include ZXRSRU02,project that you have created in CMOD.
Regards
Manga(Assign points if it helps!!)
Maybe you are looking for
-
How do I get a sound equalizer on Windows 7?
Hi there, I have a MacBook Pro late 2011 running Boot Camp Windows 7 Ultimate 64 bit. Now, when the built in speakers are playing sound, it runs just fine. When I plug in my speakers (Creative with Subwoofer), the bass basically shakes the entire hou
-
Delivery Notes and CofAs we are having issues.
Hi , one of our users has the following problem: ================================== I have recently had a printer put on the network that is compatible with SAP. When we generate CofAs or Delivery Notes from SAP, the printout font is now in courier
-
How to Create New users in 9.3.1
Hi All, Could you please tell me how to create the new users and their groups for sepecific cube in 9.3.1 version and how to grant the permission roles. Will Shared Services does the above actions. if yes could you please let me know the steps to cre
-
Adding check box in VL01n under item level. URGENT PLEASE!!
Hi, I have the requirement like below. Add a check box in VL01n / VL02n in item level under loading and shipment" tab. Could anybody please tell me, is there any user exit? Can we add custom fields in standard loading and shipment screen? Thanks Kum
-
Partial Page Reloading using JSF
Hi All, can any one suggest me how can we implement PPR technique in java server faces. can any one give more insight on this technique. Thanks in Advance. Regards, A.