Add logo/image to adobe form in ABAP
Refer - Purchase order
1. First add new logos in SE78.
2. Expand graphics and select BMAP and double click.
3. Click on import, select logo file path give name, description and type as color bitmap.
Note: If you get any error, logo must be saved in bmp format (Even if you face error just open image in local and saved in bmp format).
4. I uploaded these 2 logos in SE78. (BOSCHLOGO, BENZLOGO).
5. Open interface (YI_AB_PURCHASE_ORDER) and add 2 new fields in global data for content and mime.
6. In this scenario, if status is I it prints Bosch logo else Mercedes logo will print.
7. Double click on code initialization and write code.
READ TABLE gt_ekko into gr_ekko index 1.
IF sy-subrc = 0.
data: lf_logo type TDOBNAME.
IF gr_ekko-statu
= 'I'.
lf_logo = 'BOSCHLOGO'.
else.
lf_logo = 'BENZLOGO'.
ENDIF.
ENDIF.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = lf_logo
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = gf_content
EXCEPTIONS
not_found = 1
internal_error = 2
others = 3
.
8. Open adobe form (YL_AB_PURCHASE_ORDER).
9. drag and drop that new 2 fields into adobe form.
10. Right click on adobe form--> create-->graphic.
11. Select graphic type as graphic content and press enter.
12. Give filed name as gf_content and mime as gf_mime.
13. Click on layout and design.
14. Select master page and click on insert-->standard--> image field.
15. Select text field and give binding(graphic) and select tick embed image data.
16. Activate and execute.
Input1
Output1
Input2
Output2
*******************************Thank You****************************
Comments
Post a Comment