Today, we will learn how to incorporate a logo into an Adobe Form output in “SAP Adobe Interactive Form Tutorial Part V: Images, Graphics, and Logo in Adobe Forms.”
Pre-requisite: We need to upload the required logo or image as shown below in T-code SE78, similar to the process we follow for Smartforms.
When you transfer the image to SAP from your PC or local machine, please remember to validate it in T-code SE78. This step ensures that the logo or image is properly stored in the SAP system. For more detailed steps, you can refer to “SAP Adobe Interactive Form Tutorial Part V: Images, Graphics, and Logo in Adobe Forms“ to understand how to work with images and graphics in Adobe Forms.
Prepare the Form Interface
Transaction Code: SFP. Enter the interface name and create (Interface is mandatory for Adobe Form). In this SAP Adobe Interactive Form Tutorial Part V: Images, Graphics, and Logo in Adobe Forms, we will explore how to incorporate visual elements such as images, graphics, and logos into your Adobe Forms to enhance the user experience and provide a polished look to your outputs.
Enter the short description and Save.
Enter the Package name and Save.
Allow us to add our own custom Boundary Name for the picture/logo. Select the Import choice under Structure Connection point (left side) and press the Make button (right side) to add a Bringing in Boundary.
Please note: IV_LOGO is of type XSTRING (Data Type).
Save, Check and Enact the Connection point.
Design the Form Layout
Go to back SFP Exchange principal screen. Make the structure.
Press on make button. Give the short depiction and Point of interaction name which you have made before.
Enter the Bundle name and Save.
Drag IV_LOGO from Point of interaction which we made before and drop them to the Setting region.
Right snap on the YRAM_ADOBE_FORM5 under the specific circumstance and create a graphic.
Important step: Change the Graphic type from Graphic Reference to Graphic content
Hit return key/enter key.
Select Yes option.
Enter Field as IV_LOGO (or whatever name you have given above)
And MIME Type as ‘IMAGE/BMP’.
Save.
Go to Design. Pick the Information View Tab. Simplified the Realistic on the design.
You can expand or accumulate your logo as per your need. You ought to dispense with the logo engraving for instance the default Picture Field text. This Image Field text is a respectable spot to make the motto out of the association/logo if you have any. Else we can leave it clear.
We have added one more text component beneath the logo for showing reason.
Check, Save and Actuate. Our Design with a Realistic and Structure Point of interaction is finished. Did you notice, we have two components in our format. The logo field and the realistic substance. It tends to be contrasted with the variable name and the real satisfied.
Driver Program to call the Adobe Form
You can use the below code as a reference to plug and play for printing the logo.
*&---------------------------------------------------------------------*
*======================================================================*
* YRAM_ADOBE_FORM_PROGRAM5 *
*======================================================================*
* Project : SAP Adobe Forms Tutorial *
* Author : Varad (www.elearningsolutions.co.in) *
* Description : Printing a logo in the adobe form *
*======================================================================*
REPORT yram_adobe_form_program5.
*======================================================================*
* Selection Screen
*======================================================================*
PARAMETERS : p_logo TYPE rstxt-tdname.
*======================================================================*
* Data Objects
*======================================================================*
DATA: gv_fm_name TYPE rs38l_fnam, " FM Name
gs_fp_docparams TYPE sfpdocparams,
gs_fp_outputparams TYPE sfpoutputparams,
gv_name TYPE tdobname,
gv_logo TYPE xstring ,
gv_bmp TYPE xstring.
*======================================================================*
* Constants
*======================================================================*
CONSTANTS : gc_btype TYPE tdbtype VALUE 'BCOL',
gc_id TYPE tdidgr VALUE 'BMAP',
gc_object TYPE tdobjectgr VALUE 'GRAPHICS',
gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM5'.
*======================================================================*
* START of Calling the Form
*======================================================================*
*&---------------------------------------------------------------------*
**&&~~ Form Processing: Call Form - Open
*
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = gs_fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
" Suitable Error Handling
ENDIF.
*&---------------------------------------------------------------------*
**&&~~ Get the Function module name based on Form Name
*
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = gv_form_name
IMPORTING
e_funcname = gv_fm_name.
IF sy-subrc <> 0.
" Suitable Error Handling
ENDIF.
* Passing the logo name
gv_name = p_logo.
* Get the image/logo graphic information
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = gc_object " GRAPHICS
p_name = gv_name " Name of the Logo
p_id = gc_id " BMAP
p_btype = gc_btype " BCOL for color, 'BMON' for Black & White
RECEIVING
p_bmp = gv_bmp
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
gv_logo = gv_bmp.
*&---------------------------------------------------------------------*
**&&~~ Take the FM name by execuing the form - by using Pattern-
**&&~~ call that FM and replace the FM Name by gv_fm_name
**&&~~ Call the Generated FM
CALL FUNCTION gv_fm_name
EXPORTING
/1bcdwb/docparams = gs_fp_docparams
* iv_name = p_name
* iv_flag = p_flag
iv_logo = gv_logo
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&---- Close the spool job
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* <error handling>
ENDIF.
Let us Test our baby
Execute Program : YRAM_ADOBE_FORM_PROGRAM5
Give the picture/logo name which we transferred in SE78 or some other logo name which is now accessible in SAP framework. We would use ELS Logo.
If it’s not too much trouble, actually take a look at the program above. The logo property is powerfully acquired from the picture name and took care of to the SAP Adobe Structure. You can include any picture you need from your SAP framework. The program would deal with it consequently to acquire the mark of the picture and pass it accurately to the Adobe Structure.
Press on Print see and view the result with your picture.
YOU MAY BE INTERESTED IN
ABAP Development Environment in the Cloud