Skip to Content
0
Former Member
Mar 13, 2007 at 02:18 PM

Run Time error in ALV report

16 Views

Dear friends

When I try to run the following code, I keep getting a message that says

"The field "GT_FIELD" specified here has a different field type.".

I have run this in many occassions and it has worked before. I would appreciate if some one can help me with this. Following is the code

-


CODE FOLLOWS----


REPORT ZSAPMZRFT_ZWMSCHED_REPORT MESSAGE-ID zrammessage LINE-SIZE 168

LINE-COUNT 20(6) NO STANDARD PAGE HEADING.

TABLES: zwmsched,

zwmwave.

Data : v_repid LIKE sy-repid,

BEGIN OF s_zwmsched occurs 1,

mandt LIKE zwmsched-mandt,

werks LIKE zwmsched-werks,

lgnum LIKE zwmsched-lgnum,

ship_date LIKE zwmsched-ship_date,

carrier LIKE zwmsched-carrier,

vbeln LIKE zwmsched-vbeln,

kunnr LIKE zwmsched-kunnr,

custname LIKE zwmsched-custname,

city LIKE zwmsched-city,

state LIKE zwmsched-state,

zip LIKE zwmsched-zip,

qty LIKE zwmsched-qty,

uom LIKE zwmsched-uom,

wt LIKE zwmsched-wt,

wt_uom LIKE zwmsched-wt_uom,

volumn LIKE zwmsched-volumn,

vol_uom LIKE zwmsched-vol_uom,

inco LIKE zwmsched-inco,

equipment LIKE zwmsched-equipment,

door LIKE zwmsched-door,

wavenum LIKE zwmsched-wavenum,

load_seq LIKE zwmsched-load_seq,

notes LIKE zwmsched-notes,

pick_stat LIKE zwmsched-pick_stat,

load_stat LIKE zwmsched-load_stat,

bol_stat LIKE zwmsched-bol_stat,

mbol LIKE zwmsched-mbol,

seal LIKE zwmsched-seal,

gm_status LIKE zwmsched-gm_status,

createdate LIKE zwmsched-createdate,

created_by LIKE zwmsched-created_by,

changedate LIKE zwmsched-changedate,

changed_by LIKE zwmsched-changed_by,

END of s_zwmsched,

Begin of temp_zwmsched occurs 1,

so_lgnum LIKE zwmsched-lgnum,

so_vbeln LIKE zwmsched-vbeln,

pa_date LIKE zwmsched-ship_date,

pa_wvno LIKE zwmsched-wavenum,

pa_door LIKE zwmsched-door,

carrier LIKE zwmsched-carrier,

pickstat LIKE zwmsched-pick_stat,

mbol LIKE zwmsched-mbol,

loadstat LIKE zwmsched-load_stat,

bol_stat LIKE zwmsched-bol_stat,

pgi_stat LIKE zwmsched-gm_status,

end of temp_zwmsched.

TYPE-POOLS : slis.

DATA :

gt_field TYPE slis_t_fieldcat_alv,

wa_field TYPE slis_fieldcat_alv,

gt_layout TYPE slis_layout_alv.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

SELECT-OPTIONS: so_lgnum FOR zwmsched-lgnum,

so_vbeln FOR zwmsched-vbeln,

pa_date FOR zwmsched-ship_date,

pa_wvno FOR zwmsched-wavenum,

pa_door FOR zwmsched-door,

carrier FOR zwmsched-carrier,

pickstat FOR zwmsched-pick_stat,

mbol FOR zwmsched-mbol.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK block1.

SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-002.

SELECTION-SCREEN SKIP.

PARAMETERS: loadstat LIKE zwmsched-load_stat,

bol_stat LIKE zwmsched-bol_stat,

pgi_stat LIKE zwmsched-gm_status.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK block2.

select * from zwmsched into corresponding fields of table temp_zwmsched

where

lgnum in so_lgnum AND

vbeln in so_vbeln AND

ship_date in pa_date AND

wavenum in pa_wvno AND

door in pa_door AND

carrier in carrier AND

pick_stat in pickstat AND

mbol in mbol AND

load_stat = loadstat AND

bol_stat = bol_stat AND

gm_status = pgi_stat.

wa_field-col_pos = 1.

wa_field-tabname = 'ZWMSCHED'.

wa_field-fieldname = 'LGNUM'.

wa_field-seltext_l = 'WARE HOUSE'.

wa_field-outputlen = 11.

APPEND wa_field TO gt_field.

*wa_field-col_pos = 2.

*wa_field-fieldname = 'VBELN'.

*wa_field-seltext_l = 'DELIVERY'.

*wa_field-outputlen = 10.

*APPEND wa_field TO gt_field.

*wa_field-col_pos = 3.

*wa_field-fieldname = 'SHIP_DATE'.

*wa_field-seltext_l = 'SHIP DATE'.

*wa_field-outputlen = 11.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 4.

*wa_field-fieldname = 'WAVENUM'.

*wa_field-seltext_l = 'WAVENUM'.

*wa_field-outputlen = 11.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 5.

*wa_field-fieldname = 'DOOR'.

*wa_field-seltext_l = 'DOOR'.

*wa_field-outputlen = 5.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 6.

*wa_field-fieldname = 'CARRIER'.

*wa_field-seltext_l = 'CARRIER'.

*wa_field-outputlen = 8.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 7.

*wa_field-fieldname = 'PICK_STAT'.

*wa_field-seltext_l = 'PICK STAT'.

*wa_field-outputlen = 10.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 8.

*wa_field-fieldname = 'MBOL'.

*wa_field-seltext_l = 'MBOL'.

*wa_field-outputlen = 5.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 9.

*wa_field-fieldname = 'LOAD_STAT'.

*wa_field-seltext_l = 'LOAD STAT'.

*wa_field-outputlen = 10.

*APPEND wa_field TO gt_field.

*

*wa_field-col_pos = 10.

*wa_field-fieldname = 'BOL_STAT'.

*wa_field-seltext_l = 'BOL STAT'.

*wa_field-outputlen = 11.

*APPEND wa_field TO gt_field.

*wa_field-col_pos = 11.

*wa_field-fieldname = 'GM_STATUS'.

*wa_field-seltext_l = 'PFI STAT'.

*wa_field-outputlen = 9.

*APPEND wa_field TO gt_field.

gt_layout-zebra = 'X'.

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = v_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = gt_field

  • IT_FIELDCAT = gt_layout

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_ADD_FIELDCAT =

  • IT_HYPERLINK =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IT_EXCEPT_QINFO =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = temp_zwmsched

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.