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

module pool

Former Member
0 Likes
719

i have a table control when i insert the value on table control and when i press the enter button data of the table control are not holding and table contro is get clear give me solution.

6 REPLIES 6
Read only

vinod_vemuru2
Active Contributor
0 Likes
695

Hi,

Just save the transaction and go back. You will see that record:)

Thanks,

Vinod.

Read only

GauthamV
Active Contributor
0 Likes
695

Check these sample programs.

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

DEMO_DYNPRO_TABCONT_LOOP

DEMO_DYNPRO_TABCONT_LOOP_AT.

Read only

Former Member
0 Likes
695

Hi,

When you are doing like that you check those records are available in the internal table of the table control.

otherwise if they are not available there u cant find them in the table control once u press any button.

try to insert those records in the internal table ..

thanks

Parvathi

Read only

Former Member
0 Likes
695

Hi Servesh,

Check the details in the debugging mode...why it is deleting.

may be you are clering out that data holding the internal table.

for more info look into the documents of the [table control|]

hope it is use ful to you.

Regards!.

Read only

Former Member
0 Likes
695

Hi,

This error is because whatever you are entering into table control is not getting saved.

Follow the below style code to preserve your data of table control.

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

loop at it_final into wa_final with CONTROL CTRL.

module move.

endloop.

*

PROCESS AFTER INPUT.

module clear_data.

loop at it_final.

module append.

endloop.

MODULE USER_COMMAND_0100.

This is the flow logic of the screen containing hte table control. It_final is the internal table holding the data.

Process: In PAI, module clear_data is just clearing the internal table it_final.

Module append will insert your table control data into internal table.

module APPEND input.

if sflight is not INITIAL.

append sflight to it_final.

clear sflight .

endif.

endmodule.

here sflight is the screen work area used to create table control columns. this code checks if table control row has any record, intert in into a internal table.

Process In PBO

module MOVE output.

if wa_final is not initial.

sflight = wa_final.

clear wa_final.

endif.

endmodule.

In this module , I am looping on to the internal table having table control records and passing the data to screen work area.

Follow the above steps and ur error will be resolved.

Thanks

Vishal Kapoor

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
695

Hi,

Use this code, its working:-

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...

At screen flow-logic


PROCESS BEFORE OUTPUT.
*  MODULE status_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE read_data.
  ENDLOOP.
 
PROCESS AFTER INPUT.
*  MODULE user_command_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE insert_data.
  ENDLOOP.
 
  MODULE save_data.

In PBO


*&---------------------------------------------------------------------*
*&      Module  READ_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
  READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
ENDMODULE.                 " READ_DATA  OUTPUT

In PAI


*&---------------------------------------------------------------------*
*&      Module  INSERT_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE INSERT_DATA INPUT.
  APPEND WA_ZEKPO TO IT_ZEKPO.
ENDMODULE.                 " INSERT_DATA  INPUT
 
*&---------------------------------------------------------------------*
*&      Module  SAVE_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE SAVE_DATA INPUT.
  DATA : A LIKE SY-DBCNT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'SAVE'.
      MODIFY ZEKPO FROM TABLE IT_ZEKPO. "update db table from internal table
      A = SY-DBCNT.
      IF SY-SUBRC = 0.
        MESSAGE S008 WITH A. "success message with no of records modified
      ENDIF.
  ENDCASE.
ENDMODULE.                 " SAVE_DATA  INPUT

Using this code when ant use actin is performed then the data is appended into internal table.

And when you click SAVE button with function code SAVE, then all the records will be saved into the ztable.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir