‎2007 Mar 20 7:07 PM
Hi, in my cutom Tcode I'll be making a changes in MRP values in Alt UOM but at the database level it will be stored in Base UoM.
I want to update MARC.
Can anybody please tell me how to use FM 'MATERIAL_MAINTAIN_DARK'?
I want to know what all the parameters needs to pass? Do I need to pass Tcode MM02 anywhere? What will be the mode of transfer?
I heard BAPI 'BAPI_MATERIAL_SAVEDATA' is also there. Will you please provide info of either one?
It's urgent...Thanks
‎2007 Mar 27 1:00 AM
Hi,
Please find the corresponding field names in the BAPI
PLANTDATA-REORDER_PT - MINBE
PLANTDATA-SAFETY_STK - EISBE
PLANTDATA-MINLOTSIZE - bstmi
PLANTDATA-MAXLOTSIZE - bstma
PLANTDATA-FIXED_LOT - bstfe
PLANTDATA-ROUND_VAL - bstrf
PLANTDATA-MAX_STOCK - mabst
PLANTDATA-MIN_SAFETY_STK - eislo
<b>Populate the following parameters..</b>
HEADDATA-MATERIAL = 'Material number'.
HEADDATA-MRP_VIEW = 'X'.
Populate the PLANTDATA as mentioned above..
Populate the corresponding X in the PLANTDATAX structure.
PLANTDATAX-REORDER_PT = 'X'
PLANTDATAX-SAFETY_STK = 'X'
PLANTDATAX-MINLOTSIZE = 'X'
PLANTDATAX-MAXLOTSIZE = 'X'
PLANTDATAX-FIXED_LOT = 'X'
PLANTDATAX-ROUND_VAL = 'X'
PLANTDATAX-MAX_STOCK = 'X'
PLANTDATAX-MIN_SAFETY_STK = 'X'
Call the BAPI.
Give COMMIT WORK.
Hope this works..
Thanks
Naren
‎2007 Mar 20 8:21 PM
I believe if you just search SDN on MATERIAL_MAINTAIN_DARK - you'll find example on how to use it.
‎2007 Mar 26 11:34 PM
I want to update MRP values,
Please find a piece of code.
DATA: g_t_mara_ueb LIKE mara_ueb OCCURS 0 WITH HEADER LINE,
g_t_marc_ueb LIKE marc_ueb OCCURS 0 WITH HEADER LINE.
DATA: l_tranc TYPE transcount,
l_amerrdat LIKE merrdat OCCURS 0 WITH HEADER LINE.
l_tranc = 1.
SELECT * INTO CORRESPONDING FIELDS OF TABLE g_t_mara_ueb
FROM mara WHERE matnr = g_mat.
Then I am updating fields tcode and tranc of g_t_mara_ueb as MM02 and 1 respectively
Then I select the records from MARC
SELECT * INTO CORRESPONDING FIELDS OF TABLE g_t_marc_ueb
FROM marc WHERE matnr = g_mat
AND werks = g_plant.
New MRP values are then updated to g_t_marc_ueb. Then I call FM
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
flag_muss_pruefen = 'X'
p_kz_no_warn = 'N'
kz_prf = space
kz_verw = 'X'
kz_aend = 'X'
kz_dispo = 'X'
kz_test = ' '
TABLES
amara_ueb = g_t_mara_ueb
amarc_ueb = g_t_marc_ueb
amerrdat = l_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
OTHERS = 7.
IF sy-subrc NE 0.
ROLLBACK WORK.
ELSE.
CALL FUNCTION 'DB_COMMIT'.
ENDIF.
System does not give any error when FM is executed but table MARC is not getting updated.
Need your help
‎2007 Mar 26 11:42 PM
Hi,
You can use the BAPI_MATERIAL_SAVEDATA
Pass the parameters PLANTDATA & PLANTDATAX
With the values that you need to update.
Which fields do you want to update in the MRP view??
I will let you know which fields to be populated in the BAPI parameter..
Thanks,
Naren
‎2007 Mar 27 12:39 AM
I tried using BAPI_MATERIAL_SAVEDATA also but I was facing same problem.
Fields to be updated are
minbe
eisbe
bstmi
bstma
bstfe
bstrf
mabst
eislo
It would be great if you tell me what all the fields to be populated.
If I use FM 'MATERIAL_MAINTAIN_DARK', I can make the use of direct assignment but in BAPI it was difficult to make every assignment cause I dont know mandatory fields.
Waiting for your reply
Thanks,
Mahesh
‎2007 Mar 26 11:45 PM
Hi,
Are you populating the field d_ind in the marc_ueb structure..
Thanks,
Naren
‎2007 Mar 27 12:41 AM
‎2007 Mar 27 1:00 AM
Hi,
Please find the corresponding field names in the BAPI
PLANTDATA-REORDER_PT - MINBE
PLANTDATA-SAFETY_STK - EISBE
PLANTDATA-MINLOTSIZE - bstmi
PLANTDATA-MAXLOTSIZE - bstma
PLANTDATA-FIXED_LOT - bstfe
PLANTDATA-ROUND_VAL - bstrf
PLANTDATA-MAX_STOCK - mabst
PLANTDATA-MIN_SAFETY_STK - eislo
<b>Populate the following parameters..</b>
HEADDATA-MATERIAL = 'Material number'.
HEADDATA-MRP_VIEW = 'X'.
Populate the PLANTDATA as mentioned above..
Populate the corresponding X in the PLANTDATAX structure.
PLANTDATAX-REORDER_PT = 'X'
PLANTDATAX-SAFETY_STK = 'X'
PLANTDATAX-MINLOTSIZE = 'X'
PLANTDATAX-MAXLOTSIZE = 'X'
PLANTDATAX-FIXED_LOT = 'X'
PLANTDATAX-ROUND_VAL = 'X'
PLANTDATAX-MAX_STOCK = 'X'
PLANTDATAX-MIN_SAFETY_STK = 'X'
Call the BAPI.
Give COMMIT WORK.
Hope this works..
Thanks
Naren
‎2007 Mar 27 2:07 AM
Hey Naren, Thanks man I could save the entries.
I'll disturb you again If I face any prb
Thanks,
Mahesh