Help with user exit variable
Hello all,
I need to create a customer exit variable to get a field (0calmonth) from an infoobject attribute and use this field to filter the query.
I need some help to finish the code:
WHEN 'my variable'.
IF I_STEP = 2. "before the popup
SELECT 0CALMONTH INTO ??? "0calmonth is the attribute.
FROM /BIC/TZFECHAVAL "infoobject table.
WHERE... "conditions.
Any help? Thanks. Points will be assigned.
Hi,
Pls check the below sample code.. and change the code
WHEN 'Your Variable' .
TYPES : BEGIN OF ls_batch ,
batch TYPE /bi0/oibatch,
END OF ls_batch.
DATA : lt_batch TYPE TABLE OF ls_batch.
DATA : wa_batch TYPE ls_batch .
SELECT batch FROM /bi0/mbatch
INTO TABLE lt_batch
WHERE batch = 'XYZ'
OR batch = 'ABC' .
SORT lt_batch BY batch .
DELETE ADJACENT DUPLICATES FROM lt_batch COMPARING batch .
LOOP AT lt_batch INTO wa_batch .
l_s_range-low = wa_batch-batch.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
Thanks
Reddy
Similar Messages
-
ABAP help in user exit variables
Hi,
In the selection screen of a query, I have an optional variable CalenderMonth (SOMONTH). I have to calculate another user exit variable (CALMONTH) in ZXRSRU01 by using this SOMONTH. This is how. If the value SOMONTH is entered, then I need to assign SOMONTH to CALMONTH. If SOMONTH is not entered, then I need to set CLAMONTH to current calender month from system date.
For that, I need to check if SOMONTH is entered or not in the program ZXRSRU01. This is what I am trying to do, and is not working.
WHEN 'CALMONTH'.
If I_step = 2.
Loop at I_T_VAR_RANGE into LOC_VAR_RANGE
Where VNAM = 'SO_MONTH'.
IF LOC_VAR_RANGE-LOW IS INITIAL.
ELSE
ENDIF.
<b>PROBLEM:</b> The statement "IF LOC_VAR_RANGE-LOW IS INITIAL." is not working. When I try to debug the code, program aborts at that line. By this line of code, I mean to check if SOMONTH is initial or not.
Any suggestions or ideas very much appreciated.
Thanks alot
JohnHi
When I have tried something similar to this (in BW v3.1), and the (optional) variable I am reading from is not populated by the user; in STEP 2 table I_T_VAR_RANGE does not contain a record for it. Hence, the logic I would use is:
CASE I_VAM.
WHEN 'CALMONTH'.
IF I_STEP = 2.
READ TABLE i_t_var_range INTO loc_var_range
WITH KEY vnam = 'SOMONTH'.
IF SY-SUBRC = 0.
loc_range-low = loc_var_range-low.
ELSE.
loc_range-low = sy-datum+4(2).
ENDIF.
loc_range-sign = 'I'.
loc_range-opt = 'EQ'.
APPEND loc_range TO e_t_range.
ENDIF.
Hope this helps. -
Problem with User exit variable
We're using an user exit variable (var2) for YTD calculation (For getting the first month of current year). It gets value from another exit variable (var1) which has by default value last month of current year(populated in I_step1 from sy-datum). If the user wants he can change the default value of var1. It works fine when the query is executed the first time. But if the user calls the variable screen again, the variable screen does not show var1 in the popup and the user gets an error message that no value could be determined for var2. How can this issue be resolved or is there any other method to satisfy this requirement.
Your help would be appreciated and rewarded.
Thanks & Regards
HariHi Ravi,
Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
Krzys, Is the option <i>Can be changed in Query Navigation</i> available for Exit variables. I'll check that and get back to you.
Boujema, Thanks for the OSS note.
Thanks
Hari -
BPS Help with user exit.----- Quick one for Marc.B?
Hi All,
I'm using an user exit to prefix the GL/account with '2' to make it a stat account.In the fields to be changed , i have included all the characteristics like gl account,region,line of business...key fig name..etc.However when i run the exit, my key figure amount is doubling up.Need a quick fix or a second pair of eyes..also found that xth_data cannot be used in MODIFY statement because of hash table .so I'm using a collect.But as soon as i exit out of the loop, the key figure amount doubles....any pointers????
Here is the code.................................
FUNCTION Z_SEM_PREFIX_2ACCOUNTS.
""Local interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL
*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE
*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD
*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF
*" EXPORTING
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
*" CHANGING
*" REFERENCE(XTH_DATA) TYPE HASHED TABLE
DATA:
ls_data TYPE t_s_alloc,
lth_data TYPE t_th_alloc.
*Loop thru the data and check if its a valid GL account.
*If its a valid GL account, Prefix '2' to the beginning of the
*account and also add 'DDD' to the transaction type in order to
*identify the record.once the prefixing is over , you will have the old as well as the new set of records.
*records as they will not have the 'LOB' flag in the transaction type.
lth_data = xth_data.
LOOP AT lth_data INTO ls_data.
if ls_data-s_chas-0gl_account
is not initial.
if ls_data-s_chas-0gl_account+3(1) = '0' AND
ls_data-s_chas-0gl_account+4(1) <> '0'.
concatenate '000' '2'
ls_data-s_chas-0gl_account+4(6)
into ls_data-s_chas-0gl_account.
ls_data-s_chas-zoctrtype = 'LOB'.
endif.
endif.
collect ls_data into lth_data.
ENDLOOP.
DELETE Lth_data
where s_chas-0gl_account+3(1) <> '2' and
s_chas-zbpsflag = 'C'.
xth_data = lth_data.
ENDFUNCTION.Hi Sudz,
you got it almost right. If you do the collect the system will add the changed records to the exiting ones since you start with lth_data = xth_data. So use the following logic:
start with empty table
refresh lth_data.
now process all exiting data
LOOP AT xth_data INTO ls_data.
if ls_data-s_chas-0gl_account is not initial.
if ls_data-s_chas-0gl_account+3(1) = '0' AND
ls_data-s_chas-0gl_account+4(1) <> '0'.
concatenate '000' '2' ls_data-s_chas-0gl_account+4(6)
into ls_data-s_chas-0gl_account.
ls_data-s_chas-zoctrtype = 'LOB'.
endif.
endif.
and collect the new data
collect ls_data into lth_data.
ENDLOOP.
return only the new data
xth_data = lth_data.
Regards,
Marc
SAP NetWeaver RIG -
Hello,
I am and include within a user exit and what i am trying to do is:
populating a field that shows up in a screen popup. transaction is iw32 for which the program name is different than that of the screenvalue that im trying to populate. in iw32, in components tab, i add a component and then i get a popup to populate the purchasing group field and this is the field that i am trying to put a default value into so that I do not get prompted. Please help.
Thanks.Hey Jasmeet
You can definitely get the values of RESBD in this exit. Please use the code below to get the resbd-ingrp value from the screen:
DATA:l_field(60) TYPE C VALUE '(SAPLCOMK)RESBD',
ls_resbd TYPE resbd.
FIELD-SYMBOLS: <fs_resbd> TYPE ANY.
*Fetching the Component Item from the Screen. This is for read-only
*purpose and content should not be changed.
ASSIGN (l_field) to <fs_resbd>.
if sy-subrc eq 0.
ls_resbd = <fs_resbd>.
UNASSIGN <fs_resbd>.
endif.
Now you have all the values in the structure ls_resbd and you can easily set the value for ingrp according to your conditions.
Hope this helps. Let me know if this is what you want.
cheers
shivika -
Help with Customer exit variable
Hi Guys,
I need your urgent help. I have a requirement where I need to create a variable (on CALDAY) in a report which should use the input value given for another variable (created on CALMONTH). To put in words more clearly, CALMONTH is a variable that is mandatory for input but the CALDAY variable should not appear on the selection screen. I was told that I should write a customer exit to make this happen. So can someone please explain me the process of creating a customer exit and give me the code.
WHEN CALMONTH values are selected to be 07/2006 - 08/2006... CALDAY values should be 07/01/2006 to 08/31/2006.
CALMONTH is user entry, mandatory, range and multiple selection variable.
Early reply is highly appreciated and duely rewarded. Please let me know if I am not clear about the requirement. Thanks a bunch in advance.Let us say, user enters multiple ranges for the month, you would want corresponding date ranges for the same, right?
data : w_date like sy-datum.
case I_VNAM.
when 'ZCALDAY'. " Calday var
loop at i_t_var_range into LOC_VAR_RANGE
where iobjnm = 'ZCALMONTH'.
WA_RANGE-SIGN = 'I'.
wa_date+2(6) = loc_var_Range-low.
wa_date+0(2) = '01'.
wa_range-low = wa_date.
if loc_var_range-high eq space.
WA_RANGE-OPT = 'EQ'.
else.
wa_range-opt = 'BT'.
wa_date+2(6) = loc_var_range-high.
wa_date+0(2) = '01'.
wa_date = wa_date + 31.
wa_date+0(2) = '01'.
wa_date = wa_date - 1.
wa_range-high = wa_date.
endif.
append wa_range to e_t_range. clear wa_range.
endloop.
endcase.
This should do. -
BEX User exit variables in WEBI
Hi Experts,
Need your help please.
I have a report in BEX with a user exit variable wich depends on other manual input variable.
In BEX it works properly but in WEBI it doesn't recognize the user exit variable.
It displays the error message: Not possible to determine the value for ZPD_YEAR_DAY variable
Error in DB. Error message is: failure to execute the query MDX SELECT { [Measures].[D9CS1W7FA8FEOHJ3T32H4QDZ4], [Measures].[D9DH9K1NITCZE4UY3J4UAETZ4], [Measures].[D9DH9K1NITDR2R6PF2KGCU88W], [Measures].[D9CS1W7FA8EMZV7CHJMV2AZPC], [Measures].[D9CS1W7FA8K0S7HNQBO5JARLS], [Measures].[D9CS1W7FA8G6D3UV4MI375S8W], [Measures].[D9CS1W7FA8HPQCIDRPDBC0KSG], [Measures].[D9CS1W7FA8IHEYU538SXEFZ28], [Measures].[D9DH28DWVF6742E64ZOL8FX34] } ON COLUMNS , NON EMPTY CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( { [0CALYEAR].[2010] } , { [0HAP_DOC_ID__ZAP_SUBST].[50], [0HAP_DOC_ID__ZAP_SUBST].[70] } ), [0INFOPROV].[LEVEL01].MEMBERS ), [ZDATE_AT].[LEVEL01].MEMBERS ), { [ZCPM].[X] } ), [ZPROMOCAO].[LEVEL01].MEMBERS ), [ZRESP_AVL__ZNIV_CARR].[LEVEL01].MEMBERS ), [ZRESP_AVL].[LEVEL01].MEMBERS ), [ZNIV_CARR].[LEVEL01].MEMBERS ), [0EMPLOYEE].[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_NAME, MEMBER_CAPTION, [0EMPLOYEE].[20EMPLOYEE], [0EMPLOYEE].[40EMPLOYEE], [0HAP_DOC_ID__ZAP_SUBST].[20HAP_DOC_ID__ZAP_SUBST], [ZRESP_AVL].[2ZRESP_AVL] ON ROWS FROM [ZAVDP_M01/ZPD_GPS_VARIAVEL_002] with error: Not possible to determine the value for ZPD_YEAR_DAY variable. (WIS 10901)
This ZPD_YEAR_DAY variable is the user exit variable.
Thanks in advance,
José SimõesHi!
I am following up to this post to see if there is something I am missing.
We have bex query with user exit variable and webi bi4sp04.4
In bex the user exit variable works correctly, in webi, it is ignored (the webi results are not filtered as they are in bex web results)
I have tried moving the variable to the char restrictions and removed ready for input - so there are now no prompts in bex query.
I have reviewed note 1611185 as well as other info on restrictions of BICS and webi, but cannot find a clear answer if bex user exit variables are supported in BI4 clients or not.
Lee Lewis -
Need help with transporting User Exit Variable in CMOD ZXRSRU01
Hello Gurus.,
I changed the existing user exit variable in CMOD ZXRSRU01.,before changing neither it ask for any transport request, nor when I activated the include program .
Well., I tried this........I went to goto-> Object Directory Entry.,
changed the Package and person responsible for and then it asked for transport request...but this dint work...
Now., how can I capture the changes in a transport request, so that, i can move the changes to production system?
is there anyway to solve my problem?
Regards,
PNKThanks for ur help VIKRAM...i solved the issue...the changes are captured in someother request, but it was not showing in the Version Management.'
I checked the Lock Overview in the Object DIrectory Entry and found out that it was capturing in different request. I released the request and when I tried to change the code, it asked for new transport request.
It worked..
Thanks for your help..
Regards,
PNK -
Formula variable with User Exit
Hi,
Can we create a Formula Variable of processing type USER EXIT...which will display a constant Value Y
Any syntax would be helpful
ThanksHi,
check this for formula variables with user exits;
http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/customer-exit-to-derive-formula-variable-to-text-variable-sap-bw-35-3030684
Also Check the issues and solution :
Formula Variable with User Exit....Problem
Thanks
Hemav -
Populate user exit Variable with User Authorizations using ABAP?
Hi, Does anyone know of a way to populate a user exit variable (with ABAP) with the Authorization Values for a user running a report? I am turning off authorizations for our InfoProvider using RSSM and want to populate a variable instead and use the variable as a filter.
Hi Kenneth ,
You need dynamic authorization in your report .This can be done at query runtime by using exit variable and writing cmod code for the same .
This code will read authorization maintained at runtime of query in i_step = 1 and will pass input var values accordingly .
For step by step information you can access this document .
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0f9f33c-0f17-2d10-d3a2-ae52ccd00780?quicklink=index&overridelayout=true
Hope this will be helpful .
Regards,
Jaya Tiwari -
Need help in creating a user exit variable
Hi all,
I have created a query in which a key figure needs to be automated with an user exit variable.I want to derive the value of this key figure 'x' based on calender month.
This key figure should get the cumulative value from the first month of the fiscal year till the calender year month entered while executing the query.
I got a basic understanding on the User exits from SDN. But Im not sure how to implement this logic.
I would really appreciate if you could provide me a detailed explanation of how to do this.
Thanks in advance,
VinothHi
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2d99121a-0e01-0010-e78c-b1ae566a2413
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/how-can-i-set-bex-variables-in-i_step3-exit_saplrrs0_001-335232 -
Please help me with user-exits or baids for TCode : FOE2 & FOE1
Hi Experts
Please help me with user-exits or baids for TCode : FOE2 & FOE1.
I found these but not picking values from VIMI01,VIOB03 and VIOB41.
User-exits
FVCH0001 CH-specific enhancements: Esp. POR
ISRE0001 Determine bank procedure account no.
ISRE0002 IPD reporting data retrieval
Business Add-in
FVD_HANDLE_FORMULA Processing of Condition FormulasHi,
ASk your basis regarding the CI_CSKB table active issue, and first of all i dont see any table with the name CI_CSKB.
And check this exit-COOMKS03 whether it works for your screen exits.
Cheers!!
VEnk@
Edited by: Venkat Reddy on Nov 4, 2008 5:59 PM -
Map the user exit variables with the queries/cubes using them
Hello Friends,
What are the post unicode conversion tests that you can perform on front end/existing queries?
is there any added advantage for queries due to unicode?
is testing the working of variable enough? is there any table to map the user exit variables with the queries/cubes using them?
Thanks
TanyaGuys, any clue about this? Answer are appreciated.
Thanks
Tanya -
BI 7 Bex Query - User exit variables after variable screen re-processed
User exit variables are not re-calculated after the variable screen is called up to re-run report with a new selection. Is there some way to force the user exit variables to change? I am aware of note 1064273 but this doesn't seem to help in these circumstances.
Example:
My Bex Query uses OI_FYPER for a static characteristic selection and I have defined a customer exit formula variable which uses the values in OI_FYPER.
All works fine when the query is run first time but if the user calls up the variable screen to change the selection and re-run the query, the customer exit formula variable is not re-calculated (customer exit is called but only with ISTEP = 3).
Software version is NS2004S (BI 7.0) SPS10, BI ABAP SP11, BI JAVA SP10, BI Front End Package 1401 rel 354.hi.. i just came to know about this in another thread..
I_STEP 3 does not have I_VNAM stored. So, to access values at I_STEP3 :
data: l_range TYPE RRS0_S_VAR_RANGE.
if I_STEP = '3'.
read table I_T_VAR_RANGE into L_RANGE with key VNAM = 'OI_FYPER'
if SY-SUBRC = 0.
...code as required...
endif.
endif.
Customer-Exit for analysis Authorizations: i_step = 3, i_vnam is empty -
Funtion Module for user exits variables in BEx Queries.
Hi,
This is for BW Query customer exit variable (zvar2) for include ZXRSRU01 and exit :EXIT_SAPLRRS0_001.
Can anyone please suggest the function modules that can be used to do the following.
1)Read value of zvar1 from selection screen whatever
user enters at run time.
2)How to define the zvar2 in the include. zvar2 is the
variable created in BEx to be populated from this
customer exit.
3)How to use case statment where once the value for zvar1
is determined then,
Case zvar1.
when zvar1 = 0 , then zvar2 = 10
when zvar1 = 1 , then zvar2 = 20
3) Assign zvar2 value as computed in the case statement.
Can anyone please help with the code to achieve this.
Any information regarding function modules that can help write user exits for variable reading and input will be greatly helpful.
Thanks
Sarah.Hi Sarah,
You don't need any FM for your issue.
Please try thie sample code :
DATA: VAR_INPIUT LIKE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZVAR2'.
CLEAR L_S_RANGE.
IF I_STEP = 2."PROCESSED AFTER VARIABLE INPUT
*Reading value of ZVAR1
LOOP AT I_T_VAR_RANGE INTO VAR_INPIUT
WHERE VNAM = 'ZVAR1'.
CASE VAR_INPIUT-LOW.
*FILLING ZVAR2
WHEN 0.
L_S_RANGE-LOW = 10.
WHEN 1.
L_S_RANGE-LOW = 20.
ENDCASE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
ENDCASE.
Hope this helps
Joe
Maybe you are looking for
-
I maintain a collection of aiff files and mp3 files of the same music. Aiff for home listening and Mp3 for my devices. I can arrange these in the same or seperate libraires. Will "itunes match" duplicate the songs in the cloud if they in the same or
-
Does Creative Cloud come with Business Catalyst?
I want to drop my web hosting plan and transfer it to the Cloud subscription service. This will make it more enticing for me.
-
Different versions of libCrun.so
I am using Studio 11. my executable just would not run with an older version of /usr/lib/sparcv9/libCrun.so on a machine and later I find out that a different libCrun.so is available with the Studio installation. Using LD_LIBRARY_PATH to pick up the
-
Internal File Delivery Channel not working..
Hi, I have configured a Trading partner to poll for a file and write into a SFTP Server with Internal delivery channel as SFTP Protocol. This is working fine on dev instance. However, when I exported the same configuration to test instance (SFTP cred
-
How to execute Pro*C file from form
Hi All ! I have one pro*c file(.pc & .exe) . How I can execute this file from form. Regards, Neeraj