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

Print Table Data.

Former Member
0 Likes
1,745

Hi People,

Need some ABAP help. Presently im displaying data in a table control and now i want to print the data in that table control. I know about one function module which was mentioned in one of the threads i dont know how to use this function module

( FITRV_PRINT_TABLE_CONTROL_DATA). it will be great of you guys if you can explain this function module or provide me with an alternative.

Thanks,

Venkat

6 REPLIES 6
Read only

Former Member
0 Likes
927

----


  • Form print_table_control_data

----


  • Print data from table control screen

----


  • --> ITAB = internal table with table control data

  • --> TC = table control

  • -- OPTIMIZE = use column optimization when calling ALV

----


form print_table_control_data tables ptab

using table_control type cxtab_control

title type c

optimize type c

ddic_fields type c.

data: pgm like sy-repid,

tc type cxtab_control.

pgm = sy-repid.

tc = table_control.

call function 'FITRV_PRINT_TABLE_CONTROL_DATA'

exporting

table_control = tc

callback_program = pgm

callback_top_of_list = 'PRINT_TRIP_HEADER'

get_curr_quan_fields_from_ddic = ddic_fields

optimize_column_width = optimize

window_title = title

tables

print_data = ptab

exceptions

column_information_missing = 1

printing_not_possible = 2

others = 3.

endform. " print_table_control_data

check the program MP56TFPR. it might help you

Read only

naimesh_patel
Active Contributor
0 Likes
927

Hello,

  DATA: pgm LIKE sy-repid,
        tc  TYPE cxtab_control.

  pgm = sy-repid.
  tc  = table_control. " Your table control name

  CALL FUNCTION 'FITRV_PRINT_TABLE_CONTROL_DATA'
    EXPORTING
      table_control                  = tc   
      callback_program               = pgm
      callback_top_of_list           = 'PRINT_TRIP_HEADER'   " Make this perform for header
      get_curr_quan_fields_from_ddic = ddic_fields  " pass blank 
      optimize_column_width          = optimize      "pass blank
      window_title                   = title             " pass blank
    TABLES
      print_data                     = ptab   " your data tab
    EXCEPTIONS
      column_information_missing     = 1
      printing_not_possible          = 2
      OTHERS                         = 3.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
927

Thanks Guys,

I could get the function module to work. But for the list headings its printing blank on the top of the list. What should i do to populate the headings.

Read only

Former Member
0 Likes
927

Hi Guys,

Any ideas on how to print the header too.

Read only

0 Likes
927

I am stuck at header. How to get the header info? please help

Read only

Former Member
0 Likes
927

copied the function module and changed it to suit my needs.