XML formatted Email Attachment created by CL_IXML is too big to be received
Dear all,
I followed the excellent web blog http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment
to pass an internal table (2MB in size, 18 columns * 6300 rows) to CL_IXML DOM and send this XML file as an formatted Excel attachment, it perfectly works, but the size of this XML attachment exceeded 8 MB, although I reduced it to 6MB successfully by simplying its Cell Attribute from
<Cell ss:StyleID="s62"><Data ss:Type="String">1E2</Data></Cell>
TO <Cell*><Data ss:Type="String">1E2</Data></Cell>.
but I cannot do the same on its Data Attribute, and it is still too big to be received by the mailbox of my third party users, is there any way to reduce it below to 3MB?
we need the attachment to be formatted Excel, and cannot request my third party receiver to do anything in Excl.
I am using ECC 6.0, 32 bit no-unicode, and SAP Gui 7.20.
looking forwarding to your reply
Peter Ding
You can try zipping the file and send it as attachment.
Use the FM SCMS_XSTRING_TO_BINARY to convert the XML to Binary. Do the ZIP using the method COMPRESS_BINARY of the class CL_ABAP_GZIP.
Regards,
Naimesh Patel
Similar Messages
-
I need some advice about the macbook pro and iPhone 5.
I took a video on my iPhone and tried to email it it said it was too big to send? So i downloaded it to my macbook pro and tried to mail it to no avail? The macbook tells me the server won't let it through other mail goes through any ideas how to resize it or what it might take to send it?I agree with LowLister, the best option for you to share the video online is to upload it to your online storage account for example : Box, Dropbox, SkyDrive (All of them provide free storage beginning from 2GB).
You can upload the files which you want to share in this online storage and then they have sharing options in which you'll will get the link of the file to be sent and send the email. You're good to go!
Tip : You can store multiple files for backup purposes. -
XML output email attachment.
Hi All,
Our client is currently suing the XMLP reports in their Receivables applications. The current functionalities are covered in the current report.
1. Generate the invoice report in pdf output. (It uses RDF to generate the xml data)
2. Based on the bursting setup deliver the pdf report to various destination.
3. Send the pdf report as attachment though email.
For this, We need to submit the one concurrent program at the time of processing, it submits the second concurrent program for bursting and then it submits the third concurrent program for attaching the pdf with the mail.
Now based on the latest partner system changes this requirement is changed to deliver the xml file instead of pdf file. They have given the specific tags that needs to be included in the xml file. Please note, these tags are different or same as the table column names.
Example:
Column Name : INVOICE_NUMBER
xml tag : VendorInvoiceNumber.
Is it possible to achieve the whole new requirement. If so, could you please tell me how? I very much appreciate your help in this.
Thanks in advance.Go to OTN and get the mail example.
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Then use something like this (example below is sending xml to render as an Excel sheet, has to be opened as an XML table in Outlook 2007):
declare
conn utl_smtp.connection;
begin
conn := demo_mail.begin_mail('sender','recipient list','Subject of email','multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"');
demo_mail.attach_text(conn,'Enter comments for the message body','text/plain');
demo_mail.attach_text(conn,dbms_xmlgen.getxml('select whatever from wherever'),'application/msexcel',TRUE,'Name of your file.xls');
demo_mail.end_mail(conn);
end;
You can use this as the framework to create your mail sending package:
http://dizwell.com/2008/04/28/automatically-emailing-excel-spreadsheets-from-oracle/
Then just figure out how/where you want the mail sending to be triggered. -
XML Bursting, Email attachment is blank
I have report which as a part of my requirement need to send it to customers, I am using XML bursting logic to send it through email. It was working fine until last week and now it is sending emails succesfully with attachment as blank. below are the lines from log.
Can you please advice me on this
Edited by: User910243567 on Feb 8, 2012 3:09 AMHowdy,
I seem to vaguely remember we had this problem with our bursting file for out POs.... It turned out to be a parm in the bursting file. I am sorry but I am not positive which one it was but I think it was the content-type parm. Anyway, our final file looks like the below xml so if you compare it to what you have now it may assist:
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:request select="/AZZ_POXPRPOL_BIP/LIST_G_INIT_INFO/G_INIT_INFO/LIST_G_HEADERS/G_HEADERS">
<xapi:delivery>
<xapi:email server="10.0.12.100" port="25" from="[email protected]" reply-to="">
<xapi:message id="${POH_PO_NUM}" to="${REQUESTOR_EMAIL}" cc="" attachment="true" content-type="text/html" subject="Purchase Order ${POH_PO_NUM}">Please find attached purchase order ${POH_PO_NUM}.
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output="PO_${POH_PO_NUM}" output-type="pdf" delivery="${POH_PO_NUM}">
<xapi:template type="xsl-fo" location="xdo://XXAZZ_CUS.AZZ_POXPRPOL_XSL.en.US/?getSource=true" filter="" />
</xapi:document>
</xapi:request>
</xapi:requestset>
Good luck and remember... Oracle is not supposed to be fun...it just pays the bills! ;-)
Scott -
I am trying to attach two excel files to an email, and each time it goes as follows:
1. push the attach file button
2. chose my files
3. push the attach files button
4. the blue "progress" stripe begins to fill the address bar
5. Then it stops about an eighth of the way toward the end, and doesnt go any further...
I tried letting it go for a while, and giving it time, but it doesnt work. The file size is 34.4 (which I know is huge), but there is only about 20 lines of the Excel being used, but the program is trying to attach 64,599 lines of unused space, and that is why it isnt attaching im sure, but i dont know how to fix it, or if it is even possible.
Please help!
g5 Mac OS X (10.4.2)what email provider do you use?
i'd be surprised anyway if it will allow an attachment of that size. the limit is usuall between 1 and 5 MB, some going to 10 or 15 like gmail.
34MB? not unless you have an expensive or corporate email provider.
you can:
1: do like daddypaycheck said and reduce the file size by deleting unnecessary rows or collumns,
2: download OpenOffice.org, or NeoOffice, see if you like that and save it in the native format, usuall smaller file (beware compatibility)
3: use dropstuff or the like to break the file apart into multiple smaller compressed chunks, and send them in multiple emails (the size of the chunks each should match the attachment size limit for your email provider, see their website)
4:this is my favorite - put the file in your Sites folder, in your user's Home folder. open system prefs-> sharing. check the box to enable personal web sharing. go to www.whatismyip.org and copy the string of numbers that appear (that's your external ip). now you can host the file from your computer, and only email people a link to it! the link should be like this:
http://yourip/~your_short_username/name_of_exceldocument.xls
for example, here is my resume in .pdf, hosted from my computer (let me know if it works for you!)
http://67.40.250.86/~Willeyeam/images/WBLResume.pdf
Bam! I'd go with number 4, and test the url in your browser to make sure it works. once you get the page, you can "save as" and download the file. that way people can receive an email with only text, including the url (link) to the hosted file on your computer. then they can "save as" and download the file.
another, more sophisticated way to do this is to write a small .html page that has a link to that file (in your sites folder). name the .html file "index.html" and replace the file by that name which is by default placed in your Sites folder. that will then be your home page at:
http://yourip/~your_shortusername/
Rock on! -
Created audio only podcast, too big to post on my .Mac website
I'm new with GB and thought it would be a easy way to record my voice for my daughter (military deployed to mid east right now). Its a basic female voice track, about 9 1/2 mins long, with no effects, no art, nothing but me talking. The podcast is over 100MB and that's way too big to post on my .Mac website. I already chnaged the compression to micro, low quality. Why is it so big? is that normal? Would recording just any audio track, not a podcast, be smaller? thanks
100MB for 10 minutes would be an uncompressed AIFF file. You need to convert it to an MP3 file in iTunes. Please refer to HangTime's 'NeverFail Method', substituting MP3 for AIFF: I would suggest setting it to 128kb/s stereo, 64kb/s mono.
-
[PENTAHO] export design into xml format
Hi all,
I wonder if it's possible to create a design with reportDesigner, export the design to an xml format and then use this xml format file to create a report. For example, in the HelloWorld demo you have to create the necessary code to make a report. However, in the invoice demo you have an xml file in wich you have the structure description of the report and you can use it to make the report without writing all the code.
Thanks a lot!my questionWhat question?
This is why I wrote my question inWhat question?
So, Does anyone knows the answer to my question?What question?
There is no question in what you have posted.
If your question is about reportDesigner, whatever that is, this is the wrong forum and the wrong site. -
How can we transfer huge amount of data from database server to xml format
hi guru
how can we transfer huge amount of data from database server to xml format.
regards
subhasis.Create ABAP coding
At first we create the internal table TYPES and DATA definition, we want to fill with the XML data. I have declared the table "it_airplus" like the structure from XML file definition for a better overview, because it is a long XML Definition (see the XSD file in the sample ZIP container by airplus.com)
*the declaration
TYPES: BEGIN OF t_sum_vat_sum,
a_rate(5),
net_value(15),
vat_value(15),
END OF t_sum_vat_sum.
TYPES: BEGIN OF t_sum_total_sale,
a_currency(3),
net_total(15),
vat_total(15),
vat_sum TYPE REF TO t_sum_vat_sum,
END OF t_sum_total_sale.
TYPES: BEGIN OF t_sum_total_bill,
net_total(15),
vat_total(15),
vat_sum TYPE t_sum_vat_sum,
add_ins_val(15),
total_bill_amount(15),
END OF t_sum_total_bill.TYPES: BEGIN OF t_ap_summary,
a_num_inv_det(5),
total_sale_values TYPE t_sum_total_sale,
total_bill_values TYPE t_sum_total_bill,
END OF t_ap_summary.TYPES: BEGIN OF t_ap,
head TYPE t_ap_head,
details TYPE t_ap_details,
summary TYPE t_ap_summary,
END OF t_ap.DATA: it_airplus TYPE STANDARD TABLE OF t_ap
*call the transformation
CALL TRANSFORMATION ZFI_AIRPLUS
SOURCE xml l_xml_x1
RESULT xml_output = it_airplus
.see the complete report: Read data from XML file via XSLT program
Create XSLT program
There are two options to create a XSLT program:
Tcode: SE80 -> create/choose packet -> right click on it | Create -> Others -> XSL Transformation
Tcode: XSLT_TOOL
For a quick overview you can watch at the SXSLTDEMO* programs.
In this example we already use the three XSLT options explained later.
As you can see we define a XSL and ASX (ABAP) tags to handle the ABAP and XML variables/tags. After " -
I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button. When the button is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format. Is there a quick fix?
Hi,
You have the choice between xml or pdf, in later versions of designer you can choose with a dropdown on the email button Object palette, the "Submit As";
In earlier version you had to edit the XML Source and change the format from xml to pdf (or vice-versa);
Regards
Bruce -
Email XML file as attachment in 4.6c
Hi,
I have a requirement to generate an XML file and email it.
I am using Class CL_IXML to create the xml requirement. The code is listed below
When I download the file to the PC, i am able to open the file and the XML format is ok, but when
I email the file using SO_NEW_DOCUMENT_ATT_SEND_API1, the attachment is still in the Binary format. Does anyone know how to send the file as an XML attachment.
We are using SAP R/3 ver 4.6c.
Load the class definition
CLASS cl_ixml DEFINITION LOAD.
Creating a ixml factory
l_ixml = cl_ixml=>create( ).
Creating the dom object model
l_document = l_ixml->create_document( ).
Message
l_element_message = l_document->create_simple_element(
name = 'Message'
parent = l_document ).
Message Header
l_element_message_hdr = l_document->create_simple_element(
name = 'MessageHeader'
parent = l_element_message ).
Sender Id
l_element_dummy = l_document->create_simple_element(
name = 'SenderID'
value = 'ABCDE'
parent = l_element_message_hdr ).
Receipient Id
l_element_dummy = l_document->create_simple_element(
name = 'RecipientID'
value = 'ZZZZZZZZZZZ'
parent = l_element_message_hdr ).
Prepared
l_element_dummy = l_document->create_simple_element(
name = 'Prepared'
value = '2009-03-31T14:30:00'
parent = l_element_message_hdr ).
Msg ID
l_element_dummy = l_document->create_simple_element(
name = 'MessageID'
value = '1234567896'
parent = l_element_message_hdr ).
Msg type
l_element_dummy = l_document->create_simple_element(
name = 'MessageType'
value = 'MANIFEST'
parent = l_element_message_hdr ).
Msg ver
l_element_dummy = l_document->create_simple_element(
name = 'MessageVersion'
value = '02'
parent = l_element_message_hdr ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
Connect internal XML table to stream factory
l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
Rendering the document
l_renderer = l_ixml->create_renderer( ostream = l_ostream
document = l_document ).
l_rc = l_renderer->render( ).
Saving the XML document
l_xml_size = l_ostream->get_num_written_raw( ).
Thanks
NDHi,
I have one program conerts data to xml format.
TABLES:
MAKT, "Mat description
MARC, "Material / plant
T001W, "plant name
BHDGD. "Batch heading
Internal tables
DATA:
BEGIN OF GT_MARC OCCURS 0,
WERKS LIKE MARC-WERKS,
MATNR LIKE MARC-MATNR,
END OF GT_MARC,
Table to be downloaded as xml. Each line stores start and end tags
and the value
BEGIN OF GT_XML OCCURS 0,
LINE(120),
END OF GT_XML,
G_MAKTX(120).
User-input
SELECT-OPTIONS:
S_WERKS FOR MARC-WERKS,
S_MATNR FOR MARC-MATNR.
START-OF-SELECTION.
Extract all required data
PERFORM MAIN_PROCESSING.
END-OF-SELECTION.
SORT GT_MARC BY WERKS MATNR.
LOOP AT GT_MARC.
AT FIRST. "First tag must be root
CLEAR GT_XML.
GT_XML-LINE = ''.
APPEND GT_XML.
CLEAR GT_XML.
display data
FORMAT COLOR 2 ON.
WRITE :/ GT_MARC-MATNR, MAKT-MAKTX.
FORMAT COLOR 2 OFF.
ENDLOOP.
The last tag must be the root closing tag --*
GT_XML-LINE = '</LOCATIONS>'.
APPEND GT_XML.
CLEAR GT_XML.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
FILENAME = 'C:PLANT1.XML'
FILETYPE = 'ASC'
TABLES
DATA_TAB = GT_XML.
TOP-OF-PAGE.
MOVE SY-TITLE TO BHDGD-LINE1.
MOVE SY-REPID TO BHDGD-REPID.
MOVE SY-UNAME TO BHDGD-UNAME.
MOVE SY-DATUM TO BHDGD-DATUM.
MOVE '0' TO BHDGD-INIFL.
MOVE '132' TO BHDGD-LINES.
FORMAT INTENSIFIED ON COLOR COL_HEADING.
PERFORM BATCH-HEADING(RSBTCHH0). "report header
Form READ_PLANT
FORM READ_PLANT.
Get plant name
CLEAR T001W.
SELECT SINGLE NAME1
INTO T001W-NAME1
FROM T001W
WHERE WERKS EQ GT_MARC-WERKS.
ENDFORM. " READ_PLANT
Form MAIN_PROCESSING
FORM MAIN_PROCESSING.
Material and plant basic data
SELECT WERKS MATNR
INTO TABLE GT_MARC
FROM MARC
WHERE WERKS IN S_WERKS
AND MATNR IN S_MATNR.
ENDFORM. " MAIN_PROCESSING
Form READ_DESCRIPTION
FORM READ_DESCRIPTION.
Material name
CLEAR G_MAKTX.
SELECT SINGLE MAKTX
INTO G_MAKTX
FROM MAKT
WHERE MATNR EQ GT_MARC-MATNR
AND SPRAS EQ 'E'.
Replace special character
DO.
REPLACE '&' WITH '*ù%;' INTO G_MAKTX.
IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
ENDDO.
DO.
REPLACE '*ù%;' WITH '&' INTO G_MAKTX.
IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
ENDDO.
DO.
REPLACE '/' WITH '/' INTO G_MAKTX.
IF NOT SY-SUBRC IS INITIAL. EXIT.ENDIF.
ENDDO.
ENDFORM. " READ_DESCRIPTION
END OF PROGRAM Z_DOWN_XML ************************
*******For sending data to mail check the following link*****
http://itknowledgeexchange.techtarget.com/itanswers/is-there-an-xml-function-module/
(OR)
search in sdn.sap.com for mail data(xml) -
Customization of DAC to send emails in XML format
Hi,
We need to customize DAC to send emails in XML format to the support team whenever there is a failure of the ETL load.
We use the HPSC ticketing system.
Any help to achieve this functionality is much appreciated.
we have tried to customize the existing email template of DAC, but it is not serving the purpose to generate the ticket in HPSC.
To generate the HPSC ticket, we have a XML format. We need to customize DAC to use this format.
This is the version of Oracle BI application we are using:
Build: 10.1.3.2.1.070411.1900
Release Version: Oracle Business Intelligence 10.1.3.2.1
Package: 070411.1900
Build: 7.9.1.032307.0900
Release Version: Oracle Business Intelligence Applications 7.9.1
Package: 032307.0900
Regards,Hi,
We have raised a SR with Oracle support and are in touch with Engineering also today onwards. However, would like to try out options while waiting for a solution/workaround for this issue.
Regards, -
Gurus,
Can any body logic for the below requirement for my Report. Report is also pasted. Thanks!
Create a table as given in the requirement
Table:
Cleint Jobname Email ID Active Subject Text Body Text
SO10 SO10
· The email part should contain the entire log and spool if available.
· Once you have the job list, loop on the list and check if the job is defined in your custom table
o If you find an entry then
§ Read the Job Log and convert it to HTML
§ Read the spool if available and convert it to pdf
§ Create an email with
· To: Mail id from your custom table
· Subject [ below: ]
o Then write the entire job log.
o Give one blank line
o If spool list is available the write else write
o Give one blank line
o Write
· Attachment should contain the PDF attachment of the spool.
o If the email fails then Write (donu2019t give message) the Job name and message that email failed.
o If you donu2019t find a mail ID for the job Write (donu2019t give message) the Job name and message that email not found.
· Continue to the next Job in your list.
REPORT ZJOB_MONITORING.
T A B L E S
TABLES: tbtco.
T Y P E - S P O O L S
TYPE-POOLS: slis.
T Y P E D E C L A R A T I O N S
*TYPES: BEGIN OF type_tbtco,
include TYPE tbtco,
END OF type_tbtco.
TYPES: BEGIN OF type_output,
STRTTIME TYPE tbtco-STRTTIME,
strtdate TYPE tbtco-strtdate,
jobname TYPE tbtco-jobname,
line TYPE string,
END OF type_output.
S T R U C T U R E S
DATA: s_tbtco TYPE tbtco,
s_joblog TYPE zsbb_uc4_joblog,
s_output TYPE type_output.
I N T E R N A L T A B L E S
DATA: i_tbtco TYPE STANDARD TABLE OF tbtco,
i_joblog TYPE STANDARD TABLE OF zsbb_uc4_joblog,
i_output TYPE STANDARD TABLE OF type_output.
DATA: Begin of itab_jobname OCCURS 0,
jobname type tbtco-jobname,
end of itab_jobname.
DATA: Begin of itab_user OCCURS 0,
jobname type tbtco-sdluname,
end of itab_user.
DATA: Begin of itab_stat OCCURS 0,
jobname type tbtco-status,
end of itab_stat.
DATA: Begin of itab_uzeit occurs 0,
uzeit type sy-uzeit,
end of itab_uzeit.
Heading of the report.
DATA: t_heading TYPE slis_t_listheader.
DATA : t_fieldcat TYPE slis_t_fieldcat_alv.
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_strtda FOR sy-datum,
s_lstrun FOR sy-uzeit OBLIGATORY,
s_jobnam FOR tbtco-jobname,
s_user FOR tbtco-sdluname,
s_status FOR tbtco-status.
PARAMETERS: p_email AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK bl1.
" AT SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-LOW.
PERFORM f4_JOBNAM-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_JOBNAM-HIGH.
PERFORM f4_JOBNAM-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-low.
PERFORM f4_USER-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_user-high.
PERFORM f4_USER-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-low.
PERFORM f4_STATUS-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_status-high.
PERFORM f4_STATUS-HIGH.
S T A R T O F S E L E C T I O N
START-OF-SELECTION.
PERFORM select_data.
If email is checked.
Send the output table as an email attachment to the distribution list.
Get the email list from the config table. " ask from where to get it
IF p_email = 'X'.
Call FM 'SO_OBJECT_SEND'.
Fill the fields which are not commented accordingly.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_TYPE = 'RAW'
OWNER = SY-UNAME
TABLES
OBJCONT = TEXT
OBJPARA = OBJPARA
RECEIVERS = RECEIVERS
EXCEPTIONS
OTHERS = 01.
IF SY-SUBRC NE 0.
RAISE ERROR.
ENDIF.
ENDIF.
Prepare the ALV Report.
PERFORM alv_grid_display.
*& Form alv_grid_display
text
FORM alv_grid_display .
alv required data objects.
DATA: w_repid TYPE syrepid,
x_layout TYPE slis_layout_alv,
t_event TYPE slis_t_event,
t_fieldcat TYPE slis_t_fieldcat_alv,
w_title TYPE lvc_title,
w_print TYPE slis_print_alv,
w_comm TYPE slis_formname,
flag TYPE c VALUE 'N'.
REFRESH t_fieldcat.
REFRESH t_event.
CLEAR x_layout.
CLEAR w_title.
Field Catalog
PERFORM set_fieldcat2 USING:
1 'strttime' 'BTCXTIME' space t_fieldcat ,
2 'jobname' 'BTCJOB' space t_fieldcat ,
3 'line' space 'Job Log' t_fieldcat .
*PERFORM set_fieldcat2 USING:
1 'strttime' 'BTCXTIME' space 'I_OUTPUT' t_fieldcat ,
2 'jobname' 'BTCJOB' space 'I_OUTPUT' t_fieldcat ,
3 'line' space 'Job Log' 'I_OUTPUT' t_fieldcat .
PERFORM set_fieldcat.
Layout
x_layout-zebra = 'X'.
x_layout-colwidth_optimize = 'X'.
GUI Status
w_repid = sy-repid .
Top of page heading
PERFORM set_top_page_heading USING t_heading t_event flag.
call the FM 'REUSE_ALV_GRID_DISPLAY'
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = x_layout
it_fieldcat = t_fieldcat
IT_SORT =
i_save = 'X'
it_events = t_event
TABLES
t_outtab = i_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_grid_display
*& Form set_top_page_heading
text
FORM set_top_page_heading USING
t_heading TYPE slis_t_listheader
t_events TYPE slis_t_event
flag TYPE c.
DATA: x_heading TYPE slis_listheader,
x_event TYPE LINE OF slis_t_event.
Report title
CLEAR t_heading[].
CLEAR x_heading.
x_heading-typ = 'H'.
x_heading-info = 'Job Details'(002).
APPEND x_heading TO t_heading.
Name of the report program
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Report ID:'.
x_heading-info = sy-repid.
APPEND x_heading TO t_heading.
User who is running the report
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
APPEND x_heading TO t_heading.
Date of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
WRITE sy-datum TO x_heading-info.
APPEND x_heading TO t_heading.
Time of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
WRITE sy-uzeit TO x_heading-info.
APPEND x_heading TO t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
APPEND x_event TO t_events.
ENDFORM. " set_top_page_heading
*& Form set_fieldcat2
text
FORM set_fieldcat2 USING
p_colpos p_fieldname p_ref_fieldname
p_seltext_m
p_tabname
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-col_pos = p_colpos.
the ref_fieldname given is a data element.
IF NOT p_ref_fieldname IS INITIAL.
wa_fieldcat-rollname = p_ref_fieldname.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
wa_fieldcat-tabname = 'I_OUTPUT'.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. " set_fieldcat2
*& Form F4_JOBNAM-LOW
text
--> p1 text
<-- p2 text
FORM F4_JOBNAM-LOW .
SELECT jobname FROM tbtco
INTO TABLE itab_jobname.
DELETE ADJACENT DUPLICATES FROM itab_jobname.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'jobname'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_jobnam-low'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_jobname
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_JOBNAM-LOW
*& Form F4_JOBNAM-HIGH
text
--> p1 text
<-- p2 text
FORM F4_JOBNAM-HIGH .
SELECT jobname FROM tbtco
INTO TABLE itab_jobname.
DELETE ADJACENT DUPLICATES FROM itab_jobname.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'jobname'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_jobnam-high'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_jobname
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_JOBNAM-HIGH
*& Form F4_USER-LOW
text
--> p1 text
<-- p2 text
FORM F4_USER-LOW .
SELECT sdluname FROM tbtco
INTO TABLE itab_user.
DELETE ADJACENT DUPLICATES FROM itab_user.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'user'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_user-low'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_user
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_USER-LOW
*& Form F4_USER-HIGH
text
--> p1 text
<-- p2 text
FORM F4_USER-HIGH .
SELECT sdluname FROM tbtco
INTO TABLE itab_user.
DELETE ADJACENT DUPLICATES FROM itab_user.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'user'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_user-high'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_user
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_USER-HIGH
*& Form F4_STATUS-LOW
text
--> p1 text
<-- p2 text
FORM F4_STATUS-LOW .
SELECT status FROM tbtco
INTO TABLE itab_stat.
DELETE ADJACENT DUPLICATES FROM itab_stat.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'status'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_status-low'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_stat
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_STATUS-LOW
*& Form F4_STATUS-HIGH
text
--> p1 text
<-- p2 text
FORM F4_STATUS-HIGH .
SELECT status FROM tbtco
INTO TABLE itab_stat.
DELETE ADJACENT DUPLICATES FROM itab_stat.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'status'
PVALKEY = ' '
DYNPPROG = 'sy-repid'
DYNPNR = '1000'
DYNPROFIELD = 's_status-high'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_stat
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " F4_STATUS-HIGH
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
FORM SELECT_DATA .
select the entries from the table TBTCO
as per the selection screen
SELECT * FROM tbtco
INTO TABLE i_tbtco
WHERE STRTTIME IN s_lstrun AND
strtdate IN s_strtda AND
jobname IN s_jobnam AND
sdluname IN s_user AND
status IN s_status.
Get the job details for the above jobs.
LOOP AT i_tbtco INTO s_tbtco.
CALL FUNCTION 'ZSBB_UC4_JOB_READ_LOG'
EXPORTING
client = sy-mandt
jobcount = s_tbtco-jobcount
joblog = s_tbtco-joblog
jobname = s_tbtco-jobname
TABLES
joblog_tab = i_joblog
EXCEPTIONS
cant_read_joblog = 1
jobcount_missing = 2
joblog_does_not_exist = 3
joblog_is_empty = 4
joblog_name_missing = 5
jobname_missing = 6
job_does_not_exist = 7
OTHERS = 8.
Write the Error handling as needed.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
Append entries to main table.
s_output-STRTTIME = s_tbtco-STRTTIME.
s_output-jobname = s_tbtco-jobname.
LOOP AT i_joblog INTO s_joblog.
s_output-line = s_joblog-text.
APPEND s_output TO i_output.
CLEAR s_output.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDFORM. " SELECT_DATA
*& Form SET_FIELDCAT
text
--> p1 text
<-- p2 text
form SET_FIELDCAT .
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'STRTTIME'.
wa_fieldcat-seltext_m = 'Start Time'.
wa_fieldcat-tabname = 'I_OUTPUT'.
wa_fieldcat-reptext = p_reptext.
APPEND wa_fieldcat to t_fieldcat.
wa_fieldcat-col_pos = 2.
wa_fieldcat-fieldname = 'JOBNAME'.
wa_fieldcat-seltext_m = 'Job Name'.
wa_fieldcat-tabname = 'I_OUTPUT'.
wa_fieldcat-reptext = p_reptext.
APPEND wa_fieldcat to t_fieldcat.
wa_fieldcat-col_pos = 3.
wa_fieldcat-fieldname = 'LINE'.
wa_fieldcat-seltext_m = 'Job Log'.
wa_fieldcat-tabname = 'I_OUTPUT'.
APPEND wa_fieldcat to t_fieldcat.
endform. " SET_FIELDCAT
Edited by: venkata on Aug 12, 2008 4:13 PMsolved
-
Converting String To XML Format and send as attachment
Hi
My requirement is to convert String into XML Format and that XML File i have to send as an attachment
can any one one give solution for this Problem.
Thank you
Venkatesh.Khi,
i m filling the itab first and converting to xml
itab contaning these data
GS_PERSON-CUST_ID = '3'.
GS_PERSON-FIRSTNAME = 'Bill'.
GS_PERSON-LASTNAME = 'Gates'.
APPEND GS_PERSON TO GT_PERSON.
GS_PERSON-CUST_ID = '4'.
GS_PERSON-FIRSTNAME = 'Frodo'.
GS_PERSON-LASTNAME = 'Baggins'.
APPEND GS_PERSON TO GT_PERSON.
after conversion data is coming like that
#<?xml version="1.0" encoding="utf-16"?>
<CUSTOMERS>
<item>
<customer_id>0003</customer_id>
<first_name>Bill</first_name>
<last_name>Gates</last_name>
</item>
<item>
<customer_id>0004</customer_id>
<first_name>Frodo</first_name>
<last_name>Baggins</last_name>
</item>
</CUSTOMERS>
but errors are 1) # is coming at the first
2)for 'encoding="utf-16"?>', it is not coming perfectly, some other data (iso-8859-1) should come here
can anybody plz solve it.
regards,
viki -
Sending PDF forms (created using SFP) as Email Attachment
Hi,
I have created bunch of ADOBE forms using SFP. They are not interactive forms. created using ADOBE Live cycle designer.
I have the Function module and by executing I can view the PDF form in print preview mode. But I have to save this in backend and attach to email.
I have a program that have to send one of the forms created in SFP as email attachment to outside SAP.
Please advice how to achieve this.
Thanks,
SanjeevHi ,
Please find below a code sample for your requirement
*& Report ZENVOI_PDF_MAIL
REPORT zenvoi_pdf_mail MESSAGE-ID ad.
TYPE-POOLS : abap .
DATA : data_for_update TYPE zdemopdf ,
hexa TYPE solix_tab.
DATA : fm_name TYPE funcname ,
param TYPE sfpoutputparams,
doc_param TYPE sfpdocparams ,
output TYPE fpformoutput .
param-nodialog = abap_true. " suppress printer dialog popup
param-getpdf = abap_true.
doc_param-langu = sy-langu.
doc_param-country = 'FR'.
doc_param-fillable = abap_true.
doc_param-dynamic = abap_true.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZDEMO_PDF'
IMPORTING
e_funcname = fm_name.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = param
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4.
CHECK sy-subrc EQ 0.
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = doc_param
data_for_update = data_for_update
IMPORTING
/1bcdwb/formoutput = output
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = output-pdf "PDF file from function module
TABLES
binary_tab = hexa.
* Envoi du mail
** CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
*DATA: sender TYPE REF TO cl_sapuser_bcs.
data: sender TYPE REF TO if_sender_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
** INTERNAL TABLES
DATA: l_mailtext TYPE soli_tab.
DATA: iaddsmtp TYPE TABLE OF bapiadsmtp.
DATA: ireturn TYPE TABLE OF bapiret2.
** VARIABLES
DATA: mail_line LIKE LINE OF l_mailtext.
DATA: bapiadsmtp TYPE bapiadsmtp.
DATA: subject TYPE so_obj_des.
DATA : att_subject TYPE so_obj_des.
DATA : w_except TYPE REF TO cx_root .
CONSTANTS : c_defmail TYPE ad_smtpadr VALUE
'[email protected]' .
FIELD-SYMBOLS : <smtp> TYPE bapiadsmtp.
*Set subject of the mail
subject = 'Exemple de PDF interactif'.
* Set text of the mail
mail_line = 'Merci de remplir le formulaire et nous le retourner'.
APPEND mail_line TO l_mailtext .
att_subject = 'Template du PDF'.
TRY.
* Create persistent send request
send_request = cl_bcs=>create_persistent( ).
* Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
* sender =
* cl_cam_address_bcs=>create_internet_address( '[email protected]' ) .
* Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
* Read the E-Mail address for the user
* CALL FUNCTION 'BAPI_USER_GET_DETAIL'
* EXPORTING
* username = sy-uname
* TABLES
* return = ireturn
* addsmtp = iaddsmtp.
* LOOP AT iaddsmtp ASSIGNING <smtp> WHERE std_no = 'X'.
* CLEAR bapiadsmtp.
* MOVE <smtp> TO bapiadsmtp.
* ENDLOOP.
* CASE bapiadsmtp-e_mail.
* WHEN space.
recipient =
cl_cam_address_bcs=>create_internet_address( c_defmail ).
* WHEN OTHERS.
* recipient =
* cl_cam_address_bcs=>create_internet_address( bapiadsmtp-e_mail ).
* ENDCASE.
* Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'
i_copy = space
i_blind_copy = space
i_no_forward = space.
* Set that you don't need a Return Status E-mail
CALL METHOD send_request->set_status_attributes
EXPORTING
i_requested_status = 'E'
i_status_mail = 'E'.
* set send immediately flag
send_request->set_send_immediately( 'X' ).
*Build Document
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_mailtext
i_subject = subject ).
* add attachment to document
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = att_subject
i_att_content_hex = hexa.
* Add document to send request
CALL METHOD send_request->set_document( document ).
* Send document
CALL METHOD send_request->send( ).
COMMIT WORK.
CATCH cx_send_req_bcs INTO w_except.
CATCH cx_address_bcs INTO w_except.
CATCH cx_document_bcs INTO w_except.
ENDTRY.
Hope this help you .
Best regards -
Creating xml format file with double dagger ‡ as delimiter
Hi,
My source files are delimited with double dagger (‡) and I am using openrowset to load the files to SQL Server. When I am creating the format file by specifying the delimiter as ‡, the format file created has a different delimiter than the specified one.
The new delimiter appearing in xml format file is ç.
Any help?
TIA
Nitesh Rai- Please mark the post as answered if it answers your questionHow did you create format file?
Try this method and see if it works
http://visakhm.blogspot.com/2013/10/generate-format-files-based-on-table.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
Is anyone using Skype on an Orange UK iphone. I'm just trying to establish whether i would be able to use Skype over wifi before purchasing one. Read some reports that it's barred and the sales reps in the Orange store would only confirm that Skype i
-
Windows Sharing "Accounts..." passwords do not reset?
I am trying to connect my PC to my Mac and it seems to work fine for my laptop but not for my G5 tower. So, I went into my sharing preferences on my G5 and checked that my Windows Sharing was turned on, it was. Then I clicked on the Accounts... butto
-
Ive somehow managed to delete a complete user profile. Is it possible to retrieve the information?
-
Problems with the elliptical marquee tool in CS6/Mac
I have CS6 and did the newest update yesterday. I'm working on Mac OS X 10.6.8. The problem is following: The elliptical tool doesn't function anymore correctly. If I want to make an ellipse or circle first it looks normal put if I let go the mouse,
-
Netbeans install on Fedora 5 x86_64
Hi all. I wanted to install NetBeans and JDK 5.0 on Fedora Core 5 x86_64. I downloaded the file 'jdk-1_5_0_06-nb-5_0-linux.bin' from java.sun.com. After this I tried to run this file on my Fedora Core 5 installation. I encountered the famous error 'T