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

Table control

Former Member
0 Likes
452

Hi,

I have a table control with many columns and one column is Order Number displayed. When the user clicks on any of the order number , it should take to some other transaction.

Here how to get the Order number which the user clicked?

Pls help

Thanks

Ram

4 REPLIES 4
Read only

anversha_s
Active Contributor
0 Likes
422

Hi Prabha,

Kindly chk this standard pgms.

for examples on table control

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at

RSDEMO_TABLE_CONTROL

It is not any different from double click on a screen field. All you have to do is to give some function code to F2 key in your GUI Status, standard functions section.

Typically we use PICK as function code for it.

And then in your screen's PAI, USER_COMMAND module,

do some thing similar to the following,

WHEN 'PICK'.

*Declare lv_cursor_line like sy-tabix and

*lv_cursor_field(30).

GET CURSOR FIELD lv_cursor_field LINE lv_cursor_line.

IF lv_cursor_field EQ <your field name>.

lv_cursor_line

= lv_cursor_line + <your TC name>-top_line - 1.

****Now read your internal table with this index

READ TABLE <your itab> INDEX lv_cursor_line.

IF sy-subrc EQ 0.

****SET PARAMETER ID (if necessary)

****CALL TRANSACTION

ENDIF.

ENDIF.

Regards

Anver

if hlped pls amrk points

Read only

Former Member
0 Likes
422

Hi ram,

Check the W/SEL COLUMN property in table control and give any name there ( for eg SEL), in your code as write as follows

if SEL = 'X'.

-


FETCH THE APPROPRIATE VALUE USING THE INTERNAL TABLE COMMANDS----


ENDIF.

regards,

a.fahrudeen

Read only

Former Member
Read only

former_member186741
Active Contributor
0 Likes
422

it needs to be within the loop at the table control at the PAI. Something like:

LOOP AT t_partner.

CHAIN.

FIELD t_partner-vbeln.

FIELD t_partner-parvw.

FIELD t_partner-vtext.

FIELD t_partner-kunn2.

FIELD t_partner-name1.

  • determine which line acted on

MODULE get_selected_line.

  • do validation

MODULE process_order.

ENDCHAIN.

ENDLOOP.

module get_selected_line needs to be something like this:

MODULE get_selected_line INPUT.

  • only do the get cursor the first time....

IF sy-stepl EQ 1.

CLEAR wv_cursor_0120.

GET CURSOR LINE wv_cursor_0120.

  • wv_cursor_0120 now contains line selected

*... but if it's 0 default it to 1

IF wv_cursor_0120 = 0.

wv_cursor_0120 = 1.

ENDIF.

  • convert the relative line to the actual line number in the table

wv_absolute_line = wv_cursor_0120 + tc_partner-top_line - 1.

ENDIF.

ENDMODULE. " GET_SELECTED_LINE INPUT

module process_order needs to be something like this:

MODULE process_order INPUT.

  • only process the selected line

CHECK sy-stepl = wv_cursor_0120.

CASE ok_code.

  • operate on the pai code assigned to the 'order' field

endcase.

endmodule.