Created by: Nitin Bhatia
iGATE Global Solutions Ltd.
Q1. How to display a logo dynamically in the Adobe Forms?
Ans. To display a logo dynamically, we will have to upload it first into SAP using transaction SE78. This transaction will store this logo internally into a table “stxbitmaps”.
After uploading the logo we will have to create an interface and we will define two global variables there. Let’s say V1 type XSTRING and V2 type STRING (default value ‘image\bmp’). In Code initialization section we will have to write a simple query to fetch the logo from the table above by providing the log name. Then we will have to call a method cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp and pass on tdobject, tdname, tdid and tdbyte fetched from the query. This method is going to return a XSTRING type variable which we will move to the global variable V1 defined already.
After this step we have to create a Form and assign the interface created above to it. In the right side pane under the context tab, we have to create a graphic node. Select the graphic node and in the properties section make the Graphic Type as Graphic Content. Save it and drag V1 (from the left pane under the Global Data node) to the Field property of the Graphic and V2 (from the left pane under the Global Data node) to the MIME Type property of the form. Under the Layout tab create an image field and bind it with graphic node created. Save and activate. Execute the form. This will display an image dynamically.
Q2. What needs to be done to convert the static text in the form layout to a different language?
- Go to transaction code SFP.
- Enter your form name and hit display.
- Now go to menu Goto -> Translation.
- Give Original Language as EN and Target Language as whatever language you want to convert the static text into and hit enter.
- You will find two objects TLGS and PDFB.
- Double click on the form under PDFB tag.
- Go to menu Utilities -> Expand Tags.
- You will find vertically cascaded windows for source text and target text.
- Under the target text press copy source text button. This will copy everything defined as static text in the layout to target text.
- Now here we can convert the text into the respective language.
- Once done, save and activate the changes.
- Come out and execute the form in whatever language you want. Make sure to input the language in LA field of /1BCDWB/DOCPARAMS input table.
- Execute and see the output.
Q3. How to convert the text module used in the adobe form to a different language and display it?
Ans. Create a text module (eg: lets say we create Z_TEST_DEMO) in the SMARTFORMS transaction (in EN transaction). Create a Text (eg: lets say we create T1) in the adobe form (SFP transaction) and assign the created text module TM1 (in smartforms transaction) to the text (in form using SFP transaction).
Execute and see the output.
Now what if you want to display it in the language FR. For that please follow the steps below:
- Go to transaction SE63.
- Then go to menu Translation -> ABAP Objects -> Other Long Texts
3. Then under Object Type selection window, select B5 SAPScript: Forms and Styles and double click on SSF Smart Form
4. Give the Text Module’s name (Z_TEST_DEMO) created above and select source language as EN and Target Language as FR and hit Enter
5. Then in the Target text give the French translation of English text and give the same paragraph format (which in this case you will see as * on the left of the text in target language section below:
6. Press Save Active button.
7. This will activate all the changes.
8. Now go to your form and execute it as the text has already been assigned with the text module. Give language as FR. This will show the French text. And if you put EN as language, this will show text in English instead.
Q4. How to bind a static text box with a dynamic field coming from a table as an input?
Ans. For example you want to display
First Name Scott
where First Name is a static text which you have already added in the form layout and Scott is the name of the person you want to pick from a table as per whatever conditions you have written in your code in the driver program. For this scenario, follow the steps:
- In the form layout drag a text-field from the library to the design window.
- On the layout tab of the properties window (for the selected text-field), select position as left and reserve as 1in.
3. Then on the field tab under the object tab, put caption as First Name and appearance as Sunken Box as shown
4. Then in the binding tab under the object tab select the data binding and bind it with the respective field.
5. Save and activate and get the result.
When you have used a text instead of text-field then, right click on text and select edit text. Write First Name: and then again right click and select Floating field. Select the object property of that floating field and click on the binding tab and define the binding with whatever field you want to put in there.
Q5. How are conditions used in the adobe forms?
Ans. Suppose you want to display a particular text module in case if language you pass is EN in the input parameter. For this follow the steps below
- Go to transaction SFP and create a form.
- In the context tab, create a Text and assign a Text Module to it (created under smartforms transaction) under its properties.
- Click on conditions button and add a row using + button. Give the Import parameter name as EX_LANGU (language parameter in my example) under first OPERAND and ‘EN’ under second OPERAND as shown.
4. Save and activate the form.
5. Execute it by passing EN as language parameter. This time the text module will be displayed. If you execute it by passing FR as language parameter, the text module won’t display on the form output this time.