Passing an image dynamically from Webdynpro Java Development Component to Interactive adobe form is a tedious task and frequently required in complex SAP projects. To accompolish this task, you need to have hands on experience in MIME repository of your Development Component and Adobe Designing.
In this blog, we will see how the Images are navigated from webdynpro to SAP Interactive Forms.
Following is the step by step procedure to implement this task:
1. Store all your images in MIME repository of your webdynpro Development Component.
This is necessary step, you must store your images in MIME repository for navigation.
2. Open the Adobe Interactive Form view with the help of Java Editor and paste the following code inside wdDoInit method. This pure java code is used for creating URL for the image stored in MIME.
Before this create one attribute having name “URL” and data type as “String” in Adobe Interactive Form view inside “Data” node in Context having Collection Cardinality “1:1” and Bind the “Data” node to Interactive Form Data Source Property.
String URL= WDURLGenerator.getAbsoluteWebResourceURL(
throw new WDRuntimeException(e);
Above code creates a URL for the image stored in MIME repository of project. We require this URL as input parameter for “FomCalc Script” which we will use on Adobe Form itself.
3. Now add Interactive form to the view and open it for editing purpose. Adobe Live Cycle Designer provides two types of Object Library elements for Images.
A) Image (Static) :
With the help of this field, we can assign image to this field on Adobe Form itself but it will be final image.
B) ImageField (Dynamic)
With the help of this field, we can change the images at runtime.
We will use the second option for our requirement. We can just drag the image field in to our Interactive form. Just Drag and Drop the URL into form and select Presence of the field Hidden as shown in Below Screen shot.
4. Then Select Image Field first and then the Object Tab, under that select Binding Tab and select No Data Binding Option for it. Move to Field Tab and select “Embed Image Data” checkbox.
Select Pallet Tab and open Script Editor.We want to execute the script code on the initialize event.
Select the Following Options:
Script: $.value.#image.href = URL.rawValue;
Run At: Client
Above FormCalc script uses the reference of URL of Image which we have created using Java Code.
5. Rebuild, Build, Deploy and Run your application. You can see your image navigated to Adobe Form.
Now you will get following Output:
This way we integrated Images From Webdynpro Java to Interactive Adobe Forms.
In case you need assistance on SAP NetWeaver Platform, please contact us. Please send us your questions, comments or assistance request and our team would be glad to assist you.
By Dipak Aswale (on behalf of SAP Consulting Team)
SAP :: Streamlined
We offer variety of services including SAP ECC ,SAP HR,SAP BW,SAP CRM, SAP SCM,SAP BPM, Business Objects, SAP ABAP Development, SAP BASIS and SAP NetWeaver consulting. We have expertise in providing implementation,development, SAP Migration and SAP support services to SAP customers across diverse industries at a global level.
Have a question on SAP? Write to our SAP Architect : AskTheArchitect@Apprisia.com
(We promise a no-obligation consulting reply)