cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting a Graphic in adobe form using SFP

Former Member
0 Kudos

Hi all,

by using Form & Interface in SFP Transaction

i want to display a logo(image) not by using url(not images from hard disk), i want to use the image which is present in the sap (ie., i want to use the images in se78). How can i achieve this????

I used the following procedure, even though i couldnt achieve:

1. Select an existing node in the context, under which you want to create a graphic node.

2. In the context menu of the node, choose Create ® Graphic.

3. The system creates a graphic node under the selected node. Enter the required data about the graphic in the Properties window under the form context.

You can choose from the following graphic types:

○ Graphic Reference

Choose this option if you want to insert a graphic from its address (URL). The URL can point to a Web server or to a file system. You must be able to access the graphic at the specified URL. This means that you may have to configure appropriate access rights for Adobe Document Services (ADS). Graphics stored in MIME Repository cannot be accessed through a URL. To use these graphics, choose Graphic Content.

○ Graphic Content

Choose this option if you want to specify graphic content using a field. This field contains all image information at runtime. The graphics must be in MIME Repository.

4. The entries you need to make depend on whether you chose Graphic Reference or Graphic Content in the last step.

○ If you have chosen Graphic Reference as your graphic type, enter the URL of the graphic.

Note

In Adobe LiveCycle Designer, you can choose whether the system gets the graphic at runtime, or whether the graphic is embedded in the form. For more information, see the online help in Adobe Designer.

○ If you have specified Graphic Content as your graphic type, you must do the following:

■ In Field, enter a field name from the interface. The field must have the type STRING (graphical data is Base64-coded) or XSTRING (for binary-coded graphical data).

■ Enter a valid MIME type, such as u2019image/bmpu2019.

5. Under Conditions, enter the prerequisites that need to be met before the graphic node is processed at runtime and displayed in the form.

I cant get the image....................................

Please provide the step by step details.....

Thanks,

Vichu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi find out the code which i have posted.........

Former Member
0 Kudos

You cannot directly display a logo which is uploaded in se78 on an adobe form.The image format needs a conversion.

You can write this code in the interface section.

Create a global variable g_logo of type xstring."converted logo

v_name of type STXBITMAPS-TDNAME. "logo name in se78

Pass these parameters of the image in se78 to this method.

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp

EXPORTING

p_object = v_object " 'GRAPHICS'

p_name = v_name " Name of the logo as in se78

p_id = v_id " 'BMAP'

p_btype = v_btype " 'BCOL' ( whether the image is in color or black and white )

RECEIVING

p_bmp = v_field

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

g_logo = v_field.

The variable g_logo will have the converted image.

Drag g_logo into the context from the interface.

In the context of the adobe form make a graphics node and choose Graphic Type as Graphic Content.

The Field should have the global variable g_logo and the mime type is 'BMP' (with quotes).

Create an image field (not just image,that would be static) and in binding,bind it to g_logo and check the check box.Embed image data.

This should work..I have tested it and it is working.

Regards,

Tejaswini

Former Member
0 Kudos

The correct code is as follows,

REPORT ZTEST_GRAPHIC_MIME.

********************************************

      • Data Declaration ***

********************************************

DATA: fm_name TYPE funcname, " Captures the Generated Function Module name

w_sfpoutputparams TYPE sfpoutputparams, " Print and Spool Dialog settings

w_docparams TYPE sfpdocparams. " Print and Spool Dialog settings

DATA: w_binary TYPE xstring, " Contains converted logo

w_base64 TYPE string, " Contains image type

v_name type STXBITMAPS-TDNAME. " Contains logo name which is in se78

*********************************************

      • Function Modules ***

*********************************************

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' " Will contain the name of generated Function Module Name...

EXPORTING

I_NAME = 'ZTEST_GRAPHIC'

IMPORTING

E_FUNCNAME = fm_name

  • E_INTERFACE_TYPE =

.

CALL FUNCTION 'FP_JOB_OPEN' " To Open the Form for Printing...

CHANGING

IE_OUTPUTPARAMS = w_sfpoutputparams

EXCEPTIONS

CANCEL = 1

USAGE_ERROR = 2

SYSTEM_ERROR = 3

INTERNAL_ERROR = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

v_name = 'ENJOY'. " Name of the logo as in se78

w_base64 = 'image/bmp'. " Image Type

CALL METHOD CL_SSF_XSF_UTILITIES=>GET_BDS_GRAPHIC_AS_BMP " Get a BDS Graphic in BMP Format (Using a Cache)

EXPORTING

P_OBJECT = 'GRAPHICS'

P_NAME = v_name " Name of the logo as in se78

P_ID = 'BMAP'

P_BTYPE = 'BCOL' " BCOL'( whether the image is in color or black and white )

RECEIVING

P_BMP = w_binary

EXCEPTIONS

NOT_FOUND = 1

INTERNAL_ERROR = 2

others = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION fm_name " Generated Adobe Form Function Module(/1BCDWB/SM00000173)...

EXPORTING

/1BCDWB/DOCPARAMS = w_docparams

GRAPHIC_BINARY = w_binary

GRAPHIC_BASE64 = w_base64

  • IMPORTING

  • /1BCDWB/FORMOUTPUT =

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3

OTHERS = 4

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'FP_JOB_CLOSE' " To Close The Form For Printing

  • IMPORTING

  • E_RESULT =

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3

OTHERS = 4

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Former Member
0 Kudos

Hi,

your posting in the thread 'Inserting a Graphic in adobe form using SFP ' actually solved my problem thank you.

karthikeyan