Skip to Content
author's profile photo Former Member
Former Member

Attach Image to Invoice

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2008 at 09: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.