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

alv

Former Member
0 Likes
490

plz send any one alv report?

plz send any one alv report?

3 REPLIES 3
Read only

Former Member
0 Likes
467

hi Radhika,

factory method

&----


*

*& Form report_display

&----


----


  • -->P_IT_QUAN output table for billing and quantity

----


form report_display using p_it_outtab type any table. " ALV output

" table

data: ob_table type ref to cl_salv_table,

ob_salv_msg type ref to cx_salv_msg,

ob_functions type ref to cl_salv_functions,

ob_columns type ref to cl_salv_columns_table,

ob_column type ref to cl_salv_column_table,

ob_display type ref to cl_salv_display_settings,

it_columns type salv_t_column_ref,

wa_columns like line of it_columns,

v_long_text type scrtext_l,

v_max_length type lvc_outlen,

v_output_length type lvc_outlen.

  • Get the columns <b>(u can use as many colums</b>

ob_columns = ob_table->get_columns( ).

  • Service order number

try.

  • Set the column header for field Messages

ob_column ?= ob_columns->get_column( 'AUFNR' ).

ob_column->set_short_text( text-010 ).

ob_column->set_medium_text( text-011 )."Medium text

ob_column->set_long_text( text-011 ). " Long text

catch cx_salv_not_found.

message e000(zfi1) with ob_salv_msg->msgv1

ob_salv_msg->msgv2

ob_salv_msg->msgv3

ob_salv_msg->msgv4.

endtry.

  • Material number

  • For header display

ob_display = ob_table->get_display_settings( ).

ob_display->set_striped_pattern( cl_salv_display_settings=>true ).

ob_display->set_list_header(

text-026 ).

endif.

hpoe this will help u

Amit

*Purchase document number

try.

  • Set the column header for field Messages

ob_column ?= ob_columns->get_column( 'EBELN' ).

ob_column->set_short_text( text-028 ).

ob_column->set_medium_text( text-029 )."Medium text

ob_column->set_long_text( text-034 ). " Long text

catch cx_salv_not_found.

message e000(zfi1) with ob_salv_msg->msgv1

ob_salv_msg->msgv2

ob_salv_msg->msgv3

ob_salv_msg->msgv4.

endtry.

it_columns = ob_columns->get( ).

clear: ob_column ,wa_columns.

loop at it_columns into wa_columns.

ob_column ?= wa_columns-r_column.

  • Set the output length to the long text length of the heading

v_long_text = ob_column->get_long_text( ).

v_max_length = strlen( v_long_text ).

v_output_length = ob_column->get_output_length( ).

if v_output_length lt v_max_length.

ob_column->set_output_length( v_max_length ).

endif.

clear :wa_columns.

endloop.

  • Check if quantity report is selected

if p_quan = c_true.

  • For header display

ob_display = ob_table->get_display_settings( ).

ob_display->set_striped_pattern( cl_salv_display_settings=>true ).

ob_display->set_list_header(

text-027 ).

endif.

  • Set all basic functions

ob_functions = ob_table->get_functions( ).

ob_functions->set_all( if_salv_c_bool_sap=>true ).

  • Display the ALV grid

ob_table->display( ).

Edited by: Amit Kumar on Jul 4, 2008 1:29 PM

Read only

Former Member
0 Likes
467

Hello,

To learn about the ALV grid I suggest you to read the following: [An easy reference to the ALV Grid|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907].

Regards.