Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding images dynamically to SAPScript

Former Member
0 Likes
2,871

We have got the same form ... but need to have separate images based on company code. Is it possible to add images dynamically to a SAPscript ?

Rajib

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,979

Sure, 2 ways of doing this.

1)You can handle it in the print program, by doing an if statement and filling a variable which the SAPscript will read.


     
*In your print program,
If company_code = '0010'.
imagename = 'ThisCompany'.
endif.
*In your sapscript,    
BITMAP &IMAGENAME& OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100   

2) You can have the if statements in the SAPscript itself.



*In your sapscript,
IF COMPANY_CODE = '0010'    
BITMAP THISCOMPANY OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100  
ELSEIF
BITMAP THATCOMPANY OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100 
ENDIF


Either way you will need to load the images via SE78

Regards,

Rich Heilman

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,980

Sure, 2 ways of doing this.

1)You can handle it in the print program, by doing an if statement and filling a variable which the SAPscript will read.


     
*In your print program,
If company_code = '0010'.
imagename = 'ThisCompany'.
endif.
*In your sapscript,    
BITMAP &IMAGENAME& OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100   

2) You can have the if statements in the SAPscript itself.



*In your sapscript,
IF COMPANY_CODE = '0010'    
BITMAP THISCOMPANY OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100  
ELSEIF
BITMAP THATCOMPANY OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100 
ENDIF


Either way you will need to load the images via SE78

Regards,

Rich Heilman

Read only

0 Likes
1,979

Rich,

Can we also size the image?

Rajib

Read only

0 Likes
1,979

Don't think that you can change the size of the window dynamically. Sorry.

Regards,

Rich Heilman

Read only

0 Likes
1,979

Rich,

I had one more question.

Can the included image be other than bmp..... I had some images in .tif format. Do I need to convert them to bmp?

About the size, I was referring to the size of the image. Sorry for the confusion.

Thanks again.

Rajib

Read only

0 Likes
1,979

No, size of the image will be whatever is uploaded thru SE78. And yes, you can do other image formats such as .tif, but it must be a certain kind of tiff. I forget which. You are better off converting to BMP and being done with it.

Regards,

Rich Heilman

Read only

0 Likes
1,979

thanks a lot.

Rajib

Read only

0 Likes
1,979

It is possible to use an image of archiving in a form of SAPscript?

Read only

0 Likes
1,979

Hi,

Is it possible to add an employee photo dynamically to a form WITHOUT uploading it with SE78 ?

Thanks a lot

Ofer

Read only

Former Member
0 Likes
1,979

Rich,

Awesome solution............works great.

Thanks a TON!!

Rajib