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 Functionality on Custom Screen

Former Member
0 Likes
2,094

Hello Group,

I have I/O field for material on custom screen. And when I double click on material no, it should navigate me to MM03 screen.

I cannot set the function code since it is a I/O field.

When I double click on material, it is not going to PAI of the screen.

Can somebody tell me how can I do that?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,485

I think that you can set a flag in the attributes of the field, to "respond to double click", Then the PAI should fire.

Regards,

Rich Heilman

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,486

I think that you can set a flag in the attributes of the field, to "respond to double click", Then the PAI should fire.

Regards,

Rich Heilman

Read only

0 Likes
1,485

Go to the element list, click display attributes, check the checkbox for "responds to double-click".

Then you should be able to handle it in the PAI.

Regard,

Rich Heilman

Read only

0 Likes
1,485

Also, make sure that you set the Choose(F2) to "PICK" function code in the gui status.

Regards,

RIch Heilman

Read only

0 Likes
1,485

Hi Rich,

I did check the 'Respond to Double Click' checkbox. But when I double click on material no , i am getting a message on display bar 'Please choose a valid function'. Any further help???

Thanks,

Chandra

Read only

0 Likes
1,485

Then in the PAI, you can do something like this.



  case ok_code.
    when 'PICK'.
     set parameter id 'MAT' field p_matnr.
      call transaction 'MM03' and skip first screen.
  endcase.



Regards,

Rich Heilman

Read only

0 Likes
1,485

Yep, you need to assign a function code to the F2 key in the gui-status. Just assign "PICK", save and activate, then in your PAI, handle that FCODE by doing something like the code above.

Regards,

Rich Heilman

Read only

0 Likes
1,485

Please remember to award points for helpful answers and mark your post as solved as this will definitly work for you. Welcome to SDN. Thanks.

Regards,

Rich Heilman

Read only

0 Likes
1,485

Hello Rich,

Thanks for your help. This is almost working now, but I have couple of questions.

1) Below is my code for PAI screen 100, on which the ALV report is displayed. When I double click on material it is taking me to MM03 screen, but when I hit the back button on MM03 screen, it is going to report selection screen (screen 1000), but I want the ALV report ( screen 100) to be displayed.

2) I have several other fields other than material no, like MRP type, Plant, Material type. Since we set the FCODE to 'PICK', this fcode 'PICK' is assigned to all other fields on screen. LEAVE TO SCREEN 100 on ELSE condition is taking care of that, but is that a good idea? because when I say LEAVE TO SCREEN 100 , PBO of the Program is triggered and the program executing again.

I guess i am clear to you.

MODULE user_command_0100 INPUT.

DATA: cursorfield(20), "#EC NEEDED

g_cursor(18).

DATA: ok_code LIKE sy-tcode.

CASE ok_code. "sy-ucomm.

WHEN 'PICK'.

GET CURSOR FIELD cursorfield VALUE g_cursor.

IF g_cursor = p_matnr.

SET PARAMETER ID 'MAT' FIELD g_cursor.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ELSE.

LEAVE TO SCREEN 100.

ENDIF.

WHEN 'MANO'.

CALL SCREEN 200.

WHEN 'BACK' OR 'CANC'.

IF NOT alv_container IS INITIAL.

CALL METHOD alv_container->free.

CLEAR: alv_container.

FREE : alv_container.

ENDIF.

IF sy-subrc = 0.

SET SCREEN 0.

LEAVE SCREEN.

ELSE.

LEAVE PROGRAM.

ENDIF.

WHEN 'EXIT'.

IF NOT alv_container IS INITIAL.

CALL METHOD alv_container->free.

CLEAR: alv_container.

FREE : alv_container.

ENDIF.

LEAVE PROGRAM.

WHEN 'REFR'.

CLEAR :it_mdps, it_mdez, it_mdsu, it_outtab.

REFRESH: it_mdps, it_mdez, it_mdsu, it_outtab.

CALL METHOD o_lcl_main->mpu_get_stock_req_list.

CALL METHOD o_lcl_main->mpu_get_initial_quantity.

CALL METHOD o_lcl_main->mpu_get_available_quantity.

CALL METHOD o_lcl_main->mpu_display_stock_req_list.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

Read only

0 Likes
1,485

1) Trying just leaving the screen. Although a round trip probably wouldn't hurt.

2) You can do something like this.

CASE ok_code. "sy-ucomm.
WHEN 'PICK'.
clear ok_code.
GET CURSOR FIELD cursorfield VALUE g_cursor.
IF cursorfield = 'P_MATNR'.
SET PARAMETER ID 'MAT' FIELD g_cursor.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,485

In attributes of the field, Check the check box "responds to double click" on the display tab.