SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Adding Images and text modules in Adobe Forms



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Smartforms, SapScripts, PDF
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Fri Feb 13, 2009 1:50 pm    Post subject: Adding Images and text modules in Adobe Forms Reply with quote

Adding Images and text modules in Adobe Forms

Uploading Images and Text Modules in SAP Interactive forms:
This blog intends to help beginners upload images and text modules in Adobe forms in SAP. It provides step by step procedure on uploading images by two different methods, from a PC location and from MIME Repository. Also it throws some light on using text modules in Adobe forms.
Basic Requirement:
1) * *The reader must have a basic understanding of using Adobe forms in SAP.
2) The system must be ADS configured to upload the image.
Refer to SAP Note: 944221
3) Image must be uploaded from system to MIME beforehand.
Transaction SE78 -> Upload (F5).
Uploading Images:
Images can be uploaded in Adobe forms in two ways:
1) From a PC Location
2) From MIME Repository

1) From a PC location: This method is pretty easy. You just create an image field in the layout and specify the PC Location. But this method has one drawback: When the form will be used in a client location, to keep the image showing, the connectivity must be maintained 24 hours a day between the creating system and the client system. In case of the creating system being switched off or disruption of the link between the two systems the image may cease to show.
Procedure:
Create an Adobe form using transaction SFP. Go to transaction SFP, assign a package and save. Now go to layout and create an Image.
Now check if the palette layout is showing on your screen. If not go to menu bar Palettes -> Layout. In the layout palette, there would be a field URL. Here you specify the PC Location from where you want to pick the image.

2) From MIME Repository: Using this method, the image to be displayed is fetched from the MIME Repository. There would not be any issues of connectivity or image availability.
First in the interface two fields have to be created, one of STRING type and the other of XSTRING type.
Now in the form, create a node of type graphic.
In the Property window, under heading Graphics there would be two fields: FIELD and MIME TYPE. Against 'FIELD' specify the XSTRING variable that has been created. Against MIME TYPE field, specify the STRING variable that has been created.

LAYOUT: In the layout, create an image and go to OBJECT palette. Here specify the binding. Go to binding -><YOUR PROGRAM NAME> -> GRAPHIC.
Save and then activate. The work in layout is complete. Now we have to code in ABAP editor.
Following is the program that is to be used to print the image from MIME Repository.

Code:
*&---------------------------------------------------------------------*
*& Report  ZTEST_MIME
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest_mime.

* data declaration

DATA: w_funcname TYPE funcname,
      w_interface_type TYPE fpinterfacetype,
      w_sfpjoboutput TYPE sfpjoboutput,
      w_fpoutput TYPE fpformoutput,
      l_outputparams TYPE sfpoutputparams,
      l_docparams TYPE sfpdocparams.

l_outputparams-device = 'PRINTER'.
l_outputparams-nodialog = 'X'.
l_outputparams-preview = 'X'.
l_outputparams-dest = 'ZPL'.
* name of the pdf form

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name                     = 'ZPDF_MIME_FORM'
* IMPORTING
*   E_FUNCNAME                 = w_funcname
*   E_INTERFACE_TYPE           =
          .

CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams = l_outputparams
  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.

l_docparams-langu = 'E'.
l_docparams-country = 'US'.
l_docparams-fillable = 'X'.
l_docparams-dynamic = 'X'.

DATA: fp_result TYPE fpformoutput,
      w_binary TYPE xstring,
      w_base TYPE string.

w_base = 'image/bmp'.

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
  EXPORTING
    p_object       = 'GRAPHICS'                       
    p_name         = 'INFY'
    p_id           = 'BMAP'
    p_btype        = 'BCOL'
  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 '/1BCDWB/SM00000058'
  EXPORTING
   /1bcdwb/docparams        = l_docparams
    zgraphic_binary          = w_binary
    zgraphic_base            = w_base
* 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'
* 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.

Save and activate the program. Execute it and we should be able to see the image uploaded from the MIME Repository.

TEXT MODULES IN ADOBE FORMS:
Create Text Module in transaction: SMARTFORMS and enter the text you want to add.
Go to transaction SFP:
Getting the values from database: LOOP AT table <internal table name> INTO work area RA_INVOICE_ITEM to get the fields. To fetch the fields specify them in the text module window in which these are to be fetched.
Context, create a text element (TEXT node). Go to layout and create a text field. Navigate to window Data view and drag the contents corresponding to the text module to the text field.
Activate the form and Execute.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Smartforms, SapScripts, PDF All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.