‎2009 Feb 13 2:41 PM
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.
‎2009 Feb 13 2:43 PM
Hi,
Just save the transaction and go back. You will see that record:)
Thanks,
Vinod.
‎2009 Feb 13 2:48 PM
Check these sample programs.
DEMO_DYNPRO_TABLE_CONTROL_1
DEMO_DYNPRO_TABLE_CONTROL_2
DEMO_DYNPRO_TABCONT_LOOP
DEMO_DYNPRO_TABCONT_LOOP_AT.
‎2009 Feb 13 2:50 PM
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
‎2009 Feb 13 2:52 PM
‎2009 Feb 13 3:44 PM
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
‎2009 Feb 14 10:57 AM
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