cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Report

Former Member
0 Kudos

Hi All,

I am creating material master data

I am taking material type as Finished product

Now I want to select all the views available and want to create a material. Can any one tell me wat r all the mandatory fields i have to enter on the screens

Its a little bit urdent,plse

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To view the material types, follow the menu path:

Logistics – General --> Material Master --> Basic Setting --> Material Types --> Define Attributes of Material Types (click clock icon )

Which takes you to the next screen.

Note that SAP comes with a large number of material types already defined. Click on the display/change icon to change to display mode. The screen title should change to Display View “Material types’: Overview. Select material type FERT, then click on the Details icon.

This screen defines the characteristics of this material type.

Under the "User Departments" tab, you will see the views (selected) that are relevant for the material type selected.

These items determine which views are available when a new material of this type is created.

Txn OMS2 - Material Type Maintenance

Try using the FM 'SELECTION_VIEWS_FIND'.

You have to pass the following parameter values:

bildsequenz = mbref (from table T134 for corresponding material type) and

pflegestatus = bilds (from table T133K for corresponding screen sequence from the T134 table)..




"This function module returns the selected views in a table.

codeDATA : v_mbref TYPE mbref,
v_bildsequenz TYPE bildsq.

DATA : i_mbildtab LIKE mbildtab OCCURS 0.

SELECT SINGLE mbref FROM t134 INTO v_mbref WHERE mtart = wa_mara-mtart.

SELECT SINGLE bilds FROM t133k INTO v_bildsequenz WHERE mbref = v_mbref.

CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = v_bildsequenz
pflegestatus = wa_mara-pstat
TABLES
bildtab = i_mbildtab

EXCEPTIONS 
CALL_WRONG = 1 
EMPTY_SELECTION = 2 
OTHERS = 3 
.

Configure the Material Master Screen MM01 / MM02 / MM03

OMSR - Assign the field to the field group

OMS9 - Maintain the data screen field

Hope this helps.

Thanks

Balaji

Edited by: Balaji Ganapathiraman on Mar 21, 2008 11:51 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hai.

check the example codes.

REPORT zmm_mat_master_non_stock

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_mat OCCURS 0,

  • mbrsh(001), " Industry Sector

  • mtart(004), " Material Type

  • Views

  • Organization Levels

  • werks(004), " Plant

  • Basic Data1 View

maktx(040), " Material Description

  • meins(003), " Unit of Measure

matkl(009), " Material Group

  • MTPOS_MARA(004), " Gen Item Category

  • Purchasing

ekgrp(003), " Purchasing Group

END OF i_mat.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X'. " Flag

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_mat

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

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

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

ENDIF.

  • Upload the Data from Internal Table

LOOP AT i_mat.

  • Basic Screen

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-MBRSH'

'C'."i_mat-mbrsh.

PERFORM bdc_field USING 'RMMG1-MTART'

'NLAG'."i_mat-mtart.

  • Views Selection

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(08)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'

c_x."i_mat-kzsel_01.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'

c_x."i_mat-kzsel_02.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(08)'

c_x."i_mat-kzsel_08.

  • Organization Levels

PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMG1-WERKS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'RMMG1-WERKS'

'2000'."i_mat-werks.

  • Basic data1 View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

i_mat-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARA-MTPOS_MARA'.

PERFORM bdc_field USING 'MARA-MEINS'

'EA'."i_mat-meins.

PERFORM bdc_field USING 'MARA-MATKL'

i_mat-matkl.

PERFORM bdc_field USING 'MARA-MTPOS_MARA'

'NLAG'."i_mat-mtpos_mara.

  • Basic data2 View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

  • Purchasing View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

PERFORM bdc_field USING 'MARC-EKGRP'

i_mat-ekgrp.

  • Call The Transaction

PERFORM bdc_transaction USING 'MM01'.

ENDLOOP.

  • Close the BDC Session

PERFORM close_group.

-


REPORT zmm_mat_master_non_stock

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_mat OCCURS 0,

  • mbrsh(001), " Industry Sector

  • mtart(004), " Material Type

  • Views

  • Organization Levels

  • werks(004), " Plant

  • Basic Data1 View

maktx(040), " Material Description

  • meins(003), " Unit of Measure

matkl(009), " Material Group

  • MTPOS_MARA(004), " Gen Item Category

  • Purchasing

ekgrp(003), " Purchasing Group

END OF i_mat.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X'. " Flag

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_mat

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

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

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

ENDIF.

  • Upload the Data from Internal Table

LOOP AT i_mat.

  • Basic Screen

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-MBRSH'

'C'."i_mat-mbrsh.

PERFORM bdc_field USING 'RMMG1-MTART'

'NLAG'."i_mat-mtart.

  • Views Selection

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(08)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'

c_x."i_mat-kzsel_01.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'

c_x."i_mat-kzsel_02.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(08)'

c_x."i_mat-kzsel_08.

  • Organization Levels

PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMG1-WERKS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'RMMG1-WERKS'

'2000'."i_mat-werks.

  • Basic data1 View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

i_mat-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARA-MTPOS_MARA'.

PERFORM bdc_field USING 'MARA-MEINS'

'EA'."i_mat-meins.

PERFORM bdc_field USING 'MARA-MATKL'

i_mat-matkl.

PERFORM bdc_field USING 'MARA-MTPOS_MARA'

'NLAG'."i_mat-mtpos_mara.

  • Basic data2 View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

  • Purchasing View

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

PERFORM bdc_field USING 'MARC-EKGRP'

i_mat-ekgrp.

  • Call The Transaction

PERFORM bdc_transaction USING 'MM01'.

ENDLOOP.

  • Close the BDC Session

PERFORM close_group.

regards.

sowjanya.b