Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Upload/Export graph made with GFW_PRES_SHOW into an email body.

monik07
Explorer
0 Kudos

I have a report which has an output screen divide in 2 parts. On top, an ALV is displayed and based on the data of the ALV, a line graph is displayed below, at the bottom.

The line graph is created with the FM "GFW_PRES_SHOW".
Now, the final requirement for this report is that both, the ALV and Line Graph, should be displayed in the email body, which will be sent to the client.

Any help would be appreciated.

Thanks,
Monik

7 REPLIES 7

raymond_giuseppi
Active Contributor

What did you already try, did you attach the ALV (in XML or HTML format) and/or the exported content picture of graphic from GFV_PRES_SHOW to the message, did you define the body of the mail as html format and include the two object in the html (e.g.<img src="CID:attachment" etc>. )

Regards,
Raymond

0 Kudos

Hey Raymond,

Thanks for your reply.

I have not tried that HTML way. I wasn't aware of it. I was looking for solutions of this and figured if there's no way of doing this, might as well try to send it as an attachment (also facing problems in this).

But I'll try to search about this and go forward.

Meanwhile, if you have a link that shows a demo of this, that'd be helpful.

Thanks,
Monik

0 Kudos

Use search tool (google, lauchpad) to find threads and samples like Sending an image in Email. Look also at the reports BCS_EXAMPLE_* provided by SAP.

Regards,
Raymond

0 Kudos

Hey Raymond,

Sorry for replying to your answer so late, but I'm in need of immediate help. So below is the current status of my code:

  1. I've a working email functionality. It will have an excel attachment, mail body with the image of graph. I'm using SO_NEW_DOCUMENT_ATT_SEND_API1 to send email.
  2. Unfortunately, I'm still not able to get image to show in the email.

Here's what I've done so far:

  1. From the FM GFW_PRES_SHOW that I'm using to create graph, I have got a table of type W3MIME which will contain image info. Then I'm supposed to use WWW_GET_MIME_OBJECT, which requires a query_string table. I do not know how should I get this info.
  2. Then DP_CREATE_URL is used to create a URL for the image, which I should use in <img> tag in my HTML code.

But this is not working. I'm still getting a broken image in email. This thread suggests to change to CL_BCS class. But I cannot do that.

So my humble question to you is: how would one proceed after using GFW_PRES_SHOW to have the graph in email body considering:

  1. SO_NEW_DOCUMENT_ATT_SEND_API1 must be used
  2. email already has an excel attachment
  3. graph image must be in email body.

Kind regards,
Monik

0 Kudos

Monik,

Tried to check if any of standard programs are using the FM GFW_PRES_SHOW,but in my version there are only two demo/standard progs DEMO_GFW_PRES_SHOW and LSGFWU04,which don't have the functionality of embedding the image into excel attachment.

May be you also can check if there are any Standard or Custom Program having such a functionality in your System.Once you succeed,you can post a doc/blog so that it can be referred by Users in SCN Communicty :-).Thanks.

K.Kiran.

0 Kudos

Look at the CONTENT* of GFW_PRES_SHOW export and table parameters for 'Exported picture of graphic'. Attach this w3mime data to the mail directly in the main body or as an attachment with CI ref. Question: Why 'must' the outdated FM be used, when the CL_BCS class is much better and stable.

0 Kudos

Thanks for your input, Raymond.
I'm making progress. I changed the FM to CL_BCS and added second attachment of image with w3mime data. Below is the code:


 lr_document->ADD_ATTACHMENT(

                    i_attachment_type = 'JPG'

                    I_ATTACHMENT_SUBJECT = 'ips_graph'

                    I_ATT_CONTENT_HEX = W3MIME ).

Now I'm getting email with bigger blank image box. My guess is, it is somehow related to i_attachment_type. I don't know what type of image data is returned by GFW_PRESS_SHOW.

I will debug to find out more. Meanwhile, if you have any suggestion, I would appreciate it.