Material Data Extend to New Plant
Hi,
This is understandable how to extend data to new plant; however, is there any way material master can be extended with whole range or material group or material can be extended individually only.
Thanks
hi
See you have to record the values through SHDB. The recording is send to ABAPER for BDC programme. This prog needs CSV, or tab delimited file with values which can be uploaded
Similar Messages
-
Error when I create the New material Master (MM01) for New Plant.
Dear experts,
I got the error when I create the New material Master (MM01) for New Plant.
Error: Valuation Area 2800 Not yet productive with Material Ledger.
So Pl send me the solution asap.
Venkata Raju KhottariHi,
Have u assinged Plant to Company code?
If u say no, use T.code OX18.
Regards,
Murali
Assign points if it is useful. -
Create/extend materials for new plant with new profit centers
Hi.
We have created a new plant and want to create/extend the materials from an existing plant to the new plant (with new profit center). Can this be done via MM17?
Regards,
KjetternHi Kjettern,
To extend the existing material to a new Plant/Profit centre, pls follow the following steps: -
1. Copy down the material number (i.e XYZ) you want to extend.
2. Go to t-code MM01.
3. Enter the material number (i.e. XYZ) you copied from (1) into the Material field and hit ENTER.
4. You will get an information on the bottom that "the material type XXX and the industry sector YYY has been copied from master record".
5. Pls note that Basic Data 1 & 2 is not changeable as the same set of material data will be used when a material is extended.
6. Hit ENTER again. To change other details other than Basic Data 1 & 2, select the views that you want.
7. You will be prompted to enter a Plant. Here you must enter the new Plant that you want to extend the material to and hit ENTER.
8. You will get a confirmation stating that the material already existed and will be extended (to the desired Plant u entered in (7)).
9. Ensure that all the data in all the important tabs are maintained, for the right Storage Location, Warehouse Num, Moving Average Price, Standard Price etc. before proceed further.
10. Hit Save. You will get a msg that "Material XYZ created".
Now you are able to use this material number in the new Plant you created.
Hope this helps.
Rgds. -
IDOC: Material master (Extend Plants)
I used LSMW IDOC option to migrate material master data (MATMAS):
- Basic views
- Description
- Costing
- Plant Stock
I want to extend the plant view (Plant Stock). What change do I do to original LSMW to extend plant?
How do I specify that I am extending?
Is it that function code at the beginning of IDOC?You can do this by writing a program:
REPORT zdmmm_mm_multiplant NO STANDARD PAGE HEADING
MESSAGE-ID zdmmm
LINE-SIZE 255.
TABLE DECLARATION *
TABLES: mara, "General Material Data
mard, "Storage location data
mdma, "MRP data for material
marc. "Plant Data for Material
include zdmmmr_dev00160_mm_multi_top.
include zdmmmr_dev00160_mm_multi_f00.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN.
IF NOT s_matnr[] IS INITIAL.
*Subroutine to perform the Material Number validation
PERFORM sub_validate_matnr.
ELSEIF p_ersda IS INITIAL.
MESSAGE e003 .
ENDIF.
IF NOT s_werks[] IS INITIAL.
Subroutine to perform the plant validation
PERFORM sub_validate_plant.
ENDIF.
START-OF-SELECTION
START-OF-SELECTION.
*To retrive all possible material numbers that have to be
*extended.
PERFORM sub_get_mara.
*To retrieve all possible plants to which the material needs
*to be extended.
IF s_werks IS INITIAL.
PERFORM sub_get_werks.
ENDIF.
*For retrieving Procurement status data from T134.
PERFORM sub_get_pstat.
*To determine the plants to which the Materials have
*already been extended.
PERFORM sub_get_marc.
*To determine all Storage Locations for individual Plants.
PERFORM sub_get_t001l.
*To retrieve company code
PERFORM sub_get_t001k.
*To determine the storage locations and plants to which the Material
*has already extended.
PERFORM sub_get_mard.
*To determine the MRP Areas to which the materials need to be extended.
PERFORM sub_get_mdlv.
*To determine the MRP Areas to which the materials already been extended.
PERFORM sub_get_mdma.
*To retrieve the MRP Area related data from customized table.
PERFORM sub_get_zdmmm_mrp_area.
*TO retrieve the Scalabilty info
PERFORM sub_get_scalability.
*For extending Material to Plant, all possible Storage Location and corresponding MRP Area .
PERFORM sub_mat_extn.
*For creating success and error log.
PERFORM sub_create_log.
*Text elements
001 Material/Plant Selection
002 No data found for given Selection.
003 Reference material is not maintained
004 Material is already extended to the plant
006 Material extended for MRP Area
007 Successfully extended
008 Already extended
009 Not a seviceable storage location,cannot be extended to MRP Area
*Selection texts
P_ERSDA Date
S_MATNR Material Number
S_WERKS Extend to Plant
*Messages
Message class: ZDMMM
*000 & & & &
*001 The material no. does not exist
*002 The plant does not exists.
*003 Enter either material no. or Creation date
*& Include ZDMMMR_MM_MULTI_TOP *
Types
*Type declaration to hold material no.
TYPES: BEGIN OF ty_matnr,
matnr TYPE matnr, "Material Number
mtart TYPE mtart, "Material Type
ersda TYPE ersda, "Creation date
mbrsh TYPE mbrsh, "Industry Sector
vkorg TYPE vkorg, "Sales Organization
vtweg TYPE vtweg, "Distribution Channel
mtartz TYPE zmtart, "Material Type (Customized)
END OF ty_matnr.
*Type declaration to hold plant.
TYPES: BEGIN OF ty_plant,
werks TYPE werks_d, "Plant
bwkey TYPE bwkey, "Valuation area
END OF ty_plant.
*Type declaration to hold data from marc.
TYPES: BEGIN OF ty_marc,
matnr TYPE matnr, "Material Number
werks TYPE werks_d, "Plant
bwkey TYPE bwkey,
END OF ty_marc.
*Type declaration to hold data from mard.
TYPES: BEGIN OF ty_mard,
matnr TYPE matnr, "Material Number
werks TYPE werks_d, "Plant
lgort TYPE lgort_d, "Storage Location
mtart TYPE mtart, "Material Type
END OF ty_mard.
*Type declaration to hold data from t001l.
TYPES: BEGIN OF ty_sloc,
werks TYPE werks_d, "Plant
lgort TYPE lgort_d, "Storage Location
END OF ty_sloc.
*Type declaration to hold data from mdlv.
TYPES: BEGIN OF ty_mdlv,
berid TYPE berid, "MRP Area
werzg TYPE werks_d, "Plant
ortzg TYPE lgort_d, "Storage Location
END OF ty_mdlv.
*Type declaration to hold data from custom table ZDMMM_MRP_AREA.
TYPES: BEGIN OF ty_refmdma,
zmtart TYPE zdmmm_mrp_area-zmtart, "Material Type (Customized)
zwerks TYPE zdmmm_mrp_area-zwerks, "Plant
zberid TYPE zdmmm_mrp_area-zberid, "MRP Area
zdismm TYPE zdmmm_mrp_area-zdismm, "MRP Type
zeisbe TYPE zdmmm_mrp_area-zeisbe, "Safety Stock
zdisls TYPE zdmmm_mrp_area-zdisls, "Lot Size
zdispo TYPE zdmmm_mrp_area-zdispo, "MRP Controller
zfxhor TYPE zdmmm_mrp_area-zfxhor, "Plant Delivery Time (In days)
END OF ty_refmdma.
*Type declaration to hold data for success log.
TYPES: BEGIN OF ty_succ,
mat(18) TYPE c, "Material
plant(8) TYPE c, "Plant
sloc(15) TYPE c, "Storage Location
comm(150) TYPE c, "Comments
END OF ty_succ.
*Type declaration to hold data for error log.
TYPES: BEGIN OF ty_error,
mat(18) TYPE c, "Material
plant(8) TYPE c, "Plant
sloc(15) TYPE c, "Storage Location
comm(150) TYPE c, "Comments
END OF ty_error.
*Type declaration for holding data from mvke
TYPES: BEGIN OF ty_mvke,
matnr TYPE matnr, "Material Number
vkorg TYPE vkorg, "Sales Org
vtweg TYPE vtweg, "Distribution Channel
END OF ty_mvke.
*Type declaration for holding data from qmat
TYPES: BEGIN OF ty_qmat,
matnr type matnr,
werks type werks_d,
art TYPE qmat-art,
ppl TYPE qmat-ppl,
spezueber TYPE qmat-spezueber,
conf TYPE qmat-conf,
tls TYPE qmat-tls,
app TYPE qmat-app,
mer TYPE qmat-mer,
insmk TYPE qmat-insmk,
ave TYPE qmat-ave,
stichprver TYPE qmat-stichprver,
dynregel TYPE qmat-dynregel,
sproz TYPE qmat-sproz,
hpz TYPE qmat-hpz,
dyn TYPE qmat-dyn,
mpb TYPE qmat-mpb,
mst TYPE qmat-mst,
ein TYPE qmat-ein,
mpdau TYPE qmat-mpdau,
chg TYPE qmat-chg,
qkzverf TYPE qmat-qkzverf,
qpmat TYPE qmat-qpmat,
kzprfkost TYPE qmat-kzprfkost,
aufnr_co TYPE qmat-aufnr_co,
aktiv TYPE qmat-aktiv,
apa TYPE qmat-apa,
afr TYPE qmat-afr,
mma TYPE qmat-mma,
feh TYPE qmat-feh,
prfrq TYPE qmat-prfrq,
nkmpr TYPE qmat-nkmpr,
END OF ty_qmat.
*Type declaration for MARA and MARC data for reference material
TYPES: BEGIN OF ty_ref_data,
matnr TYPE matnr, "Material Number
ladgr TYPE ladgr, "Loading Group
bklas TYPE bklas, "Valuation class
peinh TYPE peinh, "Price unit
losgr TYPE losgr, "Costing Lot Size
hkmat TYPE hkmat, "Material Origin
herkl TYPE herkl, "Country Of Origin
dismm TYPE dismm, "MRP Type
dispo TYPE dispo, "MRP Controller
fxhor TYPE fxhor, "Planned delivery time (In days)
disls TYPE disls, "Lot size
fhori TYPE fhori, "Scheduling Margin Key for Floats
magrv TYPE magrv,
vhart TYPE vhart,
ergew TYPE ergew,
ervol TYPE ervol,
fuelg TYPE fuelg,
stfak TYPE stfak,
gewto TYPE gewto,
volto TYPE volto,
prctr TYPE prctr,
kzgvh TYPE kzgvh,
stawn TYPE stawn,
mtver TYPE mtver,
casnr TYPE casnr,
gpnum TYPE gpnum,
steuc TYPE steuc,
herkr TYPE herkr,
mownr TYPE mownr,
mogru TYPE mogru,
prenc TYPE prenc,
preno TYPE preno,
prend TYPE prend,
itark TYPE itark,
bstme TYPE bstme,
vabme TYPE vabme,
nrfhg TYPE nrfhg,
mfrgr TYPE mfrgr,
ekwsl TYPE ekwsl,
webaz TYPE webaz,
insmk TYPE insmk,
kzkri TYPE kzkri,
usequ TYPE usequ,
kordb TYPE kordb,
mprof TYPE mprof,
ekgrp TYPE ekgrp,
disgr TYPE disgr,
maabc TYPE maabc,
minbe TYPE minbe,
lfrhy TYPE lfrhy,
bstmi TYPE bstmi,
bstma TYPE bstma,
bstfe TYPE bstfe,
mabst TYPE mabst,
losfx TYPE losfx,
lagpr TYPE lagpr,
ausss TYPE ausss,
takzt TYPE takzt,
rdprf TYPE rdprf,
bstrf TYPE bstrf,
megru TYPE megru,
sobsl TYPE sobsl,
kzech TYPE kzech,
lgpro TYPE lgpro,
vspvb TYPE vspvb,
rgekz TYPE rgekz,
lgfsb TYPE lgfsb,
fabkz TYPE fabkz,
eprio TYPE eprio,
schgt TYPE schgt,
plifz TYPE plifz,
mrppp TYPE mrppp,
eisbe TYPE eisbe,
lgrad TYPE lgrad,
eislo TYPE eislo,
rwpro TYPE rwpro,
shflg TYPE shflg,
shzet TYPE shzet,
shpro TYPE shpro,
periv TYPE periv,
auftl TYPE auftl,
strgr TYPE strgr,
vrmod TYPE vrmod,
vint2 TYPE vint2,
umref TYPE umref,
prgrp TYPE prgrp,
vint1 TYPE vint1,
miskz TYPE miskz,
prwrk TYPE prwrk,
mtvfp TYPE mtvfp,
wzeit TYPE wzeit,
kzpsp TYPE kzpsp,
stdpd TYPE stdpd,
perkz TYPE perkz,
altsl TYPE altsl,
kausf TYPE kausf,
sbdkz TYPE sbdkz,
kzbed TYPE kzbed,
ahdis TYPE ahdis,
kzaus TYPE kzaus,
ausdt TYPE ausdt,
nfmat TYPE nfmat,
sauft TYPE sauft,
sfepr TYPE sfepr,
mdach TYPE mdach,
dplfs TYPE dplfs,
dplpu TYPE dplpu,
dplho TYPE dplho,
tempb TYPE tempb,
raube TYPE raube,
behvo TYPE behvo,
stoff TYPE stoff,
abcin TYPE abcin,
ccfix TYPE ccfix,
wesch TYPE wesch,
etiar TYPE etiar,
etifo TYPE etifo,
xgchp TYPE xgchp,
maxlz TYPE maxlz,
lzeih TYPE lzeih,
mhdrz TYPE mhdrz,
mhdhb TYPE mhdhb,
iprkz TYPE dattp,
rdmhd TYPE rdmhd,
mhdlp TYPE mhdlp,
brgew TYPE brgew,
ntgew TYPE ntgew,
volum TYPE volum,
voleh TYPE voleh,
groes TYPE groes,
xmcng TYPE xmcng,
loggr TYPE loggr,
sernp TYPE serail,
serlv TYPE serlv,
fprfm TYPE fprfm,
ausme TYPE ausme,
qmata TYPE qmatauth,
kzdkz TYPE kzdkz,
prfrq TYPE prfrq,
rbnrm TYPE rbnr,
qmpur TYPE qmpur,
ssqss TYPE ssqss,
qzgtp TYPE qzgtyp,
qssys TYPE qssys,
bwtty TYPE bwtty,
eklas TYPE eklas,
qklas TYPE qklas,
verpr TYPE verpr,
stprs TYPE stprs,
zkprs TYPE dzkprs,
zkdat TYPE dzkdat,
bwprs TYPE bwprs,
bwprh TYPE bwprh,
bwps1 TYPE bwps1,
bwph1 TYPE bwph1,
vjbws TYPE vjbws,
vjbwh TYPE vjbwh,
abwkz TYPE abwkz,
bwpei TYPE bwpei,
xlifo TYPE xlifo,
mypol TYPE mypool,
ncost TYPE ck_no_costing,
ekalr TYPE ck_ekalrel,
hrkft TYPE hrkft,
kosgr TYPE ck_kosgr,
awsls TYPE awsls,
mmsta TYPE mmsta,
mmstd TYPE mmstd,
stlal TYPE stlal,
stlan TYPE stlan,
plnnr TYPE plnnr,
aplal TYPE plnal,
plnty TYPE plnty,
sobsk TYPE ck_sobsl,
zplpr TYPE dzplpr,
zplp1 TYPE dzplp1,
zpld1 TYPE dzpld1,
zplp2 TYPE dzplp2,
zpld2 TYPE dzpld2,
zplp3 TYPE dzplp3,
zpld3 TYPE dzpld3,
lvolg TYPE lvolg,
diskz TYPE diskz,
lsobs TYPE lsobs,
lminb TYPE lminb,
lbstf TYPE lbstf,
lgpbe TYPE lgpbe,
END OF ty_ref_data.
*Type declaration for holding data from mdma
TYPES: BEGIN OF ty_mdma,
matnr TYPE mdma-matnr, "Material Number
berid TYPE mdma-berid, "MRP Area
werks TYPE mdma-werks, "Plant
END OF ty_mdma.
*Type declaration for holding Company code data
TYPES: BEGIN OF ty_bukrs,
bwkey TYPE bwkey, "Valuation Area
bukrs TYPE bukrs, "Company code
END OF ty_bukrs.
*Type declaration for holding T001w Data
TYPES: BEGIN OF ty_t001w,
werks TYPE werks_d, "Plant
bwkey TYPE bwkey, "Valuation Area
END OF ty_t001w.
*Type declaration for holding T134 Data
TYPES: BEGIN OF ty_t134,
mtart TYPE mtart, " Material type
pstat TYPE pstat, "Condensed status display
END OF ty_t134.
Type declaration for Holding TWLAD data
TYPES: BEGIN OF ty_twlad,
werks TYPE werks_d,
lgort TYPE lgort_d,
adrnr TYPE adrnr,
END OF ty_twlad.
*Type declaration for holding ADRC data
TYPES: BEGIN OF ty_adrc,
adrnr TYPE adrnr, "Address number
sort2 TYPE ad_sort2, "Search Term
END OF ty_adrc.
TYPES: BEGIN OF ty_dev00160,
pkey TYPE zkey, "parameter key
item TYPE zitem, "Item No
value TYPE zvalue,
END OF ty_dev00160.
Constants
CONSTANTS: c_header(1) TYPE c VALUE 'H', "Header
c_true(1) TYPE c VALUE 'X', "value = x
c_v(1) TYPE c VALUE 'V', "Sales View
c_e(1) TYPE c VALUE 'E', "Purchasing View
c_d(1) TYPE c VALUE 'D', "MRP View
c_p(1) TYPE c VALUE 'P', "Forecasting View
c_a(1) TYPE c VALUE 'A', "Work Scheduling view
c_l(1) TYPE c VALUE 'L', "Storage View
c_q(1) TYPE c VALUE 'Q', "Quality View
c_b(1) TYPE c VALUE 'B', "Accounting
c_g(1) TYPE c VALUE 'G', "Costing View
c_f(1) TYPE c VALUE 'F', "PRT View
c_k(1) TYPE c VALUE 'K'. "Basic View
Internal tables
*Internal table to hold material no and material type
DATA: i_matnr TYPE STANDARD TABLE OF ty_matnr INITIAL SIZE 0.
*Internal table to hold plant
DATA: i_plant TYPE STANDARD TABLE OF ty_plant INITIAL SIZE 0.
*Internal table to hold marc data
DATA: i_marc TYPE STANDARD TABLE OF ty_marc INITIAL SIZE 0.
*Internal table to hold marc data
DATA: i_tmarc TYPE STANDARD TABLE OF ty_marc INITIAL SIZE 0.
*Internal table to hold mard data
DATA: i_mard TYPE STANDARD TABLE OF ty_mard INITIAL SIZE 0.
*Internal table to hold t001l data
DATA: i_sloc TYPE STANDARD TABLE OF ty_sloc INITIAL SIZE 0.
*Internal table to hold MRP Area
DATA: i_mdlv TYPE STANDARD TABLE OF ty_mdlv INITIAL SIZE 0.
*Internal table to hold already extended MRP Area
DATA: i_mdma TYPE STANDARD TABLE OF ty_mdma INITIAL SIZE 0.
*Internal table to hold MRP Area data from customized table
DATA: i_refmdma TYPE STANDARD TABLE OF ty_refmdma INITIAL SIZE 0.
*Internal table to hold success messages
DATA: i_succ TYPE STANDARD TABLE OF ty_succ INITIAL SIZE 0.
*Internal table to hold error messages
DATA: i_error TYPE STANDARD TABLE OF ty_error INITIAL SIZE 0.
*Internal table to hold mvke data
DATA: i_mvke TYPE STANDARD TABLE OF ty_mvke INITIAL SIZE 0.
*Internal table for company code data
DATA: i_bukrs TYPE STANDARD TABLE OF ty_bukrs INITIAL SIZE 0.
*Internal table for T001W data
DATA: i_t001w TYPE STANDARD TABLE OF ty_t001w INITIAL SIZE 0.
*Internal table for T134 data
DATA: i_t134 TYPE STANDARD TABLE OF ty_t134 INITIAL SIZE 0.
*Internal table for TWLAD data
DATA: i_twlad TYPE STANDARD TABLE OF ty_twlad INITIAL SIZE 0.
*Internal table for ADRC data
DATA: i_adrc TYPE STANDARD TABLE OF ty_adrc INITIAL SIZE 0.
*Internal table for dev00160 data
DATA: i_dev00160 TYPE STANDARD TABLE OF ty_dev00160 INITIAL SIZE 0.
*Internal table for qmat data
DATA: i_qmat TYPE STANDARD TABLE OF ty_qmat INITIAL SIZE 0.
Work areas
*Work Area for Internal table i_mara
DATA: wa_matnr TYPE ty_matnr.
*Work Area for Internal table i_werks
DATA: wa_plant TYPE ty_plant.
*Work Area for Internal table i_marc
DATA: wa_marc TYPE ty_marc.
*Work Area for Internal table i_t001l
DATA: wa_sloc TYPE ty_sloc.
*Work Area for Internal table i_mdlv
DATA: wa_mdlv TYPE ty_mdlv.
*Work Area for Internal table i_bukrs
DATA: wa_bukrs TYPE ty_bukrs.
*Work Area for Internal table i_refmdma.
DATA: wa_refmdma TYPE ty_refmdma.
*Work Area for Internal table i_succ
DATA: wa_succ TYPE ty_succ.
*Work Area for Internal table i_error
DATA: wa_error TYPE ty_error.
*Work Area for Internal table i_selfields
DATA: wa_selfields TYPE sdibe_massfields.
*Work Area for Internal table i_mvke
DATA: wa_mvke TYPE ty_mvke.
*Work Area for Internal table i_ref_data
DATA: wa_ref_data TYPE ty_ref_data.
*Work Area for internal table I_t001w
DATA: wa_t001w TYPE ty_t001w.
*Work Area for internal table I_t001w
DATA: wa_twlad TYPE ty_twlad.
*Work Area for internal table I_t134
DATA: wa_t134 TYPE ty_t134.
WOrk Area for ADRC Table
DATA: wa_adrc TYPE ty_adrc.
WOrk Area for MARD Table
DATA: wa_mard TYPE ty_mard.
*Work Area for Internal table i_mvke
DATA: wa_dev00160 TYPE ty_dev00160.
*Work Area for Internal table i_mvke
DATA: wa_qmat TYPE ty_qmat.
SELECTION SCREEN *
SELECTION-SCREEN : BEGIN OF BLOCK b_001
WITH FRAME
TITLE text-001 . "Start of selection-screen
SELECT-OPTIONS: s_matnr FOR mara-matnr. "Material Number
PARAMETERS : p_ersda LIKE mara-ersda. "Creation Data
SELECT-OPTIONS: s_werks FOR marc-werks NO INTERVALS. "Plant
SELECTION-SCREEN : END OF BLOCK b_001 . "End of Selection-screen
*& Include ZDMMMR_MM_MULTI_F00 *
*& Form sub_validate_matnr
Subroutine for validating material number
FORM sub_validate_matnr .
SELECT matnr "Material Number
mtart "Material Type
ersda "Creation date
mbrsh "Industry Sector
FROM mara "Table for General Material Data
INTO TABLE i_matnr
WHERE matnr IN s_matnr.
*If no material is found an error message is given
IF sy-subrc <> 0.
MESSAGE e001.
ENDIF.
ENDFORM. " sub_validate_matnr
*& Form sub_validate_plant
Subroutine to validate Plant
FORM sub_validate_plant .
SELECT werks "Plant
bwkey "Valuation area
FROM t001w "Table for Plants/Branches
INTO TABLE i_plant
WHERE werks IN s_werks.
*If no plant is found an error message is given
IF sy-subrc NE 0.
MESSAGE e002.
ENDIF.
ENDFORM. " sub_validate_plant
*& Form sub_get_mara
*Determine all the materials that need to be extended to new plants,
*storage locations and MRP areas
FORM sub_get_mara .
IF NOT s_matnr[] IS INITIAL.
SORT i_matnr BY matnr.
IF p_ersda IS NOT INITIAL.
DELETE i_matnr WHERE ersda NE p_ersda.
ENDIF.
ELSE.
*If only Creation Date is given
SELECT matnr "Material No.
mtart "Material Type
ersda "Creation date
mbrsh "Industry Sector
FROM mara "Table for General Material Data
INTO TABLE i_matnr
WHERE ersda EQ p_ersda.
IF sy-subrc EQ 0.
SORT i_matnr BY matnr.
ELSE.
MESSAGE i000 WITH 'No data found for given Selection.'(002).
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
Subroutine to get data from mvke.
PERFORM sub_get_mvke.
LOOP AT i_matnr INTO wa_matnr.
CLEAR wa_mvke.
READ TABLE i_mvke INTO wa_mvke WITH KEY matnr = wa_matnr-matnr
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_matnr-vkorg = wa_mvke-vkorg.
wa_matnr-vtweg = wa_mvke-vtweg.
ENDIF.
IF wa_matnr-mtart = 'AD01'.
wa_matnr-mtartz = 'AD01'.
ELSE.
wa_matnr-mtartz = 'NAD01'.
ENDIF.
MODIFY i_matnr FROM wa_matnr TRANSPORTING vkorg vtweg mtartz.
ENDLOOP.
ENDFORM. " sub_get_mara
*& Form sub_get_werks
*Determine all the plants to which the Materials need to be extended
FORM sub_get_werks .
SELECT werks "Plant
bwkey "Valuation Area
FROM t001w "Check table for Plants/Branches
INTO TABLE i_plant.
IF sy-subrc EQ 0.
SORT i_plant BY werks.
ENDIF.
ENDFORM. " sub_get_werks
*& Form sub_get_marc
*Determine the status of the materials with respect to which plants
*they have already been extended to
FORM sub_get_marc .
CHECK i_matnr[] IS NOT INITIAL.
SELECT m~matnr "Material Number
m~werks "Plant
t~bwkey
INTO TABLE i_marc
FROM marc AS m "Table for Plant Data for Material
INNER JOIN t001w AS t
ON mwerks = twerks
FOR ALL ENTRIES IN i_matnr
WHERE matnr EQ i_matnr-matnr.
IF sy-subrc EQ 0.
*Append the plants that have been extended to
to the list of plants to which they have to be extended
only when no plants are given in the selection screen
IF s_werks IS INITIAL.
LOOP AT i_marc INTO wa_marc.
wa_plant-werks = wa_marc-werks.
wa_plant-bwkey = wa_marc-bwkey.
APPEND wa_plant TO i_plant.
CLEAR wa_plant.
ENDLOOP.
SORT i_plant BY werks bwkey.
DELETE ADJACENT DUPLICATES FROM i_plant
COMPARING werks bwkey.
ENDIF.
SORT i_marc BY matnr werks.
*Retrieve the Valutaion Area for the plants to which the material
*has already been extended.
SELECT werks "Plant
bwkey "Valuation area
INTO TABLE i_t001w
FROM t001w "Table for Plants/Branches
FOR ALL ENTRIES IN i_marc
WHERE werks = i_marc-werks.
*If selection succeed.
IF sy-subrc EQ 0.
Sort by Plant
SORT i_t001w BY werks.
ENDIF.
ENDIF.
*Copy the content of MARC into a temporary internal table
i_tmarc[] = i_marc[].
DELETE ADJACENT DUPLICATES FROM i_tmarc
COMPARING matnr.
*Retrieving Inspection type - material parameters (QMAT)
*data
SELECT matnr "Material Number
werks "Plant
art "Inspection Type
ppl "Inspection with Task List
spezueber "Inspect with Material Specification
conf "Inspection Specifications from
" Configuration
tls "Inspection Specifications from Batch
" Determination
app "Automatic Specification Assignment
mer "nspect by Characteristics
insmk "Post to Inspection Stock
ave "Automatic Usage Decision Planned
stichprver "Sampling Procedure
dynregel "Dynamic Modification Rule
sproz "Inspection Percentage
hpz "100% Inspection
dyn "Skips Allowed
mpb "Enter the Sample Manually
mst "Trigger Sample Calculation Manually
ein "Serial Number Management Possible
mpdau "Average Inspection Duration
chg "Control of Inspection Lot Creation (Lot
"Summary)
qkzverf "Procedure for Calculating Quality Score
qpmat "Allowed Share of Scrap (Percent) in
"Inspection Lot
kzprfkost "Record Appraisal Costs in Individual QM
"Order
aufnr_co "Order Number for Recording Appraisal
"Costs
aktiv "Inspection Type - Material Combination is
"Active
apa "Preferred Inspection Type
afr "Inspection for Handling Unit
mma "Field Not Used as of 3.0 Field
"Reserved for SAP
feh "Field Not Used as of 3.0 Field
"Reserved for SAP
prfrq "Field Not Used as of 3.0 Field
"Reserved for SAP
nkmpr "Field Not Used as of 3.0 Field
"Reserved for SAP
INTO TABLE i_qmat
FROM qmat "Table of "Inspection type - material
"parameters"
FOR ALL ENTRIES IN i_tmarc
WHERE matnr = i_tmarc-matnr "Material no. of temporary internal
"table
AND werks = i_tmarc-werks. "Plant of temporary internal table
*If selection succeed
IF sy-subrc EQ 0.
SORT i_qmat BY matnr.
ENDIF.
ENDFORM. " sub_get_marc
*& Form sub_get_mard
Determine the storage locations for the Plants i_plant.
FORM sub_get_mard .
CHECK i_marc[] IS NOT INITIAL.
SELECT matnr "Material Number
werks "Plant
lgort "Storage Location
FROM mard "Table for Storage Location Data for Material
INTO TABLE i_mard
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND werks EQ i_marc-werks.
*If selection succeed
IF sy-subrc EQ 0.
*Sort internal table by Material no , Plant and Storage Location
SORT i_mard BY matnr werks lgort .
ENDIF.
ENDFORM. " sub_get_mard
*& Form sub_get_t001l
Determine the storage locations for the Plants i_plant.
FORM sub_get_t001l .
CHECK i_plant[] IS NOT INITIAL.
SELECT werks "Plant
lgort "Storage Location
FROM t001l "Check table for Storage Location
INTO TABLE i_sloc
FOR ALL ENTRIES IN i_plant
WHERE werks EQ i_plant-werks.
*If selection succeed
IF sy-subrc EQ 0.
*Sort by Plant and Storage Location
SORT i_sloc BY werks lgort.
For all the storage location get the Storage Location Address
*Number
SELECT werks "Plant
lgort "Storage Location
adrnr "Address Number
FROM twlad "Table of 'Determination of Address from Plant and
"Storage Location'
INTO TABLE i_twlad
FOR ALL ENTRIES IN i_sloc
WHERE werks = i_sloc-werks
AND lgort = i_sloc-lgort.
*If selection succeed
IF sy-subrc EQ 0.
*Sort by Plant, Storage Location and Address number
SORT i_twlad BY werks lgort adrnr.
For all address numbers retrieved get the search term
SELECT addrnumber "Address number
sort2 "Search Term 2
INTO TABLE i_adrc
FROM adrc "Table of 'Addresses (Business Address
"Services)'
FOR ALL ENTRIES IN i_twlad
WHERE addrnumber = i_twlad-adrnr.
IF sy-subrc EQ 0.
SORT i_adrc BY adrnr.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " sub_get_t001l
*& Form sub_get_mdlv
Determine the MRP Areas to which the materials need to be extended.
FORM sub_get_mdlv .
CHECK i_sloc[] IS NOT INITIAL.
SELECT berid "MRP Area
werzg "Plant
ortzg "Receiving Storage Location
FROM mdlv "Table for Customizing MRP Area
INTO TABLE i_mdlv
FOR ALL ENTRIES IN i_sloc
WHERE werzg EQ i_sloc-werks
AND ortzg EQ i_sloc-lgort.
*If selection succeed.
IF sy-subrc EQ 0.
*Sort by Plant and Storage Location
SORT i_mard BY werks lgort.
ENDIF.
ENDFORM. " sub_get_mdlv
*& Form sub_get_zdmmm_mrp_area
Determine required fields w.r.t Plant and MRP Area from customized
*table
FORM sub_get_zdmmm_mrp_area .
CHECK i_mdlv[] IS NOT INITIAL.
*Retrieving MRP data from Customized table
SELECT zmtart "Material Type
zwerks "Plant
zberid "MRP Area
zdismm "MRP Type
zeisbe "Safety Stock
zdisls "Lot Size
zdispo "Mrp Controller
zfxhor "Planned Delivery Time (In Days)
FROM zdmmm_mrp_area "Customized table for MRP Area wrt
"plant and mat type.
INTO TABLE i_refmdma
FOR ALL ENTRIES IN i_mdlv
WHERE zberid = i_mdlv-berid
AND zwerks = i_mdlv-werzg.
*If selection succeed
IF sy-subrc <> 0.
*Sort by MRP Area and Plant
SORT i_refmdma BY zberid zwerks.
ENDIF.
ENDFORM. " sub_get_zdmmm_mrp_area
*& Form sub_mat_extn
For extending Material to Plant, all possible Storage Location and
corresponding MRP Area .
FORM sub_mat_extn .
*Local variable declaration
DATA: l_index TYPE sytabix. "For storing sy-tabix
DATA: l_counter TYPE i VALUE 0. "For formatting Error log.
DATA: l_sloc_extend TYPE c. "Flag for Extending the material
DATA: wa_dpop LIKE dpop. "For sending as a exporting
"parameter
DATA: wa_mdma LIKE mdma. "For sending as a exporting
"parameter
DATA: l_stat TYPE c. "For checking the Storage Location
"is Seviceable or not.
DATA: wa_bapireturn1 TYPE bapiret1. "Return Work area of
"'MD_MRP_LEVEL_CREATE_DATA'
*No material is selected.
CHECK i_matnr[] IS NOT INITIAL.
SORT i_plant BY werks.
SORT i_marc BY matnr werks.
SORT i_mard BY matnr werks lgort.
*For extending the material to Plant Storage Location and possible MRP
*Area
LOOP AT i_matnr INTO wa_matnr.
CLEAR wa_marc.
Checking whether Reference Material Exists or not
READ TABLE i_marc INTO wa_marc WITH KEY matnr = wa_matnr-matnr
BINARY SEARCH.
If no reference material exists..populate data for error log.
IF sy-subrc NE 0.
CLEAR wa_error.
PERFORM material_convert USING wa_matnr-matnr
CHANGING wa_error-mat.
wa_error-comm = 'Reference material is not maintained'(003).
APPEND wa_error TO i_error.
CLEAR wa_error.
CONTINUE.
ENDIF.
For retrieving the reference data
PERFORM sub_retrieve_refdata.
LOOP AT i_plant INTO wa_plant.
READ TABLE i_marc INTO wa_marc WITH KEY matnr = wa_matnr-matnr
werks = wa_plant-werks
BINARY SEARCH.
IF sy-subrc EQ 0.
-
Creation of new plant and the impact of business
Hi to all
i am creating a new plant, and would like to know the impact of the plant, what are the changes to be made in the customization, i want to know what are the chages required, and let me know after unit testing and integration testing what activity to be performed, as i am at go live stage and in the production client how to extended the master data, what is data migration how it can be done,
thanking youHi there,
As an SD consultant, these are the things you need to take care.
Assign the plant to the company code in OX18.
You need to assign the new plant to the sales org / distribution channel in OVX6.
Then assign the shipping point to plant in OVXC. If WH is active for your plant, then assign warehouse WH to plant & storage location in LE assignment.
Reg the master data, you need to assign the material master to the new plant. Also maintain the MRP profiles, plant specific data in the MM01.
Maintain the shipping point determination in OVL2 & storage loc determination in OVL3 (OVL3 if required)
Check with MM, PP & FI if they need to maintain any plant specific configs. There are some configs from their end for sure. For eg for production orders, purchase orders, movement types etc.
Reg the testing, you need to ensure that plant gets proposed automatically when a new sales order is created. Also maintain the relevent plant specific condition records.
Similarly when PGI is done, it should update the transfer postings in MM & FI w.r.t plant.
Even tough your project is in final stages, you have to do a regrious testing when a new plant is created. Testing cannot be compromised for time lines. It will lead to serious production issues if tsting is not properly done.
Regards,
Sivanand -
Creating a new plant and its effects/changes required in FI/CO
Hi Experts,
My client is going to create a new plant in SAP so I would like to know as to what effects does it have in FI/CO.
New plant is proposed to use functions FI, CO, SD, MM-WM and QM
I am aware that it needs to be assigned to company code and certain account determination may change depending on the way transactions take place in new plant.
Other than above, I would like to know if there are any specific points on which I need to concentrate and take care to ensure a smooth flow in FI/CO and no break up of existing system.
Thanks,
GANHI,
Below points you have to look.
1.Assigning new plant to company code and then assignment of purchasing organization to plant.
2.Vital steps:-Need to active your valuation area(new plant) in OMWD t.code with valuation grouping code.
3.Maintain MRP Controller/Controllers
4.Assign sales organization, distribution channel & new plant
5.Active quantity & value updation for new plant for all material types
6.Use LSMW or BDC with MMZ1 t.code for material ( old material or used material) uploading to new plant.
7.All info record need to be created with LSMW
8.Creation of any valuation types & MRP data
9.For new plant Excise Reg. number need to be assigned in Maintaining Plant Settings(
SPRO ->> Logistics general ->> tax on Goods Movements->>India ->>Basic setting ->> Maintain Plant Settings) -
What settings we need to check in PS module while creating the new plant.
Dear Friends,
If we extending the new plant what all the things that we need to check in Project systems module, what all the configuration that needs to performed. Here we are using the Standard Project structure to creating the projects.
But it is not a manufacturing plant. All the service processes are takes place from this plant.
While creating the plant if we are copying from the existing plant, is that the all assignments are copying to the new plant?
Regards,
Hari
Edited by: Hari Krishna on Jan 5, 2009 10:17 AMDear Hari,
Mainly two settings have to be extended for using networks for that plant..
1) Extending Network type Parameters - T-code - OPUV
2) Production Order control Parameters - T-code - OPU6
Rdgs,
Deepa -
Extending Material to new plants - Legal Control
Hi All.
I am extending a material to new plants by copying the data froma particular plant.
Whats happening is for some plants the LEGAL CONTROIL data (Foreign Trade Import view) is automatically getting copied and populated but for some plants it is not.
What could be the reason?
Poitns are assured !!!Hi , Thanks for the reply.
But the plants for which data is automatically getting populated , I am selecting only the Foreign Trade view and not all the views.
Regards -
Extending the material of an existing plant in a company code to new plant.
Hi,
I am trying to Extend the Material from Plant 1000 to 2000 Using BAPI : MATERIAL_MAINTAIN_DARK .
But it is not extended to Plant 2000.Please check the following code and correct me.
REPORT ZEXTEND_MATERIAL1.
TABLES: MARA,MARC,MARD.
DATA: AMARA_UEB TYPE TABLE OF MARA_UEB,
WA_MARA TYPE MARA_UEB,
AMARC_UEB TYPE TABLE OF MARC_UEB,
WA_MARC TYPE MARC_UEB,
AMARD_UEB TYPE TABLE OF MARD_UEB,
WA_MARD TYPE MARD_UEB.
DATA: MATNR_LAST LIKE MARA-MATNR,
NUMBER_ERRORS_TRANSACTION LIKE TBIST-NUMERROR.
DATA: idx TYPE sy-tabix.
DATA: P_KZ_NO_WARN LIKE RMMG08_012-MSGTYP,
KZ_PRF LIKE RMMG08_012-MSGTYP.
PARAMETERS: P_MATNR TYPE MATNR. "Material Number
PARAMETERS: P_WERKS TYPE WERKS_D. " Existing Plant
PARAMETERS: P_NWERKS TYPE WERKS_D. " New Plant
PARAMETERS: P_LGORT TYPE LGORT_D. " Storage Location
START-OF-SELECTION.
* Clear the Workarea
CLEAR : WA_MARA,WA_MARC,WA_MARD.
* Refresh the Internal Tables
REFRESH: AMARA_UEB,AMARC_UEB,AMARD_UEB.
* MARA Table
SELECT SINGLE * FROM MARA INTO CORRESPONDING FIELDS OF WA_MARA WHERE MATNR = P_MATNR.
IF SY-SUBRC = 0.
WA_MARA-TCODE = 'MM01'.
WA_MARA-TRANC = '0000000001'.
APPEND WA_MARA TO AMARA_UEB.
ENDIF.
* MARC Table
SELECT SINGLE * FROM MARC INTO CORRESPONDING FIELDS OF WA_MARC WHERE MATNR = P_MATNR AND WERKS = P_WERKS.
IF SY-SUBRC = 0.
WA_MARC-WERKS = P_NWERKS.
WA_MARC-TRANC = '0000000001'.
WA_MARC-PSTAT = SPACE.
APPEND WA_MARC TO AMARC_UEB.
ENDIF.
* MARD Table
SELECT SINGLE * FROM MARD INTO CORRESPONDING FIELDS OF WA_MARD WHERE MATNR = P_MATNR AND WERKS = P_WERKS AND LGORT = P_LGORT.
IF sy-subrc = 0.
WA_MARD-WERKS = P_NWERKS.
WA_MARD-TRANC = '0000000001'.
APPEND WA_MARD TO AMARD_UEB.
ENDIF.
* Call the Function Module MATERIAL_MAINTAIN_DARK.
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
P_KZ_NO_WARN = 'I'
KZ_PRF = 'W'
IMPORTING
MATNR_LAST = P_MATNR
NUMBER_ERRORS_TRANSACTION = NUMBER_ERRORS_TRANSACTION
TABLES
AMARA_UEB = AMARA_UEB
AMARC_UEB = AMARC_UEB
AMARD_UEB = AMARD_UEB
EXCEPTIONS
KSTATUS_EMPTY = 1
TKSTATUS_EMPTY = 2
T130M_ERROR = 3
INTERNAL_ERROR = 4
TOO_MANY_ERRORS = 5
UPDATE_ERROR = 6
ERROR_PROPAGATE_HEADER = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
ENDIF.
Thanks
Bhuvana
Edited by: Matt on Nov 26, 2010 10:04 AM - added tagsHi,
This function module used in many standard reports.We can see goto sm37->give the function module name->then click on the
where used list button on application toolbar u can get the more information regarding that function module.
RMMM000,L1001UEBU01
I thing we can get some information.
regards,
muralii -
Error while extending material for new plant
Dear All,
We have created new plant through copying old plant.
But when I try to extend the material to the newly created plat system giving error message
Tables TCURM and T001w inconsistent : notify your system administrator
Msg no M3820
Diagnosis
Valuation is at plant level. However, inconsistencies have arisen because of the way in which the plant was configured in Customizing or because plants have not been assigned to a company code.
kindly help me out to over come this issue as early as possible.
Regards,
murali.hi
check following links
[link1|Tables TCURM and T001W inconsistent; notify your systems administrator;
[link2|Tables TCURM and T001W Inconsistent; -
Extending material in new plant
I have mainteined the mm related views (basic data 1,2,Plnt storage data 1,purchasing accounting)for some materials and want to add FICO related views for the same material.But after gouing to MM02 ,im getting an error msg' Material not fully maintained for this transaction/event'.plz help as soon as possible.
Hi,
Some Material views extended through T.code MM50 provide the following input datas are
Maintenance Status : ___ ( select drop down menu & select require material view )
Material code : ___________
Plant : ___________
after provided input datas and then executed. Now, one line item show and first small box tick mark and press maintenance button. The view extended to the particular material.
Hope, it is useful for you.
Regards,
K.Rajendran -
WM Material Master Data - extend materials inquiry
I have a question regarding WM Material Master Data - extend materials
what is the best practice for extending materials to Warehouse Management views 1 and 2. We have 1 new warehouse with fixed bins 001 Pallet, 002 Racking, 003 Floor, 004 Bins, 005 Chemicals, 099 Quarantine. My question is should we extend 3000 materials to each of the designated fixed bins to the Plant/Warehouse Number/Storage Type for WM views 1 & 2?
Thanks,Hi
As suggested by Raj you can use Mass maintenance option MM17 to update the WM1 and WM2 view
or
You can use the LSMW option to upload from external file (e.g. xls, CSV files)
Regards
Manish Kumar -
MM LSMW extending materials to new plant
Hi Experts,
I got a requirement, where I need to create a LSMW for extending the materials for a new plant. Should I use MM01 or MM02 Direct Input Method of LSMW(RMDATIND). Kindly help me with this.
Regards,
Riyawhy dont you try it yourself manually before you try to do it with a load program.
Just execute MM02 in your system and try to extend it to a new plant, you will immediatly have your answer.
Change: you can only change what exists
Create: you create something that does not exist.
Can you change the plant data that does not yet exist in material master? -
Extending the existing functional locations to a new plant?
Hi Sapiens,
The following is my concern:
Q1) I have a set of functional locations(roughly around 5000 records) assigned to say Plant A.
I would like to extend these existing functional locations to Plant B. I am not permitted to do this using LSMW. I should execute this operation in one shot.
How to accomplish this?
Q2) After attaching all the functional locations to Plant B, i should replace the first 4 characters of the functional location structure with the Plant Code itself. Again not through an lsmw. How to accomplish this in one shot?
Please let me know the procedure of doing it with some guidelines.
Thanks in Advance,
VijayaHi
1. You can extentd to the other plant with SCAT ,BDC etc
2. But You can not replace the first four letters from the FL with the New plant code.Remember this is a master data
Regardas
Jignesh -
Regarding : Material document data and PO data do not match (Plant)
Hi Gurus,
Please go through this BAPI program.
While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
DATA: BEGIN OF it_itab OCCURS 100,
docdate(10),
postdate(10),
mvt_type(3), "Movement Type
plant(4), "Plant
lgort(4),
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
material(18), "Material Number
delnote(16),
erfmg(13),
uom(3),
lfmng(13), "Quantity
batch(10) TYPE c,
vfdat TYPE vfdat,
END OF it_itab.
DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01 INITIAL SIZE 100,
it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code INITIAL SIZE 100,
it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create INITIAL SIZE 100.
DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
DATA: w_mat_doc TYPE bapi2017_gm_head_ret-mat_doc,
w_year TYPE bapi2017_gm_head_ret-doc_year.
DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_errmsg_goodsmvt.
DATA : obj_type LIKE bapiache09-obj_type,
obj_key LIKE bapiache09-obj_key,
obj_sys LIKE bapiache09-obj_sys.
DATA: v_date1 TYPE sy-datum.
DATA: v_date2 TYPE sy-datum.
DATA: w_lines TYPE i.
DATA: errflag.
SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK bk1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
Start-of-selection processing
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = i_excel
i_filename = p_file
TABLES
i_tab_converted_data = it_itab[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT it_itab.
REFRESH it_goodsmvt_head.
REFRESH it_goodsmvt_item.
CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
wa_goodsmvt_head-pstng_date = v_date2.
wa_goodsmvt_head-doc_date = v_date1.
wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
wa_goodsmvt_head-pr_uname = sy-uname.
APPEND wa_goodsmvt_head TO it_goodsmvt_head.
Maintain it_goodsmvt_code
wa_goodsmvt_code-gm_code = '04'.
Maintain it_goodsmvt_item
*LOOP AT it_itab.
IF wa_goodsmvt_item-po_number IS INITIAL.
wa_goodsmvt_item-po_number = it_itab-pur_doc.
wa_goodsmvt_item-move_type = it_itab-mvt_type.
wa_goodsmvt_item-MOVE_PLANT = it_itab-plant.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = it_itab-material
IMPORTING
output = it_itab-material.
wa_goodsmvt_item-material = it_itab-material.
wa_goodsmvt_item-stge_loc = it_itab-lgort.
wa_goodsmvt_item-po_item = it_itab-po_item.
wa_goodsmvt_item-entry_qnt = it_itab-erfmg.
wa_goodsmvt_item-ENTRY_UOM_ISO = it_itab-uom.
wa_goodsmvt_item-po_pr_qnt = it_itab-lfmng.
wa_goodsmvt_item-batch = it_itab-batch.
wa_goodsmvt_item-expirydate = it_itab-vfdat.
wa_goodsmvt_item-NO_MORE_GR = 'X'.
wa_goodsmvt_item-mvt_ind = 'B'.
APPEND wa_goodsmvt_item TO it_goodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_goodsmvt_head
goodsmvt_code = wa_goodsmvt_code
IMPORTING
materialdocument = w_mat_doc
TABLES
goodsmvt_item = it_goodsmvt_item
return = it_errmsg_goodsmvt.
Process of commit work
IF it_goodsmvt_head[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
ENDIF.
IF it_goodsmvt_item[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IMPORTING
RETURN =
CLEAR errflag.
READ TABLE it_errmsg_goodsmvt INDEX 1.
IF it_errmsg_goodsmvt-type EQ 'E'.
WRITE:/'Error in function', it_errmsg_goodsmvt-message.
errflag = 'X'.
ELSE.
WRITE:/ it_errmsg_goodsmvt-message.
ENDIF.
IF errflag IS INITIAL.
COMMIT WORK AND WAIT.
IF sy-subrc NE 0.
WRITE:/ 'Error in updating'.
EXIT.
ELSE.
WRITE:/ 'Material Document created successfully and the Document Number for the Material',
wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.Hey,
Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
Mine is solved....
Thanks
Maybe you are looking for
-
How do I reinstall os x moutain lion after deleting necessary files?
When trying to get my Canoscan 9550F to work with OS X 10.8.x, I was able to add it to the system settings under printer, but still it didn't work. I decided to make sure the Canon driver and Apple driver weren't fighting, so I deleted some files. No
-
Hi experts i'd like to know how is possible to solve this log-in error No switch to HTTPS occurred, so it is not secure to send a password Client, name, or password is not correct; log on again Regards andrea
-
Error installing Application server on Red Hat 8
I am trying to install Application Server but I cant because I get an error message saying the following: "Error in invoking target install of makefile /opt/oracle/product/ora9ias/sqlplus/lib/ins_sqlplus.mk" Can anyone explain to me what does this me
-
Automated PDF to Grayscale Conversion
Hi, I need to find a way of converting PDF files to Grayscale using an automated process. I have adobe distiller and adobe acrobat 8 professional - but I cannot find a way to access via API or command line so that I can automate the process of batch
-
Disabling FORWARD option in UWL
Hi, We are on SRM 7.1 Is there a way to disable the "FORWARD" option in UWL completely? Do I need to modify the iview property or change something else in UWL in Portal? Please advise.