2006 May 16 3:45 PM
Hello
I'm working in SD and I'm doing my first Batch Input called from a program, the problem is when I execute it in mode 'A' or 'E' changes are made, but if I execute it in mode 'N' no changes.
The batch input execute MM01, but exactly when is selecting the views I have to drop down the scroll to select two check box more data is loose (no show on screen) and the action is not completed.
Hope you could give me some ideas because it's urgent.
P.D. The language is 'ES' (Spanish - Español).
Thanks in adavance.
Tokio
2006 May 16 4:27 PM
Hi Tokio,
BAPI_MATERIAL_SAVEDATA is not available in 4.0B.
You need to use BDC to create material. For selecting views, you can use this tables as references to find out the sequence number prior to code the BDC program.
<b>T133A
T133B
T133*</b>
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2006 May 16 3:49 PM
Instead of doing a bdc for mm01 try using the bapi
BAPI_MATERIAL_SAVEDATA.
See the link
http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm
for how to pass the data to the bapi.
This way you can be relieved of handling the scrolling up and down in the screens dynamically.
Regards,
Ravi
2006 May 16 3:51 PM
BDC over MM01 is tough. You will never get it to work 100% evertime. I would strongly suggest using BAPI_MATERIAL_SAVEDATA. Here is a sample program which creates a material with the least amount of data.
report zrich_0003 .
data: headdata type bapimathead.
data: clientdata type bapi_mara.
data: clientdatax type bapi_marax.
data: descdata type table of BAPI_MAKT with header line.
data: return type bapiret2 .
data: returnm type table of bapi_matreturn2 with header line.
data: xmara type mara.
parameters: p_matnr type mara-matnr.
headdata-material = p_matnr.
headdata-ind_sector = 'M'.
headdata-matl_type = 'FERT'.
headdata-basic_view = 'X'.
clientdata-BASE_UOM = 'EA'.
clientdatax-BASE_UOM = 'X'.
clientdata-old_mat_no = 'Old Material'.
clientdatax-old_mat_no = 'X'.
clientdata-division = '00'.
clientdatax-division = 'X'.
descdata-LANGU = sy-langu.
descdata-MATL_DESC = 'This is the description'.
append descdata.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
* PLANTDATA =
* PLANTDATAX =
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
importing
return = return
tables
MATERIALDESCRIPTION = descdata
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
returnmessages = returnm
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
check sy-subrc = 0.
Regards,
Rich Heilman
2006 May 16 3:51 PM
2006 May 16 3:59 PM
Thanks to all of you... but I apologize for answering ... Does 'BAPI_MATERIAL_SAVEDATA' works for v 4.0B?
Tokio
2006 May 16 3:58 PM
Hi,
Its better to use the BAPI FM 'BAPI_MATERIAL_SAVEDATA'.
BDC is not preferable for MM01 transaction where as the standard BAPI FM is available for the same.
Regards,
Sampath.
2006 May 16 4:05 PM
2006 May 16 4:27 PM
Hi Tokio,
BAPI_MATERIAL_SAVEDATA is not available in 4.0B.
You need to use BDC to create material. For selecting views, you can use this tables as references to find out the sequence number prior to code the BDC program.
<b>T133A
T133B
T133*</b>
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2006 May 17 12:39 AM
I have to solve this problem checking the Batch Input which I created, code lines and views selected.
It was a very hard and slow job but I learned, that's the way you get knowlodgement.
Thanks to all of you too, because you're always there, helping people like me (beginner).
Tokio.
2006 May 17 8:50 AM
Hai Takio Franco
Try with the following Code
include bdcrecx1.
tables : mara.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
mbrsh like mara-mbrsh,
mtart like mara-mtart,
maktx like makt-maktx,
meins like mara-meins,
end of it_mara.
start-of-selection.
perform upload_data.
perform open_group.
loop at it_mara.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
it_mara-matnr.
perform bdc_field using 'RMMG1-MBRSH'
it_mara-mbrsh.
perform bdc_field using 'RMMG1-MTART'
it_mara-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
it_mara-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
it_mara-meins.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_transaction using 'MM01'.
endloop.
perform close_group.
&----
*& Form upload_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM upload_data .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'c:\mat_bdc.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_mara.
IF SY-SUBRC = 0.
SORT IT_MARA BY MATNR.
ENDIF.
ENDFORM. " upload_data
flat file structure is
PRANIT_011 CCOUP This is Testing material kg
PRANIT_012 CCOUP This is Testing material kg
PRANIT_013 CCOUP This is Testing material kg
PRANIT_014 CCOUP This is Testing material kg
PRANIT_015 CCOUP This is Testing material kg
Thanks & regards
Sreenivasulu P