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

Description
This program transfers stock from the temporary stock table J_3GTBESTto the historical stock table J_3GHBEST.

Recommendation
The location setup should be performed directly before the actualsettlement since only stock from the historical stock table is takeninto account for settlement. In other words, ideally, no records shouldbe in the temporary stock table after the location setup has takenplace.
You should start the update run for the location setup in thebackground without restrictions since, depending on the volume of data,the runtime can be very long.

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

Prerequisites
Temporary stock must be available in table J_3GTBEST.

Existing_data
Records from table J_3GTBEST are deleted
Records from tablee J_3GHBEST are changed or added
If the location setup is carried out several times for the same timeperiod, records from table J_3GHBEST can also be deleted
Document items (J_3GBELP) receive a status indicating that the locationsetup has been carried out
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 whenthe locations have been incorrectly chained (for equipment items).

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

Output
The list displays the setup of the historical stock records from thetemporary 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 inthe database
The list is displayed with the ABAP List Viewer. You can also defineyour own display variants and save them.

Update
If the update run is carried out online, the list is displayed first.The appropriate database tables are not updated until after you havesaved.
If the update run is started in the background, the database updatesare performed without warning.

360087 Update task termination: Rollback segment too small