‎2011 Jul 23 5:31 PM
Hi Everyone,
I've been searching around this forum and couldn't find what I'm looking for hence resulted me starting a new thread here. I'm a fairly beginner in ABAP and I come across a problem where I have no idea on how to solve it.
Basically, I have a customer exit with multiple variables and it is being filtered out by certain criteria, the question is when I did not fill in any input and execute the query, the result is return as expected however, if i fill in an input that is not supposed to display, it will display as well, and when I debugged, there's no value E_T_RANGE in the export Sorry, I might cause some confusion here, but I'm not sure on how to re-phrase my current situation
I'm guessing that, the variable stores the value eventhough it's being filtered based on the criteria, is that possible? My question is, is it possible to clear the current value in the variable and export the value (E_T_RANGE) ?
Regards,
Kilo
‎2011 Jul 23 7:38 PM
Hello Kilo,
Yes. You can clear the values in exit and can pass the values that you require. But do the maximum validations before you clearing the values to ensure that it is not changing any other standard functionality.
Regards,
Thamil.
‎2011 Jul 24 4:28 AM
Hey Thamil,
It's a custom 'customer exit' and I'm not sure how to clear the values in exit, any guidance would be helpful? Prolly I can post some of the codes here?
Regards,
Kilo
‎2011 Jul 24 10:50 AM
Hi Kilo,
ou.r system does not have any exit with the name 'customer function'.
Yes you can post code here. You already read the [FAQ's, intros and memorable discussions in the ABAP General Forum|; and [How to post code in SCN, and some things NOT to do...|;.
So you know how to do. And: If I ask for a name, I expect the name in the system no the abstraction in someones head. Revealing the details you get the best help. Don't worry, nobody will steal your secrets or tell your boss what you ask.
Regards,
Clemens
‎2011 Jul 24 3:45 PM
Noted that, anyway posted the codes here, the first piece is actually the authorization, it checks on certain criteria and filters out whatever data that is not needed. It works as expected, as I have checked lt_items[], nothing is being passed out, value in the table is empty.
authorization->item_getlist(
EXPORTING
im_context = ls_context
im_my_objects_only = ' '
im_all_items = ' '
im_type = 'R'
im_scope = '0'
IMPORTING
ex_rc = lv_rc
ex_msg = ls_msg
CHANGING
ct_items = lt_items[]
).
READ TABLE i_t_var_range TRANSPORTING NO FIELDS
WITH KEY
vnam = 'Z_MUL_O_ZBO00021_091'.
IF sy-subrc = 0.
SELECT * FROM zzztable091num
INTO TABLE lt_num
FOR ALL ENTRIES IN lt_items
WHERE post_view = c_post
AND prod_id = lt_items-ex_id.
LOOP AT lt_num ASSIGNING <wa_num>.
READ TABLE i_t_var_range TRANSPORTING NO FIELDS
WITH KEY
vnam = 'Z_MUL_O_ZBO00021_091'
low = <wa_num>-prod_id.
IF sy-subrc NE 0.
DELETE lt_items WHERE ex_id = <wa_num>-prod_id.
DELETE lt_num[].
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT lt_items INTO l_s_items.
READ TABLE lt_proddates TRANSPORTING NO FIELDS
WITH KEY
entity = l_s_items-ex_id.
IF sy-subrc = 0.
l_s_range-low = l_s_items-ex_id.
l_s_range-high = ' '.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
This is my one of the selection criteria in my customer exit, in such that this is followed after the authorization, I have an input that actually being filtered out in the authorization level and I have checked the e_t_range, and it is null, however when I execute RSRT, I still can see the value is displayed out which is not as what I expected.
I am guessing that the value is being append in the variable, Is there any way that I can clear the variable 'Z_MUL_O_ZBO00021_091' if it doesnt pass the authorization?
Edited by: kilohertz on Jul 24, 2011 4:46 PM
‎2011 Jul 24 5:15 PM
‎2011 Jul 25 2:48 AM
Hi Clemens,
Here is it, EXIT_SAPLRRS0_001
It doesn't take into account on what I'm filtering and it just returns whatever I input in the RSRT selection which is not what I expect it to be, this is more like limitation I supposed?
Regards,
Kilo
Edited by: kilohertz on Jul 25, 2011 11:55 AM
‎2011 Jul 25 2:40 PM
Hi Kilo,
thanks a lot.
This is what SAP documentation says about usage of this exit:
"With this enhancement to global variables in reporting you have the
option of determining your default values for variables. You can use
this enhancement for variables, for which 'Processing by Customer-Exit'
has been selected in the variable maintenance. This is valid for all
variable types (characteristic value, node, hierarchy, formula and text
variables). You use the Exit EXIT_SAPLRRS0_001 for this.
You could, for example, establish the default value of a characteristic
value variable depending on the user."
In your exit, first thing to do is check what variable has been passed in parameter I_VNAME. Check if this variable has been set for 'Processing by Customer-Exit' in reporting.
I think the way to exclude certain values is to use the SIGN 'E' in the range, i.e.
l_s_range-low = '<variablevalue to exclude> '.
l_s_range-high = ' '.
l_s_range-sign = 'E'."Exclude
l_s_range-opt = 'EQ'.Also, I think the exit is called 3 times per variable name, for you I_STEP = 2 and I_VNAM = 'Z_MUL_O_ZBO00021_091' is relevant.
I have limited experience with BEX reporting so you may check SAP Help for [Customer Exits in Reusable Query Components|http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm]. There is info about [Dependencies for Variables of Type Customer Exit with sample source code|http://help.sap.com/saphelp_nw70/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm]. Check also R. Prem Kumar's very good article [Using User Exit for Variables in BEx Reporting|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d09d4588-3832-2c10-e185-f778d9dbea85?quicklink=index&overridelayout=true].
Hope this helps you to solve the issue.
Note: When asking a question, give a short description of what you are doing and what you want to achieve in business terms and natural language. Add relevant technical details and help is just around the corner.
BTW: Did you search and/or find the information in the links I gave? G*gle was my servant here.
Regards,
Clemens
‎2011 Jul 26 11:23 AM
Hi Clemens,
Have tried your method but doesn't work still, the reason being is because the I'm not able to manipulate the value of being export out, l_t_var_range in the standard sap fm: RRS_VAR_VALUES_EXIT_AFTER, it'll just return whatever I have input regardless of the filtering that I did in my customer exit.
CALL CUSTOMER-FUNCTION '001'
EXPORTING
i_vnam = <l_sx_var>-vnam
i_vartyp = <l_sx_var>-vartyp
i_iobjnm = <l_sx_var>-iobjnm
i_s_cob_pro = l_s_cob_pro
i_s_rkb1d = i_s_rkb1d
i_periv = i_s_rkb1f-periv
i_t_var_range = l_t_var_range
i_step = 2
IMPORTING
e_t_range = <l_sx_var>-range
EXCEPTIONS
OTHERS = g_c_no_replacement.
Regards,
Kilo
‎2011 Jul 26 3:22 PM
Hi Kilo,
no need to post the code of the calling program.
Better post your own code that must contain
APPEND L_S_RANGE TO E_T_RANGE.E_T_RANGE contains what you want to return to the calling program.
i_t_var_range is an export parameter that can not be changed in the exit as you can see in debugger.
Before coding, please go again through the documents I gave you the links for.
Regards,
Clemens
‎2011 Jul 27 2:36 AM
Hi Clemens,
That's exactly my point, in my e_t_range, it returns 0, no value however there's no way I can manipulate the i_t_var_range value as it always returns my selection that I want to filter out, as the filtering is already done and nothing is appended into my e_t_range.
Not sure if we are on the same page now, but I want to find out on how to block the value into getting in i_t_var_range or how to block it from being populating but as you said, there's no way to change the value. Just wondering, if there's any workaround on this or something that I have missed out? puzzled still.
Unless I do not select anything and execute, thus my i_t_var_range is empty, and it returns the expected result because no value is being exported out.
Regards,
Kilo
‎2011 Jul 27 10:44 AM
Hi kilo,
until now I vere saw rhe exact code how you populate e_t_range values nor the control of which step you do what. You did not mention where you followed the documents and where you went your own way. Who knows what it is all about.
Not easy to help you.
Regards
Clemens
‎2011 Jul 23 10:10 PM
Hi Kilo,
just give the exit name and post some code lines. That will reduce confusion to zero.
Regards,
Clemens