03-10-2021 9:42 AM
Message no. UX899
The sending and receiving fields have conflicting types. The receiving field has type P. Value MARC-DISMM was supposed to be transferred to this field, but this conflicts with the type definition for the receiving field.
The incorrect field is field 1 of the receiver structure. Record 22 of the input file contains an error.
Conversion to the SAP format is terminated.
Correct the data in the input file.
can you please help me to slovet his problem.
report ZMM_MATERIAL1
no standard page heading line-size 255.
type-pools truxs.
data : it_bdcdata type table of bdcdata,
wa_bdcdata type bdcdata,
it_messtab type table of bdcmsgcoll,
wa_messtab type bdcmsgcoll.
data : ls_bdcdata type bdcdata.
data : p_mode type ctu_params-dismode value 'E'.
data : name(100) type c.
data : it_type type truxs_t_text_data.
types : begin of ty_bdc,
materialno TYPE rmmg1-matnr,
industrysector TYPE rmmg1-mbrsh,
materialtype TYPE rmmg1-mtart,
plant TYPE rmmg1-werks,
storageloc TYPE rmmg1-lgort,
salesorg TYPE rmmg1-vkorg,
distributionchannel TYPE rmmg1-vtweg,
materialdes TYPE makt-maktx,
uom TYPE mara-meins,
materialgrp TYPE mara-matkl,
generalitem TYPE mara-MTPOS_MARA,
weightunit TYPE mara-gewei,
cashdis TYPE mvke-sktof,
tax TYPE MG03STEUER-TAXKM,
purchasegrp TYPE marc-ekgrp,
mrp TYPE marc-dismm,
valuationclass TYPE mbew-bklas,
priceunit TYPE mbew-peinh,
movingavg TYPE mbew-verpr,
checkinggrp TYPE marc-mtvfp,
transportationgrp TYPE mara-tragr,
loadinggrp TYPE marc-ladgr,
END OF ty_bdc.
DATA : it_prp TYPE TABLE OF ty_bdc,
wa_prp TYPE ty_bdc.
data : it_raw type truxs_t_text_data.
selection-screen begin of block a1 with frame title text-001.
parameter : p_prp type rlgrap-filename.
selection-screen end of block a1.
at selection-screen on value-request for p_prp.
call function 'F4_FILENAME'
exporting
field_name = 'P_FILE'
importing
file_name = p_prp.
start-OF-SELECTION.
call function 'TEXT_CONVERT_XLS_TO_SAP'
exporting
i_line_header = 'X'
i_tab_raw_data = it_type
i_filename = p_prp
tables
i_tab_converted_data = it_prp
exceptions
conversion_failed = 1
others = 2 .
if sy-subrc ne 0.
message id sy-msgid
type sy-msgty
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at it_prp INTO wa_prp.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'=AUSW'.
perform bdc_field using 'RMMG1-MBRSH'
wa_prp-industrysector.
perform bdc_field using 'RMMG1-MTART'
wa_prp-materialtype.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(12)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(12)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-VTWEG'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
wa_prp-plant.
perform bdc_field using 'RMMG1-LGORT'
wa_prp-storageloc.
perform bdc_field using 'RMMG1-VKORG'
wa_prp-salesorg.
perform bdc_field using 'RMMG1-VTWEG'
wa_prp-distributionchannel.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
wa_prp-materialdes.
perform bdc_field using 'BDC_CURSOR'
'MARA-MATKL'.
perform bdc_field using 'MARA-MEINS'
wa_prp-uom.
perform bdc_field using 'MARA-MATKL'
wa_prp-materialgrp.
perform bdc_field using 'MARA-MTPOS_MARA'
wa_prp-generalitem.
perform bdc_field using 'MARA-GEWEI'
wa_prp-weightunit.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARA-MATKL'
'00104'.
perform bdc_field using 'MVKE-SKTOF'
wa_prp-cashdis.
perform bdc_field using 'BDC_CURSOR'
'MG03STEUER-TAXKM(02)'.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
wa_prp-tax.
perform bdc_field using 'MG03STEUER-TAXKM(02)'
wa_prp-tax.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'BDC_CURSOR'
'MG03STEUER-TAXKM(03)'.
perform bdc_field using 'MG03STEUER-TAXKM(03)'
wa_prp-tax.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARA-MATKL'
'00104'.
perform bdc_field using 'MVKE-SKTOF'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'BDC_CURSOR'
'MARC-EKGRP'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARC-EKGRP'
wa_prp-purchasegrp.
perform bdc_field using 'MARA-MATKL'
'00104'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARC-EKGRP'
'P01'.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISMM'.
perform bdc_field using 'MARC-DISMM'
wa_prp-mrp.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'BDC_CURSOR'
'MBEW-VERPR'.
perform bdc_field using 'MBEW-BKLAS'
wa_prp-valuationclass.
perform bdc_field using 'MBEW-PEINH'
wa_prp-priceunit.
perform bdc_field using 'MBEW-VERPR'
wa_prp-movingavg.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARA-GEWEI'
'KG'.
perform bdc_field using 'MARC-MTVFP'
wa_prp-checkinggrp.
perform bdc_field using 'BDC_CURSOR'
'MARC-LADGR'.
perform bdc_field using 'MARA-TRAGR'
wa_prp-transportationgrp.
perform bdc_field using 'MARC-LADGR'
wa_prp-loadinggrp.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARC-EKGRP'
'P01'.
perform bdc_field using 'MARA-MATKL'
'00104'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARC-EKGRP'
'P01'.
perform bdc_field using 'MARC-DISMM'
'ND'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
'bdc rec1'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MBEW-BKLAS'
'7920'.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
'10.00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'MM01'.
call transaction 'MM01' using it_bdcdata mode 'A' update 'S'.
clear :it_bdcdata.
clear :wa_prp.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0244 text
* -->P_0245 text
*----------------------------------------------------------------------*
form BDC_DYNPRO using program dynpro.
clear ls_bdcdata.
ls_bdcdata-program = program.
ls_bdcdata-dynpro = dynpro.
ls_bdcdata-dynbegin = 'X'.
append ls_bdcdata to it_bdcdata.
endform.
*&---------------------------------------------------------------------*
*& Form BDC_FIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0249 text
* -->P_0250 text
*-------------------------------------------------------*
form BDC_FIELD using fnam fval.
if fval <> ''.
clear ls_bdcdata.
ls_bdcdata-fnam = fnam.
ls_bdcdata-fval = fval.
append ls_bdcdata to it_bdcdata.
clear ls_bdcdata.
endif.
endform. " BDC_FIELD
03-10-2021 10:18 AM
03-10-2021 2:03 PM
You must pass only texts to screen fields.
A number is a text with numeric digits and optionally a decimal point and a sign.
DATA text TYPE c LENGTH 10.
DATA dismm TYPE marc-dismm VALUE '27.5'.
WRITE dismm TO text.
03-10-2021 3:13 PM
At which place we have to write the coding
DATAtextTYPEcLENGTH10.
DATA dismm TYPE marc-dismm VALUE'27.5'.
WRITE dismm TOtext.
03-11-2021 6:46 PM
It seems that you didn't understand my answer. For batch input, you must only pass text fields, never numeric fields. So convert numeric fields to text fields. WA_PRP-MRP is numeric. TEXT is text. For instance:
DATA text TYPE c LENGTH 100.
WRITE wa_prp-mrp TO text.
perform bdc_field using 'MARC-DISMM' text.