AT SELECTION-SCREEN ON/END OF FIELD
Hi all,
I want to know the exact difference between AT SELECTION-SCREEN ON field and AT SELECTION-SCREEN ON END OF field. Could you give me the answer with an example.
Sathish.
Hi,
Let`s say you have a radio button on your selection screen and you want to perform some action once the user clicks the radio button. You can attain this functionality by using AT SELECTION-SCREEN ON FIELD. This event block is raised before the AT SELECTION-SCREEN event, on action performed on that particular field.
"AT SELECTION-SCREEN ON END OF field",
Consider the following example :
AT SELECTION-SCREEN ON END OF <seltab>
event is triggered. This event block allows you to check the whole selection table <seltab>. Warning messages are displayed as dialog boxes, not in the status line.
AT SELECTION-SCREEN ON END OF CARRID.
LOOP AT MATNR.
IF MATNR-HIGH NE ' '.
IF MATNR-LOW IS INITIAL.
MESSAGE Wxxx(MSG).
ENDIF.
ENDIF.
ENDLOOP.
Hope the info. is helpful, if so reward points.
Regards
Similar Messages
-
hi to all pls tellabt the event at selection-screen on end of and at selection-on block
plsa give some sample coding on theese points will be rewardedHi
You are mixing up the things
You need to know separately about At selection-screen and its events
selection-screen : begin of block b1 with frame title text-001.
select-options:s_bukrs for t001-bukrs no intervals no-extension
obligatory,
s_vkorg for tvko-vkorg no intervals no-extension,
s_vtweg for tvtw-vtweg no intervals no-extension,
s_spart for tspa-spart no intervals no-extension,
s_werks for t001w-werks no intervals no-extension,
s_kunag for kna1-kunnr,
s_vbeln for vbuk-vbeln,
s_fkart for tvfk-fkart,
s_fkdat for vbrk-fkdat obligatory.
selection-screen begin of line.
selection-screen comment 1(20) text-008.
selection-screen end of line.
selection-screen begin of line.
parameters p_cust type c radiobutton group cust.
selection-screen comment 3(20) text-004 for field p_cust.
selection-screen end of line.
selection-screen begin of line.
parameters p_mode type c radiobutton group cust.
selection-screen comment 3(20) text-006 for field p_mode.
selection-screen end of line.
selection-screen begin of line.
parameters p_dens type c radiobutton group cust.
selection-screen comment 3(20) text-007 for field p_dens.
selection-screen end of line.
selection-screen: end of block b1.
And the Events related to Internal table like AT NEW and AT END OF
All this AT NEW, AT FIRST, AT END OF and AT LAST are called control break statements of Internal tables and are used to calculate the TOTALS based on sertain key fields in that internal table
FIrst to use these statements the ITAB has to be sorted by the key fields on whcih you need the SUM of the fields.
Some time you will get * when mopving data from this int table to other table using these commands
so you have to use
READ TABLE ITAB INDEX SY-TABIX in AT..ENDAT..if you are using other fields between them
DATA: sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate,
sflight_wa LIKE LINE OF sflight_tab.
SELECT *
FROM sflight
INTO TABLE sflight_tab.
LOOP AT sflight_tab INTO sflight_wa.
AT NEW connid.
WRITE: / sflight_wa-carrid,
sflight_wa-connid.
ULINE.
ENDAT.
WRITE: / sflight_wa-fldate,
sflight_wa-seatsocc.
AT END OF connid.
SUM.
ULINE.
WRITE: / 'Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
SKIP.
ENDAT.
AT END OF carrid.
SUM.
ULINE.
WRITE: / 'Carrier Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
NEW-PAGE.
ENDAT.
AT LAST.
SUM.
WRITE: / 'Overall Sum',
sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
ENDAT.
ENDLOOP.
Reward points for useful Answers
Regards
Anji -
Selection screen control for a field in the report painter report
Hi,
Could you please advice me as to how we can add exclude selection functionality for a field on the selection screen of a report made by trhough report painter report.
Your prompt reply will be really appreciated.
Thanks,
Ramesh.look at this code and try
select-options : S_NODEID for ZNODETAB-ZNODEID.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-LOW'.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-HIGH'.
end-of-selection.
FORM f4_nodeid USING p_field.
declare it_node.
select znodeid from ZNODETAB into table it_node.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZNODEID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = p_field
value = space
value_org = 'S'
display = 'F'
TABLES
value_tab = it_node
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
endform -
Hiding fields in Report Selection Screen which have Mandatory Fields
Hi Friends,
I have 2 Radio Buttons. PO and SO. If PO is selected, user need to input the Plant value in the Sel.Scrn which is mandatory and Storage Location field will be invisible.
If SO is selected, then user need to input the Plant and Storage Location value which are mandatory. Now Storage Location will be visible.
When radio button SO is seleted, SAP triggers an error message as 'Make an entry in all required fields' without displaying Storage Location input field in Sele. Scrn.
How to do this.? I checked in SCN and not find perfect match to solve for Mandatory Input Fields.
Regards,
SureshHi,
Yes. What Rob has told is correct. Try like this.
AT SELECTION-SCREEN.
IF po_po EQ 'X'.
IF so_werks[] IS INITIAL.
MESSAGE 'Please enter plant' TYPE 'E'.
ENDIF.
ELSE.
IF so_lgort[] IS INITIAL.
MESSAGE 'Please enter storage location' TYPE 'E'.
ENDIF.
IF so_werks[] IS INITIAL.
MESSAGE 'Please enter plant' TYPE 'E'.
ENDIF.
ENDIF.
Thanks,
Vinod. -
TO display pop_up on selection screen And chosse that field in 'SELECT' sta
Hello,
I want a pop up on selection screen when user clicks the push button on selection screen pop up should come on selection screen and display the all field of YTLEA table. when user checks few or all field from pop up then data for that field is selected from the YTLEA table.DDIF_TABL_GET
-
Selection screen comment as input field
Hi Experts,
I have a comment in my program using following statement,
SELECTION-SCREEN COMMENT 27(60) dispath.
by default this statement is in output mode ...can we change that as input...
Not to forget i dont want to use PARAMETERS.
Thanks
SidHi Sid,
Only options possible in selection screen comment are:
SELECTION-SCREEN COMMENT [/][pos](len)
{text|{[text] FOR FIELD sel}}
[VISIBLE LENGTH vlen]
[MODIF ID modid]
[ldb_additions].
i think its not possible.
Regards,
Talwinder -
Switchin to selection screen from end-of-selection
Hi Experts,
I am creating a report, where I generate an ALV output. From selection screen, I am going to some 4, 5 output screens.
selection screen -> output screen1 -> output screen2 -> output screen3.
Can I go to selection screen from output screen 3. In output screen 3 I have pf-status also. When the back button, in the triggered code what I have to write to switch to selection screen.
Thanks and regards,
Venkat.Hi
1.Make your selection screen as screen no.100.
2.selection screen(100) -> output screen1 -> output screen2 -> output screen3.
3.Make separate pf-status for each screens.
4.In the PAI of your 3rd screen write
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
Hope this had helped you.
Regards
Hareesh Menon -
How to get the F4 help for a field in the selection screen
Hi all,
I am working on a report program. In the selection screen, I have the field 'Brand Node ID'(ZNODEID). The requirement is to have the F4 help for this field. This field is available in a 'Z' table ZNODETAB. There is no Value table maintained for the corresponding data element. So, without disturbing the table data element/domain, I should get the F4 help in the selection screen of the report. In the F4 help, data should be fetched from the table ZNODETAB and the field is ZNODEID. Is there any way to do this.
By searching the function modules, I could find that, we can use the FM F4IF_INT_TABLE_VALUE_REQUEST. But, I am not Sure. Can someone tell me the parameters to be passed to this function module to get the F4 help and the procedure to follow. S_NODEID is the select option used in the program. Please help me in this regard. Thanks in advance.
Thanks & Regards,
Paddu.look at this code and try
select-options : S_NODEID for ZNODETAB-ZNODEID.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-LOW'.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-HIGH'.
end-of-selection.
FORM f4_nodeid USING p_field.
declare it_node.
select znodeid from ZNODETAB into table it_node.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZNODEID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = p_field
value = space
value_org = 'S'
display = 'F'
TABLES
value_tab = it_node
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
endform -
Hi, experts, a question about fields in selection screen?
Hi Experts,
In my selection screen there are two fields, one is customer nr(kunnr), another is a checkbox, and I want to know is that when the customer is filled in and the checkbox is marked and then I press "enter", there should be a email address of the customer displayed at the right of the checkbox, thank you in advance.
by the way, I have known how to get the email address but I don't know how to make the email address display at the right of the checkbox.
Kind regards
Dawson
Edited by: dawson wang on Mar 28, 2009 4:49 AMHi,
Test Sample Code Bellow it will solve out your problem. First enter the pernr and than click the Check Box.
TABLES: pa0001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) tpernr.
PARAMETERS: ppernr LIKE pa0001-pernr.
SELECTION-SCREEN COMMENT 42(1) t.
PARAMETERS: check AS CHECKBOX USER-COMMAND a.
SELECTION-SCREEN COMMENT 46(50) cpernr FOR FIELD ppernr MODIF ID dpt.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
tpernr = 'Please Enter Pernr'.
AT SELECTION-SCREEN OUTPUT.
IF check = 'X'.
PERFORM get_lables.
LOOP AT SCREEN.
IF screen-group1 = 'DPT'.
screen-intensified = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
CLEAR: cpernr.
ENDIF.
**& Form get_lables
** text
FORM get_lables.
IF ppernr IS INITIAL.
cpernr = ''.
ELSE.
SELECT SINGLE * FROM pa0001
WHERE pernr = ppernr
AND endda = '99991231'.
IF sy-subrc = 0 .
cpernr = pa0001-ename.
ENDIF.
ENDIF.
ENDFORM. "get_lables
Please Reply if any Issue,
Best Regards,
Faisal -
How to assign F1 help to the selection screen fields
Hi All,
I have a requirement.I have to create a button named "HELP" at the side of Execute button in the selection screen.If I place my cursor in the selection screen field and I press that "HELP" button, I should get the Documentation help for that field.
Please suggest me on this.
Thanks in advance.
Sreeharsha SinguruHi sreeharsha,
here a short example:
TABLES: MARA.
TABLES: SSCRFIELDS.
TYPE-POOLS: ICON.
DATA: CURSORFIELD(20).
SELECTION-SCREEN: BEGIN OF LINE.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECT-OPTIONS: S_MTART FOR MARA-MTART.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: SKIP 3.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: PUSHBUTTON (10) PB01 USER-COMMAND HELP.
SELECTION-SCREEN: END OF LINE.
AT SELECTION-SCREEN.
GET CURSOR FIELD CURSORFIELD.
CASE SSCRFIELDS.
WHEN 'HELP'.
CASE CURSORFIELD.
WHEN 'S_MATNR-LOW'.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT' "Make your own Text
EXPORTING
TITEL = 'Information'
TEXTLINE1 = 'Information for field:'
TEXTLINE2 = 'S_MATNR-LOW'
START_COLUMN = 10
START_ROW = 15.
WHEN 'S_MTART-LOW'.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT' "Make your own Text
EXPORTING
TITEL = 'Information'
TEXTLINE1 = 'Information for field:'
TEXTLINE2 = 'S_MTART-LOW'
START_COLUMN = 10
START_ROW = 15.
ENDCASE.
ENDCASE.
INITIALIZATION.
CONCATENATE ICON_INFORMATION 'Help' INTO PB01.
START-OF-SELECTION.
SELECT * FROM MARA WHERE MATNR IN S_MATNR.
WRITE: / MARA-MATNR.
ENDSELECT.
Hope it helps.
Regards, Dieter -
Selection Screen Create Field OnClick
Hello experts,
I'd like to know how to add a button on selection screen that adds a field into the selection screen on click
RegardsHi,
have a look at the below program.You can use the AT SELECTION-SCREEN OUTPUT. event to change field dynamically.
TABLES: t030, skat, sscrfields.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE text-001.
* Declaration of sel screen buttons
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (20) w_button USER-COMMAND BUT1.
SELECTION-SCREEN PUSHBUTTON (25) w_but2 USER-COMMAND BUT2.
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS: p_konts FOR t030-konts,
p_bklas FOR t030-bklas.
PARAMETER: gd_ucomm like sy-ucomm default 'BUT1' no-display.
SELECTION-SCREEN END OF BLOCK block1.
TYPES: BEGIN OF t_t030,
ktopl TYPE t030-ktopl,
konts TYPE t030-konts,
txt20 TYPE skat-txt20,
bklas TYPE t030-bklas,
bkbez TYPE t025t-bkbez,
END OF t_t030.
DATA: it_t030 TYPE STANDARD TABLE OF t_t030 INITIAL SIZE 0,
wa_t030 TYPE t_t030.
DATA: gd_repsize TYPE i VALUE '83'.
*INITIALIZATION.
INITIALIZATION.
* Add displayed text string to buttons
w_button = 'GL account selection'.
w_but2 = 'Valuation class selection'.
*AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
* Check if buttons have been
if sscrfields-ucomm eq 'BUT1'.
gd_ucomm = 'BUT1'.
clear: p_BKLAS.
refresh: p_BKLAS.
elseif sscrfields-ucomm eq 'BUT2'.
clear: p_KONTS.
refresh: p_KONTS.
gd_ucomm = 'BUT2'.
endif.
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
if gd_ucomm eq 'BUT1'.
loop at screen.
if screen-name CS 'P_KONTS'.
screen-active = 1.
elseif screen-name CS 'P_BKLAS'.
screen-active = 0.
endif.
modify screen.
endloop.
elseif gd_ucomm eq 'BUT2'.
loop at screen.
if screen-name CS 'P_KONTS'.
screen-active = 0.
elseif screen-name CS 'P_BKLAS'.
screen-active = 1.
endif.
modify screen.
endloop.
endif. -
More than one Input field [Parameter] in a single row on Selection-Screen.
Hi All,
I am having one scenario where i need to create 6 input fields on selection screen. 3 input fields in first row and remaining 3 input fields on the second row. So will you guys send me some sample code how to do this.
Waiting for your reply.
Regards,
SantoshHi Santhosh,
check this snippet for parameters.
SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN BEGIN OF BLOCK calc
WITH FRAME TITLE text-001 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:
p_param1(3) type c,
p_param2(3) type c,
p_param3(3) type c,
p_param4(3) type c.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK calc.
check this snippet for select-options.
SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN BEGIN OF BLOCK calc
WITH FRAME TITLE text-001 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN :
PUSHBUTTON 20(3) b1 USER-COMMAND b1,
PUSHBUTTON 29(3) b4 USER-COMMAND b4,
PUSHBUTTON 38(3) b7 USER-COMMAND b7,
PUSHBUTTON 47(3) pm USER-COMMAND pm.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK calc.
Hope this would help you.
Regards
Narin Nandivada. -
Selection screen field problem
Hello experts..
i have a selection screen , in that i have a field s_bwart for mseg-bwart.
some times the user will input the data in the field and sometimes he wont. we have fixed movement types combination like
11-21 , 13-24 , 13-56 , 101-543 , 101-544 etc.
if the user did not input any thing in the selection screen , i am populating s_bwart in at-selection screen event with all the mvt types. after executing the report when user presses the back button to come to the selection screen, there the s_bwart field is containing all the mvt types in single values ie in the select options screen. So the user dont want that, if he comes back nothing should be there in the selection screen field s_bwart if he has not inputted anything. if he inputs only 11 mvt type then when he comes back after executing the report he should see only 11 in the select screen field ie s_bwart. Please send the replies on how to solve the problem.hi,
in ur program try to display values for users in START-OF-SELECTION event as it triggers after the selection screen displayed for users. if user doesn't give any input then display default values in this event. and also create a variable
for ex:
data: ws_flag type c,
p_value type i.
after u display default values for users in selection screen assign the flag as ' X '
ws_flag = 'X'.
before leaving ur program based on flag try to do like this.
if ws_flag = ' X '.
clear s_data. // s_data is the select options for u.
else.
s_data = p_value. // the value which user gave in selection screen as i/p.
endif.
if helpful reward some points.
with regards,
Suresh Aluri. -
How to make the obligate field in selection screen
Hi ,
In my report two radio buttons and two bloc selection screens are there.When we select the first radio button first screen will be editable second screen will be non-editable vice-versa.
but the problem is in each selection screen one mandatory field is required suppose if i give the one field obligatory in first block screen it is not allowing the second readout please help me regarding this how i will make the mandatory field in both screens.
Thanks,
HarinathHi...
Dont Declare your field as OBLIGATORY.
Instead perform the validation in AT SELECTION-SCREEN event. But validation should be only when Particular Radiobutton is selected.
And Generate only Error Message (Type E).
Try this code:
AT SELECTION-SCREEN on <yOUR mandatory field>.
IF PA_UPD = 'X'.
IF <YOUR MANDATORY FIELD> IS INITIAL.
Message 'Entry is must in this field' type 'E'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF pa_udp = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'. "#CCE
screen-active = 1.
ELSEIF screen-group1 = 'DEF'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF pa_rep = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'. "#CCE
screen-input = 0.
ELSEIF screen-group1 = 'DEF'.
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
<b>Reward if Helpful</b> -
Default Value for a selection screen field
Hi Experts,
I am having a selection screen with a date field i am defaulting the date field to sy-datum but i also have a option of changing the date field value.
The issue is i have defaulted the date field value in PBO event,so when i change my field value in selection screen every time the defaulted value is appearing instead of my new changed value.
Plzz suggest a solution.Hi ,
Actualy u should set the default value at the time of selection screen, but now from the same logic try to write like
If Date is initial.
data = sy-datum.
endif.
in ur PBO
Try this.
THank
-Anmol
Hi Experts,
I am having a selection screen with a date field i am defaulting the date field to sy-datum but i also have a option of changing the date field value.
The issue is i have defaulted the date field value in PBO event,so when i change my field value in selection screen every time the defaulted value is appearing instead of my new changed value.
Plzz suggest a solution.
Maybe you are looking for
-
How to solve the following JDBC-DB2 FORMAT problem?
Here is the error info: Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong
-
There is not anything else to say!
-
Property 'loginAction' not found on type ...
Long story short, I have a backing bean with an action called loginAction. Everything worked fine, but now I'm in the process of converting it to a maven project. For some reason, EL doesn't try to resolve it as a method any more, it tries to resolve
-
Want to see xml structure in Excel format
Hi All, Is there any tool by which we can see the xml structure to Excel sheet. Regards
-
Country specific setting for SWEHR3
Hi Experts, We have created a custom function module and configured it in SWEHR3 transaction code for the requirement of triggering notification to HR Team whenever employee changes his/her address details. Now we want to implement same functionality