Application Development and Automation 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: 
Read only

Error in FM- help me

Former Member
0 Likes
2,012

Hi Experts

I am using the following code, but am getting the error message as,

UC_OBJECTS_NOT_CONVERTIBLE

What could be the reason, pls anyone help me.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\ '

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITAB

EXCEPTIONS

CONVERSION_ERROR = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7

.

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 in advance.

Regards

Rajaram

Hi Experts

I am using the following code, but am getting the error message as,

UC_OBJECTS_NOT_CONVERTIBLE

What could be the reason, pls anyone help me.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\ '

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITAB

EXCEPTIONS

CONVERSION_ERROR = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7

.

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 in advance.

Regards

Rajaram

15 REPLIES 15
Read only

Former Member
0 Likes
1,962

hi there....

you are not specifying any file name in the function module. iun abap it is not possible to upload a directory in its entirety. which is something ur code is trying to do. correct it and the error will resolve.

do reward if helpful or get bak with further issues.

Read only

0 Likes
1,962

Hi Prem

I tried the following code also,

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\sample.txt'

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITAB

EXCEPTIONS

CONVERSION_ERROR = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7

.

IF SY-SUBRC <> 0.

but still am getting the same error as follows,

Data objects in a Unicode program are not convertible.

What could be the reason, pls advise me.

Read only

0 Likes
1,962

can u try with a different file type or leave that blank (default)

Read only

0 Likes
1,962

Hi Raja,

in SAP, whenever you use single quotes, u need to specify everything in capitals. one thing....

another thing is the file type is DAT which i think should be TXT. try these out and lemme know if problem solves or not.

Read only

0 Likes
1,962

Hi Prem

I have tried ur suggestion like

FILENAME = 'C:\SAMPLE.TXT'

FILETYPE = 'DAT'

but still its showing the same error and also tells that

E12: duplicate child ID : 'UPLD'

What it means actually.

Pls explain me.

Read only

0 Likes
1,962

did u chk the upper post... i have mentioned that for DAT file type, u need to put in the tab spaces.. hav u used that....???

Read only

0 Likes
1,962

Hi Prem

I have used and i put the spaces between the fields also,

but still am getting the same error yar.

help me pls.

Read only

Former Member
0 Likes
1,962

What is your input file data and ITAB fields?

Check if they are compatible.

Read only

0 Likes
1,962

compatible means, i cant get you.

Read only

0 Likes
1,962

This is my itab fields, and i have flat file also in the same order.

DATA : BEGIN OF ITAB OCCURS 0,

BLDAT LIKE BKPF-BLDAT, " Document Date

BUKRS LIKE BKPF-BUKRS, " Company Code

BUDAT LIKE BKPF-BUDAT,

PRCTR LIKE COBL-PRCTR,

ZUONR LIKE BSEG-ZUONR,

WAERS LIKE BKPF-WAERS,

MONAT LIKE BKPF-MONAT,

BUPLA LIKE BSEG-BUPLA,

BLART LIKE BKPF-BLART, "Type

XBLNR LIKE BKPF-XBLNR, "Reference

BKTXT LIKE BKPF-BKTXT, "Document Header Text

NEWBS LIKE RF05A-NEWBS,"Posting Key

NEWKO LIKE RF05A-NEWKO,"Account

NEWUM LIKE RF05A-NEWUM,"Special GL Indicator

WRBTR LIKE BSEG-DMBTR, "Amount

GSBER LIKE BSEG-GSBER, "Business Area

SGTXT LIKE BSEG-SGTXT, "Long Text

ZTERM LIKE BSEG-ZTERM, "Payment terms

ZFBDT LIKE BSEG-ZFBDT, "Baseline date

END OF ITAB.

Read only

0 Likes
1,962

hi ..

following are the various file types allowed.....

File type (ASCII, binary ...)

Possible values

'ASC' : ASCII file

The file is loaded line by line in the transferred table and this should have one-column and be of the type C. The file size is returned in the parameter FILELENGTH.

'TRU' : ASCII file + line wrap

If a line in a file does not fit into a row in a table, then the row is filled completely, and the rest of the line is written to the next row in the table. Words are not split, instead they are put into the next row of the table.

'BIN' : Binary file

The file is loaded into the transferred table which should have one-column and be of the type X. The table is filled line by line in this case. In this case, the last line need not necessarily be completely filled. For this reason, the parameter FILELENGTH must be used during further processing. The table may be a maximum of 1022 characters 'wide'!

'DAT' : ASCII file with tab formatting

The file is loaded line by line into the transferred table. Tabs in the file mean a change of field.

The file size is returned in the parameter FILELENGTH.

chk if these help.

Read only

0 Likes
1,962

Can you tell me what does your internal table looks like?

Also i want to see the data which you are trying to upload.

Read only

0 Likes
1,962

hi

the internal table is given above and if you want the flat file tell me ur mail id, i will send to you.,

pls help me.

Read only

JoffyJohn
Active Contributor
0 Likes
1,962

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = ' '

FILETYPE = 'DAT'

TABLES

DATA_TAB = IT_PROG.

This is the right way of using this function module

If you wish to pass the file name

declare a variable

filename and pass that field to the function module.

eg:

constants:filename type rlgrap-filename value '
p33440\Server\GeoLocation\Documentation\ZIP\Z5gold_short1.txt'.

Read only

JoffyJohn
Active Contributor
0 Likes
1,962

It seems this is caused by a program which is not UNICODE compatible.

pls check this link to get more idea[http://www.sapfans.com/forums/viewtopic.php?p=571614&sid=246b47c08f64240c5bec296d6f7d4252]