0% found this document useful (0 votes)
247 views2 pages

Obligatory Selection Screen Parameters - ABAP Police

Obligatory selection screen parameters can interfere with user command logic and break selection screens. Assigning the parameter a required attribute value of 2 makes it "recommended" rather than obligatory, avoiding automatic validation. Validation can then be done conditionally on user actions like executing the report. This fixes issues like disabled fields and prevents errors when clicking buttons.

Uploaded by

Marius Ursache
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
247 views2 pages

Obligatory Selection Screen Parameters - ABAP Police

Obligatory selection screen parameters can interfere with user command logic and break selection screens. Assigning the parameter a required attribute value of 2 makes it "recommended" rather than obligatory, avoiding automatic validation. Validation can then be done conditionally on user actions like executing the report. This fixes issues like disabled fields and prevents errors when clicking buttons.

Uploaded by

Marius Ursache
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

8/3/2016

ObligatoryselectionscreenparametersABAPPolice

Obligatoryselectionscreen
parameters
Almost every ABAP developer comes to a point where they require obligatory parameters along
withusercommandlogicintheirselectionscreens.Asyoumightalreadyknow,thatsaproblem.
Because obligatory parameters demand input on every action of user and interfere with user
commandlogic,whichresultsinabrokenselectionscreen.Letsseeanexample.
1
2
3
4
5
6
7
8
9
10
11
12
13
14

PARAMETERSp_bukrsTYPEt001bukrsOBLIGATORY.
PARAMETERSp_sumRADIOBUTTONGROUPr01DEFAULT'X'USERCOMMAND
PARAMETERSp_detRADIOBUTTONGROUPr01.
PARAMETERSp_subASCHECKBOX.

ATSELECTIONSCREENOUTPUT.
IFp_det=space.
LOOPATSCREEN.
IFscreenname='P_SUB'.
screeninput=0.
MODIFYSCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Assoonaswerunthereport,wesee
enabledwhenweclick

P_DET

P_SUB

parameterasinputdisabledandweexpectittobe

radiobutton.Butno

Company Code field demands input and Display subtotal field is still disabled although
Detailradiobuttonisalreadyselected,whichmeansourselectionscreenisbroken.Thiscertainly
isnotdesired.Theoutcomegetsevenfunnierifuse

OBLIGATORY

additionforaselectoption.We

arenotallowedtoclickextensionbuttontoenteranintervaltotheverysameselectoption!
Mostlikely,SAPintendedtomakethingseasierforusbyautomatingrequiredfieldvalidationwith
a simple

OBLIGATORY

addition. But almost every time, this validation is only required after

executing the report, not on every user action. Fortunately SAP also provided us with a
workaround:therecommendedfield.Ifweassignvalue

tothe

REQUIRED

attributeofscreen,

the field becomes recommended, which means we still see the checkmark in field which
http://abappolice.com/2015/04/obligatoryselectionscreenparameters/#more35

1/2

8/3/2016

ObligatoryselectionscreenparametersABAPPolice

indicatesthefieldexpectsanentrybutnoautomatedvalidationwillrun.Soitisuptouswhenand
howtherequiredfieldvalidationwouldtakeplace.Inordertofixourpreviouscode,weneedan
assignmenttoaselectionscreenfieldattribute,plusthevalidationcode.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

PARAMETERSp_bukrsTYPEt001bukrs.
PARAMETERSp_sumRADIOBUTTONGROUPr01DEFAULT'X'USERCOMMAND
PARAMETERSp_detRADIOBUTTONGROUPr01.
PARAMETERSp_subASCHECKBOX.

ATSELECTIONSCREENOUTPUT.
LOOPATSCREEN.
CASEscreenname.
WHEN'P_BUKRS'.
screenrequired='2'.
WHEN'P_SUB'.
IFp_det=space.
screeninput=0.
ENDIF.
ENDCASE.
MODIFYSCREEN.
ENDLOOP.

ATSELECTIONSCREENONp_bukrs.
IFsyucomm='ONLI'.
IFp_bukrsISINITIAL.
MESSAGEe055(00).
ENDIF.
ENDIF.

Withthiscode,wewontseeanyerrormessagesuntilwehittheexecutebutton,butstillhavethe
obligatorycheckmark.Thisfeatureisalsoavailableinclassicaldynproscreens.

http://abappolice.com/2015/04/obligatoryselectionscreenparameters/#more35

2/2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy