2008 Mar 05 9:37 AM
Hello !
I have done a material migration program with FM MATERIAL_MAINTAIN_DARK. The program integrate the basic data, and then each view one by one.
It works fine except with material with internal number. It creats the basic data but when i use the number generated to create the other view i get this message :
No external number assignment possible for mat. type GENERIC MATERIALS
I found this field in mara_ueb : KZ_MAT_RES
But when i put X in it, it returns that i forgot mandatory data. So I tried to select the data already in MARA and MAKT, but now the message is that the material already exist ! It is true but I want to create another view.
Here's a piece of my code to help you to understand, the commentary part is what I tried to do to resolved my problem :
ADD 1 TO v_count.
ADD 1 TO v_line.
MOVE v_line TO v_line_c.
*---MARA
MOVE sy-mandt TO t_mara_ueb-mandt.
MOVE 'MM01' TO t_mara_ueb-tcode.
MOVE v_count TO t_mara_ueb-tranc.
MOVE k_purcha TO t_mara_ueb-vpsta.
SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
AND envop = space.
IF sy-subrc = 0.
TABLES : mara, makt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_data_pur-matnr
IMPORTING
OUTPUT = t_data_pur-matnr.
*
*
SELECT SINGLE * FROM mara WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING mara TO t_mara_ueb.
*
SELECT SINGLE * FROM makt WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING makt TO t_makt_ueb.
MOVE 'X' TO t_mara_ueb-KZ_MAT_RES.
ENDIF.
MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
APPEND t_mara_ueb.
*---MARC
MOVE sy-mandt TO t_marc_ueb-mandt.
MOVE v_count TO t_marc_ueb-tranc.
MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
MOVE t_data_pur-werks TO t_marc_ueb-werks.
MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
APPEND t_marc_ueb.
*---!!! Call FUNCTION MODULE !!!
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
FLAG_MUSS_PRUEFEN = 'X'
SPERRMODUS = 'E'
MAX_ERRORS = 0
p_kz_no_warn = 'X'
kz_prf = space
KZ_VERW = 'X'
KZ_AEND = 'X'
KZ_DISPO = 'X'
kz_test = lv_test
NO_DATABASE_UPDATE = ' '
call_mode = ' ' "OR RMD OR space OR BAP
CALL_MODE2 = ' '
user = sy-uname
SUPPRESS_ARRAY_READ = ' '
FLG_MASS = ' '
IMPORTING
matnr_last = lv_matnr
number_errors_transaction = lv_nb_error
TABLES
amara_ueb = t_mara_ueb
amakt_ueb = t_makt_ueb
amarc_ueb = t_marc_ueb
amard_ueb = t_mard_ueb
AMFHM_UEB =
AMARM_UEB =
AMEA1_UEB =
ambew_ueb = t_mbew_ueb
asteu_ueb = t_steu_ueb
ASTMM_UEB =
amlgn_ueb = t_mlgn_ueb
amlgt_ueb = t_mlgt_ueb
AMPGD_UEB =
ampop_ueb = t_mpop_ueb
AMVEG_UEB =
AMVEU_UEB =
amvke_ueb = t_mvke_ueb
ALTX1_UEB =
AMPRW_UEB =
AMFIELDRES =
amerrdat = t_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
OTHERS = 7.
I really need you help !
thank you in advance.
Hello !
I have done a material migration program with FM MATERIAL_MAINTAIN_DARK. The program integrate the basic data, and then each view one by one.
It works fine except with material with internal number. It creats the basic data but when i use the number generated to create the other view i get this message :
No external number assignment possible for mat. type GENERIC MATERIALS
I found this field in mara_ueb : KZ_MAT_RES
But when i put X in it, it returns that i forgot mandatory data. So I tried to select the data already in MARA and MAKT, but now the message is that the material already exist ! It is true but I want to create another view.
Here's a piece of my code to help you to understand, the commentary part is what I tried to do to resolved my problem :
ADD 1 TO v_count.
ADD 1 TO v_line.
MOVE v_line TO v_line_c.
*---MARA
MOVE sy-mandt TO t_mara_ueb-mandt.
MOVE 'MM01' TO t_mara_ueb-tcode.
MOVE v_count TO t_mara_ueb-tranc.
MOVE k_purcha TO t_mara_ueb-vpsta.
SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
AND envop = space.
IF sy-subrc = 0.
TABLES : mara, makt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_data_pur-matnr
IMPORTING
OUTPUT = t_data_pur-matnr.
*
*
SELECT SINGLE * FROM mara WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING mara TO t_mara_ueb.
*
SELECT SINGLE * FROM makt WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING makt TO t_makt_ueb.
MOVE 'X' TO t_mara_ueb-KZ_MAT_RES.
ENDIF.
MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
APPEND t_mara_ueb.
*---MARC
MOVE sy-mandt TO t_marc_ueb-mandt.
MOVE v_count TO t_marc_ueb-tranc.
MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
MOVE t_data_pur-werks TO t_marc_ueb-werks.
MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
APPEND t_marc_ueb.
*---!!! Call FUNCTION MODULE !!!
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
FLAG_MUSS_PRUEFEN = 'X'
SPERRMODUS = 'E'
MAX_ERRORS = 0
p_kz_no_warn = 'X'
kz_prf = space
KZ_VERW = 'X'
KZ_AEND = 'X'
KZ_DISPO = 'X'
kz_test = lv_test
NO_DATABASE_UPDATE = ' '
call_mode = ' ' "OR RMD OR space OR BAP
CALL_MODE2 = ' '
user = sy-uname
SUPPRESS_ARRAY_READ = ' '
FLG_MASS = ' '
IMPORTING
matnr_last = lv_matnr
number_errors_transaction = lv_nb_error
TABLES
amara_ueb = t_mara_ueb
amakt_ueb = t_makt_ueb
amarc_ueb = t_marc_ueb
amard_ueb = t_mard_ueb
AMFHM_UEB =
AMARM_UEB =
AMEA1_UEB =
ambew_ueb = t_mbew_ueb
asteu_ueb = t_steu_ueb
ASTMM_UEB =
amlgn_ueb = t_mlgn_ueb
amlgt_ueb = t_mlgt_ueb
AMPGD_UEB =
ampop_ueb = t_mpop_ueb
AMVEG_UEB =
AMVEU_UEB =
amvke_ueb = t_mvke_ueb
ALTX1_UEB =
AMPRW_UEB =
AMFIELDRES =
amerrdat = t_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
OTHERS = 7.
I really need you help !
thank you in advance.
2008 Mar 05 10:17 AM
OK I found the answer !
It is because the matnr generate add 00000... before the number. So I have to add it for the other view. But it is not the case for material number define externally. And the message was not comprensive.
*---MARA
MOVE sy-mandt TO t_mara_ueb-mandt.
MOVE 'MM01' TO t_mara_ueb-tcode.
MOVE v_count TO t_mara_ueb-tranc.
MOVE k_purcha TO t_mara_ueb-vpsta.
SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
AND envop = space.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_data_pur-matnr
IMPORTING
output = t_data_pur-matnr.
ENDIF.
MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
APPEND t_mara_ueb.
*---MARC
MOVE sy-mandt TO t_marc_ueb-mandt.
MOVE v_count TO t_marc_ueb-tranc.
MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
MOVE t_data_pur-werks TO t_marc_ueb-werks.
MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
APPEND t_marc_ueb.
Edited by: Louis-Arnaud Bouquin on Mar 5, 2008 3:04 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |