Skip to Content

SAP Adobe Forms - dynamicly bind Image from Context value

Hello,

I am beginner in Sap Adobe Forms, I need a little help.

I have to create a Sap Adobe form with a table, which included in some columns images (dynamicly based on data in input table).

What I did now ( in my example form I expect only 2 types of pictures (red a green triangle) ):

1) In se78 create 2 pictures (red a green triangle)

2) in interface of the form create 3 global variables :

GV_PICT_TRIANGLE_RED - xstring

GV_PICT_TRIANGLE_GREEN - xstring

GV_SWITCH_PICTURE - char1 (value 'G' -> want to display green triangle, 'R' -> want to display red triangle)

3) in init section of interface add a code to load binary pictures from Se78

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp

EXPORTING

p_object = 'GRAPHICS'

p_name = 'ZGM_PEP_SIPKA_CERVENA'

p_id = 'BMAP'

p_btype = 'BCOL'

RECEIVING

p_bmp = GV_PICT_TRIANGLE_RED

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

etc...

4) in my test form in context I created 2 Graphics node (GRAPHICS_1, GRAPHICS_2) , type content graphics and map contend field to global variables GV_PICT_TRIANGLE_RED and GV_PICT_TRIANGLE_GREEN

5) that is all OK, when I on subform put ImageField IMAGE_01 a bind it to GRAPHICS_1 or GRAPHICS_2, picture will be display corect.

6) Now I need in Image field IMAGE_01 display picture dynamicly (for example depend on value of global variable GV_SWITCH_PICTURE), it means, that in some event ( initialize ) of form should I by javaScript / FormCalc set dynamic binding to GRAPHICS_1 or GRAPHICS_2.

data.#pageSet[0].Page1.image_01::initialize - (JavaScript, client)

this.bind.ref = ?????.

Can somebody tell me how to write such a Javascript code, how to access context variable GV_SWITCH_PICTURE and how to bind dynamicly IMAGE_01 to GRAPHICS_1 or GRAPHICS_2 ?

Something like this:

If ( GV_SWITCH_PICTURE = 'R' )

bind Image_01 to GRAPHICS_1

else.

bind Image_01 to GRAPHICS_2

endif.

Thx for help....

Best regards, MD

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers