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

Regarding table control

Former Member
0 Likes
544

Hi..

i have created a screen with table cotrol, i getting a problem while pressing enter..

if the user enters the data in the table control and presses enter the data is getting vanished..

please help me in doing this.

i want all the datas whatever the user is entering the table control to be shown after pressin enter also till he press save button.

thanks and regards,

sudha.

4 REPLIES 4
Read only

Former Member
0 Likes
517

Hi

in PBO

Loop at itab with control TC.

endloop.

In PAI

loop at itab.

module modify_tab.

endloop.

In Program

module modify_tab.

DESCRIBE TABLE itab LINES lin.

IF tc-current_line > lin.

APPEND itab.

ELSE.

MODIFY itab INDEX tc-current_line.

ENDIF.

endmodule.

Cheers

Ram

Read only

Former Member
0 Likes
517

Hi,

If what Ram suggests doesnt happen too, then you could possibly try populating your data from the internal table onto your screen fields in the PBO again. When you press Enter, the PBO is triggered where your screen fields from PAI are not retained unless you specify like what Ram has suggested.

So try repopulating your data in the PBO.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
517

Hi, Refer:

it_zekpo is my internal table w/o header line,

wa_zekpo is work area.

Name of input/output fields on screen are:-

wa_zekpo-field1,

wa_zekpo-field2, and so on...

Take a button on the screen with function-code SAVE or in the pf-status take the function code of the standard save button as SAVE.

Use code:-

At screen logic:-


PROCESS BEFORE OUTPUT.
*  MODULE status_8003.
 
  LOOP WITH CONTROL po_tab. "po_tab is table control on screen 8003
    MODULE read_data.
  ENDLOOP.
 
PROCESS AFTER INPUT.
*  MODULE user_command_8003.
 
  LOOP WITH CONTROL po_tab.
    MODULE modify_data.
  ENDLOOP.

  MODULE SAVE_DATA.

In PBO:-


*&---------------------------------------------------------------------*
*&      Module  READ_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
  READ TABLE it_zekpo INTO wa_zekpo INDEX po_tab-current_line. "po_tab is table control name
  "to read data from internal table to the table control on screen
  DATA : line_count TYPE i.
  DESCRIBE it_zekpo LINES line_count.
  po_tab-lines = line_count + 10.
  "to increase the number of lines in table control dynamically
ENDMODULE.                 " READ_DATA  OUTPUT

In PAI:-


*&---------------------------------------------------------------------*
*&      Module  MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tab-currentline.
  "this will modify the contents of existing line
ENDMODULE.                 " MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
*&      Module  SAVE_DATA  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE SAVE_DATA INPUT.

  DATA : A LIKE SY-DBCNT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'SAVE'. "function code for SAVE button
      MODIFY ZEKPO FROM TABLE IT_ZEKPO.
      A = SY-DBCNT.
      IF SY-SUBRC = 0.
        MESSAGE S008 WITH A.
      ENDIF.
  ENDCASE.
ENDMODULE.                 " SAVE_DATA  INPUT

Hope this helps you.

Regards,

Tarun

Read only

0 Likes
517

Try Using..

PBO.

LOOP at IT_EKPO into WA_EKPO with table table control.

Endloop.

Secondly while debugging put a breakpoint before this and check if the data is there in the internal table.

In case ur facing any problem do let me know.

Regards,

Nabheet Madan