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

conversion error

Former Member
0 Likes
1,104

Hi,

plz any body suggest i am converting spread to excel where if for unit of measure if i am giving getting the error

"Error during conversion field type conflict"

my form is below plz suggest where its going wrong

any help is highly appreciated

FORM APPEND_SPREAD_TO_XLS .

DATA: p_infile type string.

p_infile = p_file1.

LOOP AT I_SPREADSHEET INTO WA_SPREADSHEET.

WA_FINAL-BID = TEXT-004.

WA_FINAL-ITEM = TEXT-005.

WA_FINAL-DATA = TEXT-006.

WA_FINAL-DOC = SPACE.

WA_FINAL-INDEX = WA_SPREADSHEET-INDEX.

WA_FINAL-LINE = 'D'.

WA_FINAL-SPAC1 = SPACE.

WA_FINAL-chgkey = 'I'.

WA_FINAL-SPAC2 = SPACE.

WA_FINAL-INDEX1 = WA_SPREADSHEET-INDEX.

WA_FINAL-SPAC4 = SPACE.

WA_FINAL-ITDESC = TEXT-007.

WA_FINAL-PROTYP = '1'.

WA_FINAL-PRODESC = TEXT-008.

WA_FINAL-MATNR = WA_SPREADSHEET-MATNR.

WA_FINAL-MAKTX = WA_SPREADSHEET-MAKTX.

WA_FINAL-MATKL = WA_SPREADSHEET-MATKL.

WA_FINAL-WGBEZ60 = WA_SPREADSHEET-WGBEZ60.

WA_FINAL-SPAC5 = SPACE.

wa_final-DDATE = '00/00/0000'.

WA_FINAL-DTIME = '0:00:00'.

WA_FINAL-FDAT = '00/00/0000'.

WA_FINAL-TDAT = '00/00/0000'.

WA_FINAL-QTY = WA_SPREADSHEET-MENGE.

  • WA_FINAL-MEINS = WA_SPREADSHEET-MEINS.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'

EXPORTING

input = WA_SPREADSHEET-MEINS

MPORTING

OUTPUT = WA_FINAL-MEINS.

WA_FINAL-PUNIT = SPACE.

WA_FINAL-CURRY = 'USD'.

wa_final-proid = wa_SPREADSHEET-matnr.

APPEND WA_FINAL TO I_FINAL.

ENDLOOP.

CLEAR I_MATERIAL.

REFRESH I_MATERIAL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = P_INFILE

FILETYPE = 'ASC'

APPEND = 'X'

WRITE_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = I_FINAL.

IF SY-SUBRC = 0.

ENDIF.

ENDFORM. " APPEND_SPREAD_TO_XLS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
984

HI

declare the MEINS type t006a-msehi and then try

Regards

Shiva

6 REPLIES 6
Read only

Former Member
0 Likes
986

HI

declare the MEINS type t006a-msehi and then try

Regards

Shiva

Read only

Former Member
0 Likes
984

Hi,

You used the Function module

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'

EXPORTING

input = WA_SPREADSHEET-MEINS

MPORTING

OUTPUT = WA_FINAL-MEINS.

Goto SE37 and give this function module and press display, then see the Input and Output strucutres, you need to give the same data type

Regards

Sudheer

Read only

Former Member
0 Likes
984

Hi sudheer and shiva,

thanks for the replies where actually i have to declare meins

because already both wa_final and i_final represents the same internal table

BEGIN OF T_FINAL,

BID(30) TYPE C,

ITEM(15) TYPE C,

DATA(30) TYPE C,

DOC(30) TYPE C,

INDEX(3) TYPE C,

LINE(1) TYPE C,

SPAC1(10) TYPE C,

chgkey(1) TYPE C,

SPAC2(10) TYPE C,

INDEX1(3) TYPE C,

SPAC4(10) TYPE C,

ITDESC(30) TYPE C,

PROTYP(1) TYPE C,

PRODESC(30) TYPE C,

MATNR TYPE MARA-MATNR, "Material Number

MAKTX TYPE MAKT-MAKTX, "Material description

MATKL TYPE MARA-MATKL, "Material group

WGBEZ60 TYPE T023T-WGBEZ60, "Material grp Desc.

SPAC5(10) TYPE C,

ddate type d,

dtime type t,

fdat type d,

tdat type d,

qty(3) type c,

MEINS TYPE MARA-MEINS, "Base Unit of Measure

punit(10) type c,

curry(3) type c,

proid type mara-matnr,

END OF T_FINAL.

plz suggest so urgent

Read only

0 Likes
984

declare meins as

meins(3) type c,

rather than referring to MARA-MEINS.

Read only

0 Likes
984

Hi srinivas,

I tried declaring meins as type c but getting the same error

plz let e know where its going wrong

Read only

0 Likes
984

declare all the fields in your internal table I_FINAL

as type c ...