Professional Documents
Culture Documents
1 of 5
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...
SAP BW
Hi,
I have created a BEx Query based on selection screen inputs.
Selection Screen Inputs:
Related
MATNR -
Discussions
BEx: Convert single entry input to a Range/selection
Option in User-Exit
User Exit to Populate Bex Variable
Cmod coding
MATNR - 'ABC'
PLANT-'A123'
SLEVEL-'0.55' (User Input Value)
Now my report should look like this.
MATNR | PLANT | SLEVEL
Blog Articles
Revisiting the ABAP dialog step
Revisiting the ABAP dialog step
No Business is Too Small for ERP Software
6 Replies
Frankonian replied May 11, 2006
Hi Brinda,
please try this:
1. Create a 'New Formula' by RMC on the structure in 'Columns' section of Qiery
Designer.
2. RMC on 'Formula Variable' in the left section of the next screen and select 'New
Variable'
3. Press 'Next' Button
4. Type in 'Variable Name' and 'Description'
5. Select 'User Entry / Default Value' in ' Processing By' and press 'Next' Button
6. Select 'Mandatory' in filed 'Variable Entry is' and press 'Next' Button
7. Select 'Number' in filed 'Dimension ID' and press 'Next' Button
8. If required type in an default value
press 'Next' Button
9. Press 'Finish' button
10/29/2016 11:57 PM
2 of 5
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...
Thanks Joe,
Yes its working for mw now...but also i want to do Validation on the user
Input for that variable.
Eg: If 'SLEVEL' =3D Greater then 1 OR Less then Zero.
Should prompt meesage for user.
Do i need to create user exit, if yes please help with sample code and
procedure.
Thanks for your reply.
Hi Brinda,
Please create another function variable
type User esit and n o t raedy for input.
Then edit user exit RSR00001 and add fhis code:
Case I_VNAM.
....
.....
when 'new_variable'. "function variable exit
IF I_STEP = 2. "after input
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
*function variable for input
WHERE VNAM = 'var_input'.
*move required data to function variable exit
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
endif.
....
....
endcase.
IF I_STEP = 3.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
*function variable for input
WHERE VNAM = 'FFFFF'.
IF LOC_VAR_RANGE-LOW LT 0 or LOC_VAR_RANGE-LOW GT 1.
raise once_more. "error msg, back to input
else.
exit.
endif.
10/29/2016 11:57 PM
3 of 5
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...
endloop.
endi
'IF I_STEP = 3.' condition is not in case-endcase satement, because at thi level system
losses the variable name and so would never process thie level. the question is : Is this
a bug or is it a feature? ;-)
Hope this helps
Best Regards
Joe
Joe,
I had a similar situation where I need to populate the From range for OCALMONTH
with 01 of the year that the user enters.
For some reason my exit doesn't stop for i_step = 3, it only goes in to my code for
steps 1 & 3 only.
Hi Ravi,
this is exactly the problem. I debugged the coding and as soon as level I_STEP = 3 is
reached variable I_VNAM is empty. So if you add code at I_STEP = 3 within a defined
'when I_VNAM',
this part of coding will never be processed.
Processing I_STEP = 3 in 'when others' or out of case-endcase condition works, but
you
have to consider two facts:
1. It will be called in every query for every variabale (This point I could accept)
2. The variable which is called, would be processed exactly in the same way in every
queries using this variable.
If you want this, it works fine, if not, you always have to pay attention using those
variables.
Regards
Joe
Joe,
Thanks for the input. I got it resolved by declaring 2 Variables. one as
user entry(input allowed) and the other is customer exit(input not allowed)
.
In the user exit populate the second variable with the values from Variable
1.
Cheers
Ravi
10/29/2016 11:57 PM
4 of 5
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...
-Cheers
Ravi Kalapati
10/29/2016 11:57 PM
5 of 5
Toolbox for IT
My Home
Topics
People
Companies
Jobs
White Paper Library
Collaboration Tools
Discussion Groups
Blogs
Follow Toolbox.com
Toolbox for IT on Twitter
Toolbox.com on Twitter
Toolbox.com on
Facebook
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...
Toolbox.com
Data Center
Data Center
Development
C Languages
Java
Visual Basic
Web Design & Development
Information Management
Business Intelligence
Database
Data Warehouse
Knowledge Management
Oracle
Enterprise Applications
CRM
ERP
PeopleSoft
SAP
SCM
Siebel
Cloud Computing
Cloud Computing
About
News
Privacy
Terms of Use
Work at Toolbox.com
Advertise
Contact us
Provide Feedback
Help Topics
Technical Support
PCMag Digital Group
Other Communities
Toolbox for HR
Toolbox for Finance
Copyright 1998-2016 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective
companies. Toolbox.com is not affiliated with or endorsed by any company listed at this site.
PCMag Digital Group
AdChoices
10/29/2016 11:57 PM