cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment File size limit or adjust in SAP Asset Manager

gonzalo_reyna
Participant
0 Kudos

Hi,

I need to limit or adjust the file size of photos taken from camera in SAP Asset Manager. This is my second large scale implementation of SAM in ISU, and as in the previous one, the customer takes a lot of photos in the ISU processes, around 20 per order in disconnection and reconection scenarios. In this case, there are 5 companies that will use SAM over the same S4HANA machine and they are evaluating the adquisition of SAP Content Server and they have to do a Content Server sizing.

For this reason, it is important to be able to reduce the size of the photos taken. I know that either nativescript camera module or Cordova Camera plugin have the option:

Camera - Apache Cordova

However, we do not know how to implement it as it seems that the plugin is very restricted at SCPms level.

Is there any way to achieve this?

Regards,

Gonzalo.

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You would need to write a plugin to take the captured image on the device and resize it prior to attaching to the offline database. In terms of plugins, MDK does not support Cordova plugins so those for sure cannot be used. Many nativescript plugins can be used but in this case since we have a control that is already handling the camera interface to capture the image you will need to just look at resizing of the image after acquistion.

gonzalo_reyna
Participant
0 Kudos

Thanks Bill for your answer.

From what I think, this control is not accessed directly in the metadata in MDK as I couldn't find it nor debugging it. I have been searching unsuccessfully in .js and .ts files in the custom client I created through MDK Client SDK. It is not clear where to find the files that manage the camera.

I have been doing some tests with some parameters Height and Width in ../node_modules/@nativescript/core/image_source but did achieve nothing yet.

Is there any guide on how to debug this specific files?

Regards,

Gonzalo.

bill_froelich
Product and Topic Expert
Product and Topic Expert

The form cell attachment control provides you the ability to capture (or select) images to attach. We do not provide access to the internal methods that would allow you to try and swap out our existing image capture process with your own if that is what you were trying to locate.

If you want to limit the size, rather than passing the attachment value directly to the create media action you would use a rule to pre-process the attachment value to resize it before returning the newly sized value to the create media action.

How you accomplish the resizing would be via a custom plugin that you write to take the image and perform your resizing. The specifics of how to do this will depend on what you are using to do the resizing. You might be able to put the attachment into an image source and use methods there to do resizing or you might need some other library/method/etc to handle it.

--Bill

gonzalo_reyna
Participant
0 Kudos

Thank you for your answer, Bill.

I will follow your guidelines with my team and update this thread with our progress.

Regards,

Gonzalo.

fjcarrasco
Active Participant
0 Kudos

Hello Gonzalo.

Any progress resizing the image? I'll have to do too in future.

Thanks

Regards

mig1
Participant
0 Kudos

Not directly related to SAP Asset Manager, but the same principle applies for us. Field service technicians take pictures and we save the original in SAP ECC using Global Object Services. But for every user requesting to see the images they are being resized on "the way out" in ABAP using IGS. Both as a thumbnail and to a predefined max size. This works really well and large images does not need to be downloaded.