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: 

Enter event in table control

Karan_Chopra_
Active Participant
0 Kudos

I want that if I press enter from key board cursor from current row in table control shud move to next row how can i do it

12 REPLIES 12

Former Member
0 Kudos

Hi,

I am just curious to know why do you want this kind of functionality. If you have to try something like this, you have keep modifying your internal table (like, whenever you press an Enter, delete the current row from the internal table and move it to the next row)

If your requirement is add multiple rows to the table control, then you can have a button called 'ADD' that is specific and functions on the table control. You can increment the attribute called 'LINES' and keep adding rows to the table control.

Also, 'Enter' does not have a function code assigned to it. What you can do is, go to the GUI Status of the screen and in the Function Keys, assign a F-code to Enter to the Standard Toolbar key (the first one with a tick mark).

Karan_Chopra_
Active Participant
0 Kudos

This is the required functionality thats y I want that

so wen i add fcode 'ENTER' in the first 'Tick' icon in standard toolbar under function keys nothing happens wen i press enter from keyboard i mean ok_code is blank and has no values ...?

also i have one more doubt

wen i use scroll the table control from the vertical scrol bar values entered in table dissapears as some event is fired and i hav refreshed the table in PAI before looping in the table control

PROCESS AFTER INPUT.

  • Initialize check list

MODULE init_bid_list. -


> Table is cleared here and values removed in case on scrooling

LOOP AT gi_pmpb_bchid .

How to handle it

0 Kudos

Hi,

Let's say you have assigned the Function code for the 'Enter' Key in the Application Toolbar as ENTER.

Now in your program you can start coding like


if sy-ucomm = 'ENTER'.

endif.

This restriction will enable your code to execute only if the F-code is Enter.

Scrolling does not have a F-code assigned to it. It automatically triggers the PAI. Restrict your code for clearing the internal table with some condition so that it does not refresh while scrolling. I'm not very sure but you gotto debug and find the problem.

0 Kudos

*also i have one more doubt

wen i use scroll the table control from the vertical scrol bar values entered in table dissapears as some event is fired and i hav refreshed the table in PAI before looping in the table control*

Hi,

For the above query, The answer lies in ur question itself.

When you press the scroll bar, the control goes throught he code taht refreshes ur internal table and hence, no values are displayed.

Karan_Chopra_
Active Participant
0 Kudos

Recommended function keys is nt showing ENetr as key as f1 f2 etc

how can i add it

Former Member
0 Kudos

This message was moderated.

Karan_Chopra_
Active Participant
0 Kudos

I cannot change internal table nw as it will require muh time but right nw my main issue is gettin ENETR keys in pf status

it is not showing Enter in pf-status as recommended keys or Freely Assigned Function Keys so it does not catch the event even if i enter it pf-status at any f5 f6 etc as it shud be after enter only

secondly i know that bcoz if refresh values are gettin removed on scroll but i cannot remove refresh stament plz tell some alternative that on scroll table is not refreshed

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

Karan_Chopra_
Active Participant
0 Kudos

Please help guys

0 Kudos

Hi,

Go to your GUI status and in the Function Keys - Standard Toolbar, you will find a list of icons. The first icon (with a tick mark) is the Enter icon. Just assign a F-code to it say 'ENTER', save and activate.

You can now start coding like sy-ucomm = 'ENTER'.

Restrict your portion of code for clearing your internal table like this


if sy-ucomm NE 'ENTER'.
 clear itab[].
endif.

Please thoroughly debug and then code accordingly.

0 Kudos

Hi Karan,

Follow these steps . Add the following code in Flowlogic of the screen and program .

PROCESS BEFORE OUTPUT.
    LOOP AT IT_CUST_ID WITH CONTROL TBC_ID.
    MODULE FILL_TBC_ID.
    ENDLOOP.
    MODULE SET_CURSOR.
PROCESS AFTER INPUT.

  MODULE EXIT AT EXIT-COMMAND.
  MODULE GET_CURSOR.

In the program , add the following code .

data : W_CURSOR(50) ,

W_CUR_ID TYPE I VALUE 1 .

*&----


*

*& Module GET_CURSOR INPUT

*&----


*

    • text*

*----


*

MODULE GET_CURSOR INPUT.

*GET CURSOR FIELD W_CURSOR.*

ENDMODULE. " GET_CURSOR INPUT

&----


*& Module SET_CURSOR OUTPUT

&----


  • text

----


MODULE SET_CURSOR OUTPUT.

CHECK W_CURSOR IS NOT INITIAL.

CASE W_CURSOR.

WHEN 'ZV030_CUST_MAS-EMAIL'.

W_CUR_ID = 1 .

SET CURSOR FIELD 'ZV030_CUST_ID-COMPT' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-MDNUM'.

SET CURSOR FIELD 'ZV030_CUST_ID-SLNUM' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-COMPT'.

SET CURSOR FIELD 'ZV030_CUST_ID-MDNUM' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-SLNUM'.

SET CURSOR FIELD 'ZV030_CUST_ID-VITYP' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-VITYP'.

SET CURSOR FIELD 'ZV030_CUST_ID-DTCOM' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-DTCOM'.

SET CURSOR FIELD 'ZV030_CUST_ID-DIVSN' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-DIVSN'.

SET CURSOR FIELD 'ZV030_CUST_ID-VBELN_S' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-VBELN_S'.

SET CURSOR FIELD 'ZV030_CUST_ID-VBELN_B' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-VBELN_B'.

SET CURSOR FIELD 'ZV030_CUST_ID-AVORM' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-AVORM'.

SET CURSOR FIELD 'ZV030_CUST_ID-HRREM' LINE W_CUR_ID.

WHEN 'ZV030_CUST_ID-HRREM'.

W_CUR_ID = W_CUR_ID + 1.

SET CURSOR FIELD 'ZV030_CUST_ID-COMPT' LINE W_CUR_ID.

ENDCASE.

ENDMODULE. " SET_CURSOR OUTPUT

Thanks and Regards,

S.Sivakumar

Edited by: sivakumar subramaniam on Apr 12, 2010 2:23 PM

Edited by: sivakumar subramaniam on Apr 12, 2010 2:25 PM