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 (Enter key)

Former Member
0 Likes
3,153

Hi Experts

Now I'm working on Table control

I added a line on the table but

When I put some values in the new line and push enter key,

the values disappears without any process.

I checked sy-ucomm but there was no OK_CODE.

How can I use keyborad input in Table control?

Thank you in advance. \o/

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,901

Hi Kim,

I also faced the same problem.

In PF-status of the screen, add function code for enter (tickmark) sign, activate it & then code for the function code in module user command.

Hope this helps.

<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>

Regards,

Sipra

Edited by: Alvaro Tejada Galindo on Dec 14, 2009 3:37 PM

11 REPLIES 11
Read only

Former Member
0 Likes
1,901

Hi Kim,

When ever you press ENTER PAI will be triggered. Even if there is no ok-code it triggers PAI. After PAI, PBO will be triggered. In PBO you loop for table control will refresh the data. That is the problem.

To solve this, you have to store the new entries in PAI loop for table control.

PROCESS AFTER INPUT.

LOOP AT IT_ITAB.

MODULE TABLE_UPDATE.

ENDLOOP.

MODULE USER_COMMAND.

____________________________________________________

Define the module as below:

MODULE TABLE_UPDATE.

MODIFY IT_ITAB FROM WA_ITAB.

ENDMODULE.

In this case table control is created from the work area fields of the internal table. If you have seperate field names in screen and program, move the screen field values to program and append the entry to your internal table which has the table control data.

<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>

Thanks and Regards,

Lakshmi.

Edited by: Alvaro Tejada Galindo on Dec 14, 2009 3:37 PM

Read only

Former Member
0 Likes
1,902

Hi Kim,

I also faced the same problem.

In PF-status of the screen, add function code for enter (tickmark) sign, activate it & then code for the function code in module user command.

Hope this helps.

<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>

Regards,

Sipra

Edited by: Alvaro Tejada Galindo on Dec 14, 2009 3:37 PM

Read only

Former Member
0 Likes
1,901

In the GUI status of the screen you can attach a function code with the enter key. Now in PAI the function code will be copied to sy-ucomm. So u can check the function code and add the new line to your internal table and then call the table control in the same screen.The entered entry will be visable in your table control now.

Read only

0 Likes
1,901

Hi All,

What if the scenario is a table control that accept only input(s), meaning there's no data being loaded in PBO, so the code for


LOOP AT ITAB.
  MODULE MODIFY_DATA.
ENDLOOP.

will not work.


  LOOP WITH CONTROL TC_DATA.
    MODULE MODIFY_DATA.
  ENDLOOP.

  LOOP WITH CONTROL TC_DATA.
    MODULE MODIFY_DATA.
  ENDLOOP.

The scenario above is a blank table control, so it basically loops through the table control itself. Whenever I press "ENTER" in my inputs, ALL of the entries disappear, when I debug it, the value of SY-UCOMM is BLANK.

Any thoughts on this?

Thanks.

Read only

former_member191735
Active Contributor
0 Likes
1,901

>

> I added a line on the table but

>

> When I put some values in the new line and push enter key,

You need to capture the values in PAI module. If you are using work area in table control.

if there is a statement under PAI like Loop with control table_control. endloop.

Write a module in this loop and you have to modify the values in internal table with the work area.

At the same time, you also need to write code in PBO... Loop with control table_control . endloop. Write a module to read the values into your work are from internal table

>

> the values disappears without any process.

>

> I checked sy-ucomm but there was no OK_CODE.

>

> How can I use keyborad input in Table control?

Read only

0 Likes
1,901

Check the date of the original post.

Rob

Read only

0 Likes
1,901

Holly.....

Sorry man, I didnt see the date but it appeared on the first page some how.

Read only

Former Member
0 Likes
1,901

Hi Kim,

This is a common problem in table control in module pool.

You can solve this problem easily following the below code.

MODULE tblctrl_modify INPUT. "Where tblctrl is your table control name.

MODIFY ivbap "ivbap is the internal table.

FROM ivbap

INDEX tblctrl-current_line.

IF sy-subrc <> 0.

APPEND ivbap.

ENDIF.

put this logic it will solve your problem.

Thanks

Read only

0 Likes
1,901

Hi 

Not Active Contributor

Read only

0 Likes
1,901

Hi,

Please check:

Regards,,

Amrendra

Read only

0 Likes
1,901

tha correct answer is provided by shabhasis roy.