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: 

bdc problem

Former Member
0 Kudos

hi this is my first bdc prog,, i am unable to sort out what the problem,, error message is itab is not compatible with formal parameter "data_itab",,pls help me out points will be rewarded...

REPORT ZSAMPLEBDC .

tables :kna1.

data : begin of itab occurs 0,

kunnr like kna1-kunnr,

name1 like kna1-name1,

land1 like kna1-land1,

end of itab.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

FILENAME = 'c:\praveen.txt'

FILETYPE = 'asc'

CHANGING

data_tab = itab.

loop at itab.

write :/tab.

endloop.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

in ur gui download function module pass internal table body not work area.

for ex: if internal table is with out header line u have to pass body of taht internal table and if internal table is with header line then give internal table name.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

FILENAME = 'c:\praveen.txt'

FILETYPE = 'asc'

CHANGING

data_tab = itab[]. ///////// when internal table is with out header line.

and data_tab = itab //// when internal table is with header line.

if helpful reward some points.

with regards,

Suresh.A

3 REPLIES 3

Former Member
0 Kudos

Hello Praveen,

You need to change internal table declaration,

see the below link:

Thanks

Seshu

gopi_narendra
Active Contributor
0 Kudos

Try to use like this the internal table declaration

REPORT ZSAMPLEBDC .

tables :kna1.

types : begin of ty_itab,
          kunnr like kna1-kunnr,
          name1 like kna1-name1,
          land1 like kna1-land1,
        end of ty_itab.

data : itab type table of ty_itab, " Internal table
       ltab type ty_itab. " Work Area

CALL METHOD cl_gui_frontend_services=>gui_upload
  EXPORTING
    FILENAME = 'c:praveen.txt'
    FILETYPE = 'asc'
  CHANGING
    data_tab = itab.

loop at itab.
  write :/tab.
endloop.

Since that you are using classes, you can not use Header Line.

Regards

Gopi

Former Member
0 Kudos

hi,

in ur gui download function module pass internal table body not work area.

for ex: if internal table is with out header line u have to pass body of taht internal table and if internal table is with header line then give internal table name.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

FILENAME = 'c:\praveen.txt'

FILETYPE = 'asc'

CHANGING

data_tab = itab[]. ///////// when internal table is with out header line.

and data_tab = itab //// when internal table is with header line.

if helpful reward some points.

with regards,

Suresh.A