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

using table control in module pool

Former Member
0 Likes
467

hi friends,

can some one give sample code of using table control in module pool pgm

i need to design 2 screens

1st screen shuold accept values from user and save it in ZTABLE

2nd screen based on the input i should get the data from my ZTABLE and shuold allow me to change the values and save it in ZTABLE

thanks in advance

regards

soorya

3 REPLIES 3
Read only

Former Member
0 Likes
449

Hi soorya,

For demo programs on table controls with module pools

Please check the following in se38

REPORT demo_dynpro_tabcont_loop.

REPORT demo_dynpro_tabcont_loop_at.

They have only one screen...if you are stuck on a particular issue in the process of development pls revert with the issue and reward if helpful

Regards

Byju

Read only

former_member196299
Active Contributor
0 Likes
449

hi ,

Check with the following program it sould be helpful :

Here you go with the complete steps for creating module pool programs using table control:

open se51, choose the icon like a table for table control . drag it and then place it in your screen . click on F6 and you will get a screen where youi need to provide the table name / field name that ( fields ) you are going to use in the screen and table control. after giving the ztable name click on get it from dictionary . you will get the list of available fields in a table. next choose the fields you wish to place in the table control , and if you want to place all fields in your table control then select every fields . after this you will get a structure which you should drag place inside the table control area .

double click on the table control , set the proper attributes, tickmark the horizontal and vertical scroll bars to appear in your TC in the screen . save , check and activate ..

following are the sample code you should follow to display datas in your table control ..

write the following code in the flow logic of the screen ............

process before output.

module tc_01_init.

loop at g_tc_01_itab

into g_tc_01_wa

with control tc_01

cursor tc_01-current_line.

module tc_01_move.

module tc_01_get_lines.

endloop.

module status_0001.

process after input.

loop at g_tc_01_itab.

chain.

field sflight-carrid.

field sflight-connid.

field sflight-fldate.

module tc_01_modify on chain-request.

endchain.

endloop.

module tc_01_user_command.

Write the following code in your Zmodulepool program !!

program z_tst_mpool_tc_01.

data: begin of l_tab_sflight occurs 10,

carrid like sflight-carrid,

connid like sflight-connid,

fldate like sflight-fldate,

end of l_tab_sflight.

tables: sflight.

types: begin of t_tc_01,

carrid like sflight-carrid,

connid like sflight-connid,

fldate like sflight-fldate,

end of t_tc_01.

data: g_tc_01_itab type t_tc_01 occurs 0,

g_tc_01_wa type t_tc_01. "work area

data: g_tc_01_copied. "copy flag

controls: tc_01 type tableview using screen 0001.

data: g_tc_01_lines like sy-loopc.

data: ok_code like sy-ucomm.

include z_tst_mpool_tc_01_pbo .

include z_tst_mpool_tc_01_pai .

include z_tst_mpool_tc_01_incl01 .

include z_tst_mpool_tc_01_status_0001.

include Z_TST_MPOOL_TC_01_PBO .

  • inside include

module tc_01_init output.

if g_tc_01_copied is initial.

select * from sflight

into corresponding fields

of table g_tc_01_itab.

g_tc_01_copied = 'X'.

refresh control 'TC_01' from screen '0001'.

endif.

endmodule.

module tc_01_move output.

move-corresponding g_tc_01_wa to sflight.

endmodule.

module tc_01_get_lines output.

g_tc_01_lines = sy-loopc.

endmodule.

Regards,

Ranjita

Read only

Former Member
0 Likes
449

hi

go to se38-> environment->examples->ergonomic examples->screens

OR

use Tcode -> BIBS

thanks