cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic logo in sap script

Former Member

Hi All,

I wish to print a logo in my sap script but under a specific condition. More exactly I'd like to show one of two logos, depending on a condition (i.e. document approver).

I know that in my smart form (Main) I need to insert this include.

/: INCLUDE Z_COMPANY_LOGO OBJECT GRAPHICS ID BMON LANGUAGE EN

Where Z_COMPANY_LOGO is a variable defined into the colled program of my sap script.

My first problem is how to define this Z_COMPANY_LOGO variable in my called program and how can set it for pointing to my image.

The second help for me is how can I find the images saved in my SAP system? Maybe using the transaction SMW0?

Any suggestion or simple examples will be well appreciated.

Thanks in advance.

Regards,

Giovanni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi and many thanks to all for your help. Now it's more clear but I have also some last questions.

1) In your opinion is it better to use a perform inside SAP Script an d then use the control IF...ELSE...ENDIF to point the specific logo rather than calling a perform before FUNCTION 'OPEN_FORM' and set a global variable (for example "logo_name") and use it in the SAP Script using IF...ELSE...ENDIF? My question is referred to the performance (response time) obtained by calling Sap Script.

2) Regarding the images I find the following documentation.

Save a Logo using Paintshop Pro or Corel Draw as Tiff file. Use RSTXLDMC to convert the logo to standard text in SapScript. When the program is executed, the path and file name have to be correctly specified.

Run RSTXLDMC

Enter file name C:\MAIL\COMPLOGO.TIF

Resolution for Tiff file

Absolute X-position

Absolute Y-position

Absolute positioning

Reserved height

Shift to right

UOM = CM

Text title

Line width for text = 132

Text name ZHEX-MACRO-COMPLOGO

Text ID ST

Text language = E

Postscript scaling

Width & Height according to PS scaling

Number of Tiff gray levels (2,4,9) 2

Then Create a new window 'COMP' with attributes;

Window COMP description Company Logo

Window type CONST

Left margin 7.00 CH window width 10.00 CH

Upper margin LN window height 8.00 LN

Finally in the text element , mention

/: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.

Please note that if object name is not indicated as 'ZHEX...', the logo may not be printed!

My questions:

a) If someone followed these steps for loading an image, where can I find it? More exactly is there a tcode for showing the images saved in my SAP system? Maybe is it SMW0? ... or what else?

b) If in the calling program I use a global variable (type string) where I set the value 'ZHEX-MACRO-COMPLOGO' can I use it in my Sap Script to point to a right logo?

3) About the suggestion "PERFORM inside the sapscript and then do the logic and pass the logo's variable to the sapscript" is it possible to reference a form defined inside an include? In this way how can I use the statement:

/: PERFORM GET_LOGO IN PROGRAM ????????

Any help will be well appreciated.

Many thanks again for your kind support.

Regards,

Giovanni

brad_bohn
Active Contributor
0 Kudos

Don't use a PERFORM in the SAPScript - it's unnecessary and overkill. Use a variable or an IF condition to specify the logo name from the graphics manager. Also, don't use a TIFF file and the text upload program. That's an outdated methodology. Save the file as a BMP and upload it in SE78 as I suggested. To answer your question though, you would find the logo uploaded as text in transaction SO10.

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

Use If Conditions and call ur particular logo.

IF itab-bukrs = '1000'

INclude LOGO1000 -


> logo of company 1000

else itab-bukrs = '2000'

include logo2000 -


> logo of company 2000

endif.

Surya

former_member203305
Active Contributor
0 Kudos

Hi, to upload an image to SAP use the Tcode SE78.

if u want to change the imagen of the logo depending on a conditions, u could try to use IF statement.

😕 IF......

call a logo

😕 ELSE

call a logo

😕 ENDIF

or u can use a PERFORM inside the sapscript and then do the logic and pass the logo's variable to the sapscript.

Regards

brad_bohn
Active Contributor
0 Kudos

Use transaction SE78. Your variable name should be defined as type TDOBNAME. Now, you mentioned both SAPScript and Smartforms - which one? Looks like SAPScript if you're using the INCLUDE command, but you can use BITMAP instead. Also, you can use an IF condition and the hardcoded graphic name in the form as well.