Skip to Content
0
Former Member
Aug 02, 2007 at 10:59 AM

syntax error in programme

20 Views

Please check this programme this gives syntax error...

&----


*& Report YTEST12 *

*& *

&----


*& *

*& *

&----


REPORT YTEST12 .

tables:mara.

data: begin of itab occurs 10,

matnr like mara-matnr,

mbrsh like mara-mbrsh,

mtart like mara-mtart,

meins like mara-meins,

end of itab.

DATA: ITAB1 like itab occurs 10 with header line.

DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.

data: ok-code like sy-ucomm.

DATA gs_layout TYPE lvc_s_layo.

DATA: go_grid TYPE REF TO cl_gui_alv_grid,

go_custom_container TYPE REF TO cl_gui_custom_container.

start-of-selection.

CALL screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

CREATE OBJECT go_custom_container

EXPORTING container_name = 'ALV_CONTAINER'.

CREATE OBJECT go_grid

EXPORTING

i_parent = go_custom_container.

PERFORM prepare_field_catalog CHANGING gt_fieldcat[].

PERFORM LAYOUT.

perform load_data.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Form load_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM load_data .

select matnr mbrsh mtart meins from mara into table itab1.

CALL METHOD go_grid->set_table_for_first_display

IMPORTING

*container_name = 'ALV_CONTAINER'.

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

is_layout = gs_layout.

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

*it_toolbar_excluding = pt_exclude "excluding toolbar functions

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

it_outtab = itab1[]

it_fieldcatalog = gt_fieldcat[]

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " load_data

&----


*& Form prepare_field_catalog

&----


  • text

----


  • <--P_GT_FIELDCAT[] text

----


FORM prepare_field_catalog CHANGING gt_fieldcat TYPE lvc_t_fcat.

DATA ls_fieldcat TYPE lvc_s_fcat.

ls_fieldcat-tabname = 'ITAB1'.

ls_fieldcat-fieldname = 'MATNR'.

ls_fieldcat-scrtext_m = 'MATERIAL'.

ls_fieldcat-col_pos = 1.

ls_fieldcat-outputlen = 10.

  • ls_fieldcat-emphasize = 'C400'.

  • ls_fieldcat-key = 'X'.

APPEND ls_fieldcat TO gt_fieldcat.

ls_fieldcat-tabname = 'ITAB1'.

ls_fieldcat-col_pos = 2.

ls_fieldcat-fieldname = 'MBRSH'.

ls_fieldcat-scrtext_m = 'INDUSTRY'.

  • ls_fieldcat-emphasize = 'C900'.

APPEND ls_fieldcat TO gt_fieldcat.

ls_fieldcat-tabname = 'ITAB1'.

ls_fieldcat-col_pos = 3.

ls_fieldcat-fieldname = 'MTART'.

ls_fieldcat-scrtext_m = 'TYPE'.

APPEND ls_fieldcat TO gt_fieldcat.

ls_fieldcat-tabname = 'ITAB1'.

ls_fieldcat-col_pos = 4.

ls_fieldcat-fieldname = 'MEINS'.

ls_fieldcat-scrtext_m = 'UNIT'.

APPEND ls_fieldcat TO gt_fieldcat.

ENDFORM. " prepare_field_catalog

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

CASE sy-ucomm.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form LAYOUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM LAYOUT .

gs_layout-stylefname = 'FIELD_STYLE'.

gs_layout-zebra = 'X'.

gs_layout-grid_title = 'MATERIAL'.

gs_layout-sel_mode = 'A'.

gs_layout-ctab_fname = 'COLORS'.

ENDFORM. " LAYOUT