Application Development 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: 

table control on screen

Former Member
0 Kudos

i m creating a table control on screen using module pool programming....

i m not able to enter the columns.... from where i can enter the columns..........????

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

in the layout press F6 button and give the table name and select the fields u wnt to inlcude in table control and jjust press Enter.

Regards

Gopi

4 REPLIES 4

Former Member
0 Kudos

Hello,

Check this sample report.


REPORT demo_dynpro_tabcont_loop.

CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.

DATA: ok_code TYPE sy-ucomm,
      save_ok TYPE sy-ucomm.

DATA: itab TYPE TABLE OF demo_conn,
      fill TYPE i.
TABLES demo_conn.

DATA: lines TYPE i,
      limit TYPE i.

SELECT * FROM spfli INTO TABLE itab.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN_100'.
  DESCRIBE TABLE itab LINES fill.
  flights-lines = fill.
ENDMODULE.

MODULE fill_table_control OUTPUT.
  READ TABLE itab INTO demo_conn INDEX flights-current_line.
ENDMODULE.

MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE read_table_control INPUT.
  lines = sy-loopc.
  MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.

MODULE user_command_0100 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'NEXT_LINE'.
      flights-top_line = flights-top_line + 1.
      limit = fill - lines + 1.
      IF flights-top_line > limit.
        flights-top_line = limit.
      ENDIF.
    WHEN 'PREV_LINE'.
      flights-top_line = flights-top_line - 1.
      IF flights-top_line < 0.
        flights-top_line = 0.
      ENDIF.
    WHEN 'NEXT_PAGE'.
      flights-top_line = flights-top_line + lines.
      limit = fill - lines + 1.
      IF flights-top_line > limit.
        flights-top_line = limit.
      ENDIF.
    WHEN 'PREV_PAGE'.
      flights-top_line = flights-top_line - lines.
      IF flights-top_line < 0.
        flights-top_line = 0.
      ENDIF.
    WHEN 'LAST_PAGE'.
      flights-top_line =  fill - lines + 1.
    WHEN 'FIRST_PAGE'.
      flights-top_line = 0.
  ENDCASE.
ENDMODULE.

Vasanth

gopi_narendra
Active Contributor
0 Kudos

in the layout press F6 button and give the table name and select the fields u wnt to inlcude in table control and jjust press Enter.

Regards

Gopi

Former Member
0 Kudos

Hi Nidhi,

My best suggestion for someone who is new to module pool table control is to go for table control wizard.

It generates the code for you. When SAP has provided the tool for making things easier, let use it.

Let me know if you want anyhelp with the wizard

Thanks

venki

Former Member
0 Kudos

Hi,

Look at the below DEMO Programs in your SAP system

<b>DEMO_DYNPRO_TABLE_CONTROL_1 "    Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2    " Table Control with LOOP AT ITAB
DEMO_INT_TABLES_AT_1           " Control Level Processing
DEMO_INT_TABLES_AT_2           " Control Level Processing</b>

Regards

Sudheer