SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

FAQ



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ММ
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Tue Sep 18, 2007 10:58 am    Post subject: FAQ Reply with quote

Глоссарий

Контировка - это указание объектов (т.е. места возникновения затрат (МВЗ), заказа клиента, проекта), которые дебетуются во время обработки заказа на поставку материала, предназначенного для немедленного использования или расхода.

Заявка на материал и/или работы/услуги (Purchase Requisition) – это запрос в компонент Закупки с целью заготовки к определенному времени необходимого количества материалов или работ/услуг. Тр. me51n, me52n, me53n.

Заказ на поставку (Purchase Order) – это формальный запрос, который направляется закупочной организацией поставщику или заводу с просьбой поставить к указанной дате определенное количество материала или предоставить требуемый объем работ/услуг. Тр. me21n, me22n, me23n.

MM document flow

1) Purchasing Requisition -> sent by inventory dept to purchasing dept
2) Request for Quotation(RFQ)-> Purchasing Dept shall ask the vendors to give the quotation for the requested materials by inventory.
3) Quotation -> Quotation is sent by vendors to the company
4) Purchase order-> Based on all parameters of a quotation sent by vendors. Vendors are selected from whom the material has to be obtained. The company gives purchase order to the vendor.
5) Good's receipt -> vendors sends the goods to the company with goods receipt
6) Invoice verification -> this receipt. done based on good's this means that the ordered goods have reached or not.
7) Payment -> payment is done based on invoice verification. this is (FI/CO)

In the purchase requisition the source of supply can be found. If there is no source of supply can be allocated then marked for request for quotation. They sent to different vendors for requesting the quotations. All the incoming quotations are compared and a vendor is selected. The vendor evaluation simplifies the process of selecting the vendor. Then purchase orders are created with or without reference to purchase requisition or quotation. There is maintenance of long term agreements with a vendor is either a contract or scheduling agreements. A contract is an agreement with a vendor that specifies a target quantity or value over validity period. A scheduling agreement designates a specific quantity within the validity period and contains definite delivery dates in the form of delivery schedule. The goods received are compared with the corresponding Purchase Order. The posted goods update the stock levels.

Transactions:
INQUIRY - VA11
QUOTATION - VA21
PURCHASE ORDER - ME21
ORDER CONFIRMATION - VA01
PICKING LIST - VL36
PACKING LIST - VL02, VL01
SHIPPING - VT01
INVOICE - VF21, VF01

MM Cycle:
Purchase Requisition-> Staff in an orgn places Pur requisition for want of some goods/products - ME51

Request for Quotation (RFQ)-> The Purchase dept in the organ calls/requests for the quotation for the products against which PR was raised. - ME41

Vendor Evaluation->After receiving the RFQ's, after comparison a Vendor is finalized based on the terms and conditions.

Purchase Order (PO) -> Pur order was issued to that vendor asking him to supply the goods/products -ME21N

Goods Receipt Note (GRN) ->Vendor supplies the material/Products to the orgn - MB01
Goods Issue (GI) -> People receives their respective items for which they have placed the Requisitions

Invoice Verification-> Along with the Material Vendor submits a Invoice for which the Company Pays the amount - .MIRO

Data to FI -> data will be posted to FI as per the vendor invoices

Enquiry - Customer enquires about the Products services that were sold by a company - VA11
Quotation - Company Gives a Quotation for the products and Services to a Customer

Sales Order - Customer gives a Purchase order to the company against which a Sales order will be raised to Customer in SAP.
VBAK: Sales Document(Header Data) (VBELN)
VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
Enquiry, Quotation, Sales Order are differentiated based on Doc.
Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
for Quotation 'B' & for Order it is 'C'.)

Delivery(Picking, Packing, Post Goods Issue and Shipment)->
Company sends the material after picking it from Godown and Packing it in a Handling Unit(box) and Issues the goods
LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
(LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)

Billing - Also company bills to the customer for those deliveries
And in FI against this billing Accounting doc is created.
VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
(VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
Apart from these tables there are lot of other tables which starts with
'V', but we use the following tables frequently.

MM Process flow:
The typical procurement cycle for a service or material consists of the following phases:
1. Determination of Requirements
Materials requirements are identified either in the user departments or via materials planning and control. (This can cover both MRP proper and the demand-based approach to inventory control. The regular checking of stock levels of materials defined by master records, use of the order-point method, and forecasting on the basis of past usage are important aspects of the latter.) You can enter purchase requisitions yourself, or they can be generated automatically by the materials planning and control system.
2. Source Determination
the Purchasing component helps you identify potential sources of supply based on past orders and existing longer-term purchase agreements. This speeds the process of creating requests for quotation (RFQs), which can be sent to vendors electronically via SAP EDI, if desired.
3. Vendor Selection and Comparison of Quotations
The system is capable of simulating pricing scenarios, allowing you to compare a number of different quotations. Rejection letters can be sent automatically.
4. Purchase Order Processing
the Purchasing system adopts information from the requisition and the quotation to help you create a purchase order. As with purchase requisitions, you can generate Pos yourself or have the system generate them automatically. Vendor scheduling agreements and contracts (in the SAP System, types of longer-term purchase agreement) are also supported.
5. Purchase Order Follow-Up
the system checks the reminder periods you have specified and - if necessary - automatically prints reminders or expediters at the predefined intervals. It also provides you with an up-to-date status of all purchase requisitions, quotations, and purchase orders.
6. Goods receiving and Inventory Management
Goods Receiving personnel can confirm the receipt of goods simply by entering the Po number. By specifying permissible tolerances, buyers can limit over- and under deliveries of ordered goods.
7. Invoice Verification
The system supports the checking and matching of invoices. The accounts payable clerk is notified of quantity and price variances because the system has access to PO and goods receipt data. This speeds the process of auditing and clearing invoices for payment.

SAP consulting/FAQ notes

412789 (Restrictions for product selection)
550396 (FAQ: Material substitution and product selection)
870085 (FAQ: Product proposal)
869601 (FAQ: Cross-Selling)
863767 (FAQ: Listing/Exclusion)
865302 (Listing/Exclusion: Defining own requirement)

Important Tables in SAP MM

Materials Management Tables

EINA Purchasing Info Record- General Data
EINE Purchasing Info Record- Purchasing Organization Data
MAKT Material Descriptions
MARA General Material Data
MARC Plant Data for Material
MARD Storage Location Data for Material
MAST Material to BOM Link
MBEW Material Valuation
MKPF Header- Material Document, XBLNR – Ссылочный номер документа ( в 631 виде движения ссылается на поставку )
MSEG Document Segment- Material
MVER Material Consumption
MVKE Sales Data for materials
RKPF Document Header- Reservation
T023 Mat. groups
T024 Purchasing Groups
T156 Movement Type
T157H Help Texts for Movement Types
MOFF Lists what views have not been created

Purchasing Tables

A501 Plant/Material
EBAN Purchase Requisition
EBKN Purchase Requisition Account Assignment
EKAB Release Documentation
EKBE History per Purchasing Document
EKET Scheduling Agreement Schedule Lines
EKKN Account Assignment in Purchasing Document
EKKO Purchasing Document Header
EKPO Purchasing Document Item
EKES Подтверждения заказов на поставку
IKPF Header- Physical Inventory Document
ISEG Physical Inventory Document Items
LFA1 Vendor Master (General section)
LFB1 Vendor Master (Company Code)
NRIV Number range intervals
RESB Reservation/dependent requirements
T161T Texts for Purchasing Document Types
WRPL - Пополнение запасов: количеств на клиента/товар ( у нас, в таблице видно потребности дискаунтеров в материалах )
KUNNR – клиент ( дискаунтер )
MATNR – материал
PRWOG - Максимальный заданный объем запасов (при наличии материала дискаунтер пополняется именно по этому значению).

MM Functions modules

CONVERSION_EXIT_MATN1_OUTPUT - Material number conversion (OUTPUT) E.g. 00001234 -> 1234

CONVERSION_EXIT_MATN1_INPUT - Material number conversion (INPUT) E.g. 1234 -> 000000000000001234
For material numbers conversion, in contrast to simple ALPHA conversion, more complicated logic is used including customer exit MGA00003 (see transaction SMOD).

MD_CONVERT_MATERIAL_UNIT - Conversion of material units

Code:
DATA: l_menge  TYPE ekpo-menge,
       l_factor TYPE ekpo-menge.

     l_menge = 1.
     CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
       EXPORTING
         i_matnr              = wose_items-matnr
         i_in_me              = l_ausme
         i_out_me             = l_meins
         i_menge              = l_menge
       IMPORTING
         e_menge              = l_factor
       EXCEPTIONS
         error_in_application = 1
         error                = 2
         OTHERS               = 3.


SELECTION_VIEWS_FIND - Determine Views for View Selection or View Configuration
One of functional modules for those who still has to use BDC for Material Master transactions (MM01 and MM02). Allows to determine line number for desired view in the "Select View(s)" window, to prepare BDC for the view access.

ME_READ_HISTORY - Read History of Purchasing Document

ME_DISPLAY_PURCHASE_DOCUMENT
Will be called:
I_EDIT='X' => ME22
I_DISPLAY_ONLY='X' or default => ME23
I_ENJOY='X' => new transactions: ME23N / ME22N
I_PREVIEW='X' => screen preview for default output type
Code:

READ TABLE i_list_pos INDEX pu_selfield-tabindex.
       IF sy-subrc = 0.
         CALL FUNCTION 'ME_DISPLAY_PURCHASE_DOCUMENT'
           EXPORTING
             i_ebeln              = i_list_pos-ebeln
             i_ebelp              = i_list_pos-ebelp
             i_enjoy              = 'X'
           EXCEPTIONS
             not_found            = 1
             no_authority         = 2
             invalid_call         = 3
             preview_not_possible = 4
             OTHERS               = 5.
       ENDIF.


BAPI_PO_CREATE - Create purchase order

BAPI_PO_CREATE1 - Create purchase order
Both BAPIs create an PO, but BAPI_PO_CREATE1:
allows much more things: entering conditions, test mode, hold uncomplete POs etc.
not listen in BAPI transaction (4.6C), because this method of 2012 business object is not released
Code:

* Service record for EKPO line. This is the parent service
* record for the service package.
CLEAR gw_serv.
gw_serv-pckg_no = w_packno. " generated package number
gw_serv-line_no = 1.
gw_serv-ext_line = '0'.
gw_serv-outl_level = '0'.
gw_serv-outl_ind = SPACE.
gw_serv-subpckg_no = w_packno + 1. " child line package number
gw_serv-base_uom = gw_header-meins.
gw_serv-short_text = gw_header-work_desc.
* gw_serv-pln_pckg = '0000000060'.
* gw_serv-pln_line = '0000000001'.
APPEND gw_serv to gt_serv.

* Create the child service lines for the service package.
* The link between the two is the package number on these which
* is the same as the sub-package number on the parent line.
CLEAR gw_serv.
gw_serv-pckg_no = w_packno + 1. " child line package number
w_line_no = w_line_no + 1.
gw_serv-line_no = w_line_no.
w_ext_line = w_ext_line + 10.
gw_serv-ext_line = w_ext_line.
gw_serv-outl_level = '0'.
gw_serv-outl_ind = SPACE.
gw_serv-subpckg_no = '0000000000'.
gw_serv-quantity = gw_items2-netwr.
gw_serv-gr_price = '1'.
gw_serv-base_uom = gw_header-meins.
gw_serv-short_text = gw_items2-txz01.
gw_serv-pln_pckg = w_packno + 1.
gw_serv-pln_line = w_line_no.
APPEND gw_serv to gt_serv.

* Account assignments for services lines.
CLEAR gw_acc.
gw_acc-po_item = w_ebelp.
w_serial_no = w_serial_no + 1.
gw_acc-serial_no = w_serial_no.
gw_acc-quantity = gw_items2-netwr.
gw_acc-net_value = '1'.
gw_acc-distr_perc = 0.
gw_acc-costcenter = gw_items2-kostl.
gw_acc-gl_account = gw_items2-sakto.
gw_acc-orderid = gw_items2-aufnr.
gw_acc-wbs_element = gw_items2-ps_psp_pnr.
APPEND gw_acc to gt_acc.

CLEAR gw_accx.
gw_accx-po_item = w_ebelp.
gw_accx-serial_no = w_serial_no.
gw_accx-po_itemx = 'X'.
gw_accx-serial_nox = 'X'.
gw_accx-quantity = 'X'.
gw_accx-net_value = 'X'.
gw_accx-distr_perc = 'X'.
gw_accx-costcenter = 'X'.
gw_accx-gl_account = 'X'.
gw_accx-orderid = 'X'.
gw_accx-wbs_element = 'X'.
APPEND gw_accx to gt_accx.

* Service account assignments. The link between the service record
* (using packno and line no) and the account assignment record
* (using EKPO line number and serial no).
CLEAR gw_serva.
gw_serva-pckg_no = w_packno + 1. " child line package number
gw_serva-line_no = w_line_no.
gw_serva-serno_line = '01'.
gw_serva-percentage = '100'.
gw_serva-quantity = gw_items2-netwr.
gw_serva-net_value = gw_items2-netwr.
gw_serva-serial_no = w_serial_no.
APPEND gw_serva to gt_serva.

* .......then call the BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = gw_hdr
POHEADERX = gw_hdrx
TESTRUN = SPACE
MEMORY_COMPLETE = gw_memc
MEMORY_UNCOMPLETE = gw_memu
IMPORTING
EXPPURCHASEORDER = gw_ponum
TABLES
RETURN = gt_return
POITEM = gt_itmd
POITEMX = gt_itmdx
POADDRDELIVERY = gt_del
POSCHEDULE = gt_sched
POSCHEDULEX = gt_schedx
POSERVICES = gt_serv
POSRVACCESSVALUES = gt_serva
POACCOUNT = gt_acc
POACCOUNTX = gt_accx
POTEXTHEADER = gt_htxt
EXTENSIONIN = gt_extn.


K_WERKS_OF_BUKRS_FIND - Return a list of all plants for a given company code.

MBEW_EXTEND - Get the stock position for the previous month. This displays the same info that you see in MM03.

ME_REL_INFO - used in PO processing to show release strategies

Code:
FUNCTION z_info_lib_pedido_mm.
*"----------------------------------------------------------------------
*"*"Interfase local
*"  IMPORTING
*"     REFERENCE(EBELN) LIKE  EKKO-EBELN
*"     REFERENCE(TODAS)
*"  TABLES
*"      REL_INFO_GEN STRUCTURE  BAPIRLGNRQ OPTIONAL
*"      REL_PREREQUISITES STRUCTURE  BAPIRLCORQ OPTIONAL
*"      REL_POSTED STRUCTURE  BAPIRLCORQ OPTIONAL
*"      REL_FINAL STRUCTURE  BAPIRLCORQ OPTIONAL
*"----------------------------------------------------------------------
  DATA l_ekko LIKE ekko.

  SELECT SINGLE * FROM ekko
    INTO l_ekko
   WHERE ebeln = ebeln.
  IF sy-subrc = 0.
    if todas = 'X'.
      clear l_ekko-frgzu.
    endif.

    CALL FUNCTION 'ME_REL_INFO'
      EXPORTING
*   I_TITLE                 = ' '
*   I_FRGCO                 = l_ekko-frgco
        i_frgkz                 = l_ekko-frgke
        i_frggr                 = l_ekko-frggr
        i_frgst                 = l_ekko-frgsx
        i_frgzu                 = l_ekko-frgzu
        i_frgot                 = '1'
        i_no_dialog             = '2'
*   I_SUBSCREEN             = ' '
     TABLES
       rel_info_gen            = rel_info_gen
       rel_prerequisites       = rel_prerequisites
       rel_posted              = rel_posted
       rel_final               = rel_final
     EXCEPTIONS
       not_active              = 1
       OTHERS                  = 2.
  ENDIF.

ENDFUNCTION.


WFMC_MESSAGE_SINGLE - Pass the NAST as the parameter and get the print
Code:
REPORT ZREIMPRESION.
TABLES nast.
PARAMETERS: P_EBELN LIKE EKKO-EBELN,
            P_KSCHL LIKE NAST-KSCHL.
SELECT SINGLE * FROM nast
  WHERE kappl = 'EF'
    AND objky = p_ebeln
    AND kschl = p_kschl.
data code like sy-subrc.
CALL FUNCTION 'WFMC_MESSAGE_SINGLE'
  EXPORTING
          pi_nast  = nast
  IMPORTING
          pe_rcode = code.


WFMC_MESSAGE_SINGLE_SCREEN - It allows the rapid reprint of a PO message.

Code:
REPORT ZPREVISUALIZACION.
TABLES nast.
PARAMETERS: P_EBELN LIKE EKKO-EBELN,
            P_KSCHL LIKE NAST-KSCHL.
SELECT SINGLE * FROM nast
  WHERE kappl = 'EF'
    AND objky = p_ebeln
    AND kschl  = p_kschl.
data code like sy-subrc.
CALL FUNCTION 'WFMC_MESSAGE_SINGLE_SCREEN'
     EXPORTING
          pi_nast  = nast
     IMPORTING
          pe_rcode = code.


PRICING - Get Pricing items

Code:

* Author: Sergey Korolev
REPORT z_test_po_cond .

PARAMETERS:
  p_ebeln TYPE ekko-ebeln OBLIGATORY.

DATA:
  ls_komk    TYPE komk,
  ls_komp    TYPE komp,

  lt_komv    TYPE TABLE OF komv,

  ls_t001    TYPE t001,
  ls_t001w   TYPE t001w,
  ls_ekko    TYPE ekko,
  lt_ekpo    TYPE TABLE OF ekpo.

FIELD-SYMBOLS:
  <fs_ekpo> TYPE ekpo.

START-OF-SELECTION.
  CALL FUNCTION 'ME_EKKO_SINGLE_READ'
       EXPORTING
            pi_ebeln         = p_ebeln
       IMPORTING
            po_ekko          = ls_ekko
       EXCEPTIONS
            no_records_found = 1
            OTHERS           = 2.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION 'ME_EKPO_READ_WITH_EBELN'
       EXPORTING
            pi_ebeln             = p_ebeln
       TABLES
            pto_ekpo             = lt_ekpo
       EXCEPTIONS
            err_no_records_found = 1
            OTHERS               = 2.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.


  CALL FUNCTION 'K_READ_T001'
       EXPORTING
            i_bukrs   = ls_ekko-bukrs
       IMPORTING
            e_t001    = ls_t001
       EXCEPTIONS
            not_found = 1
            OTHERS    = 2.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  LOOP AT lt_ekpo ASSIGNING <fs_ekpo>.

    CALL FUNCTION 'MM_REFRESH_PARTNERS'. "buffers free
    CALL FUNCTION 'ME_FILL_KOMK_PO'
         EXPORTING
              i_ekko = ls_ekko
              i_ekpo = <fs_ekpo>
              i_t001 = ls_t001
         IMPORTING
              e_komk = ls_komk.

    CALL FUNCTION 'T001W_SINGLE_READ'
         EXPORTING
              t001w_werks = <fs_ekpo>-werks
         IMPORTING
              wt001w      = ls_t001w
         EXCEPTIONS
              not_found   = 1
              OTHERS      = 2.

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    CALL FUNCTION 'ME_FILL_KOMP_PO'
         EXPORTING
              i_ekpo  = <fs_ekpo>
              i_t001w = ls_t001w
              i_ekko  = ls_ekko
              i_komk  = ls_komk
         IMPORTING
              e_komp  = ls_komp.

    CALL FUNCTION 'PRICING'
         EXPORTING
              comm_head_i = ls_komk
              comm_item_i = ls_komp
         TABLES
              tkomv       = lt_komv.

  ENDLOOP.


BAPI_INCOMINGINVOICE_GETDETAIL
Code:

data: iitems type table of bapi_incinv_detail_item with header line.
data: iretrn type table of bapiret2 with header line.
 
data: invoicedoc type  bapi_incinv_fld-inv_doc_no.
data: fiscalyear type  bapi_incinv_fld-fisc_year.
 
*invoicedoc = '3057'.    "Doesn't work
 invoicedoc = '0000003057'.  "Does work!!
 fiscalyear = '2001'.
 
call function 'BAPI_INCOMINGINVOICE_GETDETAIL'
  exporting
    invoicedocnumber          = invoicedoc
    fiscalyear                = fiscalyear
* IMPORTING
*   HEADERDATA                =
*   ADDRESSDATA               =
  tables
    itemdata                  = iitems
*   ACCOUNTINGDATA            =
*   GLACCOUNTDATA             =
*   MATERIALDATA              =
*   TAXDATA                   =
*   WITHTAXDATA               =
*   VENDORITEMSPLITDATA       =
    return                    = iretrn
          .
check sy-subrc  = 0.


ME_MESSAGES_FIND - Find no of messages for PO
Code:
CALL FUNCTION 'ME_MESSAGES_FIND'
  EXPORTING
    I_EKKO = ekko
    I_VORGA = 'F'
  TABLES
    XNAST = XNAST
    YNAST = YNAST .


Last edited by admin on Thu Jan 31, 2008 3:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 160
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Fri May 22, 2009 2:30 pm    Post subject: Reply with quote

Note 320601 - Finding enhancement for an exit (in purchasing)

1. Execute Transaction SMOD.
2. Use the F4-input help for field "Enhancement"
3. Press button "Information system"
4. Enter "ME" for the development class and press "Enter"
5. You find the enhancement in which your exit is included by using the short text and "Display" (F7).
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ММ All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.