Saturday, May 31, 2008

SAP BAPI for displaying Material Data

SAP BAPI for displaying Material Data

If you wish to display Material data related to Material General Data, Material Plant Data and Material Valuation Data then you can use the following BAPI. This BAPI displays the above mentioned data for a Material.

BAPI/Function Module to display Material Data / Display Material Data BAPI/Function Module

BAPI_MATERIAL_GET_DETAIL

This BAPI has 4 input parameters

Material  (Mandatory)
Plant
Valuation Area
Valuation Type

Please find the code below.

REPORT ZEX_GETMATDET .

Parameters: p_matnr like BAPIMATDET-MATERIAL,
            p_werks like BAPIMATALL-PLANT,
            p_valara like BAPIMATALL-VAL_AREA,
            p_valtyp like BAPIMATALL-VAL_TYPE.


Data: st_matgendata like BAPIMATDOA,
      st_matplantdat like BAPIMATDOC,
      st_matvaldat like BAPIMATDOBEW,
      d_return like BAPIRETURN.


CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'
  EXPORTING
   MATERIAL                   = p_matnr
   PLANT                       = p_werks
   VALUATIONAREA               = p_valara
   VALUATIONTYPE               = p_valtyp
 IMPORTING
   MATERIAL_GENERAL_DATA       = st_matgendata
   RETURN                      = d_return
   MATERIALPLANTDATA           = st_matplantdat
   MATERIALVALUATIONDATA       = st_matvaldat .

   If sy-subrc = 0.

   endif.


Important Transactions related to Material Management

Create General

MM01 Immediate
MM11 Schedule
____________________________________________

Create Special

MMR1 Raw Material
MMB1 Semi finished  Product
MMF1 Finished Product
MMI1 Operating Supplies
MMH1 Trading Goods
MMU1 Non Valuated Material
MMN1 Non Stock Material
MMV1 Packaging
MMl1 Empties
MMS1 Services
MMk1 Configurable Material
MMP1 Maintenance Assembly
MMW1 Competitor Product
MMG1 Returnable Packaging
______________________________________________

Change

MM02 Immediately
MM12 Schedule
MM13 Active
______________________________________________

Display

MMO3 Current
MM19 Display at Key Date




 

 



Finding Path to SAP Transaction in the Menu

Finding Path to SAP Transaction in  Menu

You may be knowing the SAP transaction, and would like to trace the path to this transaction in the SAP menu. To do this SAP has provided a way. There is a transaction called SEARCH_SAP_MENU.

With the help of this transaction you can easily search the path to a particular transaction. For example if you wish to search the path to the transaction XD01 (Create Customer Centrally) then you can execute the transaction
SEARCH_SAP_MENU and hit enter. You will see the following. You can then choose the one that has the shortest path.

Finding SAP Transaction in the Menu
SEARCH_SAP_MENU

Node               Transaction code    Text                                  
                                                                             
Nodes              XD01                Full                                  
Preceding node                         Create                                
Preceding node                         Customer                              
Preceding node                         Business partner                      
Preceding node                         Customer                              
Preceding node                         Environment                           
Preceding node                         Customer Rebate Arrangements          
Preceding node                         Subsequent Settlement                 
Preceding node                         Master Data                           
Preceding node                         Purchasing                            
Preceding node                         Materials Management                  
Preceding node                         Logistics                             
                                                                             
Nodes              XD01                Create                                
Preceding node                         Customer                              
Preceding node                         Master Data                           
Preceding node                         Import / Export                       
Preceding node                         General Foreign Trade Processing      
Preceding node                         Foreign Trade/Customs                 
Preceding node                         Materials Management                  
Preceding node                         Logistics                             
                                                                             
Nodes              XD01                Central                               
Preceding node                         Create                                
Preceding node                         Customer Master                       
Preceding node                         Environment                           
Preceding node                         General Foreign Trade Processing      
Preceding node                         Foreign Trade/Customs                 
Preceding node                         Materials Management                  
Preceding node                         Logistics                             

Nodes              XD01                Complete                                    
Preceding node                         Create                                      
Preceding node                         Customer                                    
Preceding node                         Business partners                           
Preceding node                         Master Data                                 
Preceding node                         Sales and Distribution                      
Preceding node                         Logistics                                   
                                                                                   
Nodes              XD01                Create                                      
Preceding node                         Customer                                    
Preceding node                         Master Data                                 
Preceding node                         Import / Export                             
Preceding node                         General Foreign Trade Processing            
Preceding node                         Foreign Trade/Customs                       
Preceding node                         Sales and Distribution                      
Preceding node                         Logistics                                   
                                                                                   
Nodes              XD01                Central                                     
Preceding node                         Create                                      
Preceding node                         Customer Master                             
Preceding node                         Environment                                 
Preceding node                         General Foreign Trade Processing            
Preceding node                         Foreign Trade/Customs                       
Preceding node                         Sales and Distribution                      
Preceding node                         Logistics                                   
                                                                                   
Nodes              XD01                Total                                       
Preceding node                         Create                                      
Preceding node                         Customer                                    
Preceding node                         Partner                                     
Preceding node                         Master Data                                 
Preceding node                         Logistics Execution                         
Preceding node                         Logistics                                   

                                                                         
Nodes              XD01                Complete                          
Preceding node                         Create                            
Preceding node                         Customer                          
Preceding node                         Business partners                 
Preceding node                         Master Data                       
Preceding node                         Sales and Distribution            
Preceding node                         Environment                       
Preceding node                         Service Processing                
Preceding node                         Customer Service                  
Preceding node                         Logistics                         
                                                                         
Nodes              XD01                Complete                          
Preceding node                         Create                            
Preceding node                         Customer                          
Preceding node                         Business partners                 
Preceding node                         Master Data                       
Preceding node                         Sales and Distribution            
Preceding node                         Environment                       
Preceding node                         Service Agreements                
Preceding node                         Customer Service                  
Preceding node                         Logistics                         
                                                                         
Nodes              XD01                Full                              
Preceding node                         Create                            
Preceding node                         Customer                          
Preceding node                         Business partner                  
Preceding node                         Customer                          
Preceding node                         Master Data                       
Preceding node                         Environment                       
Preceding node                         Agency Business                   
Preceding node                         Logistics  

                    




SAP function Module to get vendor Bank Details

SAP function Module to get vendor Bank Details

If you wish to extract the bank details of a particular vendor then you can use the following BAPI.

BAPI/Function Module  for vendor bank details extraction

BAPI_VENDOR_GETDETAIL


Please find below the code to extract vendor Bank Details.

REPORT ZEX_CUSTOMERBANK .


Parameters: p_kunnr like BAPICUSTOMER_ID-CUSTOMER,
            p_bukrs like BAPICUSTOMER_ID-COMP_CODE.

Data: ty_knbk type knbk,
      ty_custadd type BAPICUSTOMER_04,
      ty_custgendet type BAPICUSTOMER_KNA1,
      ty_custcompdet type BAPICUSTOMER_05,
      d_ret         like BAPIRET1.

Data: wa_custadd like ty_custadd,
      wa_custgendet like ty_custgendet,
      wa_custcompdet like ty_custcompdet.

Data: int_knbk like ty_knbk occurs 0.

CALL FUNCTION 'BAPI_CUSTOMER_GETDETAIL2'
  EXPORTING
    CUSTOMERNO                  = p_kunnr
   COMPANYCODE                  = p_bukrs
 IMPORTING
   CUSTOMERADDRESS              = wa_custadd
   CUSTOMERGENERALDETAIL        = wa_custgendet
   CUSTOMERCOMPANYDETAIL        = wa_custcompdet
   RETURN                       = d_ret
 TABLES
   CUSTOMERBANKDETAIL           = int_knbk      .

   if sy-subrc = 0.

   Endif.



Related Topics:

Read Vendor