cancel
Showing results for 
Search instead for 
Did you mean: 

mandatory fields!

Former Member
0 Kudos

Hi,

I dunt have a live system here...Can anyone send me the screen shots of the whole process of creation of a material? using MM01?

PLease its very very urgent..

I just want to know where these mandatory fields fall in which screens in the SD perspective.. in basic data1

sales org1 / sales org2/ sales/ general/ mrp1/ accounting 1

Material name

Gross weight

Net weight

Quantity

Division

Plant

MRP type

Availability check

Price

Material Description

Unit of measure

Valuation Class

Purchasing Group

Material Group

Profit center

Regards

AK

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

This step-by-step code sample helps you upload data using BDC.

Procedure

Give the t-code shdb in the command field.

Click the new recording button.

Give a name to the recording and the t-code you want to record.

E.g.:

Recording : ZMAT_UPLOAD

Transaction code : MM01

When you click save, it takes you to t-code (MM01) you would like to do recording for upload.

Record carefully. Fill in the details you want to upload. In this case I have entered the material no, industry sector, material type, material description and basic unit of measure.

Then the Transaction recorder – edit recording ZMAT_UPLOAD screen is displayed. You can edit your recording or just save it and click back button.

Select your recording and click create program button.

Enter the program name say ZMAT_UPLOAD.Select the transfer from recording option. Save it.Give the program title, type as executable program and click source code button at the bottom.

The following piece of code is generated automatically.

report ZMAT_UPLOAD

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

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'

'MYMATERIAL10'.

perform bdc_field using 'RMMG1-MBRSH'

'P'.

perform bdc_field using 'RMMG1-MTART'

'ZOH'.

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' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

'MY MATERIAL10'.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

'G'.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_transaction using 'MM01'.

Perform close_group.

From the above code it is clear that recording has been created using matnr = mymaterial10 , industry sector = p , material type = zoh , description = my material10 , basic unit of measure = g. For our case I have assumed industry sector and material type to be constant and have not included in flat file.

The bold lines in the below code are the changes made to the sap generated program , to upload our data.

report ZMAT_UPLOAD

no standard page heading line-size 255.

types declaration..........................................................................

types : begin of t_mat,

matnr(20),

desc(50),

uom(5),

end of t_mat.

internal table and workarea declaration.......................................

data : i_mat type table of t_mat.

data : wa_mat type t_mat.

include bdcrecx1.

start-of-selection.

moving the flat file content to internal table................................

CALL FUNCTION 'UPLOAD'

EXPORTING

FILETYPE = 'DAT'

TABLES

data_tab = i_mat

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

perform open_group.

loop at i_mat into wa_mat.

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'

wa_mat-matnr.

perform bdc_field using 'RMMG1-MBRSH'

'P'.

perform bdc_field using 'RMMG1-MTART'

'ZOH'.

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' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

wa_mat-desc.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

wa_mat-uom.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_transaction using 'MM01'.

endloop.

Perform close_group.

Regards.