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

Problem in ALV using classes

Former Member
0 Likes
285

HI everyone

I have done a ALV using classes. the ALV is working perfectly but when i go to the print preview the columns are collapsing.the code is

g_repid = sy-repid.

IF custom_container1 IS INITIAL.

*----


DATA: splitter TYPE REF TO cl_gui_splitter_container.

CREATE OBJECT splitter

EXPORTING parent = cl_gui_container=>screen0

rows = 1

columns = 1.

CALL METHOD splitter->set_border

EXPORTING

border = cl_gui_cfw=>false.

CALL METHOD splitter->set_column_mode

EXPORTING

mode = splitter->mode_absolute.

custom_container1 = splitter->get_container( row = 1 column = 1 ).

*----


CREATE OBJECT grid1

EXPORTING i_parent = custom_container1.

IF sto = 'X' .

gs_layout-grid_title = 'Stock Transfer Order Status report'.

ELSE.

gs_layout-grid_title = 'Sales order Status report'.

ENDIF.

gs_layout-zebra = 'X'.

gs_layout-cwidth_opt = 'X'.

gs_layout-no_totline = 'X'.

gs_prnt-reservelns = '2'.

PERFORM prepare_field_catalog CHANGING gt_fieldcat[].

CALL METHOD grid1->set_table_for_first_display

EXPORTING

is_layout = gs_layout

is_print = gs_prnt

it_toolbar_excluding = it_toolbar_excluding

CHANGING

it_fieldcatalog = gt_fieldcat[]

it_sort = gt_sort[]

it_outtab = it_final[].

CALL METHOD grid1->set_toolbar_interactive.

CALL METHOD cl_gui_control=>set_focus

EXPORTING

control = grid1.

ENDIF.

plz help me out. it's very urgent

regards

kishore

1 REPLY 1
Read only

sridhar_k1
Active Contributor
0 Likes
253

columns collapsing, u mean cloumn size shrinking? then set IS_PRINT-NO_COLWOPT to X when calling SET_TABLE_FOR_FIRST_DISPLAY.

Regards

Sridhar