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
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.
SAP Plant Details Company code and Controlling Area for a Plant
To extract the Plant Details, Company Code details and Controlling area details for a Plant the following Function Module can be used.
ITOB_CHECK_PLANT
The above mentioned function module extracts all the details from the table T001W Plants/Branches, it also extracts details from the following fields.
T001K-BUKRS Company Code TKA01-KOKRS Controlling Area
Following are the Input Parameters
T001W-WERKS PLANT SY-BINPT Batch input, program running under batch input TKA02-GSBER Business Area 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 SY-MSGTY Messages, message type
Find the program below.
REPORT ZEX_ITOBCHECKPLANT .
Parameter: p_werks like T001W-WERKS.
Data: wa_plant type T001W, d_bukrs like T001K-BUKRS, d_kokrs like TKA01-KOKRS.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.