SAP® Documentation

Single view

/SAPCEM/STANDORTAUFBAU - Location Setup: Create HIstorical Stock from Temporary Stock

ROGBILLS - Synchronize billing plans   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book


This program transfers stock from the temporary stock table J_3GTBEST to the historical stock table J_3GHBEST.


The location setup should be performed directly before the actual settlement since only stock from the historical stock table is taken into account for settlement. In other words, ideally, no records should be in the temporary stock table after the location setup has taken place.

You should start the update run for the location setup in the background without restrictions since, depending on the volume of data, the runtime can be very long.


You should use the stock control program (/SAPCEM/BESTANDSKONTROLLE) if you want to detect negative stock at an early stage.


Temporary stock must be available in table J_3GTBEST.

Effects on Existing Data

  1. Records from table J_3GTBEST are deleted
  2. Records from tablee J_3GHBEST are changed or added
  3. If the location setup is carried out several times for the same time period, records from table J_3GHBEST can also be deleted
  4. Document items (J_3GBELP) receive a status indicating that the location setup has been carried out
  5. Document items that are locked against settlement are copied to table /SAPCEM/ENQ_BELP or deleted from the table

See also function module /SAPCEM/BEST_MASS_SAVE

Enhancement to program logic:

You can make use of a user-exit to generate a shipping document when the locations have been incorrectly chained (for equipment items).

Technical information

The appropriate source text has to be implemented in include /SAPCEM/LBEST1UZZ in form USEREXIT_SHIPMENT_DOC_CREATE. You should use include /SAPCEM/TEMPLATE001 as a template/reference. You should only make changes to the pre-defined logic in exceptional cases. You can, however, change the set values (such as sales area) if necessary.



The list displays the setup of the historical stock records from the temporary records. In other words, every line represents a (future) record in table J_3GHBEST.

The "update indicator" column can have the following characteristics:

I (Insert): a new record is created in table J_3GHBEST

U (Update): an existing record in table J_3GHBEST is changed

D (Delete): an existing record in table J_3GHBEST is deleted

SPACE: record is only displayed for information, no change in the database

The list is displayed with the ABAP List Viewer. You can also define your own display variants and save them.


If the update run is carried out online, the list is displayed first. The appropriate database tables are not updated until after you have saved.

If the update run is started in the background, the database updates are performed without warning.

BAL Application Log Documentation   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 3217 Date: 20200224 Time: 180442     sap01-206 ( 29 ms )

Our Service

Looking for Support? Questions?




Leave us your contact details and we will call you back. Panels marked with * are mandatory.