Show TOC

Function documentationClear Remaining Batch Quantities


When you have remaining batch quantities in the system that are no longer physically in the warehouse because they have already been consumed, you can use this function to distribute them across the manufacturing orders according to the requirements quantity or quantity withdrawn and then clear them. In the case of materials managed in batches, such residual batch quantities may result from excess consumption of components, especially those in process and production orders.


This function is a Web Dynpro application. You can execute this function by adding the Web Dynpro application to your Favorites. On the SAP Easy Access screen, choose Start of the navigation path Favorites Next navigation step Add other objects End of the navigation path and then choose Web Dynpro Application and enter the following:

  • Web Dynpro Application: CFB_WDA_RB_GAF

  • Description: Clear Remaining Batch Quantities

  • Application Configuration: CFB_WDA_RB_GAF_CFG

Alternatively, you can execute the Web Dynpro application in the SAP NetWeaver Business Client with the Composite Role for the Food and Beverage Industry (SAP_BPR_CFB_6). For more information, see Composite Role for the Food and Beverage Industry.


You have made the Customizing settings for Logistics - General under Batch Management Start of the navigation path Remaining Batch Quantities Next navigation step Make Settings for Clearing Remaining Batch Quantities End of the navigation path.

You have completed the goods movements for the remaining batch quantities you want to clear. Most importantly, you have completed the goods movements for which you have created reservations, since no stock is set aside for reservations when the remaining batch quantities are cleared. For more information, see Reservation.


  • When you select the remaining batch quantities, you can choose the Only Storage Locations with Consumption checkbox to specify that you only want to select the remaining batch quantities from storage locations from which consumption has been posted for a manufacturing order with movement type 261 (GI for Order). The system only selects batches whose unrestricted-use stock is greater than zero.

  • You select the relevant manufacturing orders. The system then only selects the manufacturing orders for which the batches have been consumed, irrelevant of the selection criteria.

  • You enter the posting date on which you want the system to post the material document for clearing the remaining batch quantities. You can also choose the posting date based on the manufacturing order that the system is posting to, for example you can choose Scheduled Finish Date of Order. In addition, you enter the quantity from the manufacturing order that is the basis for distributing the remaining batch quantity. The system uses the same ratio as the consumed quantity to distribute the remaining batch quantities among the manufacturing orders. You can decide if the consumed quantity is the requirements quantity that was originally planned for consumption or the withdrawn quantity that was actually consumed.

    Note Note

    You can only clear positive quantities.

    End of the note.
  • When you post, the system makes the following changes:

    • For each batch and posting date, the system generates a material document whose header has a three-character abbreviation that logs that the reason for the material movement is to clear remaining batch quantities. You define the abbreviation for the material document header and the movement type the system should use to execute stock changes in Customizing (see “Prerequisites”).

    • The system updates the stock quantities of the material.

    • The system updates the stock values in the material master record as well as the stock accounts and consumption accounts.

      Note Note

      The materials are posted exactly like unplanned withdrawals and are not posted for the reservations from the manufacturing orders (process or production orders). The system therefore does not update the withdrawn quantity in the reservations.

      End of the note.
  • You can call an application log that contains error and success messages.

  • You can also execute the Clear Remaining Batch Quantities function in the background using the program CFB_RB in transaction SA38 (ABAP: Execute Program).


  • Choose the Web Dynpro application Clear Remaining Batch Quantities. Select the batches and orders and enter the posting date. Post. Then choose the Application Log pushbutton. You can also call the application log in transaction SLG1 (Analyse Application Log) by entering the following:

    • Object: PP_CFB

    • Subobject: RB

    • External ID: Batch and material separated by a slash, for example 0000002869/MATERIAL1

  • To run the program in the background, choose SAP Easy Access Start of the navigation path System Next navigation step Services Next navigation step Reporting End of the navigation path (SA38). Enter report CFB_RB and choose values for selection and processing. Choose Start of the navigation path Program Next navigation step Background End of the navigation path to schedule a job. You can save the values you entered as a variant. To do so, choose Start of the navigation path Goto Next navigation step Variants Next navigation step Save as Variant End of the navigation path. To schedule the job, choose Start of the navigation path System Next navigation step Services Next navigation step Jobs Next navigation step Define Job End of the navigation path.