How to backup smart forms
Hi there,
How to save the samrt forms. I mean not only download the forms but also save the program in the samrt forms.
Any good solution, i appreciate that.
Kevin
HI
TO save smart forms goto
Utilities->Download form
this will do for u , it will save as a xml file.
if u want to up load it
Utilities->upload
it will up load the xml file which is down loaded
byee
all the best
Similar Messages
-
How to populate smart form with new values
Hi!
I am new to smart form . Can anybody help me in how to populate smart form with some new fileds. Actually i have to populate credit memo form with some customized values..Hello,
Please elaborate your query more in order to be comprehendable.
Regards,
Shehryar -
How to convert Smart Form into PDF format and return the result in BAPI?
I want to convert a Smart Form into PDF format and return the result in BAPI.
can anyone tell me how it can be done with related example
regards
pranayhi,
smart form to pdf--
All you have to do is call your SF to get OTF and then concert it to PDF. Works like charm:
DATA: p_output_options TYPE ssfcompop,
p_control_parameters TYPE ssfctrlop.
p_control_parameters-no_dialog = 'X'.
p_control_parameters-getotf = 'X'.
CALL FUNCTION v_func_name "call your smartform
EXPORTING
output_options = p_output_options
control_parameters = p_control_parameters
IMPORTING
job_output_info = s_job_output_info.
call function 'CONVERT_OTF_2_PDF'
tables
otf = s_job_output_info-otfdata
lines = t_pdf
and if u need more u can check below links also
Check the below links..
Re: Smartforms to PDF
Re: smartform (otf) as pdf and sending as email-attachment
VISIT THIS LINK
Re: Smartforms to PDF
PLZ REWARD POINTS IF IT HELPS YOU
rgds
anver -
How to display smart form stored in SAP in Webdynpro java( TLINE table)
Hi
I have a requirement where I have to display the smart form from WD Java end.
The BAPI is producing output in TLINE(TDLINE(132),TDFORMAT(2)). I am trying to concat both(TDLINE+TDFORMAT) and put in the interactive form but I am not able to get the output from BAPI.
Is it because the TLINE format is not supported in the WD java. How can I solve the issue.
Looking forward for the reply.
Regards,
PawanHi..
Try this PDF URL.... u might get useful things...
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
Web Dynpro Java
yours GS -
How to display Smart form in Multiple Languages ?
Hello,
Very Good evening!
How can I print the Smart Form in Multiple Languages like Korea, German and Japneese....
I got a requirement where I need to display the developed Smart form in these languages. As of now it is displayed only in the Language ENGLISH.
Any Suggestions will be appreciated!
Regards,
KittuHello kittu....
I would recommend that you create a single Smart Form in the primary supported language (or the one which you're most comfortable maintaining forms). Embed all necessary logic in this form, and design it with the idea that it would need to be viewable in multiple languages .
Then use transaction SE63 to translate all necessary form components into each desired language -- one by one -- and they will all be bound together under the same form name. In my experience, a basic multi-column spreadsheet (put together with the guidance of professional translators) works well as a translation guide.
The advantages of a single, shared form include: consistent look and feel, avoiding dual maintenance for shared logic (or, in your case, up to 10x maintenance), and simplified output determination. On the other hand, a single form does constrain your design and can make for a more complex implementation.
Hope this is useful
Best of luck,
Bhumika -
How to user Smart form for the BID in SRM 4.0
Hello,
We have SRM 4.0 and we need to send the BID information to the vendor. This is because we have vendors that are not able to get in to our system and we have to send them a print out of the bid information so that they give us back the information. Then our users will insert it in the system.
It could be as an attach to the email or it could be printable in the program SPPS - Selecting and Processing Outputs.
SAP says that there is a smart form BBP_BIDINV_BID and BBP_BID_NOTIFICATION but I am not managing to make them work.
I found some messages to help solving specific problems so I assume it is possible to do this...
Is there someone that can help me?
Thanks very much.
My best regards,
Catarina CamposHi
<u><b>Here is the standard solution to use your own forms:-></b></u>
<u>- copy the smartform BBP_BIDINV_BID to ZBBP_BIDINV_BID (transaction SMARTFORMS) and apply your changes
- use BADI to call your custom form ZBBP_BIDINV_BID</u>
<b>For PDF output form change use BADI BBP_OUTPUT_CHANGE_SF.</b>
<b>For email notification change use BADI BBP_CHANGE_SF_BID instead.</b>
<u>You will find all relevant documentation in SPRO --> Supplier Relationship Management --></u>
SRM Server --> Business Add-Ins (BAdIs) --> Document Output -->
- Change Forms for Document Output
- Change Smart Form for E-Mails Relating to Bids
<u><b>Please go through the links below for more details -></b></u>
Re: how to use cutom smartform instead standard?
Re: Email message customization ?
Re: Bid Invitation Email Subject
Re: Email notification to bidder should reflect start/end date and time
Re: RFQ Smartform in SRM
Re: Standard Text
Do let me know.
Regards
- Atul -
How to Call smart form in Action
Hi All,
Could some one tell me how to call the smart form in action.
Eg. PB40 - Offer Contract Action.
Appreciate your respnse.
Regards
RajHi ,
attached you find some abap code to call a smartform with some comments in it. Hope that helps:
DATA: l_fn_name TYPE rs38l_fnam
, l_devtype TYPE rspoptype
, ls_output_options TYPE ssfcompop
, ls_control_parameters TYPE ssfctrlop
, ls_job_output_info TYPE ssfcrescl
, l_pdf_fsize TYPE i "#EC NEEDED
, lt_otf_tab TYPE tsfotf
, lt_pdf_lines TYPE TABLE OF tline
To do
The mapping from the UI structure to the Smortform structure has to be
implemented here or in a pirvate method.....
Call function module u201CSSF_FUNCTION_MODULE_NAMEu201D to get the name of the smartform.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = zh38tm_cl_zz_2gen_bl_constants=>c_smartforms_hipo
IMPORTING
fm_name = l_fn_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc = 0.
Call function module u201CSSF_GET_DEVICE_TYPEu201D to get the print parameter
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
IMPORTING
e_devtype = l_devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
IF sy-subrc = 0.
Fill label structure to smartform
ls_labels = zh38pm_cl_zz_bl_perf_plan=>set_sf_label( ).
Set output parameters u201CLANGUAGEu201D, u201CNO_DIALOGu201D and u201CGETOTFu201D
ls_output_options-tdprinter = l_devtype.
ls_control_parameters-no_dialog = abap_true.
ls_control_parameters-getotf = abap_true.
ls_control_parameters-langu = sy-langu.
Call smartform with the structures u201CIMP_S_PERF_PLANu201D, u201CCHG_S_PRINT_PLAN
CALL FUNCTION l_fn_name
EXPORTING
control_parameters = ls_control_parameters
output_options = ls_output_options
s_doc_processing = gs_doc-s_doc_processing
s_header_display = gs_doc-s_header_display
s_header_texts = gs_doc-s_header_texts
s_header_status = gs_doc-s_header_status
t_header_appraiser = gs_doc-t_header_appraiser
t_header_appraisee = gs_doc-t_header_appraisee
t_header_part_appraiser = gs_doc-t_header_part_appraisers
t_header_other = gs_doc-t_header_others
s_header_dates = gs_doc-s_header_dates
t_header_add_data = gs_doc-t_header_add_data
t_body_columns = gs_doc-t_body_columns
t_body_element_descr = gs_doc-t_body_element_descr
t_body_elements = gs_doc-t_body_elements
t_body_cells = gs_doc-t_body_cells
t_body_cell_notes = gs_doc-t_body_cell_notes
t_body_cell_val_values = gs_doc-t_body_cell_val_values
t_body_cell_val_ranges = gs_doc-t_body_cell_val_ranges
t_body_cell_val_c_like = gs_doc-t_body_cell_val_c_like
t_body_cell_val_descr = gs_doc-t_body_cell_val_descr
IMPORTING
job_output_info = ls_job_output_info
EXCEPTIONS
formattinl_error = 1
internal_error = 2
send_error = 3
user_canceled = 4.
IF sy-subrc = 0.
APPEND LINES OF ls_job_output_info-otfdata TO lt_otf_tab.
exp_t_otf = lt_otf_tab.
Call function module u201CCONVERT_OTFu201D to convert the smartform data
to exporting parameter u201CEXP_PDF_XSTRING
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = l_pdf_fsize
bin_file = exp_pdf_xstring
TABLES
otf = lt_otf_tab
lines = lt_pdf_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc ne 0.
CLEAR exp_pdf_xstring.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
First you have to determine the smartforms function modules name the wxecute it. -
How to Download Smart Form in 4.6C.
Hi all,
I am using the version 4.6C.
Is there any standrd program like in SAP SCRIPTS to download the smart form layout to desktop later can upload to SAP.
In 4.7 have a option to downloadand upload but how to do it in 4.6C?
Any Ideas from your side? please let me know
Thanks
Martin.
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Jan 8, 2009 11:25 AMtry this program "ZI_LOAD_SMARTFORMS_AND_STYLES"
How could he try it...If it's a Z program?
Greetings,
Blag. -
plz tell me how to debugg smart forms
Hi Kalyan,
In the Smartform, within the Code Node you can hardcode a normal abap Break Point ..
Please set a break point in side the smartform:
BREAK <USERNAME>.
Then at the time of print/ preview the program stops there.
Example : If you set the break point in initializationas
BREAK <USERNAME>.
Program stops at break point. After that use Serach and set more break points.
>Search the program logic/Textelement/Address via search and set the break point at that code.
Other way to debug smartform is to debug the Function Module of that smartforms. If you want to debug particular smartform node that the solution would be, insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint. So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
or
SFTRACE can be used for debugging SMARTFORMS.
Read More here.
http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
See the Below thread for how to debug the Smartforms
How to Debug Smartform?
Re: debug of smartfrom
Smart forms
Regards,
KK -
How to use smart form for production orders
Hello Experts,
I have a couple of questions about printing out production orders from SAP, from OPK8.
My ABAPer has developed a smart form and I am trying to use the same for the list LG01, i.e. the object list.
Since, there was no place to assign a smart form directly, so the ABAPer has copied the existing print program , defined for my ref. order type and LG01 and assigned the new smart form inside the program. This new program has now been assigned against my ref. ord type, LG01 and all the plants, as seen in screenshot below.
Now, what is happening is that when I give print for my order, a pop-up screen asks for the printer. I give LOCL , check 'print now' and then click on the print preview.
I can see the new form that has been developed and it is alright.
Then, when I click on the back arrow, once again the print pop-up screen appears. Now, when I enter LOCL, print now and click the print preview, then I see another form open up before me. I am assuming that this is some form which was pre-configured in the system, under the section 'Forms', for the same object list LG01.
Do I have to assign the new smart form under the section "Forms' also, for the ref order type and LG01? or the change in the section 'print programs' is enough for the new form to kick in? Please guide me. I tried to but it gave the error that the form is not created in English. Also , my form is a smart form, not a SAPScript or PDF form, so I wonder if that will help at all.
Requirement :- I need to suppress this second form somehow but do not know how to do it. I want that only one form, i.e. my smart form should be printed out when someone gives print from the order.
Let me know if something is not clear.
Regards
P.RHi P,
Go a few steps down and remove flags on the documents you don't want to print:
this are just suggestions, they can be changed in your production order, in CO02, menu Order->Settings->List Control.
regards,
Edgar -
How to show Smart form in PDF format
Hi Experts,
I have a requirement in which I have to show a smart form in
PDF Format coming from the RFC .
Please give your helpful suggestion.
Thanks and Regards
Upendra AgrawalHi ,
Just look this pdf
see this link
http://www.****************/Tutorials/Smartforms/SFinEPasPDF/Page1.htm
Thanks
Edited by: Anup Bharti on Nov 7, 2008 7:00 AM -
How to publish Smart form of PDF in r/3 through WD
Hi,
We have a PDF smart form in the r/3.we want to call the PDF from WD View without using PDF interactive form.
Could any one give me soln for this??
ThanksHi ,
Insert IFrame UI Element and bind the Resource property to the value attribute PdfUrl of type String .
Define a Output parameter of type Binary in RFC .
Insert the following code to dispaly the smart form.
byte[] pdfContent = wdContext.currentOutput<node>().get<Binary>();
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);
try
wdContext.currentContextElement().setPdfUrl(pdfResource.getURL());
catch(Exception e)
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
Regards,
Sunitha Hari -
How to View Smart Forms in Portal Using Url Iview?
I am trying to view a smart form in the portal using url iview but not able to define proper url address. can any one help me out with relevant example?
Hi,
Go through Re: Web Dynpro and Smart Forms.
Regards,
Satyajit. -
How to View Smart Form in Portal?
I am not able to view the Smart Form in Portal. can any one give a soluton to this?
Hi,
Go through Re: Web Dynpro and Smart Forms.
Regards,
Satyajit. -
How to send smart form as mail?
Hello everybody,
I have used the following code to send a smartform in PDF format through email.
I m able to view the contents of the mail in SAP Bussiness Workplace but UNABLE TO TRANSFER THE MAIL to an INTERNET ID (like gmail id or yahoo id).
Can anybody suggest me about what might have gone wrong?
Helpful answers will surely be rewarded.
code
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
*v_form_name TYPE rs38l_fnam, " L_FM_NAME
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
DATA: l_fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = p_l_formname
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = l_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 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.
IF g_it3 = 'M'.
g_it3 = 'Mr'.
ENDIF.
IF g_it3 = 'F'.
g_it3 = 'Ms'.
ENDIF.
CALL FUNCTION l_fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
it = g_it
it1 = g_it1
it3 = g_it3
it4 = g_it4
it5 = g_it5
it6 = g_it6
it7 = g_it7
it8 = g_it8
it10 = g_it10
it14 = g_it14
it15 = g_it15
it36 = g_it36
it18 = g_it18
it37 = g_it37
it19 = g_it19
it9 = g_it9
it11 = g_it11
it13 = g_it13
it39 = g_it39
it40 = g_it40
it20 = g_it20
it21 = g_it21
it22 = g_it22
it23 = g_it23
it25 = g_it25
it26 = g_it26
it27 = g_it27
it28 = g_it28
it29 = g_it29
it30 = g_it30
it31 = g_it31
it32 = g_it32
it33 = g_it33
total = g_total
it34 = g_it34
it35 = g_it35
it2 = pa0006-begda
it12 = pa0001-begda
it16 = pa0015-begda
it17 = pa0001-endda
it24 = pa0002-endda
it38 = pa0002-begda
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
g_semail = 'X'.
IF g_semail = 'X'.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION l_fm_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
otf = i_otf
lines = i_tline
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
ENDIF.
*convert PDF from 132 to 255
LOOP AT i_tline.
*Replacing space by '~'.
TRANSLATE i_tline USING '~'.
CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
*Repalacing '~' by space.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
*Appending 255 characters as a record.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
*Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Create Message Body
Title and Description
*Object with main text of the mail.
i_objtxt = 'Find attached the output of the smartform'.
APPEND i_objtxt.
i_objtxt = 'Regards'.
APPEND i_objtxt.
i_objtxt = 'Lokesh'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
*Document information.
wa_doc_chng-obj_name = 'Offer Letter'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'Offer Letter'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
*Pack to main body as RAW.
*Object to be transported not in binary form.
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Attachment
(pdf-Attachment)
*Packing as PDF
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
*CALL FUNCTION 'LXE_SEND_MAIL_ATTMNT'
EXPORTING
description =
SENSITIVITY = 'O'
IN_OUTBOX = ' '
tables
receivers =
document_text =
DOCUMENT_ATTMNT =
DOCUMENT_ATTMNT_ATTR =
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
NO_AUTHORIZATION = 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.
*ENDIF.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE 'success' TYPE 'I'.
ENDIF.
ENDIF.
ENDFORM. " GET_OFFER_LETTERHere is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_PDF_MAIL
REPORT ZTEST_PDF_MAIL.
Internal Table declarations
DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
Variables declarations
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
IMPORTING
FM_NAME = V_FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I_OTF[] = W_RETURN-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING '~'.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
Create Message Body Title and Description
I_OBJTXT = 'test with pdf-Attachment!'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
APPEND I_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_RECLIST
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.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_RECLIST
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.
regards,
srinivas
Maybe you are looking for
-
I am a verizon carrier and I recently upgraded from a curve to a tour 9630. I am on a business enterprise server that syncs with my outlook. On my old curve and other BB's, when I would receive a call from someone in my address book, the screen would
-
Show image in crystal report 2008
Hi All, I have a UDF - image type in Sales order Line item which stores image. Currently I want to display sales order line item data in CR2008 using a query. All data is coming but image field is showing image name in place of showing image. How can
-
How to Update the C# dll in LabView
Hi., i created C# dll with "ADD" Function. in that dll contains only that function. for that function i am passing two variables. "public int Add(int A, int B) " in the Labview, i use the .NET constructor(Drag and drop the node and in the dialog b
-
Pivot table and link to account record logs user out of OnDemand
All, I have created a simple accounts report using a pivot table. I would like the user to be able to drill down on the detail account record. I followed the instructions in Doc ID 454434.1 that describes how to do this without using an action link.
-
Retake the quiz questions that got wrong answers
Hi, I psuedo-asked this before, but I'll ask it outright this time. In using Captivate 3, is there any way to make the user take the quiz a second time, but skip over the questions that they have gotten correct, requiring them to redo only the questi