Tuesday, July 1, 2008

SAP Plant Storage Location Data

SAP Plant Storage Location Data

To extract SAP Plant and Storage Location Data the following Function Module can be used

SAP ABAP Function Module to extract PLANT and STORAGE Location Data.

ITOB_CHECK_PLANT_STORAGE
_______________________________________________


Important SAP MASTER Tables associated with this Function Module are as follows.

TVKO                    SAP Sales organization
TVTW                    SAP Distribution channel
TVST                     SAP Shipping point/receiving point
LFA1                     SAP Vendor's account number
KNA1                    SAP Account number of customer
T001W                  SAP Plant
TSPA                     SAP Division
______________________________________________________

Import Parameters for the above mentioned Function Module are as follows

T001L-LGORT                 Storage location
T001L-WERKS                 Plant
SY-BINPT                        Batch input, program running under batch input (Dialog Mode)
SY-BINPT                        Batch input, program running under batch input (Dialog Cursor)
DD03D-FIELDNAME       Field name
SY-STEPL                        Screens, current table line index
SY-BINPT                        Batch input, program running under batch input (Initial Message Data)
SY-MSGTY                      Messages, message type
_______________________________________________________

The following fields are outputted

Plant, Storage location, Description of storage location, Division, Negative stocks allowed in storage location, Freezing book inventory bal., allowed in stor. loc., Storage location MRP indicator, Storage location authorization for goods movements active, Storage location is allocated to resource (storage resource), Handling unit requirement, Partner storage location of the handling unit, Sales organization, Distribution channel, Shipping point/receiving point, Vendor's account number, Account number of customer.
_______________________________________________________

Code is given below.

REPORT ZEX_ITOBPLANTSTORAGELOC.

Parameter: p_werks like T001L-WERKS,
           p_lgort like T001L-LGORT.

Data: wa_T001L type T001L.

 CALL FUNCTION 'ITOB_CHECK_PLANT_STORAGE'
   EXPORTING
     LAGER_IMP               = p_werks
     WERK_IMP                = p_lgort
    USE_BUF                 = 'X'
    DIALOG_MODE             = 'X'
    DIALOG_CURSOR           = ' '
    DIALOG_STEPL            = 0
    INIT_MESSAGE_DATA       = 'X'
    X_MESS_TYPE             = 'E'
  IMPORTING
    T001L_EXP               = wa_T001L
  EXCEPTIONS
    EMPTY_KEY               = 1
    APPLICATION_ERROR       = 2
    OTHERS                  = 3
           .
 IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 ENDIF.


See Also:
SAP Locating Plants for a Given Material
SAP get Plant Description For a given Material
SAP PLANT MATERIAL and STORAGE LOCATION
Company Code For a Plant
Plant Details Company Code and Controlling Area


No comments:

Post a Comment