Cl_bds_document_set= create_with_table
Hi all,
I need to upload file to BDS in web dynpro. i used FM BDS_BUSINESSDOCUMENT_CREATEF but that works good only in abap.
from link BDS_BUSINESSDOCUMENT_CREATEF , i learnt that method cl_bds_document_set=>create_with_table should be used in web dynpro. Can any 1 please tel what value does parameter CONTENT takes. and what other functions to be used in order to upload file to BDS other than this method
>
Bhavya belagal wrote:
> Hi,
>
> Thank you for replying, now file is uploding.
> My requirment is also that, displaying the uploaded file. for that i am using 'SCMS_DOC_URL_READ'. Files which are uploaded through the FM 'BDS_BUSINESSDOCUMENT_CREATEF' in abap are displayed. Files which are uploading using method CL_BDS_DOCUMENT_SET=>CREATE_WITH_TABLE are not displaying. using this method is it possible to display?
> In oaor transcation also files through this method are not displayed.
>
> Edited by: Bhavya belagal on Dec 24, 2010 9:20 AM
Hallo Bhavya,
please avoid nested discussion. would have been better if you started this as new discussion.
Have you seen in the repository that these files are available after CL_BDS_DOCUMENT_SET=>CREATE_WITH_TABLE ?
SCMS_DOC_URL_READ gives you the URL. control if you have had supplied a correct parameters .
see the link for getter methods from CL_BDS_DOCUMENT_SET
[https://cw.sdn.sap.com/cw/docs/DOC-9739|https://cw.sdn.sap.com/cw/docs/DOC-9739]
Similar Messages
-
Cl_bds_document_set= create_with_table docx and xlsx
Hello,
I use cl_bds_document_set=>create_with_table to put files from a server in the database but I can't add files of office 2007,
other files a doc, jpg, pdf are no problem.
The problem is that there is no mime type in table toadd of docx.
What can I do to add the right mime type?
ThanksHi,
use maintenance view V_TOADD (transaction SM30).
Regards,
Ivan -
Hi folks,
We are using BSP application to display smartform in PDF format in a new page/window. When I try to save the PDF from the browser/window, its pops up a screen with defaults as "Desktop" and a File Name. I am not sure how system is generating the default file name. How can we change this File Name?
Thanks for help!
Best Regards,
PraveenHi,
It's done while creating the Response-Caching as in below code:
cl_http_server=>server_cache_upload( url = filename response = response ).
We can pass custom value in the variable filename.
Kind Regards,
Praveen -
Hi Everyone,
I want a program for attaching an excel sheet or word document in Tr Code qm03 .
Points would be awarded for suitable answers.
Its very urgent.
Thanks in advance
SrinivasMay be this code will help u to achieve the same. In this code I am uploading PDF file from presentation server and attaching it in lineitem level to GOS in FB02.
Similarly u can do the same for qm02 for a particular notification no.
*& Report Z_GOS_DEMO_JG
report z_gos_demo_jg.
type-pools:sbdst.
data: i_file type standard table of char134 initial size 0.
data: l_hstring(1022) type x.
data: l_cstring(255) type c.
data: w_file(134) type c.
data: wa_buffer type string.
data: l_classname type sbdst_classname.
data: i_component type sbdst_components.
data: w_component type bapicompon.
data: i_signature type sbdst_signature.
data: w_signature type bapisignat.
data: i_content type sbdst_content.
data: w_content type bapiconten.
data: l_file type string.
data: objkey type sbdst_object_key.
l_file = 'C:\TEST.PDF'.
field-symbols: <dummy>.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = l_file
filetype = 'ASC'
has_field_separator = SPACE
header_length = 0
read_by_line = 'X'
dat_mode = SPACE
codepage = SPACE
ignore_cerr = ABAP_TRUE
replacement = '#'
virus_scan_profile =
IMPORTING
filelength =
header =
changing
data_tab = i_file
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
others = 19
if sy-subrc = 0.
loop at i_file into w_file.
*Replacing space by ~
translate w_file using '~'.
concatenate wa_buffer w_file into wa_buffer.
endloop.
*Replacing ~ by space
translate wa_buffer using '~'.
do.
l_cstring = wa_buffer.
assign l_cstring to <dummy> type 'X'.
check sy-subrc = 0.
move <dummy> to l_hstring.
APPENDing 255 Characters as a record
APPEND wa_record TO i_record.
move l_hstring to w_content-line.
append w_content to i_content.
shift wa_buffer left by 255 places.
SHIFT wa_buffer LEFT BY 1022 PLACES.
if wa_buffer is initial.
exit.
endif.
enddo.
endif.
l_classname = 'BSEG'.
objkey = '100000000018482007001'.
w_component-doc_count = 1.
w_component-comp_count = 1.
w_component-comp_id = '100000000018482007001'.
*W_COMPONENT-COMP_SIZE
select single mimetype from toadd into w_component-mimetype
where doc_type = 'PDF'.
append w_component to i_component.
w_signature-doc_count = 1.
W_SIGNATURE-DOC_ID = 'MESSAGE' .
w_signature-doc_ver_no = 2.
W_SIGNATURE-DOC_VAR_ID
W_SIGNATURE-DOC_VAR_TG
w_signature-comp_count = 1.
w_signature-prop_name = 'DESCRIPTION'.
w_signature-prop_value = 'FILE'.
append w_signature to i_signature.
call method cl_bds_document_set=>create_with_table
exporting
logical_system =
classname = l_classname
classtype = 'BO'
client = sy-mandt
components = i_component
content = i_content
changing
object_key = objkey
signature = i_signature
EXCEPTIONS
internal_error = 1
error_kpro = 2
parameter_error = 3
not_authorized = 4
not_allowed = 5
nothing_found = 6
others = 7
if sy-subrc = 0.
commit work.
endif. -
How to open Word doc stored in BDS?
I faced the problem using BDS. I have table with stored object_keys of Word documents stored in BDS. I can retrieve url for this docs using METHOD CL_BDS_DOCUMENT_SET=>GET_WITH_URL. But how can i open this document using url or something else?
For example, 'WS_EXECUTE' don't understand BDS-URL as a doc adress.
Thanks to all who will try to help me.Using BDS_OBJECT_DISPLAY i get runtime exception CX_SY_DYN_CALL_ILLEGAL_TYPE. I use BDS in this way. May be I don't create BDS doc in a proper way?
*& Form SAVE_FILE_RETRIVE_ID
* Locate File in BDS Repository Retrive ID
FORM SAVE_FILE_RETRIVE_ID CHANGING OBJ_KEY TYPE SBDST_OBJECT_KEY.
DATA: LV_COMPON TYPE BAPICOMPON,
LV_SIGNAT TYPE BAPISIGNAT.
LV_COMPON-DOC_COUNT = '1'.
* lv_compon-comp_count = '1'.
* lv_compon-comp_id = 'Employee Image'.
lv_compon-mimetype ='application/x-oleobject'.
* lv_compon-comp_size = '1024'.
APPEND LV_COMPON TO GV_COMPON.
LV_SIGNAT-DOC_COUNT = '1'.
* LV_SIGNAT-DOC_ID = 'IMAGE'.
* LV_SIGNAT-DOC_VER_NO = '1'.
* LV_SIGNAT-DOC_VAR_ID = '1'.
* LV_SIGNAT-DOC_VAR_TG = 'ORIGINAL'.
* LV_SIGNAT-COMP_COUNT = '1'.
* LV_SIGNAT-PROP_NAME = 'IMAGE'.
* LV_SIGNAT-PROP_VALUE ='IMAGE'.
APPEND LV_SIGNAT TO GV_SIGNAT.
CALL METHOD CL_BDS_DOCUMENT_SET=>CREATE_WITH_TABLE
EXPORTING
* LOGICAL_SYSTEM =
CLASSNAME = 'DOC'
CLASSTYPE = 'BO'
* CLIENT =
COMPONENTS = GV_COMPON
CONTENT = GV_T_FILE
CHANGING
OBJECT_KEY = OBJ_KEY
SIGNATURE = GV_SIGNAT
EXCEPTIONS
INTERNAL_ERROR = 1
ERROR_KPRO = 2
PARAMETER_ERROR = 3
NOT_AUTHORIZED = 4
NOT_ALLOWED = 5
NOTHING_FOUND = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " SAVE_FILE_RETRIVE_ID
*& Form OPEN_TASK_DOC
FORM OPEN_TASK_DOC USING OBJ_KEY TYPE SBDST_OBJECT_KEY.
DATA: LV_T_FURLS TYPE BAPIURI OCCURS 1,
LV_URL TYPE BAPIURI,
FILE_URL TYPE URL.
CALL METHOD CL_BDS_DOCUMENT_SET=>GET_WITH_URL
EXPORTING
* LOGICAL_SYSTEM =
CLASSNAME = 'DOC'
CLASSTYPE = 'BO'
* CLIENT =
OBJECT_KEY = OBJ_KEY
* URL_LIFETIME =
CHANGING
URIS = LV_T_FURLS
* SIGNATURE =
* COMPONENTS =
EXCEPTIONS
NOTHING_FOUND = 1
ERROR_KPRO = 2
INTERNAL_ERROR = 3
PARAMETER_ERROR = 4
NOT_AUTHORIZED = 5
NOT_ALLOWED = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE LV_T_FURLS INDEX 1 INTO LV_URL.
* LV_URL - url to the doc we need to display
FILE_URL = LV_URL.
CALL FUNCTION 'BDS_OBJECT_DISPLAY'
EXPORTING
URL = LV_URL
MIMETYPE = 'application/x-oleobject'
* DOC_TYPE =
* DOCUCLASS =
* FILESIZE =
* TABLES
* CONTENT =
* ASCII_CONTENT =
* EXCEPTIONS
* DP_ERROR = 1
* FILE_ERROR = 2
* INTERNAL_ERROR = 3
* EAI_ERROR = 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.
ENDFORM. " OPEN_TASK_DOC -
Download Smartform as PDF in background to App. Server
Hi experts,
we would like to create in background a smartform and convert its OTF stream to PDF. The challenge is now to
download the PDF file to the App. Server or to the BDS.
Our problem is, that the PDF data content doesn't fit to any known methods or function modules for downloading.
Short example what we have so far:
*create form
CALL FUNCTION l_function_module_name
EXPORTING
control_parameters = ls_output_control
output_options = ls_output_options
user_settings = ' '
IMPORTING
job_output_info = ls_output_info
TABLES
form_data = lt_sf_table
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
*convert to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = l_filesize
TABLES
otf = ls_output_info-otfdata
lines = lt_pdf_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
Problem: lt_pdf_lines does not have the right format e.g. using download to BDS:
CL_BDS_DOCUMENT_SET=>CREATE_WITH_TABLE requires a linetype RAW 1022
I am sure anybody of you has already downloaded a PDF in background to the BDS or application server and could give me a hint.
Please note, we are in backgroung and GUI_DOWNLOAD will not help.
Regards
TomPlease go through this link , hope you will get some useful stuff from this.
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450
*& Form f9100_save_to_pdf
text
-->P_WS_FORMNAME text
FORM f9100_save_to_pdf using value(ws_formname).
data: i_lines TYPE tline OCCURS 0 WITH HEADER LINE.
data: ws_bin_size type i,
ws_filename type string.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = ws_bin_size
TABLES
otf = i_otf
lines = i_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
flg_exit = 'X'.
MESSAGE i050 WITH 'Error converting to PDF format'.
EXIT.
ENDIF.
Get the download path
PERFORM get_download_path CHANGING ws_filename.
if flg_exit = 'X'.
EXIT.
endif.
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = ws_bin_size
filename = ws_filename
filetype = 'BIN'
TABLES
data_tab = i_lines
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 i050 WITH 'Error while File download'.
flg_exit = 'X'.
EXIT.
ELSE.
MESSAGE i050 WITH 'File downloaded successfully '.
flg_exit = 'X'.
EXIT.
ENDIF.
Regards,
Prakash. -
Upload image with Zprogram instead se78
Dear Gurus ,
I founf in sdn a useful program that upload images instead se78.
It works fine but i cant find how to pass the Description of the image....
Can you give me a hint ?
Look the code ....
REPORT ZTEST2.
TYPE-POOLS: SBDST.
TABLES: STXBITMAPS.
CONSTANTS:
C_BDS_CLASSNAME TYPE SBDST_CLASSNAME VALUE 'DEVC_STXD_BITMAP',
C_BDS_CLASSTYPE TYPE SBDST_CLASSTYPE VALUE 'OT', " others
C_BDS_MIMETYPE TYPE BDS_MIMETP VALUE 'application/octet-stream',
C_BDS_ORIGINAL TYPE SBDST_DOC_VAR_TG VALUE 'OR'.
* Globals and globals for dynpro fields
DATA: G_OBJECTTYPE(20) TYPE C,
G_NEW_RESOLUTION LIKE STXBITMAPS-RESOLUTION,
G_STXBITMAPS TYPE STXBITMAPS,
G_STXH TYPE STXH,
G_TECHINFO TYPE RSSCG,
T_SIZE(40),
BDS_DESCRIPTION LIKE BAPISIGNAT-PROP_VALUE VALUE 'LALALA'.
CONSTANTS:
C_OBJECTTYPE_BDS LIKE G_OBJECTTYPE VALUE 'BDS',
C_OBJECTTYPE_STDTEXT LIKE G_OBJECTTYPE VALUE 'OBTEXT',
C_OBJECTTYPE_GRTEXT LIKE G_OBJECTTYPE VALUE 'OBGRAPHICS'.
DATA: P_FILENAME TYPE RLGRAP-FILENAME,
P_OBJECT TYPE STXBITMAPS-TDOBJECT,
P_ID TYPE STXBITMAPS-TDID,
P_BTYPE TYPE STXBITMAPS-TDBTYPE,
P_FORMAT TYPE C,
P_TITLE LIKE BDS_DESCRIPTION,
P_RESIDENT TYPE STXBITMAPS-RESIDENT,
P_AUTOHEIGHT TYPE STXBITMAPS-AUTOHEIGHT,
P_BMCOMP TYPE STXBITMAPS-BMCOMP.
DATA L_FILE TYPE STRING..
DATA: L_FILENAME TYPE STRING,
L_BYTECOUNT TYPE I,
L_BDS_BYTECOUNT TYPE I.
DATA: L_COLOR(1) TYPE C,
L_WIDTH_TW TYPE STXBITMAPS-WIDTHTW,
L_HEIGHT_TW TYPE STXBITMAPS-HEIGHTTW,
L_WIDTH_PIX TYPE STXBITMAPS-WIDTHPIX,
L_HEIGHT_PIX TYPE STXBITMAPS-HEIGHTPIX.
DATA: L_BDS_OBJECT TYPE REF TO CL_BDS_DOCUMENT_SET,
L_BDS_CONTENT TYPE SBDST_CONTENT,
L_BDS_COMPONENTS TYPE SBDST_COMPONENTS,
WA_BDS_COMPONENTS TYPE LINE OF SBDST_COMPONENTS,
L_BDS_SIGNATURE TYPE SBDST_SIGNATURE,
WA_BDS_SIGNATURE TYPE LINE OF SBDST_SIGNATURE,
L_BDS_PROPERTIES TYPE SBDST_PROPERTIES,
WA_BDS_PROPERTIES TYPE LINE OF SBDST_PROPERTIES.
DATA WA_STXBITMAPS TYPE STXBITMAPS.
PARAMETERS: P_FILE TYPE RLGRAP-FILENAME OBLIGATORY.
PARAMETERS: P_MATNR LIKE MARA-MATNR OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
START-OF-SELECTION.
DATA: P_NAMEX TYPE STXBITMAPS-TDNAME.
MOVE P_MATNR TO P_NAMEX.
DATA: FILELENGTH TYPE I.
DATA: BEGIN OF L_BITMAP OCCURS 0,
L(64) TYPE X,
END OF L_BITMAP.
L_FILE = P_FILE.
*SELECT SINGLE * FROM STXBITMAPS WHERE TDNAME = P_NAMEX.
* IF SY-SUBRC NE 0.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILE
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = L_BYTECOUNT
TABLES
DATA_TAB = L_BITMAP
EXCEPTIONS
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
NO_BATCH = 1
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
* call method l_bds_object->get_info
* exporting
* classname = c_bds_classname
* classtype = c_bds_classtype
* object_key = l_object_key
* changing
* signature = l_bds_signature
* exceptions
* nothing_found = 1
* others = 2.
DATA: P_DOCID TYPE STXBITMAPS-DOCID.
DATA: P_RESOLUTION LIKE STXBITMAPS-RESOLUTION.
DATA: L_OBJECT_KEY TYPE SBDST_OBJECT_KEY.
CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP_BDS'
EXPORTING
COLOR = 'X'
FORMAT = 'BMP'
RESIDENT = P_RESIDENT
BITMAP_BYTECOUNT = L_BYTECOUNT
COMPRESS_BITMAP = 'X'
IMPORTING
WIDTH_TW = L_WIDTH_TW
HEIGHT_TW = L_HEIGHT_TW
WIDTH_PIX = L_WIDTH_PIX
HEIGHT_PIX = L_HEIGHT_PIX
DPI = P_RESOLUTION
BDS_BYTECOUNT = L_BDS_BYTECOUNT
TABLES
BITMAP_FILE = L_BITMAP
BITMAP_FILE_BDS = L_BDS_CONTENT
EXCEPTIONS
FORMAT_NOT_SUPPORTED = 1
NO_BMP_FILE = 2
BMPERR_INVALID_FORMAT = 3
BMPERR_NO_COLORTABLE = 4
BMPERR_UNSUP_COMPRESSION = 5
BMPERR_CORRUPT_RLE_DATA = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
ENDIF.
CREATE OBJECT L_BDS_OBJECT.
WA_BDS_COMPONENTS-DOC_COUNT = '1'.
WA_BDS_COMPONENTS-COMP_COUNT = '1'.
WA_BDS_COMPONENTS-MIMETYPE = C_BDS_MIMETYPE."application/octet-stream
WA_BDS_COMPONENTS-COMP_SIZE = L_BDS_BYTECOUNT.
APPEND WA_BDS_COMPONENTS TO L_BDS_COMPONENTS.
WA_BDS_SIGNATURE-DOC_COUNT = '1'.
APPEND WA_BDS_SIGNATURE TO L_BDS_SIGNATURE.
L_OBJECT_KEY = P_NAMEX.
CALL METHOD L_BDS_OBJECT->CREATE_WITH_TABLE
EXPORTING
CLASSNAME = C_BDS_CLASSNAME "DEVC_STXD_BITMAP
CLASSTYPE = C_BDS_CLASSTYPE "OT
COMPONENTS = L_BDS_COMPONENTS
CONTENT = L_BDS_CONTENT
CHANGING
SIGNATURE = L_BDS_SIGNATURE
OBJECT_KEY = L_OBJECT_KEY
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
READ TABLE L_BDS_SIGNATURE INDEX 1 INTO WA_BDS_SIGNATURE
TRANSPORTING DOC_ID.
IF SY-SUBRC = 0.
P_DOCID = WA_BDS_SIGNATURE-DOC_ID.
WA_STXBITMAPS-TDNAME = P_NAMEX.
WA_STXBITMAPS-TDOBJECT = 'GRAPHICS'.
WA_STXBITMAPS-TDID = 'BMAP'.
WA_STXBITMAPS-TDBTYPE = 'BCOL'.
WA_STXBITMAPS-DOCID = P_DOCID.
WA_STXBITMAPS-WIDTHPIX = L_WIDTH_PIX.
WA_STXBITMAPS-HEIGHTPIX = L_HEIGHT_PIX.
WA_STXBITMAPS-WIDTHTW = L_WIDTH_TW.
WA_STXBITMAPS-HEIGHTTW = L_HEIGHT_TW.
WA_STXBITMAPS-RESOLUTION = P_RESOLUTION.
WA_STXBITMAPS-RESIDENT = P_RESIDENT.
WA_STXBITMAPS-AUTOHEIGHT = P_AUTOHEIGHT.
WA_STXBITMAPS-BMCOMP = P_BMCOMP.
INSERT INTO STXBITMAPS VALUES WA_STXBITMAPS.
ENDIF.
ENDIF.
*--OAER
DATA: SIGN TYPE TABLE OF BAPISIGNAT WITH HEADER LINE,
COMP TYPE TABLE OF BAPICOMPON WITH HEADER LINE,
CONTENT TYPE TABLE OF BAPICONTEN WITH HEADER LINE,
CONTHEX TYPE TABLE OF SOLIX WITH HEADER LINE,
DOCID TYPE SOFOLENTI1-DOC_ID,
OBJKEY TYPE BAPIBDS01-OBJKEY,
DOC_DATA TYPE SOFOLENTI1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILE
FILETYPE = 'BIN'
TABLES
DATA_TAB = CONTENT.
BREAK FTELLI.
OBJKEY = P_NAMEX.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_DOCUMENTCLASS'.
SIGN-PROP_VALUE = DOC_DATA-OBJ_TYPE.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_CONTREP'.
SIGN-PROP_VALUE = ''.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_DOCUMENTTYPE'.
SIGN-PROP_VALUE = 'BDS_IMAGE'.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_TITLE'.
SIGN-PROP_VALUE = 'DIMITRIS'.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'DESCRIPTION'.
SIGN-PROP_VALUE = DOC_DATA-OBJ_DESCR.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'LANGUAGE'.
SIGN-PROP_VALUE = SYST-LANGU.
APPEND SIGN.
COMP-DOC_COUNT = 1.
COMP-COMP_COUNT = 1.
* comp-comp_id = doc_data-obj_descr.
COMP-MIMETYPE = 'image/jpeg'.
COMP-COMP_SIZE = DOC_DATA-DOC_SIZE.
APPEND COMP.
CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
EXPORTING
CLASSNAME = 'PICTURES'
CLASSTYPE = 'OT'
OBJECT_KEY = OBJKEY "p_matnr
TABLES
SIGNATURE = SIGN
COMPONENTS = COMP
CONTENT = CONTENT
EXCEPTIONS
NOTHING_FOUND = 1
PARAMETER_ERROR = 2
NOT_ALLOWED = 3
ERROR_KPRO = 4
INTERNAL_ERROR = 5
NOT_AUTHORIZED = 6
OTHERS = 7.
COMMIT WORK AND WAIT.
REFRESH: CONTENT, CONTHEX, SIGN, COMP.
Thanks a lot ....Hi,
You should be changing the URL passed to the URLRequest to
point to your server. Please check the URL from the HTML page
generated by your JSP and set the URLRequest URL accordingly.
Hope this helps. -
Dynamic Insertion of graphics in Smart from
Hi guys,
I want to insert a dynamic graphic image from the presentation server into smart from its possible?
Reg,
HriharanHi Mohd,
here's how to do it.
I presume you have alredy done charting in general with the cl_gui_chart_engine. You need the data and the customizing XML strings of that chart to print it out.
Follow this coding:
DATA: l_igs_viewer TYPE REF TO cl_igs_chart_engine,
i_igs_image_converter TYPE REF TO cl_igs_image_converter.
* Generate an Internet Graphics Server Chart Engine
CREATE OBJECT l_igs_viewer
EXPORTING
destination = 'GFW_ITS_RFC_DEST'. "IGS must exist, destination be installed
* IGS gets data and customizing
CALL METHOD l_igs_viewer->set_data( data_doc = l_ixml_doc ).
CALL METHOD l_igs_viewer->set_customizing(
custom_doc = l_ixml_custom_doc ).
* and now renders the chart.
CALL METHOD l_igs_viewer->execute
EXCEPTIONS
communication_error = 1
internal_error = 2
external_error = 3
OTHERS = 4.
* Next step ist to convert the image to an MS-BMP.
DATA:
l_image TYPE w3mimetabtype,
l_image_size TYPE w3param-cont_len,
l_image_type TYPE w3param-cont_type.
* get your image
CALL METHOD l_igs_viewer->get_image
IMPORTING
image = l_image
image_size = l_image_size
image_type = l_image_type.
* Create an image converter on the IGS
CREATE OBJECT i_igs_image_converter
EXPORTING
destination = 'GFW_ITS_RFC_DEST'.
i_igs_image_converter->input = 'image/gif'.
i_igs_image_converter->output = 'image/x-ms-bmp'. " !!!!
* Hand the image over
CALL METHOD i_igs_image_converter->set_image
EXPORTING
blob = l_image
blob_size = l_image_size.
* and convert it to a BMP
CALL METHOD i_igs_image_converter->execute
EXCEPTIONS
communication_error = 1
internal_error = 2
external_error = 3
OTHERS = 4.
IF sy-subrc = 0.
* if OK, get that image.
CALL METHOD i_igs_image_converter->get_image
IMPORTING
blob = l_image
blob_size = l_image_size
blob_type = l_image_type.
ENDIF.
ENDIF.
At this point, we have a BMP-24, and we are ready to save it to the SE78 BDS graphics system.
This is by far the slowest part of the story. Not applicable for mass printing, the conversion of a bitmap can take up to 1 minute!
DATA: l_docid TYPE stxbitmaps-docid.
PERFORM save_bitmap_bds
USING 'TEMP_CHART0181'
'GRAPHICS' 'BMAP' 'BCOL' 'BMP'
'Temporäre Grafik Chart 0181'(i16)
con_blank
con_x
con_x
CHANGING
l_image_size
l_image
l_docid.
The next part ist the form that converts and saves the BMP to BDS.
FORM save_bitmap_bds
USING p_name TYPE stxbitmaps-tdname
p_object TYPE stxbitmaps-tdobject
p_id TYPE stxbitmaps-tdid
p_btype TYPE stxbitmaps-tdbtype
p_format TYPE c
p_title TYPE bapisignat-prop_value
p_resident TYPE stxbitmaps-resident
p_autoheight TYPE stxbitmaps-autoheight
p_bmcomp TYPE stxbitmaps-bmcomp
CHANGING
p_image_size TYPE i
p_image TYPE w3mimetabtype
p_docid TYPE stxbitmaps-docid.
DATA: l_object_key TYPE sbdst_object_key.
DATA: l_tab TYPE ddobjname.
DATA: l_filename TYPE string,
l_bytecount TYPE i,
l_error TYPE c.
DATA: l_color(1) TYPE c.
DATA: l_bds_object TYPE REF TO cl_bds_document_set,
l_bds_content TYPE sbdst_content,
l_bds_components TYPE sbdst_components,
l_dpi TYPE stxbitmaps-resolution,
wa_bds_components TYPE LINE OF sbdst_components,
l_bds_signature TYPE sbdst_signature,
wa_bds_signature TYPE LINE OF sbdst_signature,
l_bds_properties TYPE sbdst_properties,
wa_bds_properties TYPE LINE OF sbdst_properties.
DATA wa_stxbitmaps TYPE stxbitmaps.
DATA:
l_width_tw TYPE stxbitmaps-widthtw,
l_height_tw TYPE stxbitmaps-heighttw,
l_width_pix TYPE stxbitmaps-widthpix,
l_height_pix TYPE stxbitmaps-heightpix,
l_bds_bytecount TYPE i,
l_docid TYPE stxbitmaps-docid.
CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP_BDS'
EXPORTING
color = 'X'
format = 'BMP'
bitmap_bytecount = p_image_size
compress_bitmap = 'X'
IMPORTING
width_tw = l_width_tw
height_tw = l_height_tw
width_pix = l_width_pix
height_pix = l_height_pix
dpi = l_dpi
bds_bytecount = l_bds_bytecount
TABLES
bitmap_file = p_image
bitmap_file_bds = l_bds_content
EXCEPTIONS
format_not_supported = 1
no_bmp_file = 2
bmperr_invalid_format = 3
bmperr_no_colortable = 4
bmperr_unsup_compression = 5
bmperr_corrupt_rle_data = 6
tifferr_invalid_format = 7
tifferr_no_colortable = 8
tifferr_unsup_compression = 9
bmperr_eof = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Enqueue
PERFORM enqueue_graphic USING p_object
p_name
p_id
p_btype
CHANGING l_error.
CHECK l_error EQ con_blank.
SELECT SINGLE docid INTO p_docid
FROM stxbitmaps
WHERE tdobject = p_object
AND tdname = p_name
AND tdid = p_id
AND tdbtype = p_btype.
IF sy-subrc NE 0.
CLEAR p_docid.
ENDIF.
IF p_btype = c_bmon.
l_color = con_blank.
ELSE.
l_color = con_x.
ENDIF.
* Save bitmap in BDS
CREATE OBJECT l_bds_object.
wa_bds_components-doc_count = '1'.
wa_bds_components-comp_count = '1'.
wa_bds_components-mimetype = c_bds_mimetype.
wa_bds_components-comp_size = l_bds_bytecount.
APPEND wa_bds_components TO l_bds_components.
IF p_docid IS INITIAL. " graphic is new
wa_bds_signature-doc_count = '1'.
APPEND wa_bds_signature TO l_bds_signature.
CALL METHOD l_bds_object->create_with_table
EXPORTING
classname = c_bds_classname
classtype = c_bds_classtype
components = l_bds_components
content = l_bds_content
CHANGING
signature = l_bds_signature
object_key = l_object_key
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
MESSAGE e012 WITH p_name 'BDS'.
ENDIF.
READ TABLE l_bds_signature INDEX 1 INTO wa_bds_signature
TRANSPORTING doc_id.
IF sy-subrc = 0.
p_docid = wa_bds_signature-doc_id.
ELSE.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
MESSAGE e012 WITH p_name 'BDS'.
ENDIF.
ELSE. " graphic already exists
********* read object_key for faster access *****
CLEAR l_object_key.
SELECT SINGLE * FROM stxbitmaps INTO wa_stxbitmaps
WHERE tdobject = p_object
AND tdid = p_id
AND tdname = p_name
AND tdbtype = p_btype.
SELECT SINGLE tabname FROM bds_locl INTO l_tab
WHERE classname = c_bds_classname
AND classtype = c_bds_classtype.
IF sy-subrc = 0.
SELECT SINGLE object_key FROM (l_tab) INTO l_object_key
WHERE loio_id = wa_stxbitmaps-docid+10(32)
AND classname = c_bds_classname
AND classtype = c_bds_classtype.
ENDIF.
******** read object_key end ********************
CALL METHOD l_bds_object->update_with_table
EXPORTING
classname = c_bds_classname
classtype = c_bds_classtype
object_key = l_object_key
doc_id = p_docid
doc_ver_no = '1'
doc_var_id = '1'
CHANGING
components = l_bds_components
content = l_bds_content
EXCEPTIONS
nothing_found = 1
OTHERS = 2.
IF sy-subrc = 1. " inconsistency STXBITMAPS - BDS; repeat check in
wa_bds_signature-doc_count = '1'.
APPEND wa_bds_signature TO l_bds_signature.
CALL METHOD l_bds_object->create_with_table
EXPORTING
classname = c_bds_classname
classtype = c_bds_classtype
components = l_bds_components
content = l_bds_content
CHANGING
signature = l_bds_signature
object_key = l_object_key
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
MESSAGE e012 WITH p_name 'BDS'.
ENDIF.
READ TABLE l_bds_signature INDEX 1 INTO wa_bds_signature
TRANSPORTING doc_id.
IF sy-subrc = 0.
p_docid = wa_bds_signature-doc_id.
ELSE.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
MESSAGE e012 WITH p_name 'BDS'.
ENDIF.
ELSEIF sy-subrc = 2.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
MESSAGE e012 WITH p_name 'BDS'.
ENDIF.
ENDIF.
* Save bitmap header in STXBITPMAPS
wa_stxbitmaps-tdname = p_name.
wa_stxbitmaps-tdobject = p_object.
wa_stxbitmaps-tdid = p_id.
wa_stxbitmaps-tdbtype = p_btype.
wa_stxbitmaps-docid = p_docid.
wa_stxbitmaps-widthpix = l_width_pix.
wa_stxbitmaps-heightpix = l_height_pix.
wa_stxbitmaps-widthtw = l_width_tw.
wa_stxbitmaps-heighttw = l_height_tw.
wa_stxbitmaps-resolution = l_dpi.
wa_stxbitmaps-resident = p_resident.
wa_stxbitmaps-autoheight = p_autoheight.
wa_stxbitmaps-bmcomp = p_bmcomp.
INSERT INTO stxbitmaps VALUES wa_stxbitmaps.
IF sy-subrc <> 0.
UPDATE stxbitmaps FROM wa_stxbitmaps.
IF sy-subrc <> 0.
MESSAGE e012 WITH p_name 'STXBITMAPS'.
ENDIF.
ENDIF.
* Set description in BDS attributes
wa_bds_properties-prop_name = 'DESCRIPTION'.
wa_bds_properties-prop_value = p_title.
APPEND wa_bds_properties TO l_bds_properties.
CALL METHOD l_bds_object->change_properties
EXPORTING
classname = c_bds_classname
classtype = c_bds_classtype
object_key = l_object_key
doc_id = p_docid
doc_ver_no = '1'
doc_var_id = '1'
CHANGING
properties = l_bds_properties
EXCEPTIONS
OTHERS = 1.
PERFORM dequeue_graphic USING p_object
p_name
p_id
p_btype.
ENDFORM. "save_bitmap_bds
Your final part will now be to print out the graphic using a SmartForm. The method I showed above, saves the graphics always with the same name, in this case TEMP_CHART0181. So this method is not qualified for concurrent use by multiple users.
Try it out and see how slow this works unfortunately.
I hope SAP will provide a performant way soon to print charts with smartforms better than that above.
One last hint concerning size and resolution of the bitmap. Take a low resolution of say 50 dpi to gain higher performance but lower print quality. I never tried high resolutions of like 300dpi, it just became too slow for me and I qualified that as simply unpracticable.
I hope the coding snippets can help you.
Kind Regards
Ernst -
Error on update of document stored in content server
Error on update of document stored in content server
On a regular basis (but not reproducible) we find that after updating a document, it is deleted from content server (or at least it cannot be retrieved). These problems have only been experienced since we switched to using content server as our storage repository, as opposed to R/3.
We create and maintain documents through a bespoke transaction, which calls standard SAP functions BDS_BUSINESSDOCUMENT_CREA_TAB and cl_bds_document_set=>update_with_table.
Whilst the errored documents are listed in the BDS via transaction OAOR (business document navigator), an error is received when you try to display it (in our case an MS-Word error indicating file/pathname invalid).
We are satisfied that file/pathname are valid and find that this occurs occasionally when a document has been updated. It appears that the document has been deleted.
This bespoke transaction has been running successfully for almost two years, and these problems have only been experienced after switching to content server as a storage repository (as opposed to R3 previously). Has anyone else experienced these problems?
We are running :
R/3 Enterprise 620,
SAP HTTP Content Server Version 6.30 Patch 13
SAPDB version 7.3.0.54Hi Sonny,
To check the connectivity between your content server and Workstation and SAP Server.
Pls goto the command prompt of your workstation
give the command like this example.
C:\>Ping 117.123.45.201
you will get the reply from the server. here 117.123.45.201 is your content server IP.
If you are getting the reply then it means that your contentserver and workstation are connected propely.
Like that pls check the connectivity between your systems.
Pls check the hosts file of your systems also.
If the hosts file entry is not maintained, you can check-out file from content server but you cannot check-in the original.
Pls let me know what kind of error Message you are getting?
From where you are trying to check-in the Original? From the DIR screen or from CAD Desktop screen?
Regards,
MRK
(reward points if useful) -
i have used this program for sending mail through SAP.It has two options.First for sending as an html attachement,second for plain text inline with the body of the message.Actually i need the message in html format inline with the body of the message itself(not as an attachement)
In simple words the body of the message want to be in html format,not an attachement..
*& Report ZMAIL *
report zmail .
tables: soos1.
*type-pools: sbdst.
parameters: report like varis-report obligatory.
parameters: variant like varis-variant obligatory.
parameters:reptitle like soos1-recrem obligatory.
select-options: recnam for soos1-recrem obligatory.
*{ INSERT EDPK900415 1
selection-screen skip 1.
selection-screen begin of block b1 with frame title text-001.
selection-screen begin of line.
parameters: r1 radiobutton group g1.
selection-screen comment:5(40) text-003 for field r1.
selection-screen position 35.
selection-screen end of line.
selection-screen begin of line.
parameters: r2 radiobutton group g1.
selection-screen comment: 5(40) text-002 for field r2.
selection-screen end of line.
selection-screen end of block b1.
*} INSERT
data: begin of html_tab occurs 0.
include structure w3html.
data: end of html_tab.
data : it_pack_list like soxpl occurs 0 with header line.
data: begin of html_tab_converted occurs 0,
line(255) type c,
end of html_tab_converted.
data: listobject like abaplist occurs 20 with header line.
data: abap_list like abaplist occurs 20 with header line.
data: icontab(32) occurs 10 with header line.
data: lineno type i, length type i, size type i,
l_filename like rlgrap-filename.
data: icon_wa type icon,
internal type icon-internal,
existing type c.
data: my_bds type ref to cl_bds_document_set,
key type sbdst_object_key,
files type sbdst_files,
wa type bapifiles.
data: filename type string,
filefilter type string,
path type string,
fullpath type string.
data: user_action type i.
data: cur_guicopdepage(4) type c.
data: gui_codepage(4) type n, " added for message 500824
is_unicode type rststype-sel_ok.
data: convert_output type xstring,
convert_buffer type xstring.
data i type i.
data tablength type i.
data dummy type i.
data list_index like sy-lsind .
data begin of new_pack_list occurs 10.
include structure soxpl.
data end of new_pack_list.
data : owner like soud-usrnam.
data: fg_sysdli like sonv-flag,
fg_folrg like soxdl-folrg,
dli_tab_save like soxdl occurs 20 with header line.
data: rec_count like sy-tabix.
data: object_type like sood-objtp value 'RAW'.
data: object_hd_change like sood1 occurs 0 with header line.
data: objcont like soli occurs 0 with header line.
data: attcont_tab like soli occurs 0 with header line.
data: atthead_tab like soli occurs 0 with header line.
data so_ali like soli occurs 100 with header line.
data document_data like sodocchgi1.
data msg_text(80) type c. "Message text
data: length type i, size type i.
data profile like soprd.
data subrc like sy-subrc value 0.
data so_ali_hex type standard table of solix. "note 604603
data: objpara like selc occurs 0 with header line.
data: objparb like soop1 occurs 0 with header line.
data: receivers like soos1 occurs 0 with header line.
*data: receivers like soos5 occurs 0 with header line.
data: r_dliq type c. "Shared Distrbution List
data: r_dlip type c. "Private Distrbution list
data: rep_title(50) type c. "Report Title
data : begin of dis_lst occurs 10. "Internal table to store DL
include structure sodm1.
data : end of dis_lst.
data : begin of listtab occurs 100. "Internal Table for List CONTAINER
include structure abaplist.
data : end of listtab.
data : begin of downtab occurs 1,
line(255),
end of downtab.
data ls_cnt type n.
data:begin of it_mailid occurs 0,
mailid(100), " TYPE ZSENDINT_MAILID-MAILID,
end of it_mailid.
data c1.
c1 = ' '.
shift reptitle left deleting leading c1.
*SELECT MAILID FROM ZSENDINT_MAILID INTO TABLE IT_MAILID WHERE SUBJECT = REPTITLE AND FLAG <> 'X'.
"IF SY-SUBRC = 0.
"CLEAR RECNAM.
"REFRESH RECNAM.
"LOOP AT IT_MAILID.
"MOVE 'I' TO RECNAM-SIGN.
"MOVE 'EQ' TO RECNAM-OPTION.
"MOVE IT_MAILID-MAILID TO RECNAM-LOW.
"APPEND RECNAM.
"ENDLOOP.
"ENDIF.
*S.KARTHIKRAJA 07.10.2006
call function 'LIST_FREE_MEMORY'
tables
listobject = listobject
exceptions
others = 1.
submit (report)
using selection-set variant
exporting list to memory and return.
import listobject from memory id '%_LIST'.
if listobject[] is initial.
exit.
endif.
call function 'WWW_HTML_FROM_LISTOBJECT'
exporting
REPORT_NAME =
template_name = 'WEBREPORTING_REPORT'
tables
html = html_tab
listobject = listobject
listicons = icontab.
call function 'LIST_TO_ASCI'
exporting
list_index = -1
tables
listasci = downtab
listobject = listobject
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
call function 'TABLE_COMPRESS' "Schneller Tabellencopy
tables
in = listobject
out = so_ali. "note 604603
out = so_ali_hex. "note 604603
call function 'SO_SOLIXTAB_TO_SOLITAB' "note 604603
exporting
ip_solixtab = so_ali_hex[]
importing
ep_solitab = so_ali[].
call function 'SO_DLI_LIST_READ_XDL'
exporting
private = 'X'
public = 'X'
subscript = 'X'
tables
dli_display_tab = dli_tab_save
exceptions
communication_failure = 1
dl_list_no_entries = 2
owner_not_exist = 3
system_failure = 4
x_error = 5
parameter_error = 6
others = 7.
call function 'SO_DLI_EXPAND'
exporting
system_dli = fg_sysdli
convert = 'X'
tables
member = dis_lst
objpara = objpara
objparb = objparb
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
dl_name_not_exist = 4
folder_not_exist = 5
folder_no_authorization = 6
forwarder_not_exist = 7
object_not_exist = 8
object_no_authorization = 9
operation_no_authorization = 10
owner_not_exist = 11
parameter_error = 12
recurrency_exist = 13
substitute_not_active = 14
substitute_not_defined = 15
system_failure = 16
x_error = 17
others = 18.
refresh receivers.
clear receivers.
move sy-datum to receivers-rcdat .
move sy-uzeit to receivers-rctim.
refresh object_hd_change.
object_hd_change-objla = sy-langu. "Language
object_hd_change-objcp = ' '. " Object can be changed byUSER
object_hd_change-objsns = 'F'. " Msg Sensitivity private orbusiness
object_hd_change-objdes = reptitle.
object_hd_change-objnam = object_hd_change-objdes.
append object_hd_change.
if r1 = 'X'.
move html_tab[] to objcont[].
else.
move downtab[] to objcont[].
endif.
describe table objcont lines i.
it_pack_list-head_start = 1.
it_pack_list-head_num = 0.
it_pack_list-body_start = 1.
it_pack_list-body_num = i.
it_pack_list-OBJTP = 'RAW'.
move variant to it_pack_list-objnam.
move variant to it_pack_list-objdes.
move 'HTM' to it_pack_list-file_ext.
append it_pack_list.
loop at html_tab.
call function 'SCP_TRANSLATE_CHARS'
exporting
inbuff = html_tab
outcode = gui_codepage
csubst = 'X'
substc_space = 'X'
substc = '00035'
importing
outbuff = convert_output
exceptions
invalid_codepage = 1
internal_error = 2
cannot_convert = 3
fields_bad_type = 4
others = 5.
concatenate convert_buffer convert_output into convert_buffer in
byte mode.
endloop.
i = 0.
describe field html_tab_converted length tablength in byte mode.
while i < xstrlen( convert_buffer ).
dummy = xstrlen( convert_buffer ) - i.
if tablength > dummy.
html_tab_converted-line = convert_buffer+i(dummy).
else.
html_tab_converted-line = convert_buffer+i(tablength).
endif.
i = i + tablength.
append html_tab_converted.
endwhile.
receivers-sel = 'X'.
receivers-sndex = ' '. "
receivers-sndpri = '1'. "Priority of the message
receivers-deliver = ' '.
receivers-not_deli = ' '.
receivers-read = ' '.
receivers-recnam = 'U-'.
receivers-mailstatus = 'E'.
receivers-sortclass = '5'.
receivers-recesc = 'U'. " U means Internet Address
receivers-SAP_BODY = 'X'.
receivers-sndart = 'INT'.
loop at recnam.
receivers-adr_name = recnam-low.
receivers-recextnam = recnam-low.
append receivers.
endloop.
owner = sy-uname.
if r1 = 'X'.
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = object_hd_change
object_type = object_type
outbox_flag = 'X'
owner = owner
sender = sy-uname
tables
receivers = receivers
packing_list = it_pack_list
att_cont = objcont
att_head = atthead_tab
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.
else.
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = object_hd_change
object_type = object_type
outbox_flag = 'X'
owner = owner
sender = sy-uname
tables
objcont = objcont
receivers = receivers
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.
endif.
commit work.
call function 'SO_DEQUEUE_UPDATE_LOCKS'.i have not gone thru your source code fully.
maintain the text in Tcode SO10.
use the fn module READTEXT* to read the contents of the text.
cheers
jayanthi.K -
How can i make the email sent as an attachment to account/intrec.record ?
Hello Friends,
We are on CRM7.0 .
1. Customer can call the CIC and request IC agent for some change in his personal data ( Account details- first name , last name etc) or address data( telephone numbers changed, address changed due to reloaction etc)
2. Now we already have made developments as when IC AGENT is changing any data related to account details or account address, an email is sent to the customer saying you have requested so and so changes and its pending for approval.
3. We also have developments in place as when the concerned officer has approved the changes, an email is sent to the customer saying so and so changes are approved and updated with us.
4. Now, the requirement is, whenever this email is getting sent( request email as well as approval email) , we would also like to have it as an attachment to the account so that we can keep track as when and what mail was sent and what changes where incorporated for a particulat customer
The option to me is either attach this email to the account or attach it to the interaction record.
Can anyone please guide me on
1. Is it possible to track that email and set it as an attachment ?
2. We know that in Campaign, we have quessionair documents that get autoattached to the email's sent to target group in a campain-say for product proposal...or in some senarioes, these quessionairs are autoattached to the oppotunities when Sales Rep make the customer visit, they get these quessionairs filled. I am not functional and i dont know what backend configurations are done for it, I am a technical person. I would like to know, that is there any backend transaction or configuration seeting by which i can have emails sent to a customer get auto-attached to the interaction record or account ?
Waiting for replies.
Thanks & Regards,
SuchitaHi,
Here is some sample coding to create attachments using cl_crm_documents,
* Fill the business object
ls_business_object-instid = lv_guid. ( this can be your document guid )
ls_business_object-typeid = "business object type like BUSxxxx )
ls_business_object-catid = 'BO'
* File properties
ls_property-name = file_description.
ls_property-value = lv_filename_string.
APPEND ls_property TO lt_properties.
* File info
ls_fileinfo-file_size = lv_size.
ls_fileinfo-binary_flg = 'X'.
ls_fileinfo-first_line = 1.
ls_fileinfo-file_name = lv_filename.
ls_fileinfo-mimetype = lc_mimetype.
* lv_pdf has data as xstring
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_pdf
TABLES
binary_tab = lt_content_bin.
DESCRIBE TABLE lt_content_bin LINES ls_fileinfo-last_line.
CALL METHOD cl_crm_documents=>create_with_table
EXPORTING
business_object = ls_business_object
properties = lt_properties
file_access_info = lt_fileinfo
file_content_binary = lt_content_bin
raw_mode = 'X'
IMPORTING
LOIO = ls_loio
PHIO = ls_phio
* ls_loio and ls_phio contains the logical and physical id's. You can read the attached data using PHIO or LOIO
To display the attachment in email
update content of attachments
CLEAR ls_att_content.
ls_att_content-file_name = cl_crm_email_utility=>convert_uc_numbers_to_char( lv_fname ).
ls_att_content-charset_file_name = lv_filename.
ls_att_content-content_bin = lv_pdf.
ls_att_content-mime_type = lc_mimetype.
ls_att_content-content_id = lv_guid.
ls_att_content-is_embedded = space.
APPEND ls_att_content TO gt_attachment_content.
cl_crm_email_utility=>get_body_part_from_editor
exporting
iv_plain_text = lv_text
it_attachment = gt_attachment_content
importing
et_mime_data = lv_mail_data->body
changing
cv_html = lv_btf_ascii.
To send email
lv_send_request_id = cl_crm_email_utility=>send_email( iv_mail_data = iv_mail_data ).
cl_crm_email_utility=>create_send_req_from_mail_data
exporting
iv_mail_data = lv_mail_data
importing
ev_send_request_id = lv_send_request_id.
Regards,
Arun Kumar
Edited by: Arun Kumar on May 13, 2010 2:59 PM -
How to define a custom class in BDS?
Hi,gurus,
we want to implement BDS to stored our HR project document related with personnel.
we want to have a cusom BDS class, and
we want to stored the document related to another server.
but the customizing for the BDS in SPRO is quite simple, i have no idea on how to fullfill our requirment.
any clue on this?
best regards.
JunHello,
Here are some vital steps that you can follow to be able to attach Documents using BDS.
1. Check and create an entry if required in SBDSV1 for the Business Object. Specify the Logical, Physical and Relational Document Classes here.
2. Remember that you need not create new Classes and can re-use the existing ones as long as you have the possibility to let the attachments created in SAP DB itself. But, if you feel the need that the documents must be created in an external content server, then you have to create a content repository (OAC0) and wrap it in a content category (OACT) and then assign it in the Physical document class (table SDOKPHCL)
3. The attachments can be made to the instance of Business Object in OAOR.
4. Make use of the available methods in the global class CL_BDS_DOCUMENT_SET to suit your needs.
Hope this info gives you the required insight.
With Regards
Vijay Gajavalli -
I can attach an image to SAP CRM WebUI but was not able to view it
Dear Experts,
I was trying to attach an image document to SAP CRM WebUI through cl_crm_documents (Method :- create_with_table) by passing the binary value.
I receive a string value for the image from IOS team and I convert the same to Xstring and binary in the code. And pass the binary value to the method "create_with_table".
And I could see the document gets attached. When I try to open the same. The image looks like a small cross bar(i.e :- As if we try to open an unsupported file format.) Though I tried passing both jpeg and png files.
On the other hand, when I try to attach the same image manually in WebUI. I could view the attached image perfectly. Please find the below code snippet I have used.
Help me out in getting it resolved.
CONCATENATE it_flup_gen2-or_img_faci_desc '.pdf' INTO ls_file_access_info-file_name.
* Convert string to Xstring value for FACI Image
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = it_flup_gen2-or_img_faci
mimetype = 'application/pdf'
IMPORTING
buffer = lv_faci_xstr
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_faci_xstr
IMPORTING
output_length = lv_len
TABLES
binary_tab = lv_file_content_binary.
* Assign file properties
ls_file_access_info-file_size = lv_len.
ls_file_access_info-binary_flg = 'X'.
ls_file_access_info-file_name = ls_file_access_info-file_name.
ls_file_access_info-mimetype = 'application/pdf'.
APPEND ls_file_access_info TO lt_file_access_info.
* Assign business object
ls_business_object-instid = lv_guid.
ls_business_object-typeid = 'BUS2000125'.
ls_business_object-catid = 'BO'.
** Fill property values
** Get the unique name for the Attachment
ls_properties-name = skwfc_prop_relative_url.
ls_properties-value = it_flup_gen2-or_img_faci_desc.
APPEND ls_properties TO lt_properties.
** Get the decription and title
ls_properties-name = skwfc_prop_description.
ls_properties-value = it_flup_gen2-or_img_faci_desc.
APPEND ls_properties TO lt_properties.
** Get the document mime type
ls_properties-name = skwfc_prop_mime_type.
ls_properties-value = 'application/pdf'.
APPEND ls_properties TO lt_properties.
ls_properties-name = 'LANGUAGE'.
ls_properties-value = sy-langu.
APPEND ls_properties TO lt_properties.
ENDIF.
* Creating a document with provided data
CALL METHOD cl_crm_documents=>create_with_table
EXPORTING
business_object = ls_business_object
properties = lt_properties
file_access_info = lt_file_access_info
file_content_binary = lv_file_content_binary
raw_mode = 'X'
IMPORTING
loio = ls_loio
phio = ls_phio
error = ls_error.
IF ls_error IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
regards,
SabarinathanHi Deepika,
Thanks for the response. If you go through my code snippet I have given, I have already mentioned the mimetype as "application/pdf" for pdf document and used the same in my coding. It still doesnt help out.
regards,
Sabarinathan C -
How to do changeover of relationship types in BOR ???
At our site, the method display_attachment of cl_gos_document service short dumps. The short dump message says that the BOR relationship type "ATTA" is no longer supported, and that this is due to an "incomplete changeover" of BOR relationships at this site.
I have a customer message into SAP, but I'm wondering if anyone has been thru this before at their site and knows what to do.
Uwe - I suspect this may be related to the other problem we're talking about regarding the cl_bds_document_set call.
djhAt our site, the method display_attachment of cl_gos_document service short dumps. The short dump message says that the BOR relationship type "ATTA" is no longer supported, and that this is due to an "incomplete changeover" of BOR relationships at this site.
I have a customer message into SAP, but I'm wondering if anyone has been thru this before at their site and knows what to do.
Uwe - I suspect this may be related to the other problem we're talking about regarding the cl_bds_document_set call.
djh -
Create URL for image content and display in new window
Hi,
I am attaching a new image and it is displayed in a table view.
I am having problems creating the URL for the image.
When i give the link of external site like http://www.google.com, it works fine. It does not work when i give as www.google.com.
It does not work for the image. Please help.
ls_properties-name = 'KW_RELATIVE_URL'.
ls_properties-value = lv_imgname.
APPEND ls_properties TO lt_properties.
ls_properties-name = 'LANGUAGE'.
ls_properties-value = sy-langu.
APPEND ls_properties TO lt_properties.
Assign file properties
ls_file_access_info-binary_flg = 'X'.
ls_file_access_info-file_name = lv_imgname.
ls_file_access_info-mimetype = 'image/pjpeg'.
ls_file_access_info-property = lv_string2.
APPEND ls_file_access_info TO lt_file_access_info.
Move content to file_content
lv_str = lv_img_content.
lv_strlen = XSTRLEN( lv_str ).
lv_offset = 1022.
lv_bytes_rd = 0.
lv_bytes_rm = lv_strlen.
ASSIGN lv_str TO <fs>.
WHILE lv_bytes_rd LT lv_strlen.
IF lv_bytes_rm LT lv_offset.
ls_content-line = <fs>+lv_bytes_rd(lv_bytes_rm).
ELSE.
ls_content-line = <fs>+lv_bytes_rd(lv_offset).
ENDIF.
APPEND ls_content TO lt_content.
lv_bytes_rd = lv_bytes_rd + lv_offset.
lv_bytes_rm = lv_strlen - lv_bytes_rd.
CLEAR ls_content.
ENDWHILE.
Create a Document using class CL_CRM_DOCUMENTS
CALL METHOD cl_crm_documents=>create_with_table
EXPORTING
business_object = ls_business_object
properties = lt_properties
file_access_info = lt_file_access_info
file_content_binary = lt_content
raw_mode = 'X'
IMPORTING
loio = ls_loio
phio = ls_phio
error = ls_error.
Using the logical and physical id's, get the file location as an URL
data:
lv_no type char1 value '1'.
CALL METHOD cl_crm_documents=>get_with_url
EXPORTING
loio = ls_loio
phio = ls_phio
url_type = '2'
IMPORTING
error = ls_error
url = lv_url1.
should i prefix the url with 'javascript:'?
Thanks in advance.
Regards
ShanthiHi Shanti,
The URLs that are external to the server, you should always have http://, your image URL is has http:// prefix? Other wise system will always look for the same inside the current BSP application. For Example your BSP application is ZBSP and if you are accessing www.google.com the URL in the browser will be
*******/bsp/ZBSP/www.google.com which will not be existing, hence causing the problem.
If not try adding http:// to the URL by concatenation and try.
Regards,
Ravi
Maybe you are looking for
-
Order Records by List Item description
Can someone please give me some tips on how to solve the following issue? I have a List Item that is populated using the following record group query: SELECT DOC_TYPE_DESC, TO_CHAR(DOC_TYPE_INFO_ID) FROM DOC_TYPE_INFO WHERE ACTIVE = 'Y' ORDER BY DOC_
-
I deleted my review quiz button!
I deleted my review quiz button on accident...and now i can't get it back. It is not giving me an option to undue. I want the learners to be able to review their incorrect answers after taking the quiz. How can I get it back? Can i add my own?
-
Adobe flash player stopped working properly please help
i'm using adobe flash player version10.0.32.18 on vista, and everytime i open my facebook application, i often encountered adobe flash player stopped working properly, then the page will recover, then after few minutes it will stopped then recover ag
-
MacBook Pro, Leopard & Suddenly not working printer
Hi. I have a new MacBook Pro (4 weeks old). I installed the Leopard software that came along with the new computer. I have an HP5180 printer. Everything was working just fine until last night when all of a sudden when I go to print something, I get t
-
Unable to start 2 instances at the same time in Oracle RAC 11g
Hi all, My first instance is running. I can't start second instance successful and get "ORA-00304: requested INSTANCE_NUMBER is busy" Please help! Thank you! Dan.