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

Need module pool pgm

Former Member
0 Likes
504

hi friends ,

i need module pool pgm with table control

it should allow user to enter data and that data should be stored in

ZTABLE.plz don't give demo pgm.if any one has developed give brief idea

thaks in advance

regards,

soorya

3 REPLIES 3
Read only

Former Member
0 Likes
487

Hi,

make a program.

make a screen

add a table control to that screen,if you want you an use table control with wizard

with wizard sap itself creates the code for you.

make buttons for save create and delete.

on the basis of okcode of each button write a case statement in pai module.

in pai do the data select or append/insert or modify

at pbo do the screen attribute changes.

this is all about module pool.

if you want any sample code i can send you.but that will be a code only.i cannot send ou screen design.that you have to do its not possible to send screen .

thanks

reward if helpful

vivekanand

Read only

0 Likes
487

hi vivek ,

plz send me sample code if u have

send me pgm & flowlogic code.

regards,

soorya

Read only

former_member196299
Active Contributor
0 Likes
487

hi Soorya ,

First of all you can get many module pool programs in the SDN search itelf .

Anyways here is one samplw program for your reference :

Creation of table controls in mpools

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.

hope this will be helpful to you ...

Revert for further assistance if needed ...

Regards,

Ranjita