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

Double click in module pool program

Former Member
0 Likes
2,790

Hi all,

I have set respond to double click to 4 text elements in a screen. I have also give the PICK for F2 in GUI. Now I want to call 4 different screens on clicking those text elements. But how to call different screens. I have done

CASE sy-ucomm.
 WHEN 'PICK'.
  IF screen-name = 'T1'.
   CALL SCREEN 1000.
  ELSEIF screen-name = 'T2'.
   CALL SCREEN 1001.
  ENDIF.
ENDCASE.

which is not working. Please help me.

Dev.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,765

Hi

in TOP include declare 
data : fnam type char40, fval type char40.

CASE sy-ucomm.
 WHEN 'PICK'.
GET CURSOR FIELD FNAM VALUE FVAL.
  IF fnam = 'T1'.
" You only get the Screen-Name when you say LOOP AT SCREEN
   CALL SCREEN 1000.
  ELSEIF fnam = 'T2'.
   CALL SCREEN 1001.
  ENDIF.
ENDCASE.

Cheerz

Ram

4 REPLIES 4
Read only

Former Member
0 Likes
1,766

Hi

in TOP include declare 
data : fnam type char40, fval type char40.

CASE sy-ucomm.
 WHEN 'PICK'.
GET CURSOR FIELD FNAM VALUE FVAL.
  IF fnam = 'T1'.
" You only get the Screen-Name when you say LOOP AT SCREEN
   CALL SCREEN 1000.
  ELSEIF fnam = 'T2'.
   CALL SCREEN 1001.
  ENDIF.
ENDCASE.

Cheerz

Ram

Read only

Former Member
0 Likes
1,765

Hi,

Try this .Assign function code to F2 the way you have assigned.Now in PROCESS AFTER INPUT of your screen (On which you have text buttons ), write this code.

MODULE user_command_0100 INPUT.

Declare a field of length equal to the name of the text box.Here i have taken two text boxes namely 'TEXT1' and 'TEXT2'.I have declared a local field with length 5.

DATA : L_FIELD(5) TYPE C.

CASE sy-ucomm.

WHEN 'PICK'.

GET CURSOR FIELD l_field.

IF l_field = 'TEXT1'.

CALL SCREEN 1002.

ELSEIF l_field = 'TEXT2'..

CALL SCREEN 1003.

ENDIF.

ENDCASE.

ENDMODULE.

This is working.Hope this helps.

Thanks

Tejaswini Khante

Read only

Former Member
0 Likes
1,765

hi,

use the GET CURSOR statement.

only then will you get the name of the screen element/field.

and code it in the PAI of the screen in user commmand.

hope it helps.

Read only

Former Member
0 Likes
1,765

Hi,

Follow the below step.

1) Goto Element List in relevent screen then goto tab Display attr. and tick check box in column as Resp. to DblClk.

2) Goto GUI then enclolapes the Function keys and put function code in first position and assign the same in 'Recommended function key setting' for F2.

3) FLOW LOGIC

process after input.

module user_command_0100.

4)

module user_command_0100 input.

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

case SAVE_OK.

when 'SELE'.

GET CURSOR FIELD FLD OFFSET OFF VALUE VAL LENGTH LEN.

if fld eq 'IT_PORELI-LIN'.

set pf-status 'POCON' immediately.

set titlebar 'PORECV' with sy-uname.

perform subscrnew.

CALL SCREEN 200 STARTING AT 25 10 ENDING AT 140 20.

endif.

endmodule. " user_command_0100 INPUT

Regards

Nehruu