Material Master methods

Ronen Fox Ronen.Fox at ness.com
Thu Jan 16 07:04:15 EST 2003


Les,
 
Just did the same thing a few days ago...
enclosed is the coding for a new method for BUS1001006 that creates a
specific view for a material. You have to send the view type as a parameter
for this method to work.
 
Steps for implementing the method
 
1. Create a subtype for BUS1001006
 
2. In the subtype create a new method called 'create_specific_view'
 
3. Create the following parameter for the method:
name: MaintenanceStatus
attribute: import
data ref table: MOFF
data ref field: STATM
 
4. Create the following coding for the method:
 
BEGIN_METHOD CREATE_SPECIFIC_VIEW CHANGING CONTAINER.
 
  DATA: MAINTENANCESTATUS LIKE SY-ENTRY.
  DATA: IT_MOFF TYPE MOFF.
 
  SWC_GET_ELEMENT CONTAINER 'MaintenanceStatus' MAINTENANCESTATUS.
 
    SELECT SINGLE * FROM MOFF INTO IT_MOFF
                              WHERE STATM = MAINTENANCESTATUS
                              AND   MATNR =  OBJECT-KEY-MATERIAL.
     IF SY-SUBRC IS INITIAL.
       PERFORM CREATE_ONE_VIEW USING IT_MOFF.
    ENDIF.
 
END_METHOD.
 
FORM CREATE_ONE_VIEW USING MOFF STRUCTURE MOFF.
    SET PARAMETER ID 'MAT' FIELD OBJECT-KEY-MATERIAL.
*   Verfahren aus MM03oF00/material_pflegen
    SET PARAMETER ID 'WRK' FIELD MOFF-WERKS.
    SET PARAMETER ID 'VKO' FIELD MOFF-VKORG.
    IF MOFF-STATM = 'B' OR MOFF-STATM = 'G'.
*      CASE TCURM-BWKRS_CUS.
*        WHEN '3'.  "bewbukrs.
*          SET PARAMETER ID 'BUK' FIELD MOFF-BWKEY.
*        WHEN '1'.  "bewwerks.
*          SET PARAMETER ID 'WRK' FIELD MOFF-BWKEY.
*        WHEN OTHERS.
*          SET PARAMETER ID 'BWK' FIELD MOFF-BWKEY.
*      ENDCASE.
    ENDIF.
    SET PARAMETER ID 'LAG' FIELD MOFF-LGORT.
    SET PARAMETER ID 'LGN' FIELD MOFF-LGNUM.
    SET PARAMETER ID 'MTA' FIELD MOFF-MTART.
    SET PARAMETER ID 'MTP' FIELD MOFF-MBRSH.
    SET PARAMETER ID 'VTW' FIELD MOFF-VTWEG.
    SET PARAMETER ID 'BWT' FIELD ' '.
    SET PARAMETER ID 'LGT' FIELD ' '.
 
    SET PARAMETER ID 'MXX' FIELD MOFF-STATM.    "Sicht-Popup #bergehen
    SET PARAMETER ID 'MM5' FIELD ' '.           "Org-Popup #bergehen
    SET PARAMETER ID 'MM6' FIELD ' '.           "Mat.VB durchlaufen-Flag
 
    CALL TRANSACTION 'MM01' AND SKIP FIRST SCREEN.
 
ENDFORM.
 
 
5. Create a task based on the method and make sure to pass the view type to
the task via the binding in the workflow step
 
Hope this helps...
 
Thank you
Ronen Fox
 
 
 
 
-----Original Message-----
From: Stiles, Les [mailto:Les.Stiles at icn.siemens.com]
Sent: Wednesday, January 15, 2003 6:02 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Material Master methods
 
 
I am looking for the methodology to create views for new Material Masters
via workflow. The Basic view is created via data transfer from another
system and now I plan to use custom BUS1001006 sychronous methods to
individually create views by responsible users is our 4.6C system.
 
I have researched this forum and found much information on this subject, but
have been unable to find any working sample program code that this
non-ABAPer could modify to create the Views individually.
 
Any help would be greatly appreciated,
 
Les Stiles
Systems Analyst, QM & WF
Siemens ICN
400 Rinehart Rd
Lake Mary FL 32746
(407) 942-6777
les.stiles at icn.siemens.com
 


More information about the SAP-WUG mailing list