Selection Screen on Form
Dear Gurus,
I'm wondering is there any way to pop up a selection screen before printing a form using output type ???
Thanks & Regards,
William Prawira
Thanks for the reply.
My requirement is that I need to pop a screen when user is printing billing document. Then use the screen as input to later on beeing printed on the form.
I created a selection screen over my program for my smartforms, then call it using the call screen. But seems like it can't find my screen.
Any idea for condition above?
thanks & Regards.
William Prawira
Similar Messages
-
Urgent: Selection-screen within Form routines
Hi Experts,
Within Form routines can i declare selection-screen statements. If no how should i declare my objects on selection screen within form routines bcoz when i declared with selection screen statements within form routines iam getting the error as "Within FORM routines and function modules, the SELECTION-SCREEN statement is not allowed".
Regards.
AADI.Hi Aditya,
U cannot use the Selection-screen in Forms and Function Modules.
Try to use it in an include program and call it from ur program.
Reward if Helpful,
Jagadish. -
Problem while hide a block on selection screen on button press
Hi,
I have added two buttons on the application toolbar of the selection screen. I have input fields under two blocks on the selection-screen. Initially the second block is hidden. If I press the button 1 the second block should be made visible.
For this to happen, I captured the button 1 click event using the following statement.
IF sscrfields-ucomm = 'FC01'.
Inside the if ... endif, I looped at the screen and made the second block visible. It was working fine.
loop at screen.
if screen-group4 = '013'.
screen-invisible = 1.
screen-active = 0.
endif.
endloop.
Later the second button was added. Now when i run the report for the first time, if button 2 is clicked the hidden block appears on the selection screen even though i have not added any code for it.
Just to check, i commented the logic to display the hidden block on button 1 click event. Even without any code the first time i press any of the two buttons added on the application toolbar the hidden block is displayed.
I saved a variant for the report.
During execution of the report, if i select any variant then the hidden block is displayed.
Can anyone please tell me how to fix this problem.
Regards,
T2.Hi All,
The problem is solved.
Everyone was confusing between the pushbutton on the selectio-screen and on apllication toolbar
(where you have the execute icon).
Please find the code below. Thanks for you time and help. I appreciate it.
REPORT ztest.
INCLUDE <icon>.
* TABLES *
TABLES: t001, " Company Codes
lfa1, " Vendor Master (General Section)
sscrfields. " Fields on selection screens
* To capture button press event.
DATA: gv_button_press TYPE c.
* Menu Painter: Program interface for dynamic texts
DATA: gs_dyntxt TYPE smp_dyntxt.
* SELECTION SCREEN *
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-s01.
* Company Code.
SELECTION-SCREEN BEGIN OF BLOCK ccode WITH FRAME TITLE text-s02.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY MEMORY ID buk.
SELECTION-SCREEN END OF BLOCK ccode.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK dsel WITH FRAME TITLE text-s04.
* Vendor Master.
SELECTION-SCREEN BEGIN OF BLOCK vend WITH FRAME TITLE text-s07.
SELECT-OPTIONS: s_konzs FOR lfa1-konzs MODIF ID aw1.
SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1 MODIF ID aw1.
SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2 MODIF ID aw1.
SELECTION-SCREEN END OF BLOCK vend.
SELECTION-SCREEN END OF BLOCK dsel.
* INITIALIZATION *
INITIALIZATION.
* Populate the Application toolbar button attributes.
PERFORM populate_app_toolbar_buttons.
* Hide the dynamic screen intially.
PERFORM hide_screenfields.
* AT SELECTION SCREEN *
AT SELECTION-SCREEN.
* Capture the button press event.
PERFORM capture_button_press.
* AT SELECTION-SCREEN OUTPUT. *
AT SELECTION-SCREEN OUTPUT.
* Show/Hide the dynamic selection screen based on button press.
PERFORM adapt_screen.
*& Form populate_app_toolbar_buttons *
* Display Icon on the application toolbar buttons. Also set the *
* function codes for these buttons. *
FORM populate_app_toolbar_buttons.
CLEAR gs_dyntxt.
WRITE icon_fencing TO gs_dyntxt-icon_id AS ICON.
MOVE text-b01 TO gs_dyntxt-quickinfo. " Dynamic Selections
MOVE gs_dyntxt TO sscrfields-functxt_01.
ENDFORM. " populate_app_toolbar_buttons
*& Form hide_screenfields *
* Initially hide the Dynamic selection screen. *
FORM hide_screenfields.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " hide_screenfields
*& Form capture_button_press *
* Set the flag based on button press event. Appication bar button *
* tcode is available only at 'At Selection-screen' event. *
* Use the captured data at 'At Selection-screen Output' event. *
* Screen adjustments is possible only under this event. *
FORM capture_button_press.
IF sscrfields-ucomm = 'FC01'.
IF gv_button_press IS INITIAL.
gv_button_press = 'X'.
ELSEIF gv_button_press EQ 'X'.
CLEAR gv_button_press.
ENDIF.
ENDIF.
ENDFORM. " capture_button_press
*& Form adapt_screen *
* Show/Hide the dynamic selection screen based on button press *
* captured at 'At selection-screen' event. *
FORM adapt_screen.
* If button press flag is initial hide the dynamic selection screen.
IF gv_button_press IS INITIAL.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
* Elseif button press flag is 'X' show the dynamic selection screen.
ELSEIF gv_button_press EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '0'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " adapt_screen
Regards,
T2
Message was edited by: Titu Joseph -
Set cursor on error field in selection screen
Hi ALL,
How to place the cursor on a particular selection screen field?I am doing validation if validation fails for a particular field the program should give error mesg and the cursor should place on the error field only but it's going to the Ist field on the selection can somebody tell me how do this? I tried with set cursor field <fieldname) but not working I am doing validations on at-selection screen.
Thanks&Regard
maheshHi chandrasekhar find my code below
this code i am writing under at selection-screen.
*& Form Z_VALIDATE_TVKOV
FORM z_validate_tvkov .
DATA: i_vtweg LIKE vbak-vtweg.
IF NOT s_vtweg-low IS INITIAL.
SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
WHERE vtweg = s_vtweg-low.
IF sy-subrc <> 0.
set cursor FIELD 'S_VTWEG-LOW'.
MESSAGE e000(z_sd) WITH text-052.
ENDIF.
ENDIF.
IF NOT s_vtweg-high IS INITIAL.
SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
WHERE vtweg = s_vtweg-high.
IF sy-subrc <> 0.
MESSAGE e000(z_sd) WITH text-052.
ENDIF.
ENDIF.
ENDFORM. " Z_VALIDATE_TVKOV -
Show the drop down list of variant on the selection screen in ALV reports
Hi,
i have a alv report when i execute this display will come and then i click display layout it save as a variant on the selection screen and when i go back to selection screen and press f4 on the display variant its show the drop down list of varient.
can u send me some code for this functionality...its very urgent.
thanks!
VipinHi,
try inserting this code apropietly in you program. (1 parameter + Initialization + At-selection-screen + 2 forms)
START HERE
PARAMETERS: pa_vari TYPE disvariant-variant.
INITIALIZATION.
g_repid = sy-repid.
CLEAR e_variant.
e_variant-report = sy-cprog.
e_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
pa_vari = e_variant-variant.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_vari.
PERFORM alv_variant_f4 CHANGING pa_vari.
*& Form ALV_VARIANT_F4
FORM alv_variant_f4 CHANGING pa_vari.
DATA: l_exit(1) TYPE c.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = e_variant
i_tabname_header = 'ANYTHING'
i_save = 'A'
IMPORTING
e_exit = l_exit
es_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF l_exit = space.
pa_vari = e_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " ALV_VARIANT_F4
END
Hope iy helps!
Alfonso -
How to catch a switching of radiobutton in "AT SELECTION-SCREEN"
Hi,
I have a selection screen with 2 radiobuttons in group 001.
I need to perform some code when I change a status of particular radiobutton (checked - unchecked).
I have a code in AT SELECTION SCREEN ON RADIOBUTTON GROUP 001 but this code is not executed on changing a status of particular radiobutton.
Any help is appreciated.
Thank you.
MarianCheck the sample code.
REPORT ypra_sample56.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
p_r2 RADIOBUTTON GROUP rg1,
p_r3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
PARAMETER: p_c1 TYPE c AS CHECKBOX,
p_c2 TYPE c AS CHECKBOX,
p_c3 TYPE c AS CHECKBOX,
p_c4 TYPE c AS CHECKBOX,
p_c5 TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK a2.
INITIALIZATION
INITIALIZATION.
PERFORM enable_fields.
AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
PERFORM sel_screen_output.
START OF SELECTION
START-OF-SELECTION.
DATA: ws_data TYPE tarifnr.
ws_data = 'ZPNGT_EM1'.
IF ws_data CA '1' OR ws_data CA '2' .
WRITE:/ ws_data.
ENDIF.
*& Form sel_screen_output
Selection screen Output
FORM sel_screen_output.
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
PERFORM enable_fields.
ENDIF.
IF p_r3 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sel_screen_output
*& Form enable_fields
enable fields in selection screen
FORM enable_fields .
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " disable_fields
Regards,
Prakash. -
Variants on tabbed selection screen for ALV reports
Scenario: We use a tabbed selection screen for an ALV report. We create a variant, make a selection field on the second tab mandatory & save it without a value. When we run the report with the saved variant it does not check that the required field on the second tab is populated before it executes.
Question: How can I code such a check?
Edited by: Alridge Tom on Jul 4, 2008 3:43 PMHi,
try inserting this code apropietly in you program. (1 parameter + Initialization + At-selection-screen + 2 forms)
START HERE
PARAMETERS: pa_vari TYPE disvariant-variant.
INITIALIZATION.
g_repid = sy-repid.
CLEAR e_variant.
e_variant-report = sy-cprog.
e_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
pa_vari = e_variant-variant.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_vari.
PERFORM alv_variant_f4 CHANGING pa_vari.
*& Form ALV_VARIANT_F4
FORM alv_variant_f4 CHANGING pa_vari.
DATA: l_exit(1) TYPE c.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = e_variant
i_tabname_header = 'ANYTHING'
i_save = 'A'
IMPORTING
e_exit = l_exit
es_variant = e_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF l_exit = space.
pa_vari = e_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " ALV_VARIANT_F4
END
Hope iy helps!
Alfonso -
Logic for Selection screen output
Hi All,
I have 2 blocks on my selection screen
First block has 3 radio buttons(a, b,c) and second block has 5 check boxes. When i select radio button 'C' 2 checks boxes of 2nd block should be activated (enabled).if RB 'C' is not selected those 2 chck boxes should be in disabled position. an any one help me in this regard.(logic)
Thanks in advance
P.D .RaoPlease check the below code:
REPORT ypra_sample56.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
p_r2 RADIOBUTTON GROUP rg1,
p_r3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
PARAMETER: p_c1 TYPE c AS CHECKBOX,
p_c2 TYPE c AS CHECKBOX,
p_c3 TYPE c AS CHECKBOX,
p_c4 TYPE c AS CHECKBOX,
p_c5 TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK a2.
INITIALIZATION
INITIALIZATION.
PERFORM enable_fields.
AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
PERFORM sel_screen_output.
*& Form sel_screen_output
Selection screen Output
FORM sel_screen_output.
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
PERFORM enable_fields.
ENDIF.
IF p_r3 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sel_screen_output
*& Form enable_fields
enable fields in selection screen
FORM enable_fields .
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " disable_fields
Use screen-input = '1' to enable and screen-input = '0' to disable the checkbox. And if u want to totally make that field disappear from screen use screen-active = '1' and '0'.
Regards,
Prakash.
Message was edited by: Prakash Ramu -
Selection-screen in subroutine
Hi,
I would like to know if I can create my selection-screen using a subroutine.
Here is my selection-screen.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-aaa, POSITION 50.
PARAMETERS : p_aaa TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-bbb, POSITION 50.
PARAMETERS : p_bbb TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text-ccc, POSITION 50.
PARAMETERS : p_ccc TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.
I tried this but it doesn't work.
PERFORM test : USING text-aaa p_aaa,
USING text-bbb p_bbb,
USING text-ccc p_ccc.
FORM test USING text parameter.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 1(45) text, POSITION 50.
PARAMETERS : parameter TYPE rcgfiletr-ftappl OBLIGATORY.
SELECTION-SCREEN END OF LINE.
ENDFORM.
Error message : SELECTION-SCREEN statement is not allowed in FORM
Has anyone got an idea ?
RegardsFirst, you can not use selection-screen in FORM and PERFORM somewhere.
Second, you can use subscreen or include it is up to your screen design.
reward points if it helps.
michael -
Hi Friends,
I need to run a report and before the report is generated i need to run a Extract program. So the screen sequence is goe like this.
1. The initial selection screen is the selection criteria for the report.
2. Once the criteria is given and executed it calls up another selection screen which forms the selection criteria for the extraction program.
3. Then the report is displayed.
My requirement is to suppress the selection screen for the extraction program ie the extraction program should run in the background with pre-defined selection criteria. How to go about it?
If i use SUBMIT .. VIA SELECTION SCREEN.. it still comes up with the selection screen with the pre-defined values.
Thanks in advance.Submit your program like this......
SUBMIT program
with p_field1 = a_parameter
with p_field2 = b_parameter
with s_field3 in c_select_Option
and return.
Here you are passing values from varialble to the selection-screen fields, lets say they are P_FIELD1 and P_FIELD2. Using the WITH statement allows you to pass parameters as well as select-options. It will skip the selection screen and continue processing with the passed selection-screen values.
Regards,
Rich Heilman -
How to Display my Form in the selection screen.(without print format)
Hi all,
I did one gate pass form and i want to view the form in my selection screen or output screen(just in monitor) as a display by giving one Z-code.
i.e, we can view the form thru Print preview...the same preview, i want to display after i give my parameter in the selection screen.
For example.ZGPOUT if i enter as a t-code.
it should ask my Gate Pass number in the Selection screen...if its right then my Form will come out to the display screen. (instead of going by Print method).,
Pls post ur comment and reply me with examples,if possible.
thanks & regards
sankar.Hi Prasad,
Pls refer the below link.
<< Moderator message - Point begging removed >>
http://wiki.sdn.sap.com/wiki/display/Snippets/Displayimagesontheselection-screen
Thanks
Arjun
Edited by: Rob Burbank on Aug 17, 2011 2:24 PM -
To display selection screen date parameter in smart form
Hi to all
My requirement is to display date parameters which are given at selection screen (module pool program ) on the smart forms.
I just want to dispaly this on selection.
SO_BLDAT-LOW
SO_BLDAT-HIGH
Please guide.
Regards
AnubhavHi,
If you are calling the smartform from the module program then export the parameters from the calling FM
and import the same in the smartform.
Regards,
Sandeep -
Calling Adobe Interactive Form from a selection screen
Hi,
I have to design an interactive adobe form online scenario,it goes like this :
A certain tcode will call a selection screen when we enter values in the selection screen it will open an adobe form,which will have a submit button,on clicking the button data gets saved in a z table.
I will be designing the form in Web Dynpro,is it possible to call such a form through a selection screen?? Can someone please provide some idea on how to implement the above scenario.
Thanks !!Hello,
for the online scenario you need a communication partner for the form. In WD, you have a partner to exchange the data with. But from a selection screen... who would be your partner? You can of course display a form, a PDF file, a new one (generated) or a uploaded/ stored one, you can even edit the fields, but you don´t have any partner to send the data to.
To cut this... you need a webservice if you want to exchange some data immediately (online scenario).
Regards Otto -
PWB- Connection between selection screen and Application Form
Hi Experts,
I need your help regarding PWB.
My requirement is, I need to fetch date and amount placed on selection screen into application form and those values I need to print through pwb using SAPScript.
I am new to PWB so not getting how exactly I need to do this. Please help me on this.
Thanks in advance.
Regards,
AbhijeetHi,
Write LEAVE TO SCREEN 0 in the PAI of screen 500.
MODULE user_command_0500 INPUT.
CASE g_ok_code.
WHEN 'BACK' OR 'EXIT'.
Goto Selection screen
LEAVE TO SCREEN 0.
WHEN 'CANC' .
LEAVE PROGRAM.
WHEN OTHERS.
Do Nothing
ENDCASE.
CLEAR : g_ok_code.
ENDMODULE. -
Selection screen and smart form..
Hi Frnds,
In Creating Material transfer form I need to have a selection screen giving two options whether the user wants 1) Material transfer form
or 2) Material Transfer Challan.
And reg this selection the appropriate form should be generated.
(Note: I have created 2 appropriate forms. and no Print pgm , all code written in forms itself)
Thanks in advance.
Sreehi,
u hav eto write print prog with selection screen with two radio buttonsfor ex
parameter Material transfer form radiobtton group rad.
parameter Material Transfer Challan radiobtton group rad .
if Material transfer form = 'x'.
call sf Material transfer form
else .
call sf Material Transfer Challan
Maybe you are looking for
-
It feels like my iPod touch 5 has been a bit slow lately. All my apps are closed, I think there has been a day I don't use my iPod for like a week or two. Please help. Thanks so much for the help in advance.
-
ORA-01008 Error while executing VO Query
HI, I have a VO to get the heirarchy for the selected Business. On selecting appropriate business, ppr is fired to build up available heirarchies for that business. The query for VO is SELECT pos.name ||' ('||DECODE(pos.primary_structure_flag,'Y','Pr
-
I want to relinquish the remaining balance in iTunes
Hi I want to relinquish the remaining in my account so that I could change the expense of the British to the U.S.
-
Hi! I'm new to this community and I have a question regarding my Blackberry Q10 (SQN100-3). I bought it last June 8 from Manila Philippines and now I am staying in Seoul South Korea. Everytime I download GoogleTalk from the AppWorld, it says "Unavail
-
When I installed itunes it went smooth untill quicktime had to install, the error 3 came up and said quciktime couln't be installed. This prevents me from opening itunes. Anyway, I have tried to uninstall my old version of quicktime but the uninstall