PDA

Ver la Versión Completa : Agregar logo en formulario ADOBE


Venecia
16/01/12, 18:57:30
Saludos a todos,

Alguien puede decirme como manejo en Adobe la inserción de una imagen (logo) dependiendo de una condición, en mi caso dependiendo del valor del campo código de sociedad?

Gracias.

Venecia
19/01/12, 15:10:54
;) Saludos a todos,

Alguien puede decirme como manejo en Adobe la inserción de una imagen (logo) dependiendo de una condición, en mi caso dependiendo del valor del campo código de sociedad?

Gracias.


Encontre información en un foro que me sirvió muchisimo, ya tengo mi formulario que imprime de forma dinámica la imagen que necesitaba. aqui dejo lo que encontre.
(esto incluye la parte donde se invoca al formulario)

************************************************************
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.
*&---------------------------------------------------------------------*
*& 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.

Labels parameters

Labels