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

sy-ucomm table control

Former Member
0 Likes
2,278

I am facing the following problem:

when i press 'ADD' in the table control the function code of which is 'TABLE_LINE_INSR' and then press enter then in debugging mode the value of sy-ucomm is 'TABLE_LINE_INSR' instead of enter?!!!

kindly help me with this i am absolutely stuck!!

module display_matnr input.

*SAVE_OK = OK_CODE.

*CLEAR OK_CODE.

IF sy-ucomm <> 'CANCEL' AND sy-ucomm <> 'SAVE' AND sy-ucomm <>

'TABLE_LINE_INSR' AND

sy-ucomm <> 'TABLE_LINE_DELE' AND sy-ucomm <> 'TABLE_LINE_MARK' AND

sy-ucomm <> 'TABLE_LINE_DMRK'.

7 REPLIES 7
Read only

Former Member
0 Likes
1,351

Hello,

Check whether u have assigned function code for enter..

Hopefully that may be the problem of not getting the function code for enter when in debugging mode.

<REMOVED BY MODERATOR>

Neeraj

Edited by: Alvaro Tejada Galindo on Feb 26, 2008 2:22 PM

Read only

Former Member
0 Likes
1,351

Hi Prateek,

It seems that u haven assigned the function code for the particular push button ADD in the screen. U have to Assign function code in the attributes screen of the push button.

Hope this helps u,

Regards,

Arunsri

Read only

Former Member
0 Likes
1,351

it seems that u had assign fun code to ADD button which is not getting cleared,

In PAI once the processing for ADD button is done clear ok code and sy-ucomm.

in PAI of user_cmm.

Case ok_code.

When 'ADD'.

  • your code for add button

clear ok_code.

clear sy-ucomm.

When others.

endcase.

Reward if useful.

Read only

Former Member
0 Likes
1,351

Hi There,

I've faced the same problem.

Maybe you can try to add another case in your case-endcase loop. Try WHEN ' '. Because when I debugged las time the sy-ucomm value for Enter button is ' ' or blank.

Read only

Former Member
0 Likes
1,351

Hi

It's very clear that you have to CLEAR the Sy-ucomm of the ADD function of Table control before processing or after processing the respective logic..

So that When to Press Enter , U will receive the Fcode of that..

Reward Point if Useful...

If possible post the respective code..

Read only

0 Likes
1,351

This is because Tab control V_scroll is initial.

Try This :-

if OK_CODE eq 'INSR' .


*TAB1 is My table control Name

DESCRIBE TABLE ITAB LINES  TAB1-lines .
  TAB1-lines = TAB1-lines + 1.
  IF TAB1-V_SCROLL IS INITIAL.
  insert initial line into itab index TAB1-lines.
  TAB1-V_SCROLL = 'X'.
  NO = TAB1-lines.
  TAB1-TOP_LINE NO.
  SET CURSOR FIELD 'WTAB-J_1IWERKS' LINE TAB1-lines.
  ENDIF.

Read only

Former Member
0 Likes
1,351

For your information: Enter does not set sy-ucomm value it will only trigger PAI event. So previous value of sy-ucomm will be still there.