Selection Screen Validation In ABAP Queries
Hello all,
I have created a selection screen field in the Infoset by EXTRAS --> Create Field.
Now i want the values entered in this field at the selection screen to be available
at the event Record Processing.
The values entered at the selection screen are getting stored in some system generated varaible
SP** .i am not able to read from this field.
Please let me know ur inputs.
Regards,
Najam
Hi,
Try declaring some global variable in the data delclaration event, and pass the values these variable at selection screen, and use them wherever required.
Regards,
Santhosh.
Similar Messages
-
How to put Mandatory option for selection screen fields in ABAP Queries
Hi Experts
Can anyone tell me how to put mandatory option for the selection screen fields in ABAP Queries.
Manually I had written code in the At Selection Screen option in infoset to display error message if that field is blank.
But I need to display the selection fields with the tick mark (obligatory mark).
How to do this?
Appropriate answers will be awardedHi
For parameter option
parameters : p_kunnr type kna1-kunnr obligatory.
For select option
select-options: s_date for vbak-erdat obligatory.
Plz rewards points ,
Regards ,
Ganesh. -
Hi Experts,
Please can any one give me the details ..
1)What is the actual use of selection screen validation?
2) When we use Selection-screen validation?
3)If we are not written the selection-screen validation is there any effect?
I know how to write the validation for a selection screen. But why i am asking above questions is I am very new to ABAP .My Functionl people also new to ABAP. They told me one report.I asked me what are the validation for selection screen . At that time they told there is no validation.
Thats the reason to ask above questions..
please tell me the details..
Thanks In Advance..
Thanks and Regards
Siri..Abhi,
Selection Screen Validation are used for correct input processing.
Selection screen elements are used further in select queries to fetch data. if user enters some wrong input
we will unnecessarily hit the data base with wrong values and select will fail , hence validation of the input
will avoid unnecessary data base hit.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 12:26 PM -
At Selection screen validation
Hi All,
I Have a Situation, If User does not enter any thing on seelction screen my report still displays the data based on the selection criteria, what validation can be done at seelction screen to resolve this issue.
Regards,
VBput your cursor on Selection-screen and press ABAP help...
or, use the appropriate program event, in this case: AT SELECTION-SCREEN [for screen-name is an addition].
If structure SSCRFIELDS-UCOMM eq 'SJOB' or 'PRIN' or 'ONLI', the user has selected an execution mode and you can enforce entry of something into your ranges tables (SELECT-OPTION creates a table of the same name).
In cases like this, please search forum and/or utilize SAP's excellent ABAP HELP capability. -
Raising Exception in Selection screen validation
Hi All,
I am doing a selection screen validation in BI report using the CMOD. If my validation fails i need to raise a error message instead showing the report. How can i perform that. How should i handle this using abap.
Thanks in advance
PremHi,
But this does not stop the execution of the report, the error message which i have given is been displayed in the report top and still the report gets executed.
Please suggest how to stop the report execution and to stay on the same selelction screen page.
Thanks
Prem -
Problem in AT selection screen validation
Hi,
I am having problem in AT SELECTION SCREEN Validation.
I have 2 radiobutton and 6 parameter. if i click first radio button all the 6 radiobutton should enable and take the user input, that is working fine for me.
if i click second radiobutton , out of 6 , 3 parameter should disable and remaining 3 should enable. thats also working fine.
My problem is program has written the validation for this 3 parameter in the AT SELECTION SCREEN.
For first radioutton all the validation working fine, for second validation as soon as i press the radiobutton it will display error message. Based on 2 parameter user is filling value for 3 rd parameter.
I want the same validation to be done for second radio button after user pressing enter.
PARAMETER: p_single RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND f1,
p_multi RADIOBUTTON GROUP rad1.
PARAMETERS: s_pwwrk LIKE plaf-pwwrk.
PARAMETERS: p_lgort LIKE plaf-lgort.
PARAMETERS: p_kostl LIKE cobl-kostl.
here is my code:
AT SELECTION SCREEN.
CLEAR t001w.
CLEAR t001k.
CLEAR marv.
SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
IF sy-subrc NE 0.
MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
ELSE.
SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
IF p_budat0(4) NE marv-lfgja OR p_budat4(2) NE marv-lfmon
IF marv-xruem IS NOT INITIAL.
IF p_budat0(4) NE marv-vmgja OR p_budat4(2) NE marv-vmmon.
MESSAGE e999 WITH p_budat4(2) p_budat0(4)
'is closed.
Please try again.'.
ENDIF.
ELSE.
MESSAGE e999 WITH p_budat4(2) p_budat0(4)
'is closed.
Please try again.'.
ENDIF.
ENDIF.
ENDIF.For your Case ,
If i understand clearly,You can do the validation when you want on AT SELECTION SCREEN ON WP_FIELD.
If you say your validation to be done only for Selection of Second Radio Button, then..
AT SELECTION SCREEN.
if p_multi eq 'X'. "<- Make Validation to be done only if user select Second Button
CLEAR t001w.
CLEAR t001k.
CLEAR marv.
SELECT SINGLE * FROM t001w WHERE werks EQ s_pwwrk.
IF sy-subrc NE 0.
MESSAGE e999 WITH 'Plant' s_pwwrk 'does not exist'.
ELSE.
SELECT SINGLE * FROM t001k WHERE bwkey EQ t001w-bwkey.
SELECT SINGLE * FROM marv WHERE bukrs EQ t001k-bukrs.
IF p_budat+0(4) NE marv-lfgja OR p_budat+4(2) NE marv-lfmon
IF marv-xruem IS NOT INITIAL.
IF p_budat+0(4) NE marv-vmgja OR p_budat+4(2) NE marv-vmmon.
MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
'is closed.
Please try again.'.
ENDIF.
ELSE.
MESSAGE e999 WITH p_budat+4(2) p_budat+0(4)
'is closed.
Please try again.'.
ENDIF.
ENDIF.
ENDIF.
endif. -
Problem in selection screen validation.
Hi All,
I am having the following in the selection screen:
PARAMETERS : p_r1 RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND dlvy,
p_r2 RADIOBUTTON GROUP grp .
SELECTION-SCREEN BEGIN OF BLOCK b1 with frame title text-001.
SELECT-OPTIONS: s_vbeln FOR lips-vbeln MODIF ID dly.
SELECT-OPTIONS: s_lfart FOR likp-lfart OBLIGATORY MODIF ID dly.
SELECT-OPTIONS: s_vstel FOR likp-vstel MODIF ID dly.
SELECT-OPTIONS: s_matnr FOR lips-matnr MODIF ID dly.
SELECT-OPTIONS: s_wadat FOR likp-wadat OBLIGATORY MODIF ID dly.
SELECT-OPTIONS: s_wbsta FOR vbup-wbsta MODIF ID dly.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 with frame title text-002.
SELECT-OPTIONS: s1_matnr FOR lips-matnr MODIF ID mat.
SELECT-OPTIONS: s_extwg FOR mara-extwg MODIF ID mat.
SELECT-OPTIONS: s_werks FOR marc-werks MODIF ID mat.
SELECTION-SCREEN END OF BLOCK b2.
If I choose Radio Button 1, only option 1 should be triggered,
If I choose Radio Button 2, only option 2 should be triggered,
For this I have:
AT SELECTION-SCREEN OUTPUT.
IF p_r1 = 'X'.
blk_hide = 'MAT'.
blk_show = 'DLY'.
ELSE.
blk_hide = 'DLY'.
blk_show = 'MAT'.
ENDIF.
LOOP AT SCREEN.
IF screen-group1 = blk_hide.
screen-active = 0.
ELSE.
IF screen-group1 = blk_show.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Now I need to validate the selection Screen, I am facing issue in doing selection screen validation:
Can any one help me in how to go about this?
Thanks,
Debrup.pls. replace the AT SELECTION-SCREEN OUTPUT event with this one:
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE 'X'.
WHEN p_r1.
CASE screen-group1.
WHEN 'DLY'.
screen-active = '1'.
WHEN 'MAT'.
screen-active = '0'.
ENDCASE.
WHEN p_r2.
CASE screen-group1.
WHEN 'DLY'.
screen-active = '0'.
WHEN 'MAT'.
screen-active = '1'.
ENDCASE.
ENDCASE.
MODIFY SCREEN.
ENDLOOP. -
Selection Screen Validation for Character
Hi All
My query is regarding the selection screen validation for character.
I am using a Select-option: S_ORDER FOR VBAK-VBELN OBLIGATORY.
and S_order should be only having the numeric field.
Please help how to validate it for character field.Hi,
Do as below :
at selection-screen.
if not s_order[] is initial.
if s_order-low CA 'ABCDEF.............Z'.
message 'Enter only numerics only' type 'E'.
endif.
"similarly for s_order-high also.
endif.
Thanks,
Sriram Ponna. -
Saving Selection Screens in Webdynpro Abap
Hi ,
Could you please throw some light on how to save the selection screens in Webdynpro Abap ?? Just like variants in normal Abap?
Thanks and Regards
Alok SharmaHI,
I dont think there is automatic saving of varients in web dynpros just like normal selection-screen.
Just check this link you might get some idea.
Link[Save Varient|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f028c2b9-1730-2d10-71ae-ce300ea00573?quicklink=index&overridelayout=true]
Regards and Best wishes. -
Want to have own selection screen in HR-ABAP report using LDB
Hi experts,
I am working on HR-ABAP report using LDB pnp and infotypes..But, here we get the built in selection criterion..but I want my own selection screen to be displayed..whats the solution for this??? Is it possible to create my own selection screen instead of default one..and how???
Please help me..its very urgent..Hi,
chk this out:
Create Report Categories
In this step, you define the report categories and determine the layout
of the standard selection screen for these report categories. You can
create report categories for programs or queries that are based on the
PNP or PNPCE logical databases.
The definition of report categories is divided into two sections:
o In the Change Report Category view, you define general attributes
such as sort order, input fields for date, and so on.
o In the Change Selection Criteria view, you define which selection
fields of the logical database should be avaliable on the selection
screen.
Example
You want to set up your system so that your employees can only start
evaluation reports for Payroll if they use a payroll area. Within a
payroll area, you should be able to select according to personnel
number. Additional selection criteria should not be possible and you
should not be allowed to enter a sort sequence.
Standard settings
The standard system already contains report categories. You can find the
attributes of the report categories in the table.
Note the following five report categories in particular:
o Report category ' ' is the SAP default report category for
programs that are based on the PNP logical database.
o Report category PNPCE is the SAP default category for programs that
are based on the PNPCE logical database.
o Report category '00000000' is the customer-specific default category
for programs that are based on the PNP logical database.
o Report category '0PNPCE' is the customer-specific default category
for programs that are based on the PNPCE logical database.
o Report category __X2001 is the default category for Queries that
are based on an InfoSet of the PNP LDB.
o Report category QUEPNPCE is the default category for queries that
are based on an InfoSet of the PNPCE LDB.
The default report categories are used when a report is called if
the report has not been assigned a report category.
Parameters and Options for Report Categories of the LDB PNP and PNPCE
Parameters and Options in Screen Area General Data
If you activate this parameter, you can only enter data on the data
selection period if you use reports that have been assigned. The
same date entries are then used for the person selection as for the
date selection.
o Matchcode allowed
If you activate this parameter, you have use of a Matchcode
pushbutton (search help) if you use reports that have been assigned.
This pushbutton enables you to perform the person selection.
o Sort allowed
If you activate this parameter, you have use of a Sort pushbutton if
you use report that have been assigned. This pushbutton enables you
to define a sort order before you execute the report.
o Organizational structure allowed
If you activate this parameter, you have use of an Org.Structure
pushbutton if you use reports that have been assigned. This
pushbutton enables you to perform the person selection.
Note:
For more information about these options, see the online
documentation under this path:
SAP Library -> Human Resources -> Reporting in Human Resources
Management -> Standard HR Reports -> Report Selection Screen in
Human Resources Management.
Parameters and Options in Screen Areas Data Selection Period/Person
Selection Period/Payroll Area/Period/Year
o Options for data selection period and person selection period (key
date and so on)
Here you define which options for date and person selection are
available for reports that have been assigned.
o Options for payroll area/period/year
Here you define which options for selection using payroll
area/period/year are available for reports that have been assigned.
Parameters and Options in Screen Area Selection View
o Type/Name
This parameter enables you to use selection views to define report
categories. You use the selection view selected here to determine
which fields are available in the Dynamic Selectionsy.
Note:
You create selection views for the PNP and PNPCE logical databases
in the Object Navigator (SE80):
1. Start the Object Navigator (SE80)
2. Choose Workbench -> Edit Object.
3. Choose the More... tab page and the Selection view on this tab
page.
4. Choose Create.
5. In the Create Selection View dialog box, choose the For any
tables option.
6. In the Name of view field, enter a name for your selection view.
7. In the Tables dialog box, enter the name of the table from which
you want to use fields.
Note:
When you enter the table name, observe the naming convention in
Personnel Administration:
Infotype number: nnnn -> table name: PAnnnn
8. Choose Continue.
9. In the Functional groups area, define functional groups by
assigning a name and a number.
10. Assign fields from the selected tables to the functional groups
by entering the number of the desired functional group in front of
each field.
11. Save your entries.
For more information about adjusting the dynamic selections using
your own selection views, see the online documentation under the
following menu path:
SAP Library -> Human Resources -> Reporting in Human Resources
Management -> HR Standard Reports -> Report Selection Screen in
Human Resources Management -> Enhancing the Selection Screen -
Dynamic Selections.
If you do not want to offer dynamic selections, make the following
settings:
- LDB PNP: In the Selection view field, enter PNP_NO_FREE_SEL.
- LDB PNPCE: Leave the Selection view field empty.
Parameters and Options in Screen Area Data Selection Period/Person
Selection Period/Payroll Area/Period/Year
o Available input parameters, date or period entry (today, key date,
all, and so on), and standard value.
Using the Standard value option, you define which of the selected
options is shown.
Parameters and Options in Screen Area CE Selection Fields
o CE selection fields (external person ID, grouping reason, grouping
value)
Using the options in this area, you define whether the external
person Id, grouping reason, or grouping value are available on the
selection screen.
Note:
These parameters are only relevant for you if you implement
Concurrent Employment (see also note 517071).
Parameters and Options in Screen Area Selection view
o Dynamic selections as dialog box
If this switch is set, you can call the dynamic selections as a
dialog box.
o Dynamic selections active
If this switch is set, the dynamic selections of the logical
database are active at the start of the report.
Note that the following combinations are possible for the last two
options mentioned:
Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/inactive
Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/active
Dyn.Sel. as dialog box/Dyn.Sel. active: active/inactive
Activities
1. Choose Edit -> New entries.
2. Enter an abbreviation and a long text for the report category.
The customer name range for report categories is 0-9.
3. Select the For the PNPCE logical database checkbox, if you want to
create a report category for a program or for queries of the PNPCE
logical database.
4. In the General Data screen area, choose the desired options.
If you want to use selection IDs, you must have first created and
grouped selection Ids. The IMG path to do this is given in the
parameter description section.
5. In the Data selection period/person selection period or Selection
period screen area, choose the desired options.
6. In the Selection view screen area, choose the desired options.
7. In the CE selection fields screen area, choose the desired (only
possible for report categories of the LDB PNPCE).
8. Save your entries.
9. Choose the subactivity Permitted selection criteria.
10. Choose Edit -> New entries.
11. In the Select option field, use the input help to select each field
that should be available on the selection screen.
12. Select the checkbox in the 1.page column, if you want this selection
field to be available directly when you call the selection screen.
Further notes
13. If you want to copy entries, you still have to enter the selection
parameters again in the subsequent screen.
o If you create the report category '000000000', a selection screen is
generated according to report category '00000000'for all reports for
which a report category has not explicitly been assigned.
Assign Report Categories
In this step, you assign a report category to your reports.
Example
You have created your own report, for example ZPCTEST1, and would like
it to have the selection screen that corresponds to that of the
evaluation report for Payroll, which is assigned to report category
'__M00001'.
Assign report category '__M00001' to the report.
Requirements
You must have defined the Report Categories.
Standard settings
SAP Standard Reports:
In the standard system, reports are assigned a report category. If you
want to override these assignments, perform the activities described
here. If you want to assign report categories to standard reports using
SE38, this represents a modification.
Customer-Specific Reports:
For reports you have developed yourself, you can either assign report
categories by performing the activities described here or directly in SE38.
Recommendation
Only assign a report category if you have created your own reports or if
the selection screens in the standard system do not meet your
requirements.
Activities
1. Choose Edit -> New entries.
2. Perform the required assignment using the Program name and Report
category fields.
3. Save your entries.
reward if helpful
regards,
madhumitha -
Hi Experts ,
I have module pool program there in first screen user have choice to select screen if user select the first screen .The selection will be displayed with two parameters using key word
selection-screen begin of screen 2002.
parameters : p_date type sy-datum,
p_num type kunnr.
selection-screen end of screen 2002.
call screen '2003'.
now i want to do validations on these parameters ,
please let me know how can i validate these selection-screen fields there i try chain and endchain in screen 2003 , it says no fields in screen 2003. screen 2002 was developed dynamically by systemplease let me know how to do validations i search it i cant find it plz solve issue .hi
i think there are two methods two create selection screen
1. using layout here we can create selection screen with screen painter
here we can validate using chain end endchain.
Plz try this on
Selection Screen
Defined within an ABAP program; called by the runtime environment or using the CALL SELECTION-SCREEN statement; processed in event blocks of the corresponding ABAP program.
in main screen we have 3 selections for screen 2002 ,2004, 2006.
if sy-ucomm = 2002.
2 . selection-screen begin of screen 2002.
parameters : .........
selection-screen end of screen 2002.
call selection-screen '2002'.
once this was triggered after entering vales it return to the next step then
call screen 2003.
then it goes to PBO and PAI events.
endif.
if sy-ucomm = 2003.
selection-screen begin of screen 2003.
parameters : .........
selection-screen end of screen 2003.
call selection-screen '2003'.
once this was triggered after entering vales it return to the next step then
call screen 2004.
then it goes to PBO and PAI events.
endif.
all these are done in initial screen PBO . and those are created dynamically now i want to do validations on selection-screen fields. we can;t use at selection-screen in module end end module .
plz let me know if you know any thing more. -
Wrong sequence in selection screen generated by ABAP Query
Hi,
I am developing a query to display the data in the view.
My query has 8 selection fields totally.
As part of my requirement I have added selection parameter in the
selections tab of the infoset and maintained the sequence as 9.
Inspite of maintaining the sequence number as 9 in the infoset, It is
appearing first in the selection screen of the query.
I tried putting different numbers in the sequence number, but even it
is appearing first in the selection screen.
Can you please let me know how to display the selections declared in
the infoset as per the sequence required.
Thanks,
Madhuri.Actually what happen when you declare your own fields in ABAP query . you have to care about the sequence . As an example if youre selecting lets say state name , you have two variables
<b>1-state
2- land</b>
for state you have to select land first , if your state is first and land is 2nd it gave you the error of sequence .
Because you have to get data in land first in order to get state specific to the land .
it should be
1-Land
2-State
Just see the your fields , Im sure youre missing that .
<b>You can also see the NO ( field ) in Query ( Sq03 ) . where you can define the seqence on selection.</b>
hope thisll help you .
Pl...Award the points .
Thanks
Saquib<b></b>
Message was edited by: Saquib Khan -
Selection screen validation in HR ad hoc query
Hi Experts,
I have created a query in SQ01. My infoset is created using Logical database PNPCE. Selection criteria contains Fields Personnel Number and Employment status. so when the query will be run, I want to display error message if invalid personnel number or Employment status is entered. Please let me know, How do I achieve it.
Thanks in advane.
Regards.Hi
After declaring selection screen fields.
select the field to handle validation and click on the button 'Check coding for
Element' .
you will get a block to handle the validation. -
Selection screen validation when using PNP LDB
Hi guys,
I want to validate my selection screen parameters.Thats is if somebody wants to run the program without giving any input parameters to the selection screen(trying to run the report with a blank screen) I want to pop up an error/information message so that it will return the selection screen.I am using PNP Logical database for my selection screen.Please help.Thanks in advance.
Thanks,
Karthik.Welcome to SDN.
If you are using PNP logical data base then validating the fields will be little tricky...
You canc check all the other fields in START-OF-SELECTION and if they are empty return eroor. Remember all the field s on the scree... so I will suggest you to choose HR report Category accordingly.
Also,when it comes to date field then you need to check for the start and end dates rather than blank fields as SAP defaulted them to system start and end date.
Still, I will prefer to create a HE Report Category for the PNP database and use the screen while validating....that will be easy... -
Problem in displaying selection screen of a abap-hr report
Hi,
I have developed a abap-hr report in ver..6.2.I have used logical data base PNP for it.It was working fine.
But when i migrate it into ver.4.6, I can see no selection screen for the report.
How to get the selection-screen?
Please help me through.
Thanks in advance,
Raj.
Edited by: raj b on Feb 20, 2008 8:00 AMHi Raj,
Please check whether you have assigned any report category for the PNP selection screen in the version 6.2.
The report category might not exist in the 4.6 version and that might be the reason the selection screen is not appearing.
Cheers,
Aditya
Maybe you are looking for
-
Round Edged boxes in rtf templates
Hi all, I have been really struggling to design rtf templates for XML Publisher with round edged boxes. The client requirement is to have all the tables/objects that contain data to have rounded edges..Just like a flowchart box.. I have tried using t
-
Sapscript Issue . Same line appears in all the line
Hi All , By using the logic below , i am able to find the 4 diffrenet line item in my window . Now i am getting the same line in all the lines in sapscript. Pls suggest , how to avoid this . In my final table it_excdtl , all diffrent line item are s
-
Short Dump 'ASSERTION_FAILED' during updating partner Functions
Hi All, I am updating the Partner Functions for the Customers using FM 'SD_CUSTOMER_MAINTAIN_ALL' and passing the partner functions and numbers to the XKNVP structure. while running the program in am getting the short dump as ASSERTION_FAILED. Detail
-
Disappear login. Please HELP!
Hi, i have a Macbook 13'' (one of the previous gen. black) with OS X Leopard with i believe 10.5.8 I'm having a similar problem as: http://discussions.apple.com/message.jspa?messageID=8106830 and http://discussions.apple.com/message.jspa?messageID=80
-
Unable to login to OWB Design Repository
Hi, While trying to login to OWB Design Repository I am getting an error message, 'SQL EXCEPTION'. Can anybody tell me the reason behind this. Liyakat