Application Development 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: 

when i am execute my program gave a DUMP ( Type conflict in ASSIGN in program "SAPLSFES".)

former_member809080
Participant
0 Kudos


TYPES: BEGIN OF st_spfli,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
countryfr TYPE land1,
cityfrom TYPE s_from_cit,
END OF st_spfli.

TYPES: BEGIN OF it_header ,
HEADING TYPE STRING,

END OF it_header.

DATA: L_HEADER TYPE TABLE OF IT_HEADER,
WA_HEADER TYPE IT_HEADER.



DATA: WA_SPFLI TYPE ST_SPFLI,
IT_SPFLI TYPE TABLE OF ST_SPFLI,
P_FILE TYPE STRING.



SELECT-OPTIONS: s_carrid FOR wa_spfli-carrid .

PARAMETERS : s_file TYPE RLGRAP-filename.


at SELECTION-SCREEN on VALUE-REQUEST FOR s_file.

CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'S_FILE '
IMPORTING
FILE_NAME = S_FILE.
.



START-OF-SELECTION.


select carrid
connid
countryfr
cityfrom from spfli into TABLE it_spfli
WHERE carrid in s_carrid.


WRITE: / 'ID NAME ' , 'COUNTRY'.

loop at it_spfli INTO wa_spfli.

WRITE: / wa_spfli-carrid , wa_spfli-connid, wa_spfli-countryfr, wa_spfli-cityfrom .

ENDLOOP.


WA_HEADER-heading = 'ID NAME'.

APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'COUNTRY'.

APPEND WA_HEADER TO L_HEADER.






P_FILE = S_FILE.



CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING
* BIN_FILESIZE =
filename = P_FILE
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
* VIRUS_SCAN_PROFILE = '/SCET/GUI_DOWNLOAD'
* IMPORTING
* FILELENGTH =
tables
data_tab = IT_SPFLI
FIELDNAMES = L_HEADER
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

*
*
if SY-SUBRC = 0.

MESSAGE 'DATA DOWNLOAD SUCCESFULLY' TYPE 'I'.

ENDIF.
1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor
0 Kudos

Hi yadavdeep

Please make sure all your four columns has L_header as below. You have only two. Assign the remaining two as well.
WA_HEADER-heading = 'ID NAME'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CONN ID'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'COUNTRY'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CITY'.
APPEND WA_HEADER TO L_HEADER.
Regards,Venkat
7 REPLIES 7

venkateswaran_k
Active Contributor
0 Kudos

Hi yadavdeep

Please make sure all your four columns has L_header as below. You have only two. Assign the remaining two as well.
WA_HEADER-heading = 'ID NAME'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CONN ID'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'COUNTRY'.
APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CITY'.
APPEND WA_HEADER TO L_HEADER.
Regards,Venkat

0 Kudos

Dear Sir ,

i assigned remaining two columns in internal table.

i don't understand the meaning of DUMP

TYPE CONFLICT IN ASSIGN THE PROGRAM.

The Conflict in data and header .. The data has four columns and header was having only two cols. That is the reason.

0 Kudos

Dear sir ,

i already declared all the cols in my code .

then still give a dump.

0 Kudos

Hi yadavdeep

Do not pass .. Comment this, This is the type conflict.

FIELDNAMES                      = L_HEADER

former_member809080
Participant
0 Kudos






*&---------------------------------------------------------------------*
*& Report ZDY_DEMO5
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zdy_demo5.

TYPES: BEGIN OF st_spfli,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
countryfr TYPE land1,
cityfrom TYPE s_from_cit,
END OF st_spfli.

TYPES: BEGIN OF it_header ,
HEADING TYPE STRING,

END OF it_header.

DATA: L_HEADER TYPE TABLE OF IT_HEADER,
WA_HEADER TYPE IT_HEADER.



DATA: WA_SPFLI TYPE ST_SPFLI,
IT_SPFLI TYPE TABLE OF ST_SPFLI,
P_FILE TYPE STRING.



SELECT-OPTIONS: s_carrid FOR wa_spfli-carrid .

PARAMETERS : s_file TYPE RLGRAP-filename.


at SELECTION-SCREEN on VALUE-REQUEST FOR s_file.

CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'S_FILE '
IMPORTING
FILE_NAME = S_FILE.
.



START-OF-SELECTION.


select carrid
connid
countryfr
cityfrom from spfli into TABLE it_spfli
WHERE carrid in s_carrid.


WRITE: / 'ID NAME ' , 'COUNTRY'.

loop at it_spfli INTO wa_spfli.

WRITE: / wa_spfli-carrid , wa_spfli-connid, wa_spfli-countryfr, wa_spfli-cityfrom .

ENDLOOP.


WA_HEADER-heading = 'ID NAME'.

APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CONN ID'.

APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'COUNTRY'.

APPEND WA_HEADER TO L_HEADER.

WA_HEADER-heading = 'CITY'.

APPEND WA_HEADER TO L_HEADER.







P_FILE = S_FILE.



CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING
* BIN_FILESIZE =
filename = P_FILE
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
* VIRUS_SCAN_PROFILE = '/SCET/GUI_DOWNLOAD'
* IMPORTING
* FILELENGTH =
tables
data_tab = IT_SPFLI
FIELDNAMES = L_HEADER
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

*
*
if SY-SUBRC = 0.

MESSAGE 'DATA DOWNLOAD SUCCESFULLY' TYPE 'I'.

ENDIF.

Hi yadavdeep

The problem is with the table paramter you passed in gui_download (FIELDNAMES = L_HEADER).

You need not to pass this. It is optional, The type you define for L_HEADER and the type it expects in GUI_DOWNLOAD are not matching, that is why the dump,

You remove that line adn execute.

It will work

I tested here and it works.