Skip to Content
0

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

Dec 14, 2016 at 11:11 AM

79

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Dec 14, 2016 at 11:37 AM
1

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

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

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
Former Member
Raymond Giuseppi

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

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

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
Former Member
Raymond Giuseppi

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.

0