04-16-2009 4:52 PM
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.
04-17-2009 7:15 AM
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.
04-16-2009 4:57 PM
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.
04-16-2009 5:00 PM
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.
04-16-2009 5:09 PM
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.
04-17-2009 7:15 AM
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.
04-17-2009 7:21 AM
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