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: 

Download Itab data into excel file on presentation server

Former Member
0 Kudos
337

Hi All,

Actualy i want to download the internal table data into excel file onto presentation server by using this function module SAP_CONVERT_TO_XLS_FORMAT. But i got runtime error like - type conflict when calling function module . ND m using to p_file path name nd itab within dis fun module

plz let me know how to solve .

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
161

Hi Suraj,

Check filepath type.I think there have mismatch between fiel path type in FM and ur Parameter for file path.

Thanks

tarak

4 REPLIES 4

Former Member
0 Kudos
162

Hi Suraj,

Check filepath type.I think there have mismatch between fiel path type in FM and ur Parameter for file path.

Thanks

tarak

gouravkumar64
Active Contributor
0 Kudos
161

Hi,

Can You paste your code?

Thanks

Gourav.

0 Kudos
161

Actuly i define

p file type  rlgrap-filename

lvfile type string

call function 'f4_filename'

exporting

program name = SYST-cprog

filed name = p_file.

call function sap convert to xls format

export

i field srperator = lvfile

table

i tab sap data = it mata

Former Member
0 Kudos
161

check below code.

DATA : BEGIN OF t_header OCCURS 0,

       name(40) TYPE c,

       END OF t_header.

CLEAR t_header.

t_header-name = 'Client'.

APPEND t_header.

t_header-name = 'Plant Code'.

APPEND t_header.

t_header-name = 'Product Code'.

APPEND t_header.

t_header-name = 'Product Description'.

APPEND t_header.

t_header-name = 'Base UM'.

APPEND t_header.

t_header-name = 'Inner Pack'.

APPEND t_header.

t_header-name = 'Outer Pack'.

APPEND t_header.

t_header-name = 'Ship Pack'.

APPEND t_header.

t_header-name = 'Lst Upd Dt'.

APPEND t_header.

t_header-name = 'Lst Upd By'.

APPEND t_header.

t_header-name = 'Ext date'.

APPEND t_header.

t_header-name = 'Ext Time'.

APPEND t_header.

t_header-name = 'Ext By'.

APPEND t_header.

t_header-name = 'File Name'.

APPEND t_header.

loop at it_material.

CONCATENATE  '''' it_material-matnr into it_material-matnr.

modify it_material.

*clear it_material.

endloop.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

  EXPORTING

   I_FIELD_SEPERATOR          = 'X'

*   I_LINE_HEADER              = t_header

    i_filename                 = p_pcfile

*   I_APPL_KEEP                = ' '

  tables

    i_tab_sap_data             = it_material

* CHANGING

*   I_TAB_CONVERTED_DATA       =

EXCEPTIONS

   CONVERSION_FAILED          = 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.

Thanks

Tarak