You are on page 1of 5

BEx Variable validation - Toolbox for IT Groups

1 of 5

http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...

Topics SAP Groups

SAP BW

ASK A NEW QUESTION

BEx Variable validation


Brinda asked May 11, 2006 | Replies (6)

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

PLANTSLEVEL-(User Input Value) Mandatory


Now when i select inputs at the time of running query eg;

Customer exit for variables


variable 'or' using cmod
Customer Exit to derive formula variable to text variable
(SAP BW 3.5)
BEx Query Help whit 0CALDAY
User Exit for a BEx variable

MATNR - 'ABC'
PLANT-'A123'
SLEVEL-'0.55' (User Input Value)
Now my report should look like this.
MATNR | PLANT | SLEVEL

White Papers & Webcasts


Lab Validation Report: IBM Tivoli Storage manager for
Virtual Environments
Evolution of End User Computing--Evolving to Better Meet
Customer Needs
Evolution of End User Computing--Evolving to Better Meet
Customer Needs
Evolution of End User Computing--Evolving to Better Meet
Customer Needs

ABC A123 0.55


ABC A123 0.55
Here SLEVEL value shld be user input value. How to achive this?
Join this group

Popular White Paper On This Topic

Blog Articles
Revisiting the ABAP dialog step
Revisiting the ABAP dialog step
No Business is Too Small for ERP Software

10 Critical Questions to ask a Manufacturing ERP Vendor

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

BEx Variable validation - Toolbox for IT Groups

2 of 5

http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...

10. Finally doubleclick created variable and


cobfirm 'OK'
Good Luck
Joe

Brinda replied May 12, 2006

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.

Frankonian replied May 16, 2006

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

BEx Variable validation - Toolbox for IT Groups

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

ravi.kalapati replied May 23, 2006

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.

White Papers and Webcasts


Popular
ERP Product/Project Lifecycle Management Comparison Guide
Related
Evolution of End User Computing--Evolving to Better Meet ...
Evolution of End User Computing--Evolving to Better Meet ...
Simplify and consolidate data protection for better business ...
More White Papers

Frankonian replied May 23, 2006

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

ravi.kalapati replied May 23, 2006

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

BEx Variable validation - Toolbox for IT Groups

4 of 5

http://sap.ittoolbox.com/groups/technical-functional/sap-bw/bex-variable...

On 5/23/06, Frankonian via sap-r3-bw <email@removed wrote


:
>
>
>
> 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 co
de 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 conditio
n
> 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
>
>
>
>
>
>
>
>

-Cheers
Ravi Kalapati

This thread has been closed due to inactivity.


Start a new thread here

10/29/2016 11:57 PM

BEx Variable validation - Toolbox for IT Groups

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...

Topics on Toolbox for IT

Toolbox.com

Data Center
Data Center

Enterprise Architecture & EAI


Enterprise Architecture & EAI

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

IT Management & Strategy


Emerging Technology & Trends
IT Management & Strategy
Project & Portfolio Management

Networking & Infrastructure


Hardware
Networking
Communications Technology
Operating Systems
Linux
UNIX
Windows
Security
Security
Storage
Storage

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

You might also like