Selection Screen - User input to select option only through f4 help,
Hi..
In case of selection screen, I need selection screen such a that user input must be through search help not manual entry is allowed/ possible
TYPES:BEGIN OF ty,
field1 TYPE char01,
END OF ty.
DATA:it TYPE TABLE OF ty,
wa TYPE ty.
data:v_var type c.
select-options:so for v_var.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'SO-LOW' .
screen-input = 0.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'SO-HIGH' .
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so-low.
CLEAR it[].
wa-field1 = 'A'.
APPEND wa TO it.
wa-field1 = 'B'.
APPEND wa TO it.
CLEAR wa.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD1'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'SO-LOW'
value_org = 'S'
display = 'F' "F = Force
TABLES
value_tab = it[].
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so-high.
CLEAR it[].
wa-field1 = 'A'.
APPEND wa TO it.
wa-field1 = 'B'.
APPEND wa TO it.
CLEAR wa.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD1'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'SO-HIGH'
value_org = 'S'
display = 'F' "F = Force
TABLES
value_tab = it[].
Similar Messages
-
What is the use of the event at selection-screen on input?
Hi,
This event is used mainly for validating an input provided to the selection screen element. Once a value is entered in the Selection Screen this Event gets triggered.
The syntax for this is
AT SELECTION-SCREEN ON {para/selcrit}
Effect
This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
Note
If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
Reward if helpful. -
I need to get an icon on the selection screen as well as selection text .
HI ,
Can anybody please tell me how to get an icon in the selection-screen along with the selection texts written for select-options or parameters.
For Example:
Select-Options: S_WERKS For T001w-werks,
S_AUART For TVAKT-AUART,
S_ERDAT For LIKP-ERDAT.
IN THE SELECTION TEXTS:
FOR S_WERKS i write (WareHouse)
FOR S_AUART i write (OrderType)
FOR S_ERDAT i write (PlantDate)
I need to get the icons for this fields as well as selection texts written for these fields.
I will reward full points to the solution.
Mohan.Hi mohan,
<b>Run the below code</b>
Report zex33.
tables : t001w,
tvakt,
likp.
type-pools: icon.
selection-screen begin of line.
selection-screen comment 1(20) text_001.
select-options: S_WERKS For T001w-werks.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_002.
select-options :S_AUART For TVAKT-AUART.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(20) text_003.
select-options : S_ERDAT For LIKP-ERDAT.
selection-screen end of line.
initialization.
write ICON_WAREHOUSE as icon to text_001.
concatenate text_001 text-001 into text_001 separated by space.
write ICON_ORDER as icon to text_002.
concatenate text_002 text-002 into text_002 separated by space.
write ICON_PLANT as icon to text_003.
concatenate text_003 text-003 into text_003 separated by space.
*In text-001 -> Warehouse
*In text-002 -> Order Type
*In text-003 -> Plant Date -
I/p in a field only through F4 help
I have attached a search help to a field on screen .
I want to disable manual input in the field . i.e
I.e Value entered should be there only through f4 help and not otherwise.Hi,
check the below code
REPORT zex33 message-id zsmg .
PARAMETER :p_vbeln LIKE vbak-vbeln MODIF ID md1.
DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
At selection-screen.
if p_vbeln ne space.
message e001(zsmg) with 'select by pressing F4'.
endif.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'VBAK'
fieldname = 'VBELN'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_VBELN'
TABLES
return_tab = return
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-input = '0'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
regards,
Omkar. -
Selecting user input from Select option into smart form
Hi,
when i use parameter then i wil show company code in smart-form output
but when i use select option then its throwing error parameter specified here is different
what should i do in this case i want to design a big select option screen for taking user input
REPORT ZMM.
TABLES BSEG.
DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
V_FMNAME TYPE RS38L_FNAM.
*PARAMETERS SO_BUKRS TYPE BUKRS.
SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
DATA : Z_CONTROL TYPE SSFCTRLOP, "Smart Forms: Control structure
Z_OPTIONS TYPE SSFCOMPOP. "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog, "SAP Smart Forms: General Indicator
Z_options-tdnewid, "New Spool Request (Print Parameters)
z_control-PREVIEW. "Print preview
MOVE 'LP01' TO Z_options-tddest. "Spool: Output device
MOVE space TO Z_options-tdimmed. "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device. "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORMNAME
IMPORTING
FM_NAME = V_FMNAME.
CALL FUNCTION V_FMNAME
EXPORTING
CONTROL_PARAMETERS = Z_CONTROL
OUTPUT_OPTIONS = Z_OPTIONS
USER_SETTINGS = ''
BUKRS = SO_BUKRS.
pls help me in this regards.
ketan..hi
thnx for your reply
can u pls elaborate in my code
now i changed code BUKRS = SO_BUKRS-low.
either i can give low or high but how to select from range
REPORT ZMM.
TABLES BSEG.
DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
V_FMNAME TYPE RS38L_FNAM.
*PARAMETERS SO_BUKRS TYPE BUKRS.
SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
DATA : Z_CONTROL TYPE SSFCTRLOP, "Smart Forms: Control structure
Z_OPTIONS TYPE SSFCOMPOP. "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog, "SAP Smart Forms: General Indicator
Z_options-tdnewid, "New Spool Request (Print Parameters)
z_control-PREVIEW. "Print preview
MOVE 'LP01' TO Z_options-tddest. "Spool: Output device
MOVE space TO Z_options-tdimmed. "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device. "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORMNAME
IMPORTING
FM_NAME = V_FMNAME.
CALL FUNCTION V_FMNAME
EXPORTING
CONTROL_PARAMETERS = Z_CONTROL
OUTPUT_OPTIONS = Z_OPTIONS
USER_SETTINGS = ''
BUKRS = SO_BUKRS-low.
ketan.. -
Adding a new input field on selection screen after input in a select option
Hi Experts,
There are 2 input fields on the selection screen.
I would like to add a new select option field when a value is entered in the 2nd field <b>only</b>. If there is an input in the 1st field or both the fields, the new input field should not appear.
Message was edited by:
Gaurav Kothariexecute the code .
you will get sel option for s_lgort only when there is a value in s_werks.
tables mard.
select-options: s_matnr for mard-matnr,
s_werks for mard-werks,
s_lgort for mard-lgort modif id abc.
at selection-screen output.
if not s_werks[] is initial and s_matnr[] is initial.
loop at screen.
if screen-group1 = 'ABC'.
screen-active = '1'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif. -
Validating a selection screen on input parameters
hi,
on my selection screen ,a parameter called no. of boxes and 3 select options are given.
i want to validate the 3 select options according to the entry done in no. of box .
ex. if 2 is entered in no. of boxes then only the 2 select options would be available to user for entering rest 1 would be isolated
Thanks in advance !!!
amitHi,
Check this,
PARAMETERS: p_1 type i.
SELECT-OPTIONS:num1 for mara-matnr.
SELECT-OPTIONS:num2 for mara-matnr.
SELECT-OPTIONS:num3 for mara-matnr.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if p_1 = '1'.
IF screen-name cs 'NUM2'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
elseif p_1 = '2'.
IF screen-name cs 'NUM3'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
endif.
endloop.
Regards,
Vik -
Not all selection screen value coming from selection screen only first val
hi i am doing
SELECTION-SCREEN BEGIN OF BLOCK gl_ac3 WITH FRAME TITLE text-019.
SELECT-OPTIONS: gl_acdp1 FOR gv_gldep1.
SELECTION-SCREEN END OF BLOCK gl_ac3.
then i am using seelct as below
SELECT robukrs
rzzhkont
FROM zzamd1t INTO TABLE it_amdt
WHERE ryear = p_gjahr
AND robukrs IN so_bukrs
AND rzzhkont IN gl_acdp1.
but the value selected by select statement from internal table is for only first value of gl_acdp1 ie for first account c1 but user is entereng three acts c1 c2 and c3 so fro all data should be selected but for only one it is being selected
pls sugestHi,
Is gv_gldep1 & rzzhkontare of same data type.
Do as below
SELECTION-SCREEN BEGIN OF BLOCK gl_ac3 WITH FRAME TITLE text-019.
SELECT-OPTIONS: gl_acdp1 FOR gv_gldep1.
SELECTION-SCREEN END OF BLOCK gl_ac3.
INITILIZATION.
MOVE 'I' TO gl_acdp1-sign,
'EQ' TO gl_acdp1-option,
'C1' TO gl_acdp1-low,
APPEND gl_acdp1.
MOVE 'I' TO gl_acdp1-sign,
'EQ' TO gl_acdp1-option,
'C2' TO gl_acdp1-low,
APPEND gl_acdp1.
MOVE 'I' TO gl_acdp1-sign,
'EQ' TO gl_acdp1-option,
'C3' TO gl_acdp1-low,
APPEND gl_acdp1.
START-OF-SELECTION.
SELECT robukrs
rzzhkont
FROM zzamd1t INTO TABLE it_amdt
WHERE ryear = p_gjahr
AND robukrs IN so_bukrs
AND rzzhkont IN gl_acdp1.
Make sure that ur table zzamd1t has values for C1, C2 and C3.
Tell us how is ur output with this code.
Regards,
Bala Krishna
Edited by: Bala Krishna on Aug 11, 2008 9:11 PM -
Bex selection screen field input
Hi Gurus,
I have a requirement . The selection screen has plant (single value). If user enters plant value greater than (Ex. 2001) it should throw an error message . if the user doesnt enter any values in that field. Then it has to choose all the plant values !!
please guidance needed
thanks
satishsathish,
make the variable optional and then if the user does not select anything then all values will be selected.
As for the first part - if the value does not exist - then the output will be # - not sure if an error message can be handled that way - you would have to write an exit for the same and include it in the query with i_step=2 and raise an exception.
Arun -
SQL- 2005 : User Input in select statement's where cond [Input Parameter]
Hi All
i am using SQL Server 2005 , i want to select the data based on the user input in where condition,
but i am not sure what to give in where condition,can anyone have any idea on this
SELECT [NO]
,[NAME]
,[PAGE_COUNT]
FROM [DS].[DB].[tablename]
where [NO]=???
Regards
Chaitanya.AHI
public String getEmployeeName(String employeeNumber)
// TODO : Implement
String name = new String();
String exception = new String();
try
InitialContext initialContext = new InitialContext();
DataSource dataSource =(DataSource) initialContext.lookup("jdbc/XXXX");
java.sql.Connection connection = dataSource.getConnection();
PreparedStatement stmt =connection.prepareStatement("SELECT [NAME]FROM [XXX].[ASDF].[ABCD] where [NO]=?");
stmt.setString(1,employeeNumber);
ResultSet result = stmt.executeQuery();
while (result.next())
name = result.getString("Name");
connection.close();
return name;
catch (Exception e)
exception = "Exception";
return exception;
i used the above function to achieve my requirement
Thanks
Chaitanya.A -
Selection Screen - How to populate more than 1 field with help input
Hello all,
I have a selection screen in which 4 fields are defined.
Help input is available for the first field. On selecting the entry in the popup, I would like the 4 fields to be populated with the corresponding values.
Try transaction CV01 for a sample of what I want:
Selecting from the popup will populate all 4 fields.
Thanks in advance,
Alain Cyr.Please see the following program, it should show you exactly what you need to do.
report zrich_0002 .
parameters: p_bukrs type t001-bukrs,
p_butxt type t001-butxt,
p_ort01 type t001-ort01,
p_land1 type t001-land1.
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
at selection-screen on value-request for p_bukrs.
call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
tabname = 'T001'
fieldname = 'BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
tables
return_tab = return
exceptions
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
others = 5.
read table return with key fieldname = 'P_BUKRS'.
* Add it back to the dynpro.
dynfields-fieldname = return-retfield.
dynfields-fieldvalue = return-fieldval.
append dynfields.
* Get the company code from db and add to dynpro
data: xt001 type t001.
clear xt001.
select single * into xt001
from t001
where bukrs = return-fieldval.
dynfields-fieldname = 'P_BUTXT'.
dynfields-fieldvalue = xt001-butxt.
append dynfields.
dynfields-fieldname = 'P_ORT01'.
dynfields-fieldvalue = xt001-ort01.
append dynfields.
dynfields-fieldname = 'P_LAND1'.
dynfields-fieldvalue = xt001-land1.
append dynfields.
* Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.
Welcome to SDN! Please remember to award points for helpful answers and mark you post as solved when solved completely. Thanks.
Regards,
Rich Heilman -
At selection-screen output and at selection-screen on
Hi Experts,
I had coded in both at selection-screen output for disabling input of certain fields and at selection-screen for validation like this:
AT SELECTION-SCREEN output.
IF p_amt = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_AMT'.
screen-input = '1'.
WHEN 'P_TST'.
screen-input = '1'.
WHEN 'P_B4C'.
screen-input = '1'.
WHEN 'P_AFC'.
screen-input = '1'.
WHEN 'P_COM'.
screen-input = '1'.
WHEN 'P_COM1'.
screen-input = '1'.
WHEN 'P_COM2'.
screen-input = '1'.
WHEN OTHERS.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF p_amt = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_AMT'.
screen-input = '1'.
WHEN 'P_TST'.
screen-input = '1'.
WHEN 'P_B4C'.
screen-input = '1'.
WHEN 'P_AFC'.
screen-input = '1'.
WHEN 'P_COM'.
screen-input = '1'.
WHEN 'P_COM1'.
screen-input = '1'.
WHEN 'P_COM2'.
screen-input = '1'.
WHEN OTHERS.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF p_pdf = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_PDF'.
screen-input = '1'.
WHEN 'P_TST'.
screen-input = '1'.
WHEN 'P_PATH'.
screen-input = '1'.
WHEN OTHERS.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF p_afc = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_TST'.
screen-input = '1'.
WHEN 'S_FID-LOW' OR 'S_FID-HIGH'.
screen-input = '0'.
WHEN 'S_ORG-LOW' OR 'S_ORG-HIGH'.
screen-input = '0'.
WHEN 'S_OFF-LOW' OR 'S_OFF-HIGH'.
screen-input = '0'.
WHEN 'S_DAT-LOW' OR 'S_DAT-HIGH'.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
AT selection-screen on block b5.
if p_tst is initial.
message text-016 type 'E'.
endif.
AT selection-screen on block b2.
if p_amt ne 'X' and p_pdf ne 'X'.
if s_fid is initial and s_org is initial.
message text-000 type 'E'.
endif.
if s_dat is initial.
message text-000 type 'E'.
endif.
endif.
when i comment out at selection-screen validations the input is disabled for the screen fields as set, else the validations are executed first.
Any solution for this???
Thanks in advance.AT SELECTION-SCREEN
Syntax
AT SELECTION-SCREEN selscreen_event.
Effect
This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
Note
The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data. -
Value from Program to Selection screen using pushbutton on Selection Screen
Sir,
I am creating a Selection screen for update some fields using selection screen. I have 6 fields on screen. First 3 Fields are mendaotry for fetching the data to dispay last 3 fields. I have create a push button for fetch the last 3 fields using first 3 fields.
So Plz guide me how to do that. I have used At Selection Screen with user command. but result is zero.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'FETCH'.
IF AGSLNO-LOw is NOT INITIAL.
SELECT SINGLE AGATE_ENTRY_NUM BTRANSPORTER_CODE B~TRUCK_NO
INTO (V_GTENT_N, V_TR_CODE, V_TRUCK_NO)
FROM ZGATEOUT AS A
INNER JOIN ZGATE_IN AS B ON AGATE_ENTRY_NUM = BGATE_ENTRY_NUM
AND AWERKS = BWERKS
AND ATRANSPORTER_CODE = BTRANSPORTER_CODE
INNER JOIN ZTRPTR_REQ AS C ON AWERKS = CWERKS
AND ATRANSPORTER_CODE = CTRANSPORTER_CODE
WHERE C~AGSLNO = AGSLNO-LOW.
ENDIF.
ENDIF.
S_GTENT_N-low = V_GTENT_N.
S_TR_CODE-low = V_TR_CODE.
S_TRUCK_NO-low = V_TRUCK_NO.
Thanks.
RamHi.,
did you assigned user command to push button..!!
put a break point at IF sscrfields-ucomm = 'FETCH'. and check whether at selection screen event is triggered or not. and check the ucomm value .
check this help for reference: http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm
hope this helps u.,
Thanks & regards,
Kiran -
Selection screen flow logic change not taking affect. Please help!
Hi
When I am trying to change the selection scren flow logic I get the following message:
Selection screen: Report generation makes screen changes ineffective.
Whatever I am changing is not taking affect in runtime.
Even though I have activated the changed code for the screen
What shall I do resolve this?
Thanks
GopalYou should not be changing the screen flow logic of a standard selection screen 1000. It will always be regenerated. In order to modify the standard selection screen, you can do this in the AT SELECTION-SCREEN output event and loop at screen and change the attributes.
Loop at screen.
if screen-name = 'P_CHECK'.
screen-input = '0'.
modify screen.
endif.
endloop.
Regards,
Rich Heilman -
How to prevent AT SELECTION-SCREEN event on second Selection Screen
Hi All
I have a program in which I am entering some parameters in a selection screen and also validating them in AT SELECTION-SCREEN events. After validating them the program shows another selection screen in which I have some push-buttons. I have some events on those push-buttons also.
However I am facing a different problem now. When I execute the second selection screen I get the report, and when I click on back button then it again triggers the AT SELECTION SCREEN event of the first selection screen and displays the related messages.
How to prevent this ? Is there any way where I can restrict the execution of selection screen events for a particular selection screen?
AmolHi,
try this logic when Ist selection screen validation
is done set a flag = 'X' .
at selection-screen.
if glag is initial
*screen validation
flag = 'X..
endif.
regards
amole
Maybe you are looking for
-
Start up problem.....flashing file icon
Problem: 1) few days ago I configured computer for ethernet link between crt imac and powerbook. 2) Now when I start up on the crt only, I get a flashing globe on a square which turns to a flashing file with a question mark in it. And the start up ne
-
How to access application server path in sap
Hi All, Could you please help me how we can navigate application serverpath; for example in my job the file is placing at this directory /usr/sap/interfaces/WAP/100/MM/OUT/SOFTCONQAG/ARCHIVE in application server, How can I go to that path to check
-
Currency field to be displayed with commas and asterisks(formatting)
I have a field REGUH-RWBTR in my sap script code. I need to have the currency displayed with commas. And also if the digits are less, then left pad it with asterisks for remaining spaces. For eg, If the Digit is 12345678912.23 (max value), it should
-
Music Distortion via Earphones
Hello community, Just yesterday, my iPhone 3G which runs on 3.1.2 played back distorted music. The music echoes and sounds warped, and the artist lyrics become muffled. It's similar to only listening to an instrumental but in a distorted way. I check
-
Importing a Power Designer 12 Model into a DI Datastore
<p>I was wondering if anyone has had any luck with trying to import a PowerDesigner 12 model into Data Integrator through the Metadata Exchange. According to the documentation, I should be able to do this using the third party tool MIMB. The BO DI