‎2009 May 28 10:01 AM
Hi Gurus,
Can anyone give me a BAPI which corresponds to VB11-Material Replacement ?
I need to update standard database table.
Thanks
Chandan
‎2009 May 28 10:22 AM
please go thru this all
RV_MAT_SUB_SAVE ( Update for Material Substitution)
see Include :MV13DF00
CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK
EXPORTING
USE_OUTBOUND_CALL = BOOLE_T
TABLES
X_KONDDVB = XKONDD
Y_KONDDVB = YKONDD
X_KONDDPVB = XKONDDP
Y_KONDDPVB = YKONDDP
DB_TIME = TIME_VAKE_DB
DB_XVAKE = XVAKE.
Also check this if required
PRODUCT_SUBSTITUTION
COND_CROSS_SELLING
Try with Fm RV_MAT_SUB_SAVE
CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK
EXPORTING
USE_OUTBOUND_CALL = BOOLE_T
TABLES
X_KONDDVB = XKONDD
Y_KONDDVB = YKONDD
X_KONDDPVB = XKONDDP
Y_KONDDPVB = YKONDDP
DB_TIME = TIME_VAKE_DB
DB_XVAKE = XVAKE.
This FM is used in the include MV13DF00
and see
try to commit the DB work by using 'BAPI_TRANSACTION_COMMIT' and see if table has been updated.
‎2009 May 28 10:28 AM
Thanks Prem, But I need to pass some fields to the FM, where can I pass them ?
I need to pass Two material numbers from my Program to this FM, where can Pass them ???
Thanks
Chandan
‎2009 May 28 10:47 AM
you can pass the materials to the tables which is in the function module in the loop one by one
CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK
EXPORTING
USE_OUTBOUND_CALL = BOOLE_T
TABLES
X_KONDDVB = XKONDD
Y_KONDDVB = YKONDD
X_KONDDPVB = XKONDDP
Y_KONDDPVB = YKONDDP
DB_TIME = TIME_VAKE_DB
DB_XVAKE = XVAKE.
‎2009 May 28 10:56 AM
But where to pass, which is the corresponding field in the FM ???
Can you please elaborate ??
In VB11, you can see there are two type of material numbers, I need to pass those material numbers from my program to the FM, so can u please tell me where in the FM, should I pass my material numbers ?
Thanks
Chandan
‎2009 May 28 11:56 AM
‎2009 May 28 11:59 AM
the material you want to substitute is in this field KONDDVB-SMATN, for this you declare an internal table like X_KONDDVB like KONDDVB with field SMATN where the material need to pass
‎2009 May 28 1:13 PM
Prem,
Do u mean, I need to pass my fields in TABLES part of the FM ??
I guess TABLES is for output purpose ! Also I need to enter two materials and not one, you said only about one !!!
Ca u tell me exactly what I need to do ?
I have two fields with me: Old Matnr and New Matnr.
Old matnr will be replaced by New matnr
Please tel me wat I need to do
‎2009 Jun 02 2:07 PM