‎2006 Apr 11 9:44 AM
Hi all,
I have to upload data like prices to master table according country. There might be rounding differences, if the price unit in the upload file is different to the price unit in the material master. This upload will not change the price unit in the material master, it will recalculate the price from the upload file before updating the material master. How can i do that ? please help me.
‎2006 Apr 11 9:56 AM
Hi
Try this process
In the program after you giving the Bdc statement do the appropriate validation and than u pass that data to the respective fields.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSW'.
perform bdc_field using 'RMMG1-MATNR'
'000000000000000022'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '3005'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'SKTEXT-MAKTX(01)'.
perform bdc_field using 'SKTEXT-MAKTX(01)'
newdesc.
perform bdc_field using 'MARA-MEINS'
'EA'.
perform bdc_field using 'MARA-MATKL'
'01'.
perform bdc_field using 'MARA-SPART'
'00'.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_field using 'MARA-BRGEW'
'12'.
perform bdc_field using 'MARA-GEWEI'
'KG'.
perform bdc_field using 'MARA-NTGEW'
'10'.
ws_mode = 'N'.
call transaction 'MM02' using bdcdata mode ws_mode
messages into messtab.
*loop at bdcdata.
*if bdcdata-fval eq newdesc.
itab-matnr = matnr.
*itab-olddesc = myvar.
itab-maktx = 'hail' .
append itab.
perform field_catalog changing fcat.
perform field_lay changing layout.
dont follow this but after this statement you do the required validations.
Thanksa
Mrutyunjaua Tripathy
‎2006 Apr 11 9:54 AM
Hi Gautam,
1) UPload the data in the file into an internal table using GUI_UPLOAD function module / open dataset command.
2) For each record in the file,
loop at itab.
select single <UOM>
from mara
where matnr = itab-matnr.
if itab-UOM <> mara-<UOM>.
Use any one of the following FMs
CONVERT_CURRENCY_BY_RATE
CONVERT_COUNTRY_CURRENCY
CONVERT_AMOUNT_TO_CURRENCY
CONVERT_TO_FOREIGN_CURRENCY
CONVERT_TO_LOCAL_CURRENCY
CONVERT_TO_TC_CURR
to convert the price in the file to a new price with unit in the material master.
modify itab.
clear itab.
endloop.
3) Upload to material master using BAPI/BDC.
Regards,
Ravi
‎2006 Apr 11 9:56 AM
Hi
Try this process
In the program after you giving the Bdc statement do the appropriate validation and than u pass that data to the respective fields.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSW'.
perform bdc_field using 'RMMG1-MATNR'
'000000000000000022'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '3005'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'SKTEXT-MAKTX(01)'.
perform bdc_field using 'SKTEXT-MAKTX(01)'
newdesc.
perform bdc_field using 'MARA-MEINS'
'EA'.
perform bdc_field using 'MARA-MATKL'
'01'.
perform bdc_field using 'MARA-SPART'
'00'.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_field using 'MARA-BRGEW'
'12'.
perform bdc_field using 'MARA-GEWEI'
'KG'.
perform bdc_field using 'MARA-NTGEW'
'10'.
ws_mode = 'N'.
call transaction 'MM02' using bdcdata mode ws_mode
messages into messtab.
*loop at bdcdata.
*if bdcdata-fval eq newdesc.
itab-matnr = matnr.
*itab-olddesc = myvar.
itab-maktx = 'hail' .
append itab.
perform field_catalog changing fcat.
perform field_lay changing layout.
dont follow this but after this statement you do the required validations.
Thanksa
Mrutyunjaua Tripathy