cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Determine the color of graphic

Former Member
0 Kudos

Hi Experts,

Can u plz explain the code how to determine the color of the graphic dynamically.I want black and white graphic on first page and color one on the next page and this must continue

till the last page.....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

upload two graphics to sap.

one is black and white and other is color.

declare a variable for count type i in global declaration.

before graphic declaration just

declare program lines i.e. move sfsy-page to count.

count the no of pages using sfsy-page.

insert 2 graphic

make 2 graphic as conditional.

i.e. in the condition tab of graphic1 -


> count = 1.

then the black and white image will print.

for the graphic 2 declare ---> count > 1 .

then the color image will print.

or u can directly maintain condition for both graphics.

in the condition tab sfsy-page = 1. block and while

for second image sfsy-page > 1. color image

it will work .

with Regards,

Kiran.G

Former Member
0 Kudos

Hi kiran

I want color graphics for pages of odd numbers and

black and white graphics for pages of even...

So in conditions tab wat we have to declare in comparison value field.

Former Member
0 Kudos

Hi,

Declare 2 variables in Global Definition value type i.

count type i.

Create Program lines before graphic insertion.

input parameters output

value value

count

in code.

clear value.

move sfsy-page to count.

value = count MOD 2 .

now insert u r two graphics and make them as conditional.

for u r black and white graphics

i.e. goto -


> condition tab -


> value = 0 .

for u r color graphic

i.e. goto -


> condition tab -


> value = 1 .

it will work,

with Regards,

Kiran.G

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

There is tab to the right called CONDITIONS and it allows you to enter a variable value .ie IMG = 1 etc etc

REWARD IF USEFUL

Former Member
0 Kudos

in the condition tab of the graphic you can use sfsy-page

if it is even or odd change the graphic properties