Email Dynamic Form as Attachment using class cl_bcs?
Hi Experts
I really hope that you can help me.
I have a dynamic form embedded in my view and I need to email this form as an attachment to a list of participants.
I already use the class cl_bcs for sending email, but how do I retrieve the form parameters (on button click within WD ABAP) and then convert them to the correct format so that they can be included in the cl_bcs class for sending?
Thanks in advance
I'll award points to helpful answers.
Anton Kruse
HI,
To send mail with PDF attachement,
U have to specify the emporting and exporting parameters for the Interactive Form in the SFP transaction.
Then add the below coding,
*Send mail in PDF format
Funtion module to get the generated FM name
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = lc_formname
IMPORTING
e_funcname = lv_fmname.
CATCH cx_fp_api_repository. "#EC NO_HANDLER
CATCH cx_fp_api_usage. "#EC NO_HANDLER
CATCH cx_fp_api_internal. "#EC NO_HANDLER
ENDTRY.
ls_param-nodialog = 'X'." suppress printer dialog popup
ls_param-getpdf = 'X'." launch print preview
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_param
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
Do Nothing
ENDIF.
ls_fp_doc-langu = lc_sprsl.
ls_fp_doc-country = lc_country.
ls_fp_doc-fillable = 'X'.
Mail Format /1BCDWB/SM00000091
CALL FUNCTION lv_fmname
EXPORTING
/1bcdwb/docparams = ls_fp_doc
empno = ls_emp_det-empno
empname = ls_emp_det-empname
state = ls_emp_det-state
location = ls_emp_det-location
organisation = ls_emp_det-organisation
position = ls_emp_det-position
mailid = ls_emp_det-mailid
actual_date = ls_emp_det-actual_date
likely_date = ls_emp_det-likely_date
resig_date = ls_emp_det-resig_date
generic_det = lt_generic
bond_det = lt_bond
IMPORTING
/1bcdwb/formoutput = ls_formout
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
*do nothing.
ENDIF.
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
Do Nothing
ENDIF.
*Function call to get the xstring value.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = ls_formout-pdf
TABLES
binary_tab = lt_att_content_hex."PDF file from function module
lv_bodytext_row-line = lc_subject.
APPEND lv_bodytext_row TO lt_bodytext.
APPEND ' ' TO lt_bodytext.
lv_bodytext_row-line = text-001.
APPEND lv_bodytext_row TO lt_bodytext.
APPEND ' ' TO lt_bodytext.
DESCRIBE TABLE lt_bodytext LINES lv_num_rows.
lv_num_rows = lv_num_rows * 255.
MOVE lv_num_rows TO lv_textlength.
TRY.
lv_attdoctype = lc_pdf.
lv_atttitle = text-000.
lc_document = cl_document_bcs=>create_document(
i_type = lc_raw
i_text = lt_bodytext
i_length = lv_textlength
i_subject = lv_subject ).
lc_document->add_attachment( EXPORTING
i_attachment_type = lv_attdoctype
i_attachment_subject = lv_atttitle
i_attachment_language = sy-langu
i_att_content_hex = lt_att_content_hex ). This will attach ur PDF to mail
Create persistent send request
lv_send_request = cl_bcs=>create_persistent( ).
Add document to send request
lv_send_request->set_document( lc_document ).
lv_sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender
CALL METHOD lv_send_request->set_sender
EXPORTING
i_sender = lv_sender.
CLEAR : ls_smtp_addr.
READ TABLE lt_mailid INTO ls_mailid WITH KEY pernr = ls_0001-pernr.
IF sy-subrc = 0.
ls_smtp_addr = ls_mailid-usrid_long.
ENDIF.
Create recipient.
lv_recipient = cl_cam_address_bcs=>create_internet_address(
ls_smtp_addr ).
Add recipient with its respective attributes to send request
lv_send_request->add_recipient( EXPORTING
i_recipient = lv_recipient
Set send immediately
lv_send_request->set_send_immediately( 'X' ).
Send document
lv_send_request->send( ).
CATCH cx_root INTO lv_oref. "#EC NO_HANDLER
ENDTRY.
Hope this ll help u!!
Thanks,
Divya.S
Similar Messages
-
Send email with spool as PDF attachment using class CL_BCS
Hi,
I am converting a spool to PDF using the function module CONVERT_OTFSPOOLJOB_2_PDF. The spool contains graphic images etc just like a script output.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = v_rqident
no_dialog = 'X'
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 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.
After this I want to attach the pdf as an attachment to an email and send it. For this purpose I am using the code found in the example BCS_EXAMPLE_5.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'My attachment'
i_att_content_hex = binary_content.
How do I convert the script text into binary content, could you please suggest some help.Old code, but I use:
DATA: lt_pdf TYPE soli_tab,
lt_pdfbin TYPE solix_tab.
* Convert the lines
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
transfer_bin = 'X'
TABLES
content_in = i_pdf
content_out = lt_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 NE 0.
RAISE convert_error.
ENDIF.
lt_pdfbin = lt_pdf.
Also, keep in mid that that OTF convert function has a 99 page limit - if you can potentially reach that limit, you need to handle the background job process and retrieval of the RAW data from the spool. -
How I can create dynamically-formed requests or use native SQL in EJB?
Hi all.
I'm working around modify an example from NetWeaver Developer Studio (CarRental). I want to get ordered data from table and allow users to specify the ordering field, not in the code. EJB QL doesn't support dynamically-formed queries like "select object(b) from QuickBooking b where b.status like ?1 order by b.<b>?2</b>" so i can't passing field name as parameter into query. Creating a sorting method for every field is not good solution because I need a dynamically-formed requests.
I think using native SQL will help but I don't know how I can use SQL in EJB.
Thanks,
Levimport javax.persistence.EntityManager;within class, place
protected EntityManager entityManager;of course make it public, private, whatever you need.
Then, in your method
entityManager.createNativeQuery(....);R. Grimes -
How to send a mail to sapuser using class cl_bcs
Hi to all experts,
i have send a mail to local sap user using the class cl_bcs .in the function module we gave reciever type as "B" to send to the local sapuser how to do this in this class cl_bcs.got it
we have to use rml address
recipient = cl_cam_address_bcs=>create_rml_address(
i_syst = sy-sysid
i_client = sy-mandt
i_username = sy-uname ). -
Email PDF fillable form as attachment using php?
Please help me this is our problem.
We have created a simple PDF form for our clients to book in a job. Currently they fill it in manually and we receive it by fax. We have created this form with editable fields now, and would like to host this special PDF so it is 'browsable to' on our website. When filled in we would like to submit it to a PHP script which would process and then email the complete PDF to our production department, and another copy to the user. Is this possible? If so, how?Thanks Paul for your message, but i have already did that, my real problem is in PHP how to I grab that PDF file and attach it to an email. I know the name of the pdf file i am sending but will it be referenced in the files as $_FILES["test.pdf"] that is my problem i try that and it doesn't work so I am wounder what variable is sent in the $_POST that is the file. Does that make sense?
-
How to email PDF form as attachment?
Hi All,
I have developed online interactive form app(dynamic).
When user clicks the submit button after entered the data,
I want to email the PDF form as an attachment to some users.
Could anyone please explain the steps or give me some sample code?
Thanks
SundarHi Sundar,
I suggest you to see<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491">this.</a>
Regards,
Ram. -
Dynamic Forms (Data Dictionary) using CFForm (??)
Hi,
The basic plan is to build the forms in my application
dynamically using a data dictionary rather than basing them upon
static tables and having statically coded forms to match. This
would allow me to offer the ability for an administrator to add new
fields if required (client 'requirements' are hard to pin down and
may therefore change).
I'm developing using CF8 (hoping it will be released real
soon..;-).). Application will be structured using Fusebox 5.
I've tried building up the form elements (<cfinput>
& etc) off in CFC, returning the layout result code in a
content variable, and its not working.
I have some other approaches to try, but this one would be
preferable.
Has anyone else tried this - and do you have any advice to
offer (or am I just crazy trying it because there is no way its
going to work ?)
Thanks
Bryn50This approach works well using standard html forms and html
form controls such as <input> and <select> etc.
I'm wanting to use CFFORM (for the first time in a long time)
for the functionality on offer (such as flash forms).
As I saw elsewhere, I have not used this in a verrry long
time because generally I've found it inflexible and the validation
on offer is a tiny subset of what is generally needed. I'm kinda
hoping to be able to overcome that this time around by adding my
own javascript validation when necessary.
I have some ideas for approaches that might work, but they
don't seem like very good ones to me:
1/. might be to try using standard html form controls inside
a cfform. Can I still have it display using flash ?
2/. might be to have all of the logic that selects the
appropriate cfform control for a given field in the same file as
the cfform, however that seems so unelegant and also it defies the
MVC/fusebox 5 approach I'm also wanting to use.
Thanks for your help...
Cheers, -
Class CL_BCS Query for body part of mail
HI,
I want to send the mail with out attachement using Class CL_BCS. Can any body help me on how to send the message body in the mail using CL_BCS class....
Thanx & Regards,
SameerHi Sameer
I've been struggling with this class CL_BCS too for a while and I want to give my experience with that class. Following a code example which will submit a report to memory and send the report as an attachment by mail thru the SMTP interface.
*& Report ZOBR_SEND_TRIP_SIM_BY_MAIL *
*& This program does following:
*& 1. Submit a travel expense report to memory
*& 2. Read the travel expense report from memory
*& 3. Convert the travel expense report to HTML format
*& 4. Copy the travel expense report from format RAW(1000) to RAW(255)
*& 5. Send an email with body text and attachtments
REPORT zobr_send_trip_sim_by_mail .
DATA:
gi_abaplist TYPE TABLE OF abaplist,
gi_html TYPE w3htmltab,
gs_html LIKE LINE OF gi_html,
gw_string TYPE string,
gw_length TYPE i,
gw_length_c TYPE so_obj_len,
gi_solix TYPE solix_tab,
gs_solix LIKE LINE OF gi_solix,
gi_soli TYPE soli_tab,
gs_soli LIKE LINE OF gi_soli,
go_send_request TYPE REF TO cl_bcs,
go_document TYPE REF TO cl_document_bcs,
go_sender TYPE REF TO cl_sapuser_bcs,
go_recipient TYPE REF TO if_recipient_bcs,
go_exception TYPE REF TO cx_bcs.
* Submit report to memory
SUBMIT rprtef00 "USER sy-uname
EXPORTING LIST TO MEMORY AND RETURN
WITH pnppernr EQ '00001000'
WITH pnptimra EQ 'X'
WITH pnpxabkr EQ 'D2'
WITH pnppabrp EQ '11'
WITH pnppabrj EQ '2006'
WITH s_reisen EQ '0002600221'
WITH hinz_dru EQ space
WITH hinz_weg EQ space
WITH hinz_dyn EQ 'X'
WITH allesdru EQ 'X'
WITH reisepro EQ 'X'
WITH reisetxt EQ 'X'
WITH sw_antrg INCL 'X'
WITH addinfo EQ 'X'
WITH extperio EQ '000'
WITH simulate EQ space
WITH einkopf EQ space.
* Read report from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gi_abaplist
EXCEPTIONS
not_found = 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.
* Convert report to HTML format
CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
* EXPORTING
* REPORT_NAME =
* TEMPLATE_NAME = 'WEBREPORTING_REPORT'
TABLES
html = gi_html
listobject = gi_abaplist.
LOOP AT gi_html INTO gs_html.
CONCATENATE gw_string
gs_html
INTO gw_string.
ENDLOOP.
gw_length = STRLEN( gw_string ).
gw_length_c = gw_length.
* copy table from format raw(1000) to raw(255)
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = gi_abaplist
out = gi_solix.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
TRY.
* Create persistent send request
go_send_request = cl_bcs=>create_persistent( ).
* Create document (body text in text format)
gs_soli = 'Trip is now settled, see attachment.'.
APPEND gs_soli TO gi_soli.
gs_soli = 'Reimbursement is paid out by your next salary.'.
APPEND gs_soli TO gi_soli.
go_document = cl_document_bcs=>create_document( i_type = 'RAW'
i_text = gi_soli
i_subject = 'Trip reimbursement' ).
* Add attachment (ABAP list format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'ALI'
i_attachment_subject = 'Expense report(ALI)'
i_att_content_hex = gi_solix.
* Add attachment (HTML format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'HTM'
i_attachment_subject = 'Expense report(HTM)'
i_att_content_text = gi_html.
* Add note (Text format)
CALL METHOD go_send_request->set_note( gi_soli ).
* Add document to send request
CALL METHOD go_send_request->set_document( go_document ).
* Get sender object
go_sender = cl_sapuser_bcs=>create( sy-uname ).
* Add sender
CALL METHOD go_send_request->set_sender
EXPORTING
i_sender = go_sender.
go_recipient = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
* Add recipient with its respective attributes to send request
CALL METHOD go_send_request->add_recipient
EXPORTING
i_recipient = go_recipient
i_express = ' '
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
* set send immediately flag
go_send_request->set_send_immediately( 'X' ).
* Send document
CALL METHOD go_send_request->send( ).
COMMIT WORK.
* Exception handling
CATCH cx_bcs INTO go_exception.
EXIT.
ENDTRY.
Notice that the only way to put a body text in the email is to call the method cl_document_bcs=>create_document with input of a type 'RAW'.
Be aware of the settings of the SMTP node in SAPConnect (transaction SCOT) because the seetings could cource an unwanted conversion of the email.
1. Doubbelclick on the TMTP node and a popup screen will show.
2. Click on the 'Set' button next to 'Internet' under 'Supported address type' and a popup screen will show.
3. Set output format for SAP documents as 'SAPscript/Smart forms' = 'PDF', 'ABAP list' = 'PDF', 'RAW text' = 'TXT'.
This setting will convert 'SAPscript/Smartforms', 'ABAP list' to PDF format. If 'RAW text' = 'PDF' the body text wil be converted to 'PDF' format and change to an attachment and the body text will disappear.
Hope this is usefull for you and others.
Best regards
Ove Bryntesson
Applicon A/S -
Attach PDF file in class cl_bcs
HI Experts,
I have created a smart form and later on i converted it into a pdf file using CONVERT_OTF Function Module.
Now i have to send it to an external customer for which i m using the functionality of class CL_BCS for sending the email, can any one tell me that how and where can i attach my pdf file while i m using class CL_BCS.
Thanks
Shakun.Hi,
DATA: l_send_request TYPE REF TO cl_bcs, " Send request
l_body TYPE bcsy_text, " Mail body
l_attach TYPE bcsy_text, " Attachment
wa_text TYPE soli, " Work area for attach
l_document TYPE REF TO cl_document_bcs, " Mail body
l_sender TYPE REF TO if_sender_bcs, " Sender address
l_recipient TYPE REF TO if_recipient_bcs, " Recipient
l_email type ad_smtpadr, " Email ID
l_extension type soodk-objtp value 'OTF', " TXT format
l_size TYPE sood-objlen. " Size of Attachment
APPEND 'Test Mail ' TO l_body.
l_attach[] = st_job_output_info-otfdata[].
l_lines = LINES( l_attach ).
l_size = l_lines * 255.
Creates persistent send request
l_send_request = cl_bcs=>create_persistent( ).
Craete document for mail body
l_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_body
i_subject = 'Subject-Here' ).
Add attchment
CALL METHOD l_document->add_attachment
EXPORTING
i_attachment_type = l_extension "'PDF'
i_attachment_subject = 'test_delv'
i_attachment_size = l_size
i_att_content_text = l_attach.
Add the document to send request
CALL METHOD l_send_request->set_document( l_document ).
Sender addess
l_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD l_send_request->set_sender
EXPORTING
i_sender = l_sender.
L_EMAIL = <email_id>.
l_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
Add recipient address to send request
CALL METHOD l_send_request->add_recipient
EXPORTING
i_recipient = l_recipient
i_express = 'X'
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
Trigger E-Mail immediately
l_send_request->set_send_immediately( 'X' ).
Send mail
CALL METHOD l_send_request->send( ).
COMMIT WORK.
Regards,
KC -
Email word document as attachment
I have a template in word document with some variables and text in color, bold, grey etc. stored in UNIX directory.
My goal is to replace variable with customer name, number dynamically and then
send email this word document as an attachment in class cl_bcs.
How can I load this word document into internal table, search and replace the variable dynamically and email the document as an attachment without loosing the color, bold font etc. I tried the approach Open dataset, read dataset, find and replace variable but when I send email ( using document type = 'DOC' and content as 255 char), I click on the attachment and the file was corrupted.
Thanks for your input.Hi,
You can try adding the attaching the content in HEX format. Refer to the below source code-
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = ls_attachments-file_type
i_attachment_subject = ls_attachments-file_name
i_att_content_hex = ls_attachments-attachx[].
Refer to this below links for an example-
http://www.divulgesap.com/blog.php?p=NTA=
http://www.divulgesap.com/blog.php?p=ODI=
Hope it helps.
Cheers,
Ravikiran -
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) -
CLASS cl_bcs Query for sender mail id
Hi,
I am using class cl_bcs.but, i am facing problem for sender mail-id. I want to append mail-id directly to sernder mail-id without using user mail attribute.
Is there ne way from which i can append mail-id as sender mail id??
thanx in advance,
Sameeryou can do that.
check this code sample.
DATA: sender TYPE REF TO if_sender_bcs.
CLEAR sender .
sender = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
and check this code sample for complete code.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0
Regards
Raja -
Dynamic Forms with Subforms and Text Fields
I've been reading all of the messages relating to subforms and dynamic forms and have used many of the suggestions, but haven't found anything that addresses the problem I am having. I'm using Designer 7.0. I've saved my form as a dynamic form, I've set my text fields for multiple lines and expand to fit. My problem is that as soon as I set the parent subform to Flow Content, everything moves to the left margin. I've tried grouping items together within a subform in hopes that the items will maintain their position on the page, but everything always moves to the left margin. I'm creating a legal form that needs to have text and a text field centered at the top of the page. Below that to the left is a text field that needs to be able to expand with two text fields to the right of it. Below that are additional text fields that need to expand as needed.
Am "stacking" my subforms incorrectly and setting the wrong subform to Flow Content? Or, can you now lock a field to a specific position? Any help would be greatly appreciated.Unfortunately, I hadn't understood that you needed the fields to expand in height and everything below them to move down the page. In that case, you'll need to use flowed subforms.
Having all objects move to the left side of the page is expected when setting a subform to flowed. That's because the flow is top-down, left-right.
One thing you could try is making the text field that needs to be centered exactly as wide as the flowed subform and then setting its left- and right-hand margins to an equal number. This would ensure an equal amount of space on the left- and right-hand sides and because the field would be as wide as its flowed container (subform), entering multiple lines of text would result in everything below moving down.
I've attached a sample form where the page subform has been set to flowed, the text field at the top is a multi-line/height-expandable text field with its width set to the page width and its left- and right-hand margins both set to 2in and the button and check box objects are pushed below the text field.
When text is entered into the text field, it expands in height and causes the button and check box to move down.
To achieve other horizontal and vertical positioning/offsets, you could play with the margins of all the fields that need this.
Stefan
Adobe Systems -
Can anybody send me a code how to send an email from forms
with attachement for multiple users
I am using oracle 8i and forms 6i
My mail application is Novel group wise
Thanks for your helpOracle Reports can be run directly to email.
Check out the DESTYPE parameter.
To send emails you can use a call to Java Mail using the Java importer. There is a sample form for this in the Oracle9i Forms demos. This should work in 6i also.
You might also be able to use email from the database with the UTL_SMTP package:
http://otn.oracle.com/sample_code/tech/pl_sql/htdocs/maildemo8i_sql.txt -
I am pasting a part of the code which I am working on now...
This is related to sending an e-mail using class CL_BCS.. I am trying to send an e-mail with subject line more than 50 characters in it.
The e-mail is already working, i get an e-mail immediately but with a shortened subject line.....
We can use the set_message_subject method to get the subject line longer but it doesnt work still due to some strange reason...
I know that the problem is with the bolded part.. when i went into the debugger mode i see that it compares the subject line which is passed on to the i_subject.
Points are guaranteed.........
-------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
clear i_subject.
-------- create and set document with attachment ---------------
create document from internal table with text
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = '' ).
*changing the content of the attachment
binary_content[] = l_iobjbin[].
*change the name of the PDF attachment
concatenate 'Build ID' s_buildid_i 'Rev' v_buildid_rev
into i_att_sub separated by space.
add attachment to document
CALL METHOD document->add_attachment
EXPORTING i_attachment_type = 'PDF'
i_attachment_subject = i_att_sub
i_att_content_hex = binary_content.
*subject line more than 50 chars
t_sub = '[ D01 TEST] CCS0000096 NJ 8A7192 21 CONSTITUTION AVE'.
<b>
CALL METHOD send_request->set_message_subject
EXPORTING
ip_subject = t_sub.
</b>
add document to send request
CALL METHOD send_request->set_document( document ).Try this way
data : subject type SOTR_TXT.
subject = '[ D01 TEST] CCS0000096 NJ 8A7192 21 CONSTITUTION AVE'.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = subject ).
aRs
Maybe you are looking for
-
My Ipod Classic will not register with itunes
I have followed all the steps to help fix this problem. My ipod stopped syncing and charging when connected to my computer and itunes no longer recognises my ipod so i can not get into the ipod itself to do anything through Itunes. As recommended by
-
Calling Portal event from ABAP class
Hi Experts, I need a following clarificatrion, Please help, 1. Is it possible to call a webdynpro method from a normal ABAP class? 2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'. Is th
-
Hello, Is there a way to recognize space sign at the end of a sentence? The meaning of that is that there is a word that somebody typed at the end of the sentence and after that pushed the space bar . When looking at the text inside the sap system th
-
Raw HTML data in reply box instead of formatted text when using forums or webmail interface
At work, we use an internal webmail service with SmarterMail Enterprise 5.5 to communicate. Since upgrading to FF6, the reply text area no longer shows formatted text, and instead just shows the raw HTML code of the message you're typing. The size of
-
My new (second-hand) iphone 4s will not charge. What do I do?
Please help. My new (to me, but second-hand) iphone 4s will not charge. What do I do?