Professional Documents
Culture Documents
Solution
Current SAP F4 search doesn’t have this facility. In the new Search Help,
data will be populated in below format:
1. Create a Help View ZMM_MCHB with reference to Table MCHB and View
Fields:
MATNR - Material Number
WERKS - Plant
LGORT - Storage Location
CHARG - Batch Number
CLABS - Valuated Unrestricted-Use Stock
CINSM - Stock in Quality Inspection
CEINM - Total Stock of All Restricted Batches
CSPEM - Blocked Stock
With this Selection Condition, system will select only those Batches
where any one of the stock is positive.
4. Append this Elementary Search Help to the Collective Search help MCH1
Function Module ZBATCH_F4_SHLP_AVSTOCK
We use this custom function module to calculate the Available Stock per
Batch. Please note the below points:
1. As per F1 help of this field, the custom function module should have
same interface as of F4IF_SHLP_EXIT_EXAMPLE.
2. For coding, please refer a similar kind of function module
SAPBC_GLOBAL_F4_SFLIGHT
3. The Custom Function Module will have the below parameters:
TABLES
SHLP_TAB TYPE SHLP_DESCT
RECORD_TAB STRUCTURE SEAHLPRES
CHANGING
VALUE(SHLP) TYPE SHLP_DESCR
VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
3. Call the below function module multiple times and fill the Stockinfo
table. Please refer function module SAPBC_GLOBAL_F4_SFLIGHT DATA
Seatinfo for data declaration
4. After the above step we expect Stockinfo table will have the following form
Matl Plant Sloc Batch Unres Quality Blocked Restricted Available
Stock Stock Stock Stock Stock
MAT1 1000 0001 BATCH1 100 20
MAT1 1000 0001 BATCH2 50 15 5 10
5. We now want to calculate the Available Stock of each batch. For this
we would use Function Module BAPI_MATERIAL_AVAILABILITY. To calculate
the Available Stock, we need to know the Checking Rule which would be
used to calculate ATP quantity. Checking Rule PP is defaulted in the
search parameter, however it should be modifiable.