Need module pool pgm
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
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
Similar Messages
-
Using module pool pgm, Con't modify the table field valus
Hello frnds,
i m create one rpt using module pool pgm, click display button display the table values .
Iwant to modify some fields that changes is update to table.
Bellow coding is correct or not, how can modify the fields with save changes.
TABLES : ZRFIM1.
DATA: ZREPNO TYPE ZRFIM1-ZREPNO,
ZPLANT TYPE ZRFIM1-ZPLANT,
ZRIMNO TYPE ZRFIM1-ZRIMNO,
ZRIMDAT TYPE ZRFIM1-ZRIMDAT,
DISPLAY TYPE C,
CLEAR TYPE C,
EXIT TYPE C,
SAVE TYPE C,
OK_CODE LIKE SY-UCOMM.
data : itab type table of zrfim1 with default key.
data : wa_itab type zrfim1.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
SET PF-STATUS 'SAVE'.
AT USER-COMMAND.
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'DISPLAY'.
SELECT SINGLE ZREPNO ZPLANT ZRIMNO ZRIMDAT FROM ZRFIM1
INTO (ZRFIM1-ZREPNO, ZRFIM1-ZPLANT, ZRFIM1-ZRIMNO, ZRFIM1-ZRIMDAT)
WHERE ZREPNO = ZRFIM1-ZREPNO.
WHEN 'CLEAR'.
CLEAR ZRFIM1.
WHEN 'SAVE'.
select single * from zrfim1 into wa_itab where ZREPNO = ZRFIM1-ZREPNO.
wa_itab-zrepno = ZREPNO.
wa_itab-zplant = ZPLANT.
wa_itab-zrimno = ZRIMNO.
wa_itab-zrimdat = ZRIMDAT.
modify zrfim1 from wa_itab.
ENDCASE.
endmodule.
Thanks in advance.hello,
change the code like:
(IF ZRFIM1 is the structure has been used on screen)
wa_itab-zrepno = ZRFIM1-ZREPNO.
wa_itab-zplant = ZRFIM1-ZPLANT.
wa_itab-zrimno = ZRFIM1-ZRIMNO.
wa_itab-zrimdat = ZRFIM1-ZRIMDAT.
modify zrfim1 from wa_itab.
thanks
K. -
Hi Experts,
In the Transaction caa2, in Special Cases tab if i enter Program type '01' as we got, then the search help of the Status Code(3rd one) field contain only some values not all the status codes. How can i solve this problem, if i take search help i am getting all the values but i dont want all the values, only some of the Status Codes i want depend on Program Type. Can any one help me ASAP.
Regards
RajendraHi Experts,
In the Transaction caa2, in Special Cases tab if i enter Program type '01' as we got, then the search help of the Status Code(3rd one) field contain only some values not all the status codes. How can i solve this problem, if i take search help i am getting all the values but i dont want all the values, only some of the Status Codes i want depend on Program Type. Can any one help me ASAP.
Regards
Rajendra -
How to create transaction or screen variant for custom tcode in module pool
Hi,
I have one module pool program with custome tcode ,i want to create transaction or screen variant for this tcode.Next time when we run this tcode we need a variant for this tcode.
I tried by using of SHD0 but it is working only for standred tcodes.Is there any possibilty please help me.
thanks,
Lavanya.Hi,
you created a Custom Tcode for ur module pool Pgm..if u execute the Tcode in the output screen give the input details and press Save Option then variant will be created. Then you can use that variant.
otherwise.. while creating a Tcode..
select an option for Tcode type Tranasction With variant ..there u will provide the variant for ur Tcode ( which is already created ).
Regards,
PraVeen. -
hi all
when im tryin to create tabstrip in module pool pgm im gettin error as subscreen s not assigned to tab how do i assign the subscreen for the tabstriphi,
If you need it in selection screen,check this link.
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_tabstrip.htm
also Check this.
http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/content.htm
According to the tab pressed,you can write the coding in PAI and display the output in PBO.
Following is the sample code.I am using custom container.
CONTROLS: main_tab TYPE TABSTRIP.
DATA: BEGIN OF i_main_tab,
subscreen LIKE sy-dynnr,
prog LIKE sy-repid VALUE
'ZZZ_TABSTRIP',
pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
END OF i_main_tab.
MODULE status_9001 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
IF o_custom_container1 IS INITIAL.
Creating Object
PERFORM f9000_objects_create.
Building the field catalog
PERFORM f9001_build_field_cat TABLES i_fcat
USING 'ZZZ_GRID'.
For Layout
PERFORM f9002_layout USING sy-title c_x c_a c_x.
i_main_tab-subscreen = '9100'.
Displaying data
CALL METHOD o_alvgrid1->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = i_grid[]
it_fieldcatalog = i_fcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i005 WITH text-009."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
endif.
when c_main_tab-tab2.
if o_custom_container2 is initial.
perform f9000_objects_create1 using:
create custom container
'o_custom_container2' '' '' '',
Create splitter container
'o_splitter' o_custom_container2 '2' '1',
Create event reciever
'o_eventreceiver' '' '' ''.
Creating containers for the split grids
call method o_splitter->get_container exporting row = 1
column = 1
receiving container = o_container1.
call method o_splitter->get_container exporting row = 2
column = 1
receiving container = o_container2.
Set where the splits on the screen comes
call method o_splitter->set_row_height
exporting
id = 1
height = 45
exceptions
cntl_error = 1
cntl_system_error = 2
others = 3.
if sy-subrc ne 0.
perform f9003_error_handle using text-E04.
endif.
perform f9000_objects_create1 using:
Create the alv grids
'o_alvgrid2' o_container1 '' '',
'o_alvgrid3' o_container2 '' ''.
set handler o_eventreceiver->handle_double_click for o_alvgrid2.
perform f9001_build_field_cat tables i_fcat1
using 'ZZZ_GRID1'.
perform f9001_build_field_cat tables i_fcat2
using 'ZZZ_GRID2'.
For Layout
PERFORM f9002_layout USING sy-title c_x c_a c_x.
i_main_tab-subscreen = '9200'.
if not i_grid1[] is initial.
call method o_alvgrid2->set_table_for_first_display
exporting
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = i_grid1[]
it_fieldcatalog = i_fcat1[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
if sy-subrc <> 0.
message i005 with text-009."Error in ALV report display
leave list-processing.
endif.
Populate the GRID2 data
read table i_grid1 into w_grid1 index 1.
if sy-subrc = 0.
if not i_grid2[] is initial.
Generate the grid2 data.
call method o_alvgrid3->set_table_for_first_display
exporting
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = i_grid2[]
it_fieldcatalog = i_fcat2[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endif.
endif.
else.
No data for the entered selection criteria
message i005 with text-010.
leave list-processing.
endif.
endif.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module MAIN_TAB_ACTIVE_TAB_GET INPUT
This is used to catch the pressed tab
MODULE main_tab_active_tab_get INPUT.
CASE sy-ucomm.
WHEN c_main_tab-tab1.
i_main_tab-pressed_tab = c_main_tab-tab1.
i_main_tab-subscreen = '9100'.
WHEN c_main_tab-tab2.
i_main_tab-pressed_tab = c_main_tab-tab2.
i_main_tab-subscreen = '9200'.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. " MAIN_TAB_ACTIVE_TAB_GET INPUT
*& Module USER_COMMAND_9001 INPUT
This is used for user command
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
PERFORM exit_program.
SET SCREEN '0'.
WHEN 'EXIT' OR 'CANC'.
PERFORM exit_program.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
For screen 9001 we need to write Flow logic as below. For subscreens, Flow logic is
not required.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.
CALL SUBSCREEN main_tab_sca
INCLUDING i_main_tab-prog i_main_tab-subscreen.
PROCESS AFTER INPUT.
MODULE user_command_9001.
MODULE main_tab_active_tab_get.
rgds,
latheesh -
How to pass the field value from module pool program to smartform using submit?
// AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.
gv_orderid= wa-itemid./
SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN
WITH p_order = gv_orderid
AND RETURN.
//AT driver pgm(zmusic_store_smf):
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMUSIC_SMARTFORM1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = lv_form
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION lv_form
EXPORTING
* iv_orderid = is_purchase_item-zorder_id.
iv_orderid = gv_orderid.
// here i'm trying to call my smartform('ZMUSIC_SMARTFORM1') from this driver pgm but unable to access the value of gv_orderid please help me out with this.Declare the gv_orderid in modulepool program.
And Declare the parameter as import parameter in smartform.
CALL FUNCTION lv_form
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
i_input = gv_orderid
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5 -
Module pool domain text display info req?
hi
i had an req to show a filed MATNR on a screen in module pool pgm,there shd be a i/p filed for material,user can select the material from the list of available materials,along with the test to be displayed for the filed next to material nos.
the list of mateiral is based on the login user name.
i am able to display the material list,but text is not coming.
pls tell me how to show the text next to matnr no. in list.
i had used the code:
loop at itab_carrid.
clear:text.
CALL FUNCTION 'ADS2KIPBRO_GET_DOMAIN_TEXT'
EXPORTING
E_TABLE = 'MARA'
E_FIELD = 'MATNR'
E_VALUE = itab_carrid-matnr
IMPORTING
I_TEXT = text
EXCEPTIONS
ILLEGAL_INPUT = 1
DOMAIN_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
move text to itab_carrid-text1.
modify itab_carrid transporting text1.
endloop.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.hi
tell me,if i made a i/p field on screen from the data variable declared in my program
like :data:actvt(3) type c.
than on layout of screen:I/P filed-actvt.
now i want to provide the f4 to this.i had written the POV for the filed,the data is there in itab,but not poping out.
code:PROCESS ON VALUE-REQUEST.
FIELD ACTVT MODULE create_dropdown_box.
TYPES: BEGIN OF type_carrid,
actvt(3) type c,
text1(40) type c,
END OF type_carrid.
DATA: itab_carrid type Type_carrid occurs 0 with header line.
itab_carrid-actvt = '001'.
append itab_carrid.
itab_carrid-actvt = '002'.
append itab_carrid.
itab_carrid-actvt = '003'.
append itab_carrid.
itab_carrid-actvt = '004'.
append itab_carrid.
itab_carrid-actvt = '005'.
append itab_carrid.
itab_carrid-actvt = '006'.
append itab_carrid.
itab_carrid-actvt = '007'.
append itab_carrid.
endif.
clear:itab_carrid.
loop at itab_carrid.
clear:text.
CALL FUNCTION 'ADS2KIPBRO_GET_DOMAIN_TEXT'
EXPORTING
E_TABLE = 'YLOGON1'
E_FIELD = 'ACTVT'
E_VALUE = itab_carrid-actvt
IMPORTING
I_TEXT = text
EXCEPTIONS
ILLEGAL_INPUT = 1
DOMAIN_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
move text to itab_carrid-text1.
modify itab_carrid transporting actvt text1.
endloop.
clear:itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ACTVT'
DYNPNR = SY-DYNNR
DYNPPROG = SY-REPID
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
plz tell me how to pop out this help in screen. -
Hi i need material for module pool and alv's.
hi
i need material for module pool and ALV's(not object oriented) if any one have pls do send that to my
ID [email protected]
thanx in advance.Hi
Check the below link:
http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sap-img.com/
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
ALV
ABAP List Viewer
The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
This helps us to implement all the features mentioned very effectively.
Using ALV, We can have three types of reports:
1. Simple Report
2. Block Report
3. Hierarchical Sequential Report
There are some function modules which will enable to produce the above reports without much effort.
All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
1. SIMPLE REPORT.
The important function modules are
a. Reuse_alv_list_display
b. Reuse_alv_fieldcatalog_merge
c. Reuse_alv_events_get
d. Reuse_alv_commentary_write
e. Reuse_alv_grid_display
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : H header, S selection , A - action
Key : only when typ is S.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using REUSE_ALV_FIELDCATALOG_MERGE.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
Reward points if useful
Regards
Anji -
Need help in module Pool programming.
Dear gurus
I'm stuck in a step of Module Pool program
Steps i used for enhancement in XK01.
1) i appended a structure in table LFA1 having two fields A and B.
2) then i went to IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields -> Prepare Modification-Free Enhancement of Vendor Master Record ( Here i created my screen group Z1 without Function Code.
3) then i created below module pool program. of screen 9999 and in layout i added to fields to display A and B which i appended.
PROGRAM ZSNAK_XK01.
TABLES: lfa1.
module status_9999 output.
endmodule. " status_9999 OUTPUT
module user_command_9999 input.
endmodule.
4) After this i wen to IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields ->
Business Add-In: Processing of Master Data Enhancements ( Here i created my implementation on method CHECK_ADD_ON_ACTIVE and added this code
if i_screen_group eq 'Z1'.
e_add_on_active = 'X'.
endif.
5) then i went to IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields ->
Business Add-In: Customer Subscreens. and created my implementation on method GET_TAXI_SCREEN where i have written this code.
e_screen = '9999'.
e_program = 'ZSNAK_XK01'.
e_headerscreen_layout = ''.
After activation when i execute t-code XK01 i see my button there after INFORMATION BUTTON when i click on it i get following error.
Incorrect screen type: Screen is incorrectly defined or used.
The attribute screen type with the values 'Normal Screen' and
'Subscreen' determines the use of the screen. If a normal screen is used
as subscreen or vice versa, an error occurs.
The screen "ZSNAK_XK01" 9999 has, in this respect, an inappropriate screen
type.
Please guide me
Regards
Saad Nisar.I think you have defined the screen 9999 as normal screen. go to attributes tab of the screen and make it as "subscreen' (radio button) and activate
a® -
Please use a more informative subject in future
hi Experts
In my module pool program i having a list box in a modeled dialog box . if the list box is left empty it will give an error message .after pressing the enter buttton the list box gets disable . in which i want enable after pressing enter . how can i achive it .
regards
chinnaiya
Edited by: Matt on Apr 27, 2009 10:27 AMHI,
Do the following to solve your problem.
In the screen flow logic after "process after input" write the following:
CHAIN.
FIELD fieldname MODULE chk-fieldname.
ENDCHAIN.
Now create a module chk-fieldname in F01 and write your code there.
So now even if there is an error also your field will not be disabled.
Hope this helps you.
Thanks,
Sri... -
Help needed for checkbox in module pool
Hi experts,
My requirement is i have 8 machines. i want to have a check box for each machine and when i select a specific machine by checking it, it should store data in my ztable as that specific machine name or it should show a flag or mark on each field selected inside my ztable.
I am confused in the logic to enter in my module pool program. please help.see this :
Create CheckBox in Module pool and update the Databas once i hit the enter
Also please search before you post -
Hi Friends,
Can anyone give me the idea for creating module pool using 3 to 4 database tables.a module pool program can be ceated using <u><i><b>se 80 - object avigator.</b></i></u>
select program in the drop-down box..
enter a program name and press enter key...
right click on the program name (object name)
save the object in ur own package...
u can also create include callled TOPinclude- to globalise all the data used in the program...
choose create ---> choose SCREENS ..
goto layout and set the layout of the screen...
use screen PBO - Process before output modules...
(PBO occurs before user interaction)
and PAI - Process after input modules for module pool programming..
(PAI occurs after user interaction)
double click on modules..
declare structures for using different internal tables and work areas for different database tables .
let us have a a structure called struct_tables
having fields from VBAK and KNA1 such as NAME1, STRAS, ORT01, PSTLZ,
TELF1 BY INNER JOINING VBAK AND KNA1 TABLES BASED UPON KUNNR AS KEY FIELD AND HAVING SALES DOCUMENT NUMBER 'VBELN' AS INPUT BY THE USER .
statement :
SELECT NAME1
STRAS
ORT01
PSTLZ
TELF1
VBELN
KUNNR
FROM VBAK INNER JOIN KNA1 ON
VBAKKUNNR = KNA1KUNNR .
and then u can also write the sselected fields in a table control wizard...
thus u can perform module pool programming using 3-4 database tables. -
hello friends
i m new in ABAP
i had designed database and now i want to enter the data through module pool so please guide me about the module pool and insert condition how could i do that
Do post friends...................
Waiting for ure precious suggestions
With Best Regards
RubyCreate Table Control screen in Module Pool
· Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
· Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Create Table Control
· Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
Enter the fields that you want to display in the table control. Example uses fields from EKKO.
Now save and activate it!
· Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Press Save
· Step 3 (Create TOP include)
Double click on the top include and enter following ABAP code:
Tables: ZTC_EKKO.
controls: tc100 type tableview using screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
· Step 4 (Create screen)
Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
· Step 5 (Create table control)
Press the Layout button to bring up the screen painter editor.
Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
Create Table Control
· Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
Enter the fields that you want to display in the table control. Example uses fields from EKKO.
Now save and activate it!
· Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Press Save
· Step 3 (Create TOP include)
Double click on the top include and enter following ABAP code:
Tables: ZTC_EKKO.
controls: tc100 type tableview using screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
Press Save and Activate
· Step 4 (Create screen)
Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
· Step 5 (Create table control)
Press the Layout button to bring up the screen painter editor.
Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
· Step 6 (Populate table control )
Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the Get from Dict button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
Below is the result, there will been syntax errors if we check now! So Save and go back
into the flow logic tab.
· Step 7 (Create flow control )
Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
module data_retrieval.
loop at it_ekko into wa_ekko with control TC100.
module populate_screen.
endloop.
PROCESS AFTER INPUT.
loop at it_ekko.
endloop.
MODULE USER_COMMAND_0100.
Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
***INCLUDE MZ_TCONTROL_DATA_RETRIEVALO01 .
*& Module data_retrieval OUTPUT
text
MODULE data_retrieval OUTPUT.
select data from ekko table
SELECT ebeln bukrs bstyp bsart
bsakz loekz statu aedat
UP TO 10 ROWS
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDMODULE. " data_retrieval OUTPUT
Double click the module populate_screen to create. Now move the values in this loop from the wa_ekko into the Table Control with the move-corresponding statement.
MODULE populate_screen OUTPUT.
DATA: ld_line TYPE i.
* Set which line of table is a top of displayed table control
IF sy-stepl = 1.
tc100-lines =
tc100-top_line + sy-loopc - 1.
ENDIF.
* move fields from work area to scrren fields
MOVE-CORRESPONDING wa_ekko TO ztc_ekko.
ENDMODULE. "
populate_screen OUTPUT
· Step 8 (Create transaction )
Now create a transaction to test the table control program. Right click the Program and select create-> transaction.
· Step 9 (Execute transaction )
Execute transaction ZTC
please see the link for screen shots of the dailog module
http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm
reward points if it is usefull ....
Girish -
Need some assistance in module pool progarming
i got my first requirement please guide me from where i should start.
To post Production Order confirmation in a module pool program having functionality of
showing list of orders as well as changing and displaying production order confirmation
Moderator message: "spec dumping", please work yourself first on your requirement, these forums cannot replace training courses.
Edited by: Thomas Zloch on Feb 7, 2012Hi Forum,
Thanks for your suggestions. This is the actual query. It is working fine and what I want is to write it in a format of sub-query where it will increase the perofrmance as I am using this queryi n JSP code to pull the data onto the web form.
The OR and AND conditions are mapped correctly as per our business logic I can cobmined ( 5,6,7,8,910) with (12). This condition TAB1.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) is different from (QM_JOB_STATUS in (12) and QMI.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH)
Suggest me what I have to do to increase the performance of the query. We are usign a flat database.
select select "TAB1"."JOB_NUM" as "JOB_NUM",
"TAB1"."TITLE" as "TITLE",
"TAB1"."REP" as "REP",
"TAB1"."GOOD" as "GOOD",
"TAB1"."CODE" as "CODE",
"TAB2"."QN_JOB_GPH_FILE" as "QN_JOB_GPH_FILE",
"TAB3"."STA_CODE" as "STA_CODE",
"TAB3"."JI_DESC" as "JI_DESC",
"TAB1"."QM_USER_STATUS" as "QM_USER_STATUS",
"TAB4"."RR_NAME" as "RR_NAME"
from "TAB3" "TAB3",
"TAB4" "TAB4",
"TAB2" "TAB2",
"TAB1" "TAB1"
where (TAB1.JOB_STATUS IN (5, 6, 7, 8, 9, 10)) or (JOB_STATUS in (12) and TAB1.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH)
and "TAB1"."JOB_NUM"="TAB2"."QN_JOB_NUM"
and "TAB1"."REP"="TAB4"."RR_REP"
and "TAB3"."STA_CODE"="TAB1"."QM_USER_STATUS"
Cheers,
Krishna. -
I have to develop a pgm using module pool
INput:User name And Password..
if any one type it has to update in a table... if any one modify the password that also have to be updated
i want to use two buttons one for update and other for modify in appln tool bar.. can any one give me the coding and step by step procedure...Hi Hema,
Well, there's no need to use two buttons. MODIFY will help you achieve your goal. But still you can design whichever way it's comfortable for you. Use the approach given below:
1. Create Screen '9000' and design screen according to your requirements. If you want to add, two buttons, you can do that in your GUI status. Assign a function code to the buttons. Set the OK_CODE for ypur screen elements
2. in PAI, write two modules. First to handle the function code for MODIFY and UPDATe and other for at Exit Command.
3. In Module for MODIFY and UPDATE, define two variables which will have exactly same name as the input fields for ID and password. Set these values to your table fields. Use MODIFY to update your table.
(The point to note is, the variable names you have given to fields in your screen, and if you define them in your program, these program variables will contain the exact value what you have entered in the screen).
Hope this helps.
Cheers,
Santosh Verma,
Deloitte, India.
Maybe you are looking for
-
HT201320 how to limit number of emails in mac mail on iphone5
Since I upgraded to ios7 my main email account within mac mail has been loading up to 1000 emails. I want it to be as before, a limit of 200. How???
-
When I run the web application on local machine with OS Windows Tomcat version 4.1 using http the page looks fine with special characters appearing ok. Encoding in browser is seen to be "western-european" but when the same web application is deployed
-
What is the cheapest route for replacing an iphone?
Super glue dripped onto my iPhone running in around my home button. It works half the time, when it don't it just keeps bringing up Siri. I just got my phone bill lowered with the new rates so I really do not want to be making payments on a new phone
-
My credit card was charged for two purchases in the amount of 14.95 each. I did not authorize these purchases. The purchase dates were 12/24 and 12/25.
-
How Do we execute The Jheadstart from ias 10.1.2
New to J2EE so need some help!!! I deployed the Sample application (MYdemo) in a ias 10.1.2 Instanse on linux (used Jheadtstart Blogs) the jspx files are located on the following directory /a01/app/oracle/product/oas10.1.2/j2ee/JHeadStart/application