12-17-2008 7:09 AM
Hi All
I need to read image from application server and attach it to Invoice .
It wld be helpful if anyone suggest fn module to read image from application server and more attach to invoice.
Thanks
Arunachala.G
12-17-2008 9:10 AM
Below is the code base which is used to upload a picture from the SAP Application Server.
TYPES pict_line TYPE x LENGTH 1022.
DATA l_mime_api TYPE REF TO if_mr_api.
DATA l_pict_wa TYPE xstring.
DATA l_pict_tab TYPE TABLE OF pict_line.
DATA l_length TYPE i.
DATA l_url TYPE c LENGTH 255.
l_mime_api = cl_mime_repository_api=>get_api( ).
l_mime_api->get(
EXPORTING i_url = '/SAP/PUBLIC/BC/ABAP/Sources/PLANE.GIF'
IMPORTING e_content = l_pict_wa
EXCEPTIONS OTHERS = 4 ).
IF sy-subrc 0.
RETURN.
ENDIF.
l_length = XSTRLEN( l_pict_wa ).
WHILE l_length >= 1022.
APPEND l_pict_wa(1022) TO l_pict_tab.
SHIFT l_pict_wa BY 1022 PLACES LEFT IN BYTE MODE.
l_length = XSTRLEN( l_pict_wa ).
ENDWHILE.
IF l_length > 0.
APPEND l_pict_wa TO l_pict_tab.
ENDIF.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = l_pict_tab
CHANGING
url = l_url.
picture->load_picture_from_url(
EXPORTING url = l_url ).
picture->set_display_mode(
EXPORTING display_mode = picture->display_mode_stretch ).
The Entire code is available in the program DEMO_CFW.
12-18-2008 3:01 AM
Hi
I need to attach image to invoice ...fb03.. when I user create->attachment.. its asking popup to enter the file location.
I need to enter the filepath in my program from the selection screen .. ie from application server ..
It wld be helpful to give the picture of this.
Thanks
Arunachal.G