To debug a customer exit
hi guys,
how do i debug a variable customer exit,
i hve been to the particular include program,
do i just put a break-point on the variable
i want to look at.... or some infinite loop ?
thanks
your help will be greatly appreciated
Just put a external breakpoint on ur code on i_vnam.
Now when u run ur query it will go to debugger directly first for i_step = 1, then it will pop-up selection screen for u. Once you enter value to selection screen, it will go back to debugeer for i_step = 2.
When u r debugging use F5 for each variable, and once u on last line of code, use F8, so that it will no go to debug system code. If you familiar with ABAP debugging it won't be a problem i hope.
Best of luck with ur debugging.
KJ!!!
Similar Messages
-
Debug Customer Exit variable in Query
Hi ,
Iam new to debugging Query in BI7. I know we use RSRT to debug query, but what radio buttom to check so that during debug, the code stops at Customer exit code??
Thanks,
DVHi,
Go to the CMOD and Put a Break Point where u require it and Execute.
or/and
Go to RSRT>After giving ur Query Name>Click on Execute+Debug->In the LAst Tab u have Variables>Customer Exit Before and After.
Execute it,it shud stop at that Exit for that Query.
Rgds
SVU123
Edited by: svu123 on Feb 2, 2010 8:21 AM -
Customer Exit var (basedOn 0P_KEYDT) ABAP error - Going into Debug mode
Hello All,
I have created a BEX Query based on Infoset, so i couldnt use '0P_KEYDT' SAP Exit in a variable.
Instead i created a Z 'Customer exit' with the same code.
But when i execute query in RSRT, query is going into Debug mode.
InfoProviders are all active, when i remove the Z 'Customer Exit' from the query then query is running fine. So i see that the problem is with the Z 'Customer exit' code.
Here is the 0P_KEYDT code:
FUNCTION RSVAREXIT_0P_KEYDT.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_VNAM) LIKE RSZGLOBV-VNAM
*" VALUE(I_VARTYP) LIKE RSZGLOBV-VARTYP
*" VALUE(I_IOBJNM) LIKE RSZGLOBV-IOBJNM
*" VALUE(I_S_COB_PRO) TYPE RSD_S_COB_PRO
*" VALUE(I_S_RKB1D) TYPE RSR_S_RKB1D
*" VALUE(I_S_RKB1F) TYPE RRO01_S_RKB1F
*" VALUE(I_THX_VAR) TYPE RRO01_THX_VAR
*" VALUE(I_STEP) TYPE I DEFAULT 0
*" EXPORTING
*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID
*" EXCEPTIONS
*" UNKNOWN_VARIABLE
*" UNEXPECTED_VARTYPE
*" VARIABLE_INITIAL
DATA:
LS_RA_SID TYPE RSR_S_RANGESID.
IF I_STEP EQ 0 OR " without popup or
I_STEP EQ 1. " before popup
REFRESH E_T_RANGE.
CLEAR: LS_RA_SID.
LS_RA_SID-SIGN = 'I'.
LS_RA_SID-OPT = 'EQ'.
LS_RA_SID-LOW = SY-DATUM.
APPEND LS_RA_SID TO E_T_RANGE.
ENDIF.
ENDFUNCTION.
Here is Z 'Cusotmer Exit Code: (Defined I-STEP and E_T_RANGE)
method ZPKEYDT.
Data: ls_var_range TYPE rrs0_s_var_range,
l_s_range TYPE rsr_s_rangesid.
IF I_STEP EQ 1.
REFRESH e_t_range.
CLEAR: l_s_range.
l_s_range-SIGN = 'I'.
l_s_range-OPT = 'EQ'.
l_s_range-LOW = sy-datum.
APPEND l_s_range TO e_t_range.
ENDIF.
endmethod.
I could really appreciate your help!
Thanks in advance,
DCHi DeeCh.
If you want to populate the value before the variabel screen input.then please follow below code
case i_vnam.
when 'ZPKEYDT'.
if i_step = 1.
l_s_range-low = sy-datum..
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
clear l_s_range.
endif.
endcase.
Regards,
Nanda.S -
How to debug i_step=0 Bex Variable (Customer Exit)
Hi all,
can anyone please help me regarding following problem:
I have a variable (customer exit) in a query. This is for hierarchy authorization.
This variable is mentioned in my analysis authorization (Infoobject 0COSTCENTER).
Now i want to debug the coding when execute the query in TA RSRT.
But when i set a break-point. The i_step starts with 1. I want to debug
the coding when the i_step is 0 !!!! Any idea?
Best regards,
FrankHere a break solution:
only for develop system-
you can set this code at start of the include:
DATA: flag TYPE c.
WHILE flag IS INITIAL.
ENDWHILE.
let start the query, then go to SM50 and take in debugging the process in loop. (Programe/mode-program-debugging).
Pay attention leave the code immediately after that. -
Debugging Customer Exit.
Hi All,
I have created a customer exit variable. Its selected for ready for input and i have written the code for it to modify the entered value according to the requirement.
I am trying to debug the code but, while debugging it, i_step value is 1 at start. Then it prompts me for the variable input. After I enter the value, the debugger stops at break point and the value of i_step is 3. My question is wont it stop at i_step = 2 ??
Please advice how to debug such scenarion.
Thanks,
Anjum.Hi nasarat anjum,
If variable getting filled through User Exit, it not supposed to be ready for user entry.
The following values are valid for I_STEP:
· I_STEP = 1
Call up takes place directly before variable entry
· I_STEP = 2
Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1.
· I_STEP = 3
In this call up, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called up again.
Check: How to... Create & Populate User Exit variable
So if you want to validate input value, you need to write code under I_STEP = 3
Hope it Helps
Srini -
Customer exit variable output error
Hi gurus,
I have created one customer exit variable. in the selection screen i am giving multiple plant and material value,
my code is working for sigle plant and single material.
when i have taken multiple value. i am getting error message
error is 'No value determined for th variable"
When i debug my code in RSRT, it is giving all the values for different combination of plant and material. and those values are getting in the E_T_RANGE.
but out put it is giving the error.
my code is:
WHEN 'ZPRDEMVA'.
IF i_step = 2.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZPRRNDT'.
v_date = LOC_VAR_RANGE-LOW.
v_year = v_date+0(4).
v_month = v_date+4(2).
v1_date = v_date+6(2).
v3 = v_year - 1.
v4 = v_month - 1.
if v4 = 00.
v4 = 12.
v3 = v3 - 1.
endif.
concatenate v3 v4 v1_date into ddate.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = ddate
IMPORTING
WEEK = zweek
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
WEEK = zweek
IMPORTING
DATE = monday
EXCEPTIONS
WEEK_INVALID = 1
OTHERS = 2.
sunday = monday + 6.
v3_date = monday.
v4_date = sunday.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZPRPLNML'.
CLEAR L_S_RANGE.
v_werks = LOC_VAR_RANGE-LOW.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZPRMATML'.
CLEAR L_S_RANGE.
v_matnr = LOC_VAR_RANGE-LOW.
data: dummy_menge like i_mseg-menge value '0.01'.
Do 52 times.
select MATERIAL PLANT QUANT_B MOVETYPE
from /BIC/AWINO0100 into table i_mseg
where PSTNG_DATE between monday and sunday
and MOVETYPE between 261 and 262
and MATERIAL = v_matnr
and PLANT = v_werks.
if sy-subrc NE 0.
i_mseg-menge = '0.01'.
i_mseg-matnr = v_matnr.
i_mseg-werks = v_werks.
i_mseg-bwart = '261'.
append i_mseg.
endif.
loop at i_mseg.
itab1-matnr = i_mseg-matnr.
itab1-werks = i_mseg-werks.
itab1-menge = itab1-menge + i_mseg-menge.
itab1-bwart = i_mseg-bwart.
COLLECT i_mseg into itab1.
endloop.
sort itab1 by matnr werks bwart.
loop at itab1 where bwart = '261'.
itab2-matnr = itab1-matnr.
itab2-werks = itab1-werks.
itab2-bwart = itab1-bwart.
itab2-menge = itab1-menge.
read table itab1 with key matnr = itab2-matnr
werks = itab2-werks
bwart = '262'.
if sy-subrc = 0.
itab2-menge = itab2-menge - itab1-menge.
endif.
append itab2.
endloop.
clear itab1[].
refresh itab1.
sunday = sunday + 7.
monday = monday + 7.
ENDDO.
loop at itab2.
sum1 = sum1 + itab2-menge.
endloop.
average = sum1 / 52.
loop at itab2.
sum2 = sum2 + ( ( itab2-menge - average ) * ( itab2-menge - average ) ).
endloop.
sum2 = sqrt( sum2 / 52 ).
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = sum2.
Append l_s_range to E_T_RANGE.
clear itab2[].
refresh itab2.
sum1 = 0.
sum2 = 0.
monday = v3_date.
sunday = v4_date.
ENDLOOP.
ENDLOOP.
ENDIF.
Can any one please help me.
Thanks in advance.Hi Alec,
i created a customer exit with the formula variable only. in the code i am getting the both quantity and unit fields. now i want to get quantity with unit in output.
thanks -
Customer exit variable in Report designer
Hello,
I have created one Customer Exit variable ( variable ready for input) for one of the characteristics in a query. However, when i execute this query in Report designer, the selection variable is not appearing. It is just taking the variable value from Exit, eventhough the variable is ready for input.
Is it a standard behavior or am i missing anything ?
RaviHello,
First check your variable is included in the report desinger or not
if it is included in Filters, use the T-code RSRT2 and execute. You should get a variable screen.
Debug your query here.
Hope it is useful.
Thanks,
Ashok -
Customer exit variable in Planning filter - IP
Hi,
I am new to business planning. I am trying to use a customer exit variable in filter, while performing check system generates message "RFC failue error". the logic is written to get the current year. But I am not able to use this variable? Can you please answer me this question... Can I use Customer exit variables in planning modeler filters or planning functions ?Hi there,
Yes you can, and it is used very often in both.
Probably your variable is wrongly defined.
What you can do is create a query over that aggregation level, and insert the planning filter in there. Put some key figure on the query and put a breakpoint on your variable customer exit code. Execute the query and debug the variable code to check the error.
Hope this helps,
Regards,
Diogo. -
Customer exit variable with exclusion
Hello all, anyone know why a customer exit variable cannot exclude values ?
I've tried with multiple, single and interval without success (it give me a generic error in the customer exit for my variable).
Only the "selection option" mode seems to be enabled to exclude values (also in debug mode with rsrt transaction).
Unfortunately, I cannot use selection option (because this exclusion is an integration of pre-existence selection on a complex structure).
We have SAP BW 3.1C, with SP16. I've looked for sap notes but nothing about this problem (may be a limit).Now I post my code. The variable is a "Multiple Single Values", optional, not "Ready for Input".
This is my code.
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
If I_STEP = 2.
CASE I_VNAM.
WHEN 'ZXXXXX'.
clear l_s_range.
l_s_range-sign = 'E'.
l_s_range-opt = 'EQ'.
l_s_range-low = 'xxxxxxx'.
append l_s_range to e_t_range.
ENDCASE.
ENDIF.
The query raise an error (generic error on customer exit).
I've debugged the code. Error has raised from plausibility_check on RRS_VAR_VALUES_EXIT_AFTER. The following is the code that raise the error.
CASE i_vparsel.
WHEN rro04_c_vparsel-param
OR rro04_c_vparsel-<b>multiple</b>
OR rro04_c_vparsel-table.
IF <l_s_range>-sign <> rs_c_range_sign-<b>including</b>
OR <l_s_range>-opt <> rs_c_range_opt-<b>equal</b>.
PERFORM raise USING rs_c_false g_c_ue_invalid_range
i_vnam space space space.
ENDIF.
From this code, it seems that with multiple selection we only have sign including and option equal.
What do you think about ? -
Hi all,
I created a query with customer exit variable that is filled from another variable manual entry.
When i start a query I receive this error message:
Error for variable in the customer exit
and in debug I find this message:
System error in the program CL_RSR_REQUEST and Form GET_SETXX_WA
How can I do?
Thanks
Gianmarcowhen 'ZODACE'.
tables: /BIC/AZSD_O0100,
/BIC/AZSD_O0200.
ranges: r_createdon for /BIC/AZSD_O0100-CREATEDON.
break-point.
if i_step = 2.
loop at i_t_var_range into loc_var_range
where vnam = 'ZDATADOC'.
clear r_createdon.
r_createdon-low = loc_var_range-low.
r_createdon-high = loc_var_range-high.
r_createdon-sign = 'I'.
r_createdon-option = 'BT'.
append r_createdon.
exit.
endloop.
select DOC_NUMBER into
/BIC/AZSD_O0100-DOC_NUMBER
from /BIC/AZSD_O0100
where /BIC/ZAUDAT in r_createdon.
select single * from /BIC/AZSD_O0200
select * from /BIC/AZSD_O0200
where refer_doc = /BIC/AZSD_O0100-DOC_NUMBER.
clear l_s_range.
l_s_range-low = /BIC/AZSD_O0200-refer_doc.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
append l_s_range to e_t_range.
endselect.
endselect.
endif.
The variable are:
ZODACE based on IO 0REFER_DOC with customer exit
ZDATADOC based on IO ZDATU with manual entry
After wich end-user digit a data in ZDATADOC popup I take ODOC_NUMBER in order item ODS ZSD_O01 where ZDATADOC=CREATEDON.
With 0DOC_NUMBER I go to delivery item ODS ZSD_O02 and I take the corresponding 0REFER_DOC and then I fill variable ZODACE.
0REFER_DOC is in row of the query. -
Customer exit variable doesn't work
Hi,
I tried to create customer exit for my query but iam not getting the right result.
My requirement is to create a Key figure variable that displays Q1 - Q4 based on fiscal year/period (001.2008) entered by the user.
steps I have taken
1. created variable MD_VAR for fiscal year/period
2. created key figure variable MD_VAR_KF where I have the description as Q1 .
and the result I have is Q&MD_VAR_KF& but I would like to get Q1
my code
data: lv_month type n length 3.
CASE I_VNAM.
WHEN 'MD_VAR_KF'. "KF variable
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM ='MD_VAR'.
lv_month = LOC_VAR_RANGE-LOW+6(3).
IF lv_month = '001' OR lv_month = '002' OR lv_month = '003'.
L_S_RANGE-LOW = '1'.
ELSEIF lv_month = '004' OR lv_month = '005' OR lv_month = '006'.
L_S_RANGE-LOW = '2'.
ELSEIF lv_month = '007' OR lv_month = '008' OR lv_month = '009'.
L_S_RANGE-LOW = '3'.
ELSEIF lv_month = '010' OR lv_month = '011' OR lv_month = '012'.
L_S_RANGE-LOW = '4'.
ELSE.
L_S_RANGE-LOW = 'wrong values'.
ENDIF.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
ENDCASE.
What did I do wrong and how do I achieve my requirement
thanksWhen you variable result displays the variable name inside &...& means the variable is not deriving a value.
Make sure the variable &MD_VAR_KF& is defined as a Text variable and as an Exit variable. Otherwise it won't process it in the exit.
If Fiscal Period is dependent on Fiscal Year Variant (I can't remember off-hand) then the variant key will preceed the Fiscal Period value in the variable, and the value is always processed based on internal format YYYYMMM. So your substring will be +6(3) if FYV dependent, and +4(3) otherwise.
You have focused the issue on the code but didn't clarify how you defined the variable itself. If these settings are correct then you need to debug the code to see what part works and what doesn't, then provide more details. -
Customer Exit not called upon in the Query...
Dear Guys,
I am working on the "Slow Moving Item(MC46)" report in BW.We need "No.of Days Not consumed" in the Input selection screen in the BW Query.We tried creating a Formula variable upon "Calday" with Data type "Numeric" and then a Customer Exit is called to the Subtract the "No. of days not consumed" from "Today's date(System Date)" and gives the result as "Earlier date" .
(Eg: Today's Date : 04-04-08
No. of Days Consumed : 30
ZSlow_Mov_Date : 03-03-08).
But for some reason the Customer exit is not called upon when we execute the Query (RSRT-->Execute + Debug option)..Can someone take time to throw some light on this,plz?
Manythanks
ArunHello Arun,
In the User Exit Code, please check at what I_STEP value the variable exit is called.
See this link for more info about I_STEP
[Dependencies for Variables of Type Customer Exit |http://help.sap.com/saphelp_nw04/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm]
Thanks
[Chandran|http://chandranonline.blogspot.com/] -
Customer exit variable - missing values
Hello experts,
Has anyone ever encountered this problem?
We have a customer exit variable, based on 0VENDOR. In the customer exit we simply fill in a variable with the values in this master data table. By debugging we can see how the e_t_range structure gets filled in correctly with all the values in the master data, for example 2,300 values, the same values we expect to see in the report but we don't know why at some point after our code in the customer exit and in the standard code, our variable contains less values and only an incorrect number of values gets displayed in the final report.
Any ideas on this would be very much appreciated.
Many thanks in advance,
InmaHi,
Are you sure you're losing some values?
Remember that if no values exist for a master data value on the InfoCube, no line will be shown, so you could see less than 2300 lines.
You could probably try to show filter values on the query and check if they match with your e_t_range.
Regards,
David. -
Hi all,
I wrote a customer exit and debugged that and the coede was working fine but i am not able to see the result in the query.Can anyone of you suggest what are the possible causes for this.Here is the code which i had written.
DATA: l_s_range type rsr_s_rangesid.
data: loc_var_range like rrrangeexit.
DATA: v_pre1(2) type c.
DATA: v_pre2(2) type c.
CASE: I_VNAM.
when 'Z_MTD_PREBAL'.
if i_step = 2.
loop at i_t_var_range into loc_var_range
where vnam = '0P_FPER'.
clear l_s_range.
l_s_range-low(4) = loc_var_range-low(4).
v_pre1 = loc_var_range-low+4(3) - 1.
if v_pre1 < 10.
l_s_range-low+4(2) = '00'.
l_s_range-low+6(1) = v_pre1.
else.
l_s_range-low+4(1) = '0'.
l_s_range-low+5(2) = v_pre1.
endif.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
Append l_s_range to e_t_range.
exit.
endloop.
endif.
This code is used to display the previous month's balance based on the user input for fiscal period(YYYYMMM).MMM stands for the period.
hence, the key figure has been restricted on Fiscal period which has a customer exit variable. the code for the same is as above. -
Hello all,
I have checked multiple scenarios and they do not work:
Current situation/setup:
1. <b>Creation of several variables and adding each of them to different queries</b> :
Variable Type Processing Infoobject Selection ready for input
COB 1 6 ZCCOSTCTR__ZCCOB S
CB2 1 6 ZCCOB S
CBV 1 3 ZCCOB S
2. <b>Adding values in a role</b> (currently 3.0 is used and we want to check the exit and if it works before upgrading to 7.0) and assign it to the user:
Old active Object:ZCKS_COB:
1KYFNM *
9ZCCOB $C-B2, $C-OB , $C-BV
added new object without 1KYFNM:
ZCCOB $C-B2, $C-OB, , $C-BV
3. <b>Marked the used object auth. relevant</b> for the cube of the query
4. Enhanced ZXRSRU01 via CMOD with coding and activated also the project:
WHEN 'COB' or 'RESPNO'.
IF I_STEP = 0.
IF I_STEP = 1.
IF I_STEP = 3.
CALL FUNCTION 'Z_VARIABLE_BY_AUTH'
EXPORTING
I_VNAM = I_VNAM
TABLES
E_T_RANGE = E_T_RANGE
EXCEPTIONS
NO_AUTH = 1
NOT_VALID = 2
MISSING_OPERATOR = 3
OTHERS = 4.
IF SY-SUBRC = 1.
MESSAGE W007(EYE).
ENDIF.
IF SY-SUBRC = 2.
MESSAGE W707(BRAIN).
ENDIF.
IF SY-SUBRC = 3.
MESSAGE W999(BRAIN).
ENDIF.
IF SY-SUBRC = 4.
MESSAGE W649(BRAIN) with I_VNAM ''.
ENDIF.
endif.
The function 'Z_VARIABLE_BY_AUTH' was tested separately and fills in E_T_RANGE as expected.
I also changed the variable names each time to all the other existing variables while debugging.
If I use a variable of <b>type customer-exit</b> and process it with <b>i_step =1</b> the value selection and query result is OK.
But this <b>scenario works without roles</b> and authorization values triggered by a variable $<VARIABLE> and is not the intended and documented way proposed by SAP. The documentation says to create a variable of type authorizations and to process it in I_Step = 3. But in this step I_VNAM is empty and so there is no processing ot the function module.
Has anyone a solution? I could not find the issue during several debugging sessions. One strange thing is the protocol of rssm: the authorization buffer is not reflecting the enhanced role but only the value $C-B2 for object ZCKS_COB.
Thanks in advance to have a look on this tricky issue.
Bye,
PetraTry this:
IF i_s_rkb1d-compid = 'Query Name'
Validation of data for the value entered in your Variable
READ TABLE i_t_var_range INTO yourworkarea
WITH KEY vnam = yourvariable
IF sy-subrc = 0.
IF w_s_var_range-low(4) <> w_s_var_range-high(4). " Your condition or Logic
l_msgv1 = c_qtr_com1. " Your message
i_handle = 9998.
CALL FUNCTION 'RRMS_HANDLE_MESSAGE_INIT'
EXPORTING
i_handle = i_handle
i_msg_handler_id = sy-uzeit.
CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
EXPORTING
i_class = 'RSBBS'
i_type = 'I'
i_number = '000'
i_msgv1 = l_msgv1
RAISE again.
ENDIF.
ENDIF.
ENDIF.
Maybe you are looking for
-
How do I tell itunes on a Windows XP PC to start downloading new songs to my external drive ? The whole library has already been moved. I am just one final step away. Everything I`m downloading still lands on C: Relaunching itunes while pressing "shi
-
I am using a product called Crystal Xcelsius to design and develop dashboards for banking customers. The product using Flex controls with an Excel spreadsheet to show data. It then supports data connections to refresh or update that data. After setti
-
Where to find sensor values in Enterprise Manager
Hi, I followed the instruction from (http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bp_sensors.htm) to add sensors to my BPEL process. Where do I navigate to find the sensor values in Enterprise Manager? I also notice in SOA Com
-
Topic: Mental & emotional harassment by Nokia Care of my City regarding lumia 520! I am Abhishek Rawat, residing at 101, Balaram Dey Street, Kolkata-700006, Mob:9XXXXXXXXX. I bought a Nokia Lumia 520(IMEI-358106053448414) on 8-8-2013, Bill No.- P/081
-
Adobe Reader X crashes when connected to Internet
I have several systems which I've updated to Adobe Reader X. On *one* of the systems, Reader crashes ~10 seconds after opening it. This happens whether I open a document or just the application with no document. Platform is WinXP-32. There are no