How to send output of a XML report to certain email Ids
Hi,
I have used rdf as well as rtf file and created my xml report. Now i want to send my report output(pdf or excel) to certain email ids and i donot want to use email bursting technique for this. So please tell me the other ways to do this thing.
Thanks,
ST
Hi;
Please also check:
concurrent ouput to email
Re: concurrent ouput to email
Regard
Helios
Similar Messages
-
Urgent ...how to send output of sap through mail
Could you please guide me how to send output of SAP Script through mail in PDF format.
Thanks in Advance....
Regards,
Kumar.*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver,
p_sender LIKE somlreci1-receiver,
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
regards,
venkat -
How to send output of smartform in pdf format as an attachment to email
how to send output of smartform in pdf format as an attachment to email
search before posting further and follow Forum rules
Edited by: Vijay Babu Dudla on Jan 15, 2009 4:50 AMDid u check on sdn?
i dont think so or else there are many posts on this topic and good wikis too.
look at one of these code tutorial wiki
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/mail%2bsend%2bthrough%2boutput%2bcontrols
So next time do use the search functionality.
кu03B1ятu03B9к
Edited by: kartik tarla on Jan 15, 2009 12:33 PM -
Standard report for employee email ids(I T105)
Hi All,
Any standard report for employee email ids(I T105)
Thanks
SDHi..
There is no standard report program but.. you can use Function module HR_READ_INFOTYPE to retrieve email address giving a Personnel number.
OR, It is better to go directly to PA0105 and fetch mail ID's
SELECT USRID_LONG FROM PA0105 INTO LT_EMAIL_ID WHERE PERNR = PERNR
Hope this will solve your problem..
Regards,
Jhings -
How to specify page encoding for XML reports.
Hi,
Environment: Apps:11.5.10, Oracle Reports: 10g
I'm trying to generate XML tags by using a "rdf" report (10g).
Initially I generated the XML tags before moving the report to server. In the output file I got
<?xml version="1.0" encoding="WINDOWS-1252"?>
Then I moved the report to server and made the concurrent program output to XML.
In the concurrent program output the tag is
<?xml version="1.0" encoding="&Encoding"?>
The output shows error
===============
XML Parsing Error: XML declaration not well-formed
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<?xml version="1.0" encoding="&Encoding"?>
Its clear that there is something wrong with page encoding format which has to get assigned while run time. But its not happening so.
How to specify the page encoding format?
Any help would be appreciated.
Thank you
BKR.
Edited by: BalaKrishna Reddy Avuthu on Aug 14, 2009 2:00 PMRemove the encoding so it says:
<?xml version="1.0"?>
Also, you will get a similar error if your xml tags for fields contain any special characters like & or #. -
How can i use FNDLOAD for XML reports and data defnitions
I registerd concurrent program and linked xml reports and data defnitions in staging instance, and successfully moved to DEV.. after that stage is refreshed and when i download the details from DEV and uploaded to Stage only concurrent program i can upload...Wheteher we can use FNDLOAD Command for the Data definitions or Data template for the XML Report,used FNDLOAD for the concurrent program, it uploaded only concurrent program details.
Hi,
Use XDOLoader.
Note: 469585.1 - How To Use XDOLoader?
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=469585.1
Regards,
Hussein -
How to show image in TestStand xml report
Hi,
I am using TestStand to run DLLs written over CVI.
I am using the xml report for collecting results.
Some of the tests i run require showing images on the report -
I would like to know how to allow showing an image on xml report by writing a CVI code.
Thanks,
MoshikHi Moshik,
There is an example for inserting images in your report in this discussion:
http://forums.ni.com/ni/board/message?board.id=330&message.id=2819&requireLogin=False
TestStand uses the sequences named reportgen_***.seq that default to the
C:\Program Files\National Instruments\TestStand 3.5\Components\NI\Models\TestStandModels directory for report generation.
You can edit the reportgen_xml.seq for XML reports.
Is it really necessary for your DLLs to do the image insertion?
Gavin Fox
Systems Software
National Instruments -
How to send large amount of XML data in one CLOB variable
Hi,
I am sending large amount of XML data to TCP/IP port in one CLOB variable.
My requirement is to send the whole data in one go in one CLOB variable.
But that CLOB variable is not sufficient to hold all the data.
Please suggest some solution.
Thanks in advanceHi Here is my code:
CREATE OR REPLACE PACKAGE BODY APPS.XXMB_WIP_PROD_TAG_DOOR_PKG
AS
PROCEDURE xxmb_get_xml_data_1270 (
-- errbuf OUT VARCHAR2,
-- retcode OUT NUMBER,
p_org IN VARCHAR2,
p_limit_to_global IN VARCHAR2,
p_label IN VARCHAR2,
p_printer IN VARCHAR2,
p_quantity IN VARCHAR2,
p_print_method IN VARCHAR2,
p_enable_release IN VARCHAR2,
p_enable_serial_no IN VARCHAR2,
p_release IN VARCHAR2,
p_rep_group IN VARCHAR2,
p_cart_type IN VARCHAR2,
p_cart_no_from IN VARCHAR2,
p_cart_no_to IN VARCHAR2,
p_serial_no IN VARCHAR2
AS
CURSOR c_xml_data_door (
p_org IN VARCHAR2,
p_label IN VARCHAR2,
p_printer IN VARCHAR2,
p_quantity IN VARCHAR2,
p_print_method IN VARCHAR2,
p_rep_group IN VARCHAR2,
p_release IN VARCHAR2,
p_cart_type IN VARCHAR2,
p_cart_no_from IN VARCHAR2,
p_cart_no_to IN VARCHAR2,
p_serial_no IN VARCHAR2
IS
SELECT xxasa.item_id AS item_id, xcs.serial_number AS serial_number,xxcpf.cart_type,xcs.destination_cart_num cart,xcs.destination_slot_num slot
CURSOR c_product_detail (
l_product IN NUMBER,
l_serial_num IN VARCHAR2,
p_limit_to_global IN VARCHAR2
IS
SELECT xcra_specie.reference_id AS reference_id,
xcra_ege.attribute_value AS ege, xcs.item_id AS item_id,
AND msib.inventory_item_id = l_product
and xcs.organization_id = nvl(p_org, xcs.organization_id)
AND xcs.serial_number = NVL (l_serial_num, xcs.serial_number);
/*-------------------------------------------------------+
| Cursor to fetch the data for special Message Label |
+-------------------------------------------------------*/
CURSOR c_count (p_item_id IN NUMBER)
IS
SELECT xcrav.attribute_value, xcs.serial_number, xcs.cabinet_number
FROM xxmb_czmfg_ref_attributes xcrav,
cz_config_attributes cca,
AND msib.organization_id = xcs.organization_id
AND msib.inventory_item_id = xcs.item_id;
/*--------------------------+
| Common variables |
+--------------------------*/
v_limit_to_global VARCHAR2 (100);
l_label_count NUMBER := 1;
total_rec NUMBER;
l_rewrite VARCHAR2 (1) := 'N';
l_file_count NUMBER := 1;
l_separate_line VARCHAR2 (10);
BEGIN
fnd_profile.get ('WMS_LABEL_OUTPUT_DIRECTORY', l_output_dir);
fnd_profile.get ('WMS_LABEL_FILE_PREFIX', l_output_file_prefix);
l_request_id := apps.fnd_global.conc_request_id;
l_output_file_name :=
l_output_file_prefix || l_request_id || l_file_end;
l_dir_seperator := '/';
IF (INSTR (l_output_dir, l_dir_seperator) = 0)
THEN
l_dir_seperator := '\';
END IF;
v_label := p_label;
v_printer := p_printer;
v_quantity := p_quantity;
V_LIMIT_TO_GLOBAL := P_LIMIT_TO_GLOBAL;
L_XML_CONTENT := '<?xml version="1.0" encoding="UTF-8" ?>';
L_XML_CONTENT := L_XML_CONTENT || '<!DOCTYPE labels SYSTEM "label.dtd">';
L_XML_CONTENT := L_XML_CONTENT || '<labels>';
FOR r_xml_data_door IN c_xml_data_door (p_org,
p_label,
p_printer,
p_quantity,
p_print_method,
p_rep_group,
p_release,
p_cart_type,
p_cart_no_from,
p_cart_no_to,
p_serial_no
LOOP
-- dbms_output.put_line ( 1 );
FOR r_product_detail IN
c_product_detail (r_xml_data_door.item_id,
r_xml_data_door.serial_number,
v_limit_to_global
LOOP
-- dbms_output.put_line ( 2 );
-- l_xml_content := '<?xml version="1.0" encoding="UTF-8" ?>';
-- l_xml_content := l_xml_content || '<!DOCTYPE labels SYSTEM "label.dtd">';
-- l_xml_content := l_xml_content || '<labels>';
fnd_file.put_line (fnd_file.LOG, 'label cnt: ' || l_label_count);
dbms_output.put_line (l_label_count);
L_XML_CONTENT := L_XML_CONTENT || '<label _FORMAT='
|| '"'
|| 'lib://FRD/'
|| v_label
|| '"'
|| ' _PRINTERNAME='
|| '"'
|| v_printer
|| '"'
|| ' _QUANTITY='
|| '"'
|| v_quantity
|| '"'
|| '>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Color">'
|| R_PRODUCT_DETAIL.COLOR
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT ||'<variable name= "Model">'
|| R_PRODUCT_DETAIL.model
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Build_Date">'
|| R_PRODUCT_DETAIL.BUILD_DATE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Assy_Cart">'
|| R_PRODUCT_DETAIL.ASSY_CART
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Assy_Slot">'
|| R_PRODUCT_DETAIL.ASSY_SLOT
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Assy_Line">'
|| R_PRODUCT_DETAIL.ASSY_LINE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Finish_Cart">'
|| R_PRODUCT_DETAIL.FINISH_CART
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Finish_Slot">'
|| R_PRODUCT_DETAIL.FINISH_SLOT
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Serial_Number">'
|| R_PRODUCT_DETAIL.SERIAL_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Serial_Number_Barcode">'
|| R_PRODUCT_DETAIL.SERIAL_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Specie">'
|| R_PRODUCT_DETAIL.SPECIE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT ||'<variable name= "Truck_Group">'
|| R_PRODUCT_DETAIL.TRUCK_GROUP
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Label_Sequence_No">'
|| L_LABEL_COUNT
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT ||'<variable name= "WIP_Cart">'
|| R_PRODUCT_DETAIL.WIP_CART
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "WIP_Slot">'
|| R_PRODUCT_DETAIL.WIP_SLOT
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Cabinet_Sequence_No">'
|| R_PRODUCT_DETAIL.CAB_SEQ_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "RAW_PART_NO">'
|| R_PRODUCT_DETAIL.RAW_PART_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "JC">'
|| R_PRODUCT_DETAIL.JC
|| '</variable>' ;
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "QC">'
|| R_PRODUCT_DETAIL.QC
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Thickness">'
|| R_PRODUCT_DETAIL.THICKNESS
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Width">'
|| R_PRODUCT_DETAIL.width
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Length">'
|| R_PRODUCT_DETAIL.length
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Overlay">'
|| R_PRODUCT_DETAIL.OVERLAY
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Options">'
|| R_PRODUCT_DETAIL.OPTIONS
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Stop">'
|| R_PRODUCT_DETAIL.stop
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Profile_No">'
|| R_PRODUCT_DETAIL.PROFILE_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Door_Style">'
|| R_PRODUCT_DETAIL.DOOR_STYLE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Glaze">'
|| R_PRODUCT_DETAIL.GLAZE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Shape">'
|| R_PRODUCT_DETAIL.SHAPE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Glass">'
|| R_PRODUCT_DETAIL.GLASS
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Hinge_Side">'
|| R_PRODUCT_DETAIL.HINGE_SIDE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Hinge_Type">'
|| R_PRODUCT_DETAIL.HINGE_TYPE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "EGE">'
|| R_PRODUCT_DETAIL.EGE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Door_Style_Code">'
|| R_PRODUCT_DETAIL.DOOR_STYLE_CODE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Finish_Technique">'
|| R_PRODUCT_DETAIL.FINISH_TECHNIQUE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Hinge_Location">'
|| R_PRODUCT_DETAIL.HINGE_LOCATION
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Construction_Type">'
|| R_PRODUCT_DETAIL.CONSTRUCTION_TYPE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_Type">'
|| R_PRODUCT_DETAIL.PANEL_TYPE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_Profile_No">'
|| R_PRODUCT_DETAIL.PANEL_PROFILE_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Rail_Profile_No">'
|| R_PRODUCT_DETAIL.RAIL_PROFILE_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Rail_1_Length">'
|| R_PRODUCT_DETAIL.RAIL_1_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Stile_Profile_No">'
|| R_PRODUCT_DETAIL.STILE_PROFILE_NO
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Rail_2_Length">'
|| R_PRODUCT_DETAIL.RAIL_2_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Stile_1_Length">'
|| R_PRODUCT_DETAIL.STILE_1_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Stile_2_Length">'
|| R_PRODUCT_DETAIL.STILE_2_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_1_Width">'
|| R_PRODUCT_DETAIL.PANEL_1_WIDTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_1_Length">'
|| R_PRODUCT_DETAIL.PANEL_1_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_2_Width">'
|| R_PRODUCT_DETAIL.PANEL_2_WIDTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Panel_2_Length">'
|| R_PRODUCT_DETAIL.PANEL_2_LENGTH
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT ||'</label>';
/*-----------------------------------------+
| Handling XML data for special message |
+-----------------------------------------*/
FOR rec_count IN c_count (r_product_detail.item_id)
LOOP
L_XML_CONTENT := L_XML_CONTENT || '<label _FORMAT='
|| '"'
|| 'lib://FRD/SpecMessage_Door.btw'
|| '"'
|| ' _PRINTERNAME='
|| '"'
|| v_printer
|| '"'
|| ' _QUANTITY='
|| '"'
|| v_quantity
|| '"'
|| '>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Serial_Number">'
|| REC_COUNT.SERIAL_NUMBER
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Special_Message">'
|| REC_COUNT.ATTRIBUTE_VALUE
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT || '<variable name= "Cabinet_Sequence_No">'
|| REC_COUNT.CABINET_NUMBER
|| '</variable>';
L_XML_CONTENT := L_XML_CONTENT ||'</label>';
EXIT WHEN c_count%NOTFOUND;
end LOOP;
-- L_XML_CONTENT := L_XML_CONTENT || '</labels>';
fnd_file.put_line (fnd_file.LOG, l_xml_content);
dbms_output.put_line ( l_xml_content );
L_LABEL_COUNT := L_LABEL_COUNT + 1;
-- apps.inv_print_request.sync_print_tcpip (l_xml_content,
-- l_job_status,
-- l_printer_status,
-- l_status_type,
-- l_return_status,
-- l_return_msg
END LOOP;
END LOOP;
l_xml_content := l_xml_content || '</labels>';
fnd_file.put_line (fnd_file.LOG, l_xml_content);
apps.inv_print_request.sync_print_tcpip (l_xml_content,
l_job_status,
l_printer_status,
l_status_type,
l_return_status,
l_return_msg
L_XML_CONTENT := null;
/*--------------------------------------------------------------------------------------+
| APPS.INV_PRINT_REQUEST.SYNC_PRINT_TCPIP will send the XML data to TCP/IP Port |
+--------------------------------------------------------------------------------------*/
fnd_file.put_line (fnd_file.LOG,
'Printer Status:' || ' ' || l_printer_status
fnd_file.put_line (fnd_file.LOG,
'Return Status:' || ' ' || l_return_status
fnd_file.put_line (fnd_file.LOG,
'Return Message:' || ' ' || L_RETURN_MSG
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
fnd_file.put_line
(fnd_file.LOG,
'Unexpected error in the xxmb_get_xml_data_1270 procedure, error is : '
|| SQLERRM
|| ', '
|| SQLCODE
END xxmb_get_xml_data_1270;
END xxmb_wip_prod_tag_door_pkg;
/ -
How to send output by mail?
Hi Experts,
Current output type in our system:
Document: SD delivey note
Output type: LD00
Medium: 1
Form: Smartforms.
Now we are printing delivery note by LD00 and Medium 1.
In the future, we need to send ducument output to customer by mail, format still as original smartforms.
Would you please give me a guide line to do this?
Thank you.
Richard.Hi Richard,
you need to do following things to send output as an email.
The output type should have medium 5. thats to send an email. Along with this you need to check following two things.
if you are using a copy of a standard program it should have code to send an email. Then you just need to configure following output type with medium '5' to send an email.
If you dont have code to send it as an email you can use FM to send it as an email.
you can use following FM if its an adobe form.
CALL FUNCTION 'SD_PDF_SEND_DATA'
EXPORTING
iv_device = p_w_device
iv_email_subject = w_lv_subject
it_email_text = w_mail_text
is_main_data = p_wa_fp_formoutput
iv_language = w_langu
is_address = w_ls_address
IMPORTING
ev_send_to_all = w_lv_send_to_all
EXCEPTIONS
exc_document = 1
exc_send_request = 2
exc_address = 3
OTHERS = 4.
Else for smart form you need to convert it to PDF format first and send it as an email. Refer below code.
Call Smartform function module.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ssfctrlop
output_options = ssfcompop
IMPORTING
job_output_info = it_otf_data
TABLES
it_nfal = it_nfal.
***********appending the otf data into the final table*********************
it_otf_final[] = it_otf_data-otfdata[].
converting OTF data into pdf data**************************
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_filesize
bin_file =
TABLES
otf = it_otf_final
lines = it_pdfdata[]
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
To send data as email attachment, we need to have a table of SOLISTI1.
This table contains line size of 255 characters. Below function module
does the trick of changing the table from X character sized lines into
any given Y character sized lines.
REFRESH it_pdf[].
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_dst = '255'
TABLES
content_in = it_pdfdata[]
content_out = it_pdf[]
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
"Subject of the mail.
w_document_data-obj_name = 'MAIL_TO_HEAD'.
w_document_data-obj_descr = 'Regarding Mail Program by SAP ABAP'.
"Body of the mail
w_body_msg = 'This is body of mail msg.'.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
"Write Packing List for Body
DESCRIBE TABLE i_body_msg LINES g_tab_lines.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
w_packing_list-body_num = g_tab_lines.
w_packing_list-doc_type = 'RAW'.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Write Packing List for Attachment
w_packing_list-transf_bin = 'X'.
w_packing_list-head_start = 1.
w_packing_list-head_num = 1.
w_packing_list-body_start = 1.
DESCRIBE TABLE it_pdf LINES w_packing_list-body_num.
w_packing_list-doc_type = 'PDF'.
w_packing_list-obj_descr = 'PDF Attachment'.
w_packing_list-obj_name = 'PDF_ATTACHMENT'.
w_packing_list-doc_size = w_packing_list-body_num * 255.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Fill the document data and get size of attachment
w_document_data-obj_langu = sy-langu.
READ TABLE it_pdf INTO w_pdf INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_attachment ).
"Receivers List.
w_receivers-rec_type = 'U'."Internet address
w_receivers-receiver = p_mail.
w_receivers-com_type = 'INT'.
w_receivers-notif_del = 'X'.
w_receivers-notif_ndel = 'X'.
APPEND w_receivers TO i_receivers .
CLEAR:w_receivers.
"Function module to send mail to Recipients
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
contents_bin = it_pdf
contents_txt = i_body_msg
receivers = i_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc = 0 .
MESSAGE i303(me) WITH 'Mail has been Successfully Sent.'.
ENDIF.
ENDIF.
Edited by: Sumit Naik on Oct 13, 2010 11:20 PM -
How to send output of one Bapi to another Bapi??
dear all,
I am having two BAPIs. From one Bapi I am getting value(Output) in one dropdown box.
Now my problem is how to give output of first BAPI(in drop down box) as input to second BAPI which should display in second drop down.
Am I clear???
I have two drop down boxes and two BAPIs. I am able to get output of first BAPI into first drop down box. Now i have to use the data in first drop down box as input to second BAPI(second drop down box).
The second BAPI takes first BAPI output as its Input.
As I am new to Web Dynpro please help me in this regard detailly.Hi Pradeep,
Consider you have dropdown1 displays all the countryNames which is output of BAPI1..
Now you want to input this to BAPI2.Am i right ?
If so
1. create model instance of BAPI2 as you did for BAPI1.
2. get the value from outputnode of BAPI1 by
wdCOntext.outputNode().getXXX()
and set this value to the input model instance of BAPI2 and call execute method on the model.
Regards, ANilkumar -
How to send the file in *application server* as an email?
Hi,
I have a file in application server and I want to send that file as an email from application server.
Please let me know how to do it.Hi Suman,
look here:
Re: How to send an email from Application server?
Regards, Dieter -
How to send a payslip of the emp in the email body in R12
Hi All,
Would like to know how can we send the payslip of an employee in the email.
How can one do the above mentioned function in Oracle Payroll in R12.
Please note that the payslip amounts should be in the email body and not as an attachment.
thanx,
ChetanOpen the workflow process you are using.
Open the notification.
In the notification you will see there will be a message given
Open the message and in that there will different parts of message like Subject, Body as text and HTML.
See the HTML body you can find the there must be some attributes defined there. Create you own attribute say a URL (which is OA Page, a function in Apps)
and test.
e.g in OTL Workflows for Employees (HXCEMP) workflow, there is a message template "Inline Timecard Approval" in which a URL attribute is used.
I think some workflow experts can help you more.
HTH -
How to send the invoice through more than one E-mail Ids?
Hi Experts,
I need to send invoice to two email ids. I made a set up in vv31 by setting the transmission medium 7 but
it doesn't work.
The customer is asking that when i do invoice it should go to two email address.
Which output type i should take?
Kindly help me regarding this.
Thanks
RaghuHi,
In VV31
In communication maintain recipients as your 2 Emil id's and recipient type
If you have customized output then take that if Not then use standard RD00
Kapil -
Everyday, I get atleast 8 emails from people I don't know. Is there anyway I can mark the email IDs of these senders and program the Mail app to send incoming emails from these IDs to the junk/trash folder directly, without letting these emails enter my inbox?
Thank you (:Hello Josh! Did you ever solve your problem?
I am experiencing exactly the same thing as you, and I am not sure of what is causing it!
Thanks in advance for any feedback you may have! -
How to send output of alv report as mail
Hi Experts,
I Have retrieved data from USER tables and i need to send the output of the list through mail.
could you please help me in completing this task
Moderator message: FAQ, please search for previous discussions of this topic.
Edited by: Thomas Zloch on Mar 16, 2011 9:41 AMHi,
You can send the report data as an either excel sheet ot txt attachment in side the email. for this you can use the function module . for this refer to program BCS_EXAMPLE_7 .
Maybe you are looking for
-
i am trying to restore a backup og my iphone 4 from itunes on my macbook, it asks me for a password which i do not recall setting up, is there any way of getting this password.
-
COPA Assessment Cycle using KEU5 for multiple controlling areas
Hello All, There is an organization with operations in several countries. There is a separate controlling area for each country. There is one controlling area, for instance, for Germany and another for Netherlands. A problem is encountered while exec
-
Generic Data Extraction From SAP R/3 to BI server using Function Module
Hi, I want step by step procedure for Generic Extraction from SAP R/3 application to BI application using Functional module. If any body have any Document or any PPT then please reply and post it in forum, i will give point for them. Thanks & Regards
-
Problem related to generation of header file
hi guys, I am getting Exception during the generation of the header file, using "javah -jni HelloWorld" I am refering jni.pdf (java.sun.com/docs/books/jni/download/jni.pdf ) I have given that error below Exception in thread "main" java.io.IOException
-
HT1222 It says IOS 5.1 is not available. How do i fix that?
It says IOS 5.1 is not available. How do i fix that?