Error in Control Framework in smart forms programms
IN VF02 smartforms ENTRY form , I add a function about save PDF at local PC. When I print the smartfomrs,There is ERROR message in update modules.
IN SM13 can see the ERROR message.
Function Module: RV_MESSAGE_UPDATE
Status :Update was terminated
Error details: FES 022: Error in Control Framework
THE CODE:
FORM processing USING proc_screen
CHANGING cf_retcode.
******I ADD THE CODE
PERFORM DOWNLOAD_AS_PDF USING lf_fm_name
ls_control_param
ls_composer_param
ls_bil_invoice
nast
repeat
ls_bil_invoice-HD_ORG
ls_spoolid
CHANGING cf_retcode
ENDFORM.
IN DOWNLOAD_AS_PDF FORM ,I USE FUNCTION : P_fm_name(smartforms function) CONVERT_OTF GUI_DOWNLOAD
WHY the UPDATE MODULE have ERROR MESSAGE???
How do I solve this problem???
Hello,
Your error message is related to GUI_DOWNLOAD, which is a frontend function.
You simply cannot use it in background, because it puts a file on the
frontend PC where you start the function (WS = WorkStation).
Note that GUI_DOWNLOAD is intendted to be used for dialog user
and will not run at BACKGROUND.
You can review SAP Library: ABAP Programming (BC-ABA)
->Saving Data Externally
->Working with Files
->File Handling in ABAP
Regards,
David
Similar Messages
-
Error in Control Framework in smart forms programms use GUI_DOWNLOAD
IN VF02 smartforms ENTRY form , I add a function about save PDF at local PC. When I print the smartfomrs,There is ERROR message in update modules.
IN SM13 can see the ERROR message.
Function Module: RV_MESSAGE_UPDATE
Status :Update was terminated
Error details: FES 022: Error in Control Framework
I USE GUI_DOWNLOAD FUNCTION at my code. WHEN I mark it,no error message. I must use the Similar function.
How do I solve this problem???Hello,
Check the thread:
Re: Error in Control Framework in smart forms programms
Regards,
David -
Error in Control Framework: Background job failed
Hi Experts,
One background job failed with job log: Error in Control Framework in ECC 6.0 system; the job is supposed to produce a XML report. Can anyone please give some idea on this why it could happen? One SAP note 893534 has described same kind of issue but in CRM system. That note even cant be implemeneted in ECC 6.0. Any workaround? Is it a BASIS issue here?
Thanks & Regards,
SKBHello,
please check the variant. We had this problem, and when checking the variant I got a shortdump because the variant did not fit to the program (there were problems with subscreens in the selection screen). After adjusting the variant with program RSVARDOC_610 the variant was ok.
I can not check if this solved the problem because the job runs weekly, and the next job is on Monday. But give it a try...
HTH,
Jens Hoetger -
Error in Control Framework with GUI_DOWNLOAD FM
Dear All,
I am using GUI_DOWNLOAD FM to download a file in PDF format to presentation server.
The code has been written in an enhancement spot in a class "/SCA/CL_SVORDER", method "Print" on an SNC server.
On execution I get the error "Error in Control Framework".
First I tht that this has something to do with the data table. But when I tried to pass a simple table of Integers in ASC format, it gave the same error.
Please assist.
*----Begin of Code Snippet
data: fullpath type STRING value 'D:\temp\PO.pdf',
bin_filesize type I,
filetype type char10 value 'BIN'.
bin_filesize = numbytes.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = bin_filesize
filename = fullpath
FILETYPE = filetype
IMPORTING
FILELENGTH =
tables
data_tab = t_data
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*----End of Code SnippetHi!
I have the same error, but i need to use CSV Format.
in another program, i used this with XML format.
lv_xml = lr_element->to_xml( ).
Converts the string to xstring
lv_xxml = wd_this->convert_file( lv_xml ).
Shows it in a new browser window
*cl_wd_runtime_services=>attach_file_to_response(*
*i_filename = lco_filename*
*i_content = lv_xxml*
*i_mime_type = lco_mime_type*
*i_in_new_window = abap_FALSE*
*i_inplace = abap_false ).*
Regards! -
Hi All,
I created a webdynpro development. In that all applications are working fine. One button i added and click of that it will download all the attachments corresponding to the sales order and it will place the attachments in desktop folder.
I written all the code in one function module and in the method i associated this function module.
If i debug this, this is working fine. when i click the download button, it shows the error - error in control framework
Any body has any idea about it?
Regards,
Vinoth.Hi VinothKumar,
Did u tried running the method directly. There also u are not getting any error means, you have to check the code in wda where you created the method for that class.
If you are using the fm directly inside the method of wda, then you have to debug step by step in wda.
Regards
Sarath -
Abap mapping - Error in Control Framework
Hi Gurus,
Scenario: IDOC - -- XI -
Http (post)
i am using ABAP mapping for IDOC to XML. I am able to test it using sxi_mapping_test which gives me output XML. But, when i test the scenario from RWB, it fails with "SYSFAIL" error in inbound queue as per moni.
error - "Error in Control Framework".
Looks like it did not even go to message mapping pipeline step.
Please help.
Thank you,
mkHI,
Hope you have done all the necessary pre-requisites for ABAP mapping
This may help u- http://help.sap.com/saphelp_47x200/helpdata/en/55/bff20efe8c11d4b54a006094b9456f/content.htm
just cross verify with this guide-
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
Please also try to debug as follows...
put a break point inside your class/method....
goto tcode SXI_MAPPING_TEST....give in the configuation details of your scenario...and when you execute, give the IDOC-XML, copy it from SXMB_MONI where you are getting the error....
when you execute, it shoudl stop at the break point that you had set in your class....continue debugging using 'F6' function key, and check where you are hitting this error...
The chances are that the FM that converts IDOC-XML to flat file format might not have been executed correctly...
Thanks
Swarup -
Hi All,
I am passing input data to RFC, In input parameters I am passing data to three import parameters and one table parameter of RFC from Web Dynpro. Once I execute it, am getting error "Error in Control Framework, error key : RFC_Error_System_FAILURE".
If anybody aware about it, please guide me.
Thanks in advance.
Regards
MangleshHi Manglesh,
Please verify the Jco settings once.
Please go through the weblog /people/sap.user72/blog/2005/01/08/adaptive-rfc-models-in-web-dynprosome-pointers
Regards, Anilkumar -
FES 022: Error in Control Framework(VF01)
Hi,
In T.Code VF01 while saving the billing document number it was fine. After saving while pressing the back, cancel or exit button the system shows the message {{Express document "Update was terminated" received from author "Developer"}}. Kindly help to resolve this issue.
Thanks and Regards,
Karthik.VHi,
While checking SM13 it shows,
Module Name Message Type status
POST_DOCUMENT V1 Initial
G_FI_POSTING V1 Initial
FI_WT_POST V1 Initial
BREAKDOWN_RELATION_INSERT V1 Initial
RV_INVOICE_POST V1 (no retry) Initial
RV_MESSAGE_UPDATE V1 Error
MCV_STATISTICS_UPD_V1_INVOICE V1 Initial
MCV_STATISTICS_UPD_V2_INVOICE V2 Initial
MCV_UPDATE_CM_INVOICE V1 Initial
Also i checked the function module RV_invoice _update. i kept breakpoint inthe fn.Mod and executed vf01 tcode, but the system doesnt go to the debugger. Kindly update the solutions.
Thanks and regards,
Karthik.V -
Control Framework: Fatal error - GUI cannot be reached
Hello All,
Iam using BDC for creating a ZCR order throught VA01 - Credit Memo request. When executed in the foreground, it works fine.But when ran in background gives an error message - Control Framework: Fatal error - GUI cannot be reached and gives a short Dump for 'RAISE_EXCEPTION'.
Please suggest.Normally, BDC should run the same way whether it is in background of Foreground.
No, BDC does not run the same way in background and foreground
To understand BDC in background : different behavior or termination read those OSS notes :
- [Note 33319 - Batch input: Backgr. runs diff. than in the dialog|https://service.sap.com/sap/support/notes/33319]
- [Note 311440 - Batch input and controls|https://service.sap.com/sap/support/notes/311440]
Also this note of interest :
- [Note 554139 - FAQ 2: Batch input|https://service.sap.com/sap/support/notes/554139]
Regards,
Raymond -
Smart form printing without dialog box
Hi,
Thanks to eveyone for reading this post.
I want to print a form thru smartform. I am able to do that now by calling that smart form and passing the data. Now i wanted to print multiple docs using smartform so that the dialog box printer doesnt apppear and all printing is executed without any user intervention.
I tried to call smart form in the following way so that data is printed to the printer without any thing appearing on the screen (dialog box).
I did consult the forums here and when i try it I either see the dialog box or see other sy-subrc.
Code -
Data: w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop.
W_COMPOP-tdnewid = 'X'.
W_COMPOP-tdFINAL = 'X'.
W_COMPOP-tdimmed = 'X'.
W_COMPOP-tddelete = 'X'.
W_COMPOP-tdcopies = 1 .
*W_COMPOP-TDNOPREV = 'X' .
W_COMPOP-TDDEST = 'LP01'.
*W_COMPOP-tdnoprint = 'X'.
W_ctrlop-DEVICE = 'PRINTER'. " Here we dont give printer name 'KX-P3696'.
w_ctrlop-no_dialog = 'X'.
w_ctrlop-preview = ''.
CALL FUNCTION '/1BCDWB/SF00000135'
*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.
i would be glad if anyone can help me. I did a few RND in the code above to make it work but it dosent.
Moreover when the dialog box appears then there is a text in the bar below which says please maintain printer master data. (something like that). Is that creating a problem ?
Thanks,
JGREPORT ZANNTEST.
Data Declarations
DATA : control TYPE ssfctrlop,"Smart Forms: Control structure
output_options TYPE ssfcompop,"Smart Composer (transfer) options
v_fm TYPE rs38l_fnam."Form Name
control-preview = 'X'."Preview the output of Smartform
control-no_dialog = 'X'."Don't show Dialog
output_options-tddest = 'LOCL'."Spool: Output device
output_options-tdnoprint = 'X'."No printing from print preview
Function Module to get Generated Fucntion module of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZCONEXTNLETTER' " your created zform
IMPORTING
fm_name = v_fm
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.
CALL FUNCTION v_fm
EXPORTING
user_settings = ' ' " don't forget this option
control_parameters = control
output_options = output_options
PR_PERNR = '00001019' " it wil come from ur form parameters
PR_BEGDA = '19940101' " it will come from ut form parameters
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.
this is the best answer for ur requirement..
lets njyyyyyyyyyyy.. -
Error in calling/converting smart form from ECC to pdf in portal.
Hi,
We have a requirement in our project where we have to show IT form in portal exactly in the way payslip are shown in ESS
Screen, that is in the pdf form in ess portal screen.
For this my HR abap consultant has made one customize smart form which is being called from a RFC FM.
After the FM lf_fm_name gets executed , the OTF data is being captured and then converted in to PDF.
After that the PDF is then converted into XSTRING format which is then supplied to the portal side through export parameter
of the RFC.
Now when we debugged the RFC, the conversion is taking place perfectly fine in to XSTRING.This is wat we assume.
Portal Side: I have used Iframe ui ELEMENT in my webdynpro java and its property source I have binded with a value attribute
of type string and I am executing above customize RFC given to me by my HR abap consultant and after executing that RFC with
userID and payroll year as its import parameter I am taking export parameter of that RFC with name pdf_string of type XSTRING
of that RFC into my webdynpro java value attribute which i binded to source property of Iframe.
Now when we see the output in portal , first of all pdf is not getting generated and its showing the error message:
file does not begin with '%pdf-' and secondly errored Adobe form getting opened outside Iframe window its not coming within
Iframe window like what payslip comes inside Iframe UI element.
I want to know what mistake we are doing in our ABAP coding or portal coding.
Please help.Hi Satyam,
You can use the existing SAP GRT framework for developing the app.
Its easy and provides more features.
See this wiki:
http://wiki.sdn.sap.com/wiki/display/WDJava/HowtodevelopcustomWebDynproESSapplicationsusingGenericReportingTool%28GRT%29
Regards
Yugandhar Reddy -
Control Framework: Fatal error - GUI cannot be reached-ALV Grid in Bckgrnd
I have an ALV grid which dumps in the background. But works fine in the foreground.
I thought I am not using Control framework anywhere. But I get 'COntrol framework :Fatal error - GU cannot be reached' error.
I am using a docking container that I have split using a splitter.
I have no custom container in my screen. What else could be causing the Control framework error ? Any suggestions is appreciated. But please do not tell me to use 'REUSE_ALV*' or Classical reporting
Here are the PBO modules of my screen and here are my data declarations.
ALV Data declarations :
data :gt_sort type lvc_t_sort,
gr_event_handler TYPE REF TO lcl_event_handler ,
o_docking type ref to cl_gui_docking_container,"Docking Container
o_grid type ref to cl_gui_alv_grid,"Grid
o_split type ref to cl_gui_easy_splitter_container,"Splitter
o_top_container type ref to cl_gui_container, "Top Container
o_bottom_container type ref to cl_gui_container,"Bottom Container
o_document type ref to cl_dd_document. "Document
module status_0100 output.
if o_docking is initial.
set pf-status 'ZSTATUS_0100'.
set titlebar 'ZTITLE_0100'.
Creating Objects
perform create_objects.
Filling top of page
perform fill_top_of_page.
Filling the fieldcatalog table
perform build_fieldcat. "we already got'em
Displaying the output
perform display_output.
endif.
Here is the Form Create_objects called in the PBO.
form create_objects .
Creating Docking Container
CREATE OBJECT o_docking
EXPORTING
RATIO = '95'.
IF sy-subrc eq 0.
Splitting the Docking container
CREATE OBJECT o_split
EXPORTING
PARENT = o_docking
sash_position = 25 "Position of Splitter Bar (in Percent)
with_border = 0. "With Border = 1 Without Border = 0
Placing the containers in the splitter
o_top_container = o_split->top_left_container .
o_bottom_container = o_split->bottom_right_container .
Creating Grid
CREATE OBJECT o_grid
EXPORTING
i_parent = o_bottom_container.
Creating the document
CREATE OBJECT o_document
EXPORTING
style = 'ALV_GRID'.
CREATE OBJECT gr_event_handler .
ENDIF.
endform. " create_objects
form fill_top_of_page .
data : lv_char(255) type c.
Calling the methods for dynamic text
CALL METHOD o_document->add_gap
EXPORTING
width = 140.
CALL METHOD o_document->add_text
EXPORTING
text = 'Plant Attainment Report '
sap_fontsize = 'Large'
sap_color = cl_dd_area=>list_key_int
sap_emphasis = cl_dd_area=>strong. " For bold
Display the data
CALL METHOD o_document->display_document
EXPORTING
parent = o_top_container.
Calling the method of ALV to process top of page
CALL METHOD o_grid->list_processing_events
EXPORTING
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = o_document.
endform. " fill_top_of_page
form display_output .
gx_variant-report = sy-repid.
gs_layout-zebra = 'X'.
gs_layout-sel_mode ='X'.
gs_layout-cwidth_opt = 'X'.
call method o_grid->set_table_for_first_display
exporting
is_variant = gx_variant
i_save = 'A'
is_layout = gs_layout
changing
it_fieldcatalog = it_fldcat
it_outtab = <gt_tabletotal>.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SET HANDLER gr_event_handler->handle_print_top_of_page FOR o_grid .
endform. " display_output
Edited by: Shareen Hegde on Jul 23, 2009 5:03 PM (I have no clue why
.. doesn't work anymore. My code looks messed up..Sorry folks!Nilesh,
If i put all these create objects inside the IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL. ENDIF , will I be still able to use ,
call method o_grid->set_table_for_first_display
exporting
is_variant = gx_variant
i_save = 'A'
is_layout = gs_layout
changing
it_fieldcatalog = it_fldcat
it_outtab = <gt_tabletotal>.
in background ? WIll I not get - OBJECTS_OBJREF_NOT_ASSIGNED erorr ?
How can I call the set_table_for_first_display without creating the object reference ?
Here is my creat object routine.
form create_objects .
* Creating Docking Container
IF CL_GUI_ALV_GRID=>OFFLINE( ) .
CREATE OBJECT o_docking
EXPORTING
RATIO = '95'.
IF sy-subrc eq 0.
* Splitting the Docking container
CREATE OBJECT o_split
EXPORTING
PARENT = o_docking
sash_position = 25 "Position of Splitter Bar (in Percent)
with_border = 0. "With Border = 1 Without Border = 0
* Placing the containers in the splitter
o_top_container = o_split->top_left_container .
o_bottom_container = o_split->bottom_right_container .
* Creating Grid
CREATE OBJECT o_grid
EXPORTING
i_parent = o_bottom_container.
* Creating the document
CREATE OBJECT o_document
EXPORTING
style = 'ALV_GRID'.
ENDIF.
CREATE OBJECT gr_event_handler .
endif.
endform. " create_objects -
Hi All,
I configured the smart form and given the name of right print program for contract.
and created the message type ZNEU.
when I want to print it by using ME9K.I am getting error of Value of spool attribute can not be changed.This same smart form worked in testing client with the same configuration.
Please help me out.
Helpful answers will be rewarded
Thanks in Advance,
PraveenHi,
Please talk to your basis person or pl. use this link to know the print controls...
1. Choose Tools > CCMS > Spool > Spool administration.
2. Then choose Full administration. Choose Print controls on the DeviceTypes tab page to display a list of the standard print controls.
See the print controls in both the systems... they must be different.
Hope this will help u solve the problem, If yes then give points.
Darshan -
Why the control parameters changed when print smart form
Hi experts:
I set the control parrameters in my source code to print the smart form, I use the loop table for printing, but I found the print device changed automatically, only the frist page is ok. that means, the control paramenters lost when loop. how to solve it?
this is my source:
LOOP AT it_outtab INTO wa_outtab WHERE flag = 'X' .
ssf_open ls_control_param outopt ls_composer_param.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE 'Call SSF_FUNCTION_MODULE_NAME Error' TYPE 'E'.
ENDIF.
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 lf_fm_name
EXPORTING
control_parameters = ls_control_param
zgl_k_stru = wa_outtab
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE 'Call LF_FM_NAME Error' TYPE 'E'.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ssf_close .
MOVE-CORRESPONDING outopt TO ls_composer_param.
ls_composer_param-tdimmed = ' '.
ls_control_param-no_dialog = 'X'.
IF outopt-tdpreview = 'X'.
EXIT.
ENDIF.
ENDLOOP.Hi Prabhat,
Please check following point in your smartform design.
1) In your smartform design, how many pages do you have? (Check the page format and margins, have a look at form painter
as well)
2) Check out the navigation from one page to another page.
3) Debugg the form and check at what point the last page is been added.
Regards,
Amee. -
Error in opening the PDF file created from the smart form output.
Hi All,
i have a simple smart form which takes 3 values like customer no, name and no of times customer called and gives an out like
Customer 0001000000 with name Ravi called 5 times today.
I have to send this output to mail as an attachment.
for this i am coding as below.
******Call the SSF Function module
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = Form name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = lv_fmname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
lv_partner_number = '0001000000'.
lv_name_org1 = 'Ravi'.
lv_z_no_calls_day = '5'.
lw_ctrlop-getotf = 'X'.
lw_ctrlop-no_dialog = 'X'.
lw_compop-tdnoprev = 'X'.
lw_compop-tddest = 'LP01'.
*******Call the Form Function module and get the OTF of form output
CALL FUNCTION lv_fmname
EXPORTING
name_org1 = lv_name_org1
partner_number = lv_partner_number
z_no_calls_day = lv_z_no_calls_day
control_parameters = lw_ctrlop
output_options = lw_compop
user_settings = ' '
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf] = w_return-otfdata[.
*********Now here if i look in to the OTF data i got in debug it has the data i aniticipated along with some other data.
the output is in the format
TDPRINTCOM(2) TDPRINTPAR(70)
ST XXXX.. customer 0001000000 with
name.....
i have my data in the above format spread in three lines of the output otf table where XXXX... is some number.
***********To convert to PDF Format
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = lv_len_in
BIN_FILE =
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
*********For testing purpose i created a file on the desktop with the the data in i_tline. it created PDF file but when i tried to open it it's giving an error.
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 = 'Smart Form'.
wa_doc_chng-obj_descr = 'Frequent Caller Alert_Day'.
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
*********Creating the Entry for the document
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.
i_objbin] = i_tline[.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objhead = 'Frequentcaller list_Day.pdf'.
APPEND i_objhead.
************Creating the entry for the attachment.
CLEAR : i_objpack.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'ATTACHMENT'.
i_objpack-obj_descr = 'FCA'.
i_objpack-doc_size = v_lines_bin * 255 .
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = 'mail id'.
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 = i_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
This is all i am doing.
It is sending a mail with the attachment but we are not able to open the attachment. it's giving an error like file is damaged and couldn't be repaired.
I serched in the forum but i couldn't get the answer.
I suspect there is a problem in getting the OTF data..
Please help me in resolving this issue....
Thanks in advance.
RKCheck the sample , and see where you made the mistake.
REPORT ZPDF_MAIl.
DATA:
w_fm_name TYPE rs38l_fnam,
w_bin_filesize TYPE i,
w_filesize TYPE i,
w_lines_txt TYPE i,
w_lines_bin TYPE i.
DATA:
wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop,
wa_objhead TYPE soli_tab,
wa_buffer TYPE string,
wa_doc_chng TYPE sodocchgi1.
DATA:
BEGIN OF t_mail_ids OCCURS 0,
mailid TYPE ad_smtpadr,
END OF t_mail_ids,
t_otfdata TYPE ssfcrescl,
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_pdf_tab TYPE tline OCCURS 0 WITH HEADER LINE,
t_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z195_TEST'
IMPORTING
fm_name = w_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION w_fm_name
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IMPORTING
job_output_info = t_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
LOOP AT t_pdf_tab.
TRANSLATE t_pdf_tab USING '~'.
CONCATENATE wa_buffer t_pdf_tab INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
t_record = wa_buffer.
APPEND t_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
t_objtxt = ' To Change the COR, Use the Transaction ZCOR_CHANGE'.
APPEND t_objtxt.
t_objtxt = ' Check the Attached PDF file for COR'.
APPEND t_objtxt.
DESCRIBE TABLE t_objtxt LINES w_lines_txt.
READ TABLE t_objtxt INDEX w_lines_txt.
READ TABLE t_objtxt INDEX w_lines_txt.
wa_doc_chng-obj_name = 'COR Display'.
wa_doc_chng-expiry_dat = sy-datum + 10.
CONCATENATE 'COR' "w_cornr
'-' "w_stat_descr w_action_desc
INTO wa_doc_chng-obj_descr SEPARATED BY space.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = w_lines_txt * 255.
CLEAR t_objpack-transf_bin.
t_objpack-head_start = 1.
t_objpack-head_num = 0.
t_objpack-body_start = 1.
t_objpack-body_num = w_lines_txt.
t_objpack-doc_type = 'RAW'.
APPEND t_objpack.
t_objpack-transf_bin = 'X'.
t_objpack-head_start = 1.
t_objpack-head_start = 1.
t_objpack-head_num = 0.
t_objpack-body_start = 1.
DESCRIBE TABLE t_objbin LINES w_lines_bin.
READ TABLE t_objbin INDEX w_lines_bin.
t_objpack-doc_size = w_lines_bin * 255 .
t_objpack-body_num = w_lines_bin.
t_objpack-doc_type = 'PDF'.
t_objpack-obj_name = 'COR'.
t_objpack-obj_descr = 'COR Test'.
* concatenate 'COR' w_cornr into t_objpack-obj_descr
* separated by space.
APPEND t_objpack.
*LOOP AT t_mail_ids.
CLEAR t_reclist.
t_reclist-receiver = 'INTENATEMAIL'.
t_reclist-rec_type = 'U'.
APPEND t_reclist.
*ENDLOOP.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = t_objpack
object_header = wa_objhead
contents_bin = t_objbin
contents_txt = t_objtxt
receivers = t_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 EQ 0.
ENDIF.
Maybe you are looking for
-
Logical delete flag in fixed assets extract
I have to create a flat file of Fixed Assets data. I am asked to put the 'Logical Delete Flag' in it. My data will be based on the t.code AR01(report RABEST_ALV01). It uses the logical database ADA. My question is where can i find the logical delete
-
Order by to_char(month) for a chart
Hi There, I was using the following query to display a chart item in APEX. I was wondering what would be the best way to order by the output so that the months show up in an ordered way. (code) SELECT NULL , TO_CHAR(MA.DATE_LOGGED,'Mon') , COUNT(*) P
-
Hi, i have taken a standard oracle report and i am trying to alter the report. RDBMS : 11.1.0.7.0 Oracle Applications : 12.1.1 Report Builder 10.1.2.0.2 I am getting the following errors in EBS: Enter Password: REP-1219: 'F_Deductions_Amount' has no
-
Hello folks, Just a quick and novice question..... I brought some video in from my DV camera and upon it completion I attempted to view it. The Browser, Timeline, and Viewer showed up; However, the Canvas did not. I am using FCP HD 4.5 and contacted
-
Hi, I have a problem with flex, well realy I even dont know how to install it, I download the flex_sdk_3.0.0.477 zip file and now than I have it, I dont know what to do with it .. How can I install it or what should I do with it .. this makes sence ?