Skip to Content

To display multiple images in an adobe form based on the drop down value the user selects on the selection screen. When the user selects some value in selection screen, the adobe form should display some fixed number of images in a single page. For example, if the user selects 2 in selection screen, adobe form should display 2 images per page, if he selects 3 then form should display 3 images per page.

To resolve this scenario, create a drop down with 4 values(1,2,3,4) in drop down in selection screen. In driver program, make an internal table with all image URLs(LT_URL) and create internal tables for each page and filled them with image URLs based on the drop down value.

case dropdownval.
when ‘1’.
itab1[] = lt_url[].
when ‘2’.
refresh itab1[].
loop at lt_url into ls_url.
lv_temp = sy-tabix
mod 2.
if lv_temp eq 1.
append ls_url to itab2[].
else.
append ls_url to itab3[].
endif.
endloop.
clear: ls_url.
when ‘3’.
refresh iatb1[].
loop at lt_url into ls_url.
lv_temp = sy-tabix
mod 3.
if lv_temp eq 1.
append ls_url to itab3[].
elseif lv_temp eq 2.
append ls_url to itab4[].
elseif lv_temp eq 0.
append ls_url to itab5[].
endif.
endloop.
clear: ls_url.
when ‘4’.
refresh itab1[].
loop at lt_url into ls_url.
lv_temp = sy-tabix
mod 4.
if lv_temp eq 1.
append ls_url to itab6[].
elseif lv_temp eq 2.
append ls_url to itab7[].
elseif lv_temp eq 3.
append ls_url to itab8[].
elseif lv_temp eq 0.
append ls_url to itab9[].
endif.
endloop.
clear: ls_url.
endcase.

Create 4 pages in my adobe form. In first page place only one subform with Image field UI element in it. In second page, place two subforms, third page with three subforms and fourth page with four subforms.  Now bind the subform in first page with ITAB1. In second page, bind first subform with ITAB2 and second subform with ITAB3. In third page, bind first subform with ITAB3, second subform with ITAB4 and third subform with ITAB5. In fourth page, bind first subform with ITAB6, second subform with ITAB7 and third subform with ITAB8 and fourth subform with ITAB9. Make all the subforms in all pages as FLOWED.

In Adobe form to display the Image with IMAGE FIELD UI element, add the following java script to bind the image URL coming from internal table field to IMAGE FIELD UI element.

  1. this.ImageUI.value.image.href = this.Imgurl.rawValue;

In Adobe form we have add the scripting to display the page according to the drop down value selected. In root page add the following scripting to enable only the page required and hide rest all pages.

if ( dropdownval.rawValue == “1” ) {

     this.page2.presence = “hidden”;

     this.page3.presence = “hidden”;

     this.page4.presence = “hidden”;

   }

if (dropdownval.rawValue == “2” ) {

     this.page1.presence = “hidden”;

     this.page3.presence = “hidden”;

     this.page4.presence = “hidden”;

   }

if (dropdownval.rawValue == “3” ) {

     this.page1.presence = “hidden”;

     this.page2.presence = “hidden”;

     this.page4.presence = “hidden”;

   }

if (dropdownval.rawValue == “4” ) {

     this.page1.presence = “hidden”;

     this.page2.presence = “hidden”;

     this.page3.presence = “hidden”;

   }

Regards,

Mahidhar Suggala.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply