Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Module pool report

Hi

Can any one give me brief idea about Module pool reporting

Regards

Sandhya

SAP-ABAP Consultant

Tags:
Former Member
Former Member replied

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

Try like this

parameters :

table1(30) type c,

input(30) type c.

data w_flag type i.

at selection-screen output.

if w_flag eq 1.

clear w_flag.

loop at screen.

if screen-name = 'INPUT'.

%_INPUT_%_APP_%-TEXT = TABLE1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

at selection-screen.

w_flag = 1.

start-of-selection.

write input.

Use GET PF-STATUS to Gets the current GUI status.

Syntax

GET PF-STATUS <f> [PROGRAM <prog>] [EXCLUDING <itab>].

Returns the name of the current GUI status (the same as SY-PFKEY) into the variable <f>. The PROGRAM addition writes the name of the ABAP program to which the status belongs into the variable <prog>. The EXCLUDING addition returns a list of all currently inactive function codes into the internal table <itab>.

Then use SET PF-STATUS Sets the GUI status

Syntax

SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]

[IMMEDIATELY] [OF PROGRAM <prog>].

Sets the GUI status <stat> for the subsequent screens. The EXCLUDING addition allows you to deactivate functions dynamically. The IMMEDIATELY addition sets the GUI status of the list currently displayed. The OF PROGRAM addition allows you to use a GUI status from another program.

Here you can use the Excluding option to exclude the ICONS

Sample coding

&----


*& Include MZ_TABLEO01 *

&----


&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'MYSTATUS'.

SET TITLEBAR 'TITLE-001'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module POPULATE_IT OUTPUT

&----


  • text

----


MODULE populate_it OUTPUT.

IF ok_code NE 'ADD' AND

ok_code NE 'DEL'.

IF flag NE 'X'.

SELECT * FROM ztest_so INTO TABLE it_populate.

flag = 'X'.

ENDIF.

ENDIF.

ENDMODULE. " POPULATE_IT OUTPUT

&----


*& Module set_lines OUTPUT

&----


  • text

----


MODULE set_lines OUTPUT.

DESCRIBE TABLE it_populate LINES sy-tfill.

so_tbl_ctrl-lines = sy-tfill.

ENDMODULE. " set_lines OUTPUT

&----


*& Module move_values_to_tbl_ctrl OUTPUT

&----


  • text

----


MODULE move_values_to_tbl_ctrl OUTPUT.

MOVE : it_populate-vbeln TO ztest_so-vbeln,

it_populate-bukrs TO ztest_so-bukrs,

it_populate-kunnr TO ztest_so-kunnr,

it_populate-erdat TO ztest_so-erdat.

ENDMODULE. " move_values_to_tbl_ctrl OUTPUT

&----


*& Module set_select_status OUTPUT

&----


  • text

----


MODULE set_select_status OUTPUT.

READ TABLE it_selected WITH KEY vbeln = it_populate-vbeln.

IF sy-subrc EQ 0.

line_sel_col = 'X'.

ELSE.

line_sel_col = space.

ENDIF.

ENDMODULE. " set_select_status OUTPUT

&----


*& Module clear_okcode OUTPUT

&----


  • text

----


module clear_okcode output.

CLEAR OK_CODE.

endmodule. " clear_okcode OUTPUT

and in PAI

&----


*& Include MZ_TABLEI01 *

&----


&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

case ok_code.

when 'BACK' or 'CANC' or 'EXIT'.

leave to screen 0.

when 'SELALL'.

clear IT_selected.

refresh IT_selected.

loop at IT_POPULATE.

move-corresponding IT_POPULATE to IT_selected.

append IT_selected.

endloop.

when 'DESELALL'.

clear IT_selected.

refresh IT_selected.

when 'SAVE'.

LOOP AT IT_SELECTED.

MODIFY ZTEST_SO FROM IT_SELECTED.

ENDLOOP.

LOOP AT IT_DELETED.

DELETE FROM ZTEST_SO WHERE VBELN = IT_DELETED-VBELN.

ENDLOOP.

commit work.

when 'DEL'.

LOOP AT IT_SELECTED.

MOVE-CORRESPONDING IT_SELECTED

TO

IT_DELETED.

APPEND IT_DELETED.

  • Also delete it from T_SO.

DELETE IT_POPULATE WHERE VBELN = IT_SELECTED-VBELN.

ENDLOOP.

CLEAR IT_SELECTED.

REFRESH IT_SELECTED.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module get_selected_so INPUT

&----


  • text

----


module get_selected_so input.

If ok_code ne 'SELALL'.

IF line_sel_col EQ 'X'.

Read table IT_selected with key vbeln = IT_POPULATE-vbeln.

If sy-subrc ne 0.

MOVE-CORRESPONDING ztest_so TO IT_selected.

Append IT_selected.

Else.

MOVE-CORRESPONDING ztest_so TO IT_selected.

Modify IT_selected index sy-tabix.

Endif.

Else.

Read table IT_selected with key vbeln = IT_POPULATE-VBELN.

If sy-subrc eq 0.

Delete IT_selected where VBELN = IT_POPULATE-VBELN.

Endif.

Endif.

ENDIF.

endmodule. " get_selected_so INPUT

check these links, it may be helpful to u.

this link contains information about :

1)Table Controls in ABAP Programs

2)Looping Through an Internal Table

3)Table Controls: Examples with Scrolling

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm

process before output.
*&spwizard: pbo flow logic for tablecontrol 'MY_TAB'
  module my_tab_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
  loop at   it_item
       into wa_item
       with control my_tab
       cursor my_tab-current_line.
    module my_tab_get_lines.
*&spwizard:   module MY_TAB_change_field_attr
  endloop.
 
  module status_0100.
  module set_curson.
  module get_date.
  module ok_code.
 
process after input.
*&spwizard: pai flow logic for tablecontrol 'MY_TAB'
  loop at it_item.
    chain.
      field wa_item-zeile.
      field wa_item-matnr.
      field wa_item-maktx.
      field wa_item-meins.
      field wa_item-menge.
      field wa_item-rflag.
      module my_tab_modify on chain-request.
    endchain.
  endloop.
  module my_tab_user_command.
*&spwizard: module MY_TAB_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
  module get_vendor_name.
  module user_command_0100.
 
 



For second screen

PROCESS BEFORE OUTPUT.
*&spwizard: pbo flow logic for tablecontrol 'CON_TAB'
  module CON_TAB_change_tc_attr.
*&spwizard: module CON_TAB_change_col_attr.
  loop at   IT_DB_ITEM
       into WA_DB_ITEM
       with control CON_TAB
       cursor CON_TAB-current_line.
    module CON_TAB_get_lines.
*&spwizard:   module CON_TAB_change_field_attr
  endloop.
 
 MODULE STATUS_0110.
*
PROCESS AFTER INPUT.
*&spwizard: pai flow logic for tablecontrol 'CON_TAB'
  loop at IT_DB_ITEM.
    chain.
      field WA_DB_ITEM-ZEILE.
      field WA_DB_ITEM-MATNR.
      field WA_DB_ITEM-MAKTX.
      field WA_DB_ITEM-MEINS.
      field WA_DB_ITEM-MENGE.
      field WA_DB_ITEM-RFLAG.
    endchain.
  endloop.
  module CON_TAB_user_command.
*&spwizard: module CON_TAB_change_tc_attr.
*&spwizard: module CON_TAB_change_col_attr.
 
 MODULE USER_COMMAND_0110.

Regards

Pavan

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question