Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection-Screen

Former Member
0 Likes
438

Dear Experts,

I have a selection screen with one input field.When I input the value and press enter then i want to execute code.

I dont want to execute it( code ) by F8 or click on EXECUTE button.

Pls help us................

Thanks & Regards

Alok Vishnoi.

4 REPLIES 4
Read only

Former Member
0 Likes
412

we have Provision from sap like load-of-program.

in your code

write this event

load-of-program.

under that you process the code for as follows....

if sy-tcode = 'Z......'.

Then proceed otherwise raise the message like 'you have to run this report through transaction code only.

Regards,

madan.

Edited by: Madan kurapati on May 9, 2008 4:03 PM

Read only

Former Member
0 Likes
412

Hi,

check out this code......

PARAMETERS : P_VB TYPE VBELN.

AT SELECTION-SCREEN.

IF SY-UCOMM = 'ONLI' OR SY-UCOMM = ''.

CALL SCREEN 1000.

ENDIF.

END-OF-SELECTION.

WRITE : 'HI !'.

( If it is a module-pool call the user-defined screen

You can give Your own pf-status : ' set pf-status 'XXXX' ' (in report also at event 'selection-screen output' ) ; DEFINE YOUR OWN FCODE and do the processing if sy-ucomm is the defined one.

Read only

Former Member
0 Likes
412

Hi Alok,

I guess u want to execute the code as an when data is entered in input field.

For this,

U have to use event "data_changed" of class "cl_gui_alv_grid".

Declaration:

CLASS lcl_event_receiver DEFINITION .

PUBLIC SECTION .

METHODS:

handle_data_changed

FOR EVENT data_changed OF cl_gui_alv_grid

IMPORTING er_data_changed.

ENDCLASS.

Implementation of class:

CLASS lcl_event_receiver IMPLEMENTATION .

METHOD handle_data_changed.

PERFORM data_changed USING er_data_changed .

ENDMETHOD .

ENDCLASS .

Form (actual code)

FORM data_changed USING rr_data_changed TYPE REF TO

cl_alv_changed_data_protocol.

DATA: ls_mod_cells TYPE lvc_s_modi.

DATA: ls_cells TYPE lvc_s_modi.

WHEN 'Input field name'.

CALL METHOD rr_data_changed->get_cell_value

EXPORTING

i_row_id = ls_mod_cells-row_id

i_fieldname = ls_mod_cells-fieldname

IMPORTING

e_value = lv_variable.

Here, lv_variable of type input field is a local variable to store the data enterd in the field.

Regards,

Pooja Bajaj.

Read only

Former Member
0 Likes
412

hi there...

i dont think ,the method given above will help. it will work wenever any key is pressed and not just on the press of Enter.

I would suggest you to open ur program in se80, there, u will get an option to set the aplication toolbar. in that u can define the functionality on the press of enter.

do reward if helpful or get back with further query.