Application Development 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: 

Related to the Module Pool Programming

Former Member
0 Kudos

Hi,

I have user a Table Controls in the screen program.

Not what I want is when I click on a particular cell of a Table Control it should take me to some other screen where that details of the selected row has to be displayed.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Nivash,

When you want to pick the value and take over that value to next screen, you got to make PF-STATUS, and for F2 that is Choose, type function code PICK.

And then go to PAI section of screen and provide behavior to PICK command i.e Double Click;

MODULE user_command_0200 INPUT.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

CALL SCREEN 100.

WHEN 'PICK'.

GET CURSOR FIELD fs_likp-vbeln LINE line_sel VALUE w_vbeln.

IF fs_likp-vbeln NE 'FS_LIKP-VB'.

MESSAGE 'Click on Delivery Number Only'(003) TYPE 'S'

DISPLAY LIKE 'E'.

fl_flg2 = 'NO'.

ELSEIF fs_likp-vbeln EQ 'FS_LIKP-VB'.

fl_flg2 = 'YA'.

ENDIF. " IF FS_LIPS-VLELN...

IF fl_flg2 EQ 'YA'.

w_tabix = t_tablecontrol-top_line + line_sel - 1 .

CALL SCREEN 300.

ELSEIF fl_flg2 EQ 'NO'. " IF FL_FLG2 EQ 'YA'

CALL SCREEN 200.

ENDIF. " ELSEIF FL_FLG2 EQ 'NO'

ENDCASE. " CASE OK_CODE

ENDMODULE. " USER_COMMAND_0200 INPUT

Moreover, declaration should be given as;

DATA:

w_vbeln type likp-vbeln, " Delivery Number

line_sel like sy-stepl, " Selected Line in Table

w_tabix like sy-tabix. " Table Index

Please check the code above, you'll definitely get solution.

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can add a filed SEL in your tab control and give a push button to display the details of selected record.

Code to display the details in PAI of screen when push button is pressed.

Write module to get selected record.

FIELD <work area of table>-sel

MODULE tab_9200_mark ON REQUEST.

Hope it helps you.

Former Member
0 Kudos

Hi,

Welcome to SCN.

Please [search|https://www.sdn.sap.com/irj/scn/directforumsearch?threadid=&q=doubleclickinmodulepool+programing&objID=c42&dateRange=all&numResults=30&rankBy=10001] the SCN before posting the your question. There are lot many post's on this question.

Former Member
0 Kudos

You can use at user command within your table control logic.

For fast and better answers you should post questions related to module pool programming in UI programming.

Regards,

Lalit Mohan Gupta.

Former Member
0 Kudos

Hello Nivash,

When you want to pick the value and take over that value to next screen, you got to make PF-STATUS, and for F2 that is Choose, type function code PICK.

And then go to PAI section of screen and provide behavior to PICK command i.e Double Click;

MODULE user_command_0200 INPUT.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

CALL SCREEN 100.

WHEN 'PICK'.

GET CURSOR FIELD fs_likp-vbeln LINE line_sel VALUE w_vbeln.

IF fs_likp-vbeln NE 'FS_LIKP-VB'.

MESSAGE 'Click on Delivery Number Only'(003) TYPE 'S'

DISPLAY LIKE 'E'.

fl_flg2 = 'NO'.

ELSEIF fs_likp-vbeln EQ 'FS_LIKP-VB'.

fl_flg2 = 'YA'.

ENDIF. " IF FS_LIPS-VLELN...

IF fl_flg2 EQ 'YA'.

w_tabix = t_tablecontrol-top_line + line_sel - 1 .

CALL SCREEN 300.

ELSEIF fl_flg2 EQ 'NO'. " IF FL_FLG2 EQ 'YA'

CALL SCREEN 200.

ENDIF. " ELSEIF FL_FLG2 EQ 'NO'

ENDCASE. " CASE OK_CODE

ENDMODULE. " USER_COMMAND_0200 INPUT

Moreover, declaration should be given as;

DATA:

w_vbeln type likp-vbeln, " Delivery Number

line_sel like sy-stepl, " Selected Line in Table

w_tabix like sy-tabix. " Table Index

Please check the code above, you'll definitely get solution.

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer:-

Check ur pf-status. in that did you give PICK to the functionkey F2 which will enable the double click facility.

Apart from setting the PF-status with PICK (F2) also set the property "respond to double click" for the tablecontrol column in screen painter.

Goto SE41 --> PF-STATUS ---> SET F2 = PICK

In PAI:-


MODULE USER_COMMAND_8001.
  CASE SY-UCOMM.
    WHEN 'PICK'.
      GET CURSOR FIELD v_fieldname Value v_fieldval.       
      IF v_fieldname EQ 'VBELN'.
        "select query (in  where clause us v_fieldval to fetch associted records)
        SET SCREEN '8002'.
        LEAVE SCREEN.
      ENDIF.
  ENDCASE.
ENDMODULE.

Now in PBO of other screen i.e, 8002, display data in table control.

Hope this helps you.

Regards,

Tarun