Image Capture
This section details the development aspects, including key classes, function groups, and methods used to manage image storage, retrieval, and handling. The guide is intended for SAP consultants and IT professionals responsible for implementing and maintaining image capture functionality.
Prerequisites
Configuration requirements
PreBilt EWM Framework must be installed and configured.
SAP Image Repository or External Web Link for Image Storage.
GOS or DMS for Attachment services (if attatching to business objects)
Technical prerequisites for Image Capture
Device camera access:
Mobile devices must support camera functionality.
Authorisation requirements:
Users must have the necessary SAP authorizations (/TCTM/*) to execute transactions and access image capture functionality.
Implementation considerations
Integration with SAP standard transactions:
Image capture and display must be configured within relevant warehouse processes such as picking, putaway, receiving, and inventory counting.
Customisation and deployment:
Additional effort may be required to configure the image repository and authentication settings.
Functional overview
Image Capture and Display functionality within PreBilt for EWM™ provides the ability to store, retrieve, and present images for various logistical processes. This capability enhances operational efficiency by enabling warehouse personnel to capture images directly from mobile devices, which are then stored in SAP or external repositories for retrieval as required.
ABAP Class Configuration & Configuration Transactions
/TCTM/ESV_IMAGE_CFG - TCTM: EWM Image Service Config
Image retrieval and storage will vary from customer to customer. For example images can be stored in the MIME repository, in attachment services such as GOS or DMS or in a third-party system or web repository.
For this reason, the image display/capture framework provides a configurable ABAP plugin layer to cater for any requirements. To add a configuration follow these steps:
Add Image Type
This is the reference for the scenario being added and is used in the extra element configuration when adding the image display/capture to the EWM RF screen step.
Add Image Service Type Implementation Class
Create a sub class of abstract class /TCTM/EWM_SRV_IMAGE_TYPE_ABSTR and implement the required methods. This class is used to parse the image metadata from the HTTP call from the frontend. Refer to sample class /TCTM/EWM_SRV_IMAGE_TYPE_PROD for implementation details.
Add Image Service Store Implementation Class
Create a sub class of abstract class /TCTM/EWM_SRV_IMAGE_STORE_ABST and implement the GET_IMAGE and STORE_IMAGE as per requirements. Refer to sample class /TCTM/EWM_SRV_IMAGE_STORE_MIME for implementation details.
Add MIME Not Available Image Path (Optional)
This can be used to load a placeholder image from the MIME repository when an image is not found.
Image capture/storage
The PreBilt for EWM™ Framework supports standard image capture, enabling users to take and upload images directly from their device. This process is initiated within the application, where users can activate the device camera, capture the necessary image, and optionally link it to a relevant business object in SAP. Once captured, the image is processed and stored according to predefined configurations.
Images can be stored in one of the following locations:
SAP MIME Repository
A predefined external storage location
A cloud-based content management system
Image storage and retrieval are handled via the ICF service IMAGE under the TCT_EWM node.
To enable image display or capture functionality, specific extra elements must be configured:
"IMAGE" for Image Display
"IMG_DISCAP" for Image Display & Capture
The URL for storing or retrieving images is defined in the extra element parameters within the logical transaction configuration. This URL serves as the base repository path, for example: https://sapserver.com/tctm_ewm/image/(image class type)
How image capture and storage works
When a user captures an image through the PreBilt application, the system invokes the capturePicture function from frontend module ImageCaptureControl.js, which accesses the device camera and captures an image. The captured image is then uploaded to SAP via an POST request to the configured upload endpoint.
On the backend, the ABAP method, if_http_extension~handle_request, is the entry point for handling HTTP requests to the EWM image service
The method /TCTM/EWM_SRV_IMAGE_TYPE_PROD->parse_data_store processes the incoming request. It extracts MATNR and UOM from the request, formats the filename as MATNR_UOM, and prepares metadata for storage. The system then passes the processed data to the storage class /TCTM/EWM_SRV_IMAGE_STORE_MIME->store_image, which converts the image to an XSTRING format and writes it into SAP’s MIME Repository. This ensures each image is uniquely identified and can be retrieved when required.
Forced capture
Forced Image Capture is a configurable enforcement mechanism that mandates image capture before a business process can proceed, this is an additional parameter.
When enabled, the system prompts the user to capture an image before proceeding with the next step. The transaction cannot be completed unless an image is provided. This is managed through configuration settings under the Extra Elements node within transaction /TCTM/EWM_CFG
Extra Element Parameter Key = FORCE_CAPTURE = X
This is useful for scenarios such as reporting proof of delivery, damages, or quality checks, where image evidence is mandatory.
How forced capture works
When a product is inputted or scanned, the system attempts to retrieve its image. The ImageDisplayControl.js module sends a request to the backend to check for an existing image.
This request queries the MIME repository using the parse_data_retrieve method within class /TCTM/EWM_SRV_IMAGE_TYPE_PROD. Within this method, the system calls lo_mr_api->get, which searches for an image based on the MATNR (material number) and UOM (unit of measure) which is extracted from the request. If an image is found, it is sent to the frontend and displayed.
If no image is found and elementDefinition.elementProperties.forceCapture is set to true in ImageCaptureControl.js, the system triggers a forced capture prompt.
The FORCE_CAPTURE value is received from the backend which can be seen inside the EXTRA_ELEMENTS within the network response preview.
The application then prevents the user from proceeding until an image is captured.
This ensures images are only captured when necessary, optimizing efficiency while enforcing mandatory image requirements when needed.
Image display and retrieval
The Image Display feature enables users to retrieve and view stored images in real-time an essential capability for scenarios that require visual verification or cross-referencing, such as confirming the correct product during picking operations.
Similar to the image capture functionality, the image retrieval process is designed with flexibility in mind. Images can be stored in a variety of locations, including:
A predefined SAP repository
A configured external storage location
A cloud-based content management system
The image display framework leverages ICF services and predefined URL structures to dynamically fetch and render images. Retrieval is based on a parameterized logic, using consistent naming conventions (e.g., MATERIAL_UOM.png for material-specific images).
When an image needs to be displayed during a logical transaction, the frontend sends a request to the backend, passing the parameterised values. The process begins with the retrieve_image
method in IF_HTTP_EXTENSION~HANDLE_REQUEST, which forwards the request to /TCTM/EWM_SRV_IMAGE_TYPE_PROD->parse_data_retrieve.
This method constructs a list of filenames using the provided parameters such as MATNR_UOM, or simply MATNR. These filenames are then handed off to /TCTM/EWM_SRV_IMAGE_STORE_MIME->get image, which prefixes a configured base path and cycles through the list, attempting to find a matching image in the SAP MIME repository via cl_mime_repository_api->get()
.
If a matching image is found, it’s returned to the frontend. If no image is found, the system attempts to retrieve a default fallback image using get_not_available_image
. If no image can be retrieved at all, the system raises an HTTP error.
Last updated
Was this helpful?