Read DMS document in binary format
Hi,
I have a requirement to read DMS document in binary format into internal table.
and i want to print the data in internal table through SAP spool.
Please let me know how to handle this requirement.
Thanks
Srini
Hi,
Check scms pakage, FG - SCMS_CONV for conversions..
Regards
Surjit
Similar Messages
-
Read DMS document into internal table
Hi,
I have a requirement to read DMS document in binary format into internal table.
and i want to print the data in internal table through SAP spool.
Please let me know how to handle this requirement.
Thanks
SriniHi,
Check scms pakage, FG - SCMS_CONV for conversions..
Regards
Surjit -
Create a Document in DMS and attach a file coming in binary format
Hi to all,
I have to create a new document in DMS (trx: CV01N) with an attachment but this attachment is a pdf file in binary format. Can I use bapi "BAPI_DOCUMENT_CREATE2"? It support binary files in input or I have to convert files in someway? Or I have to use another BAPI?
I'm using an r/3 4.6c and I know that it is a big limit.
Please, I need help.
Thank you very much in advance,
EnricoThat assumes two things:
1. That Apple would have let Microsoft have access to its file format.
2. That Microsoft would want to spend the time and trouble to write filters for file formats that Apple can't be bothered doing for its own software.
Peter -
How to read a file containing bitmap message in binary format
Dear all,
Can anybody tell me how to read bitmap message which stored data in binary format? The messages are stores like this :
A file contain some messages along with these bitmaps in square zeroes.
I want to again convert it into ASCII.Double post: http://forum.java.sun.com/thread.jspa?threadID=587497
-
How to read 16-bit signed integer in binary format with 2 byte sync. preceding??
A flowmeter provides data as 16-bit signed integer in binary format with 2 byte sync. preceding
I got i small problem by understanding the synchronasation.
I read the data provided by the flowmeter, and then write it to a binaryfile.dat. i need to convert the data to decimal format. is it better to convert the data before or after writing it to the binary file. Coz i need to read the data out again for calculations and save it again in a new file.
I understand that the synchronization help one to see where to begin reading the usable data. is it right?
Need any suggestions
Thank you !
Zamzam
HFZ
Attachments:
DataOut.JPG 37 KBHI Rolf.k.
Thank you for the small program it was helpfull.
You got right about that proberly there will be conflict with some spurios data, I can already detect that when writing the data to a spreadsheet file.
I writes the data in such a way, that in each line there will be a date, a timestamp, a tab and a timestamp at the end. That means two columns.
When i set given samplerate up, that controls the rate of the data outflow from the device, (1,56 Hz - 200 Hz), the data file that i write to , looks unorderet.
i get more than one timestamp and severel datavalues in every line and so on down the spreadsheet file.
Now the question is: Could it be that the function that writes the data to the file, can't handle the speed of the dataflow in such a way that the time stamp cant follow with the data flowspeed. so i'm trying to set the timestamp to be with fractions of the seconds by adding the unit (<digit>) in the timestamp icon but its not working. Meaby when i take the fractions off a second within the timestamp i can get every timestamp with its right data value. Am i in deeb water or what do You mean!??
AAttached Pics part of program and a logfile over data written to file
regards
Zamzam
HFZ
Attachments:
DataFlowWR.JPG 159 KB
Datalogfile.JPG 386 KB -
Pages is sending my documents in docx format, but windows unable to open them. They arrive blank or can only be read as a single line at a time. When viewed prior to sending, the document is divided with black lines after each sentence.
Windows will only be able to open these if you have Word 2007+. Older versions of Word, for example Word 2003 would require a compatibility pack.
Perhaps you can try 'Saving As' a different file type instead?
Regards,
Steve -
I used pages to write my coursework, but when I saved it, pages crashed...
Now I tried to reopen the file. It shows "The document ___.pages can not be read - The Document Does Not Have A Valid Format".
I've looked through the forum to find any fix methond. I tried the "zip solution" -> changes the file entention as .zip file.
But the still can not solve my problem. it shows the zip file can not be open..
I put my files in the following link.
http://dl.dropbox.com/u/16476040/Marketing%20Coursework.pages
Please could anyone try to offer me assistance. bacause it is very urgent.
I will be very grateful if anyone can help me.Hi, Peter
I followed the instriction, and changed to root to locate /.DocumentRevisions-V100/
I can see several ______.pages file under the ./DocumentRevisions-V100/PerUID/
From the "Date Modified" attribute, I can find several __.Pages files that what I want.
But unfortunately, when I tried to open these version files, it still shows
The document can not be read. The Document does not have a valid format.... -
Read Binary File - variable binary format
Hi Everyone,
I'm using the "read from binary file" subvi to interpret some data from a file. I have the code running fine if the the temp file is always the same format, however I want the "read from binary file" to adapt to different file structures based on a user input. Here's a snapshot of my current VI:
The structure of the file I'm reading can change, so I tried to make it so that user input would change the way labview interprets the binary structure. I did this using case structures. The issue I ran into is that the ouput of the different case structures merges into 1 line, and since each case structure's binary format is a different array size I get an error:
======>
Does anyone know of a way to remedy this issue?
If you take a look at my file, I was thinking about putting all of my commands that interpret the binary file and parse the data into a case structure similiar to the one above. I was trying to avoid this as I would end up with a set of the entire code in 12 different cases, and if I wanted to make a small change to the the code I would have to change all 12 cases.
Thanks for any suggestions!
Attachments:
Read Copy of Binary File - Static.vi 105 KB
Read Copy of Binary File - Variable.vi 105 KBOne solution is to include the File Read into the case structure. But you need to find a way to return the different types of data records as you obviously can't connect them to the same indicator.
All in all I find your design rather crude anyhow. Reading a file and letting the user decide what data type to expect is going to give lots of errors. Instead the file should contain information of what is in there and the reading routine should decide based on that how to interpret the next bunch of data.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Reading Characteristics of a DMS Document if the one does not exist yet
Hi,
Whenever a document is created with classification from transaction CV01N, an entries is being made into the tables of DB for the entered classification of the document. In this case I can get the characteristic values of document classification from within the BAdI method (for example DOCUMENT_MAIN01~BEFORE_SAVE) by selecting from DB table.
Is there any way for read the document classification from within method DOCUMENT_MAIN01~BEFORE_SAVE before the actual save of document (corresponding entries does not exist in DB table)?Nemesis wrote:
The original table t_data contains data which is normally deleted after 45 days, but it also stores data which is used for demonstration purposes by consultants, and which should not be deleted with the rest.
Truncating would delete all the data in the table t_data, but the problem is that a subset of the data must be retained in the table. This means that either I adapt the purge code on this table not to delete the required data, or I displace the data that must be saved until the purge is done and then reinsert it into t_data...Choice 1:
Use partitioned tables. Store the "temporary" data in partitions that can be deleted and the consultants demo data in another partition that doesn't get truncated.
Choice 2:
Have two similarly structured tables that store the two types of data so that one table can be truncated as required and the other maintains the data. Use a view on top of the tables to union the data to appear as one "table" for use in the application.
As already mentioned by others, creating tables at run time is just wrong. It's poor design, it's not scalable and it leads to dynamically generated queries which can inherently have bugs that will not be apparent until run-time and sometimes only under certain conditions, thus leaving your code very liable to break and very difficult to debug.
Global Temporary tables are what are generally used for temporary storage of data within a transaction or a session if they suit, but it sounds as if you need the data retention across sessions with truncate option available as required on partial data. That is one of the purposes of partitions on tables... or of course go for the two table and view option if you haven't paid for partitioning in your licence.
Edited by: BluShadow on Dec 22, 2009 8:33 AM
LOL! Billy posted whilst I was typing. p.s. Glad to see you got your Ace badge Billy. Well deserved. -
Sending DMS Document as Attachment thru e-mail
Hi,
I am attaching the DMS document in purchase order & I am sending the PO thru email to vendor.But while doing so the attached document shuld be sent as attachment But in my present config setting it is not doing so.
Pl suggest
RgdsHi,
With my solution you will be able to send the PO and all link document in a mail at the same time you print it.
First Step
Create a new message with transaction NACE , this message will use support 8 ( external program) . The print program should be a copy the same as for printing your PO but add a new form entry inside.
Second step .
In the print program , create the new form entry and add the code . bellow a sample code i wrote . Some object are specific so you have to create it . If you need i can give you te detail of thoses objects.
DATA : bin_file TYPE xstring ,
bin_filesize TYPE i ,
w_objky TYPE objky,
my_sender TYPE zcl_send_mail=>ty_sender,
mail_line TYPE LINE OF soli_tab,
w_attsub TYPE so_obj_des.
DATA: l_druvo TYPE t166k-druvo,
l_nast TYPE nast,
l_from_memory,
l_doc TYPE meein_purchase_doc_print.
DATA : v_parvw2 TYPE nast-parvw,
v_parnr2 TYPE nast-parnr,
v_lifnr TYPE konv-lifnr,
v_adrnr TYPE lfa1-adrnr,
st_address TYPE addr1_sel,
st_sadr TYPE sadr.
* definition des tables internes
DATA : it_otf TYPE STANDARD TABLE OF itcoo ,
it_line TYPE STANDARD TABLE OF tline ,
it_fill TYPE STANDARD TABLE OF drad,
it_new TYPE STANDARD TABLE OF drad ,
itb_xtkomv TYPE STANDARD TABLE OF komv WITH HEADER LINE,
itb_xekpo TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
it_ekpo TYPE HASHED TABLE OF ekpo WITH UNIQUE KEY ebeln ebelp ,
it_draw TYPE HASHED TABLE OF draw WITH UNIQUE KEY dokar
doknr
dokvr
doktl ,
it_drat TYPE HASHED TABLE OF drat WITH UNIQUE KEY dokar
doknr
dokvr
doktl
langu,
my_attachement_list TYPE zcl_send_mail=>attachement_list,
my_recipient_list TYPE zcl_send_mail=>recipient_list ,
it_hexa TYPE solix_tab ,
it_body TYPE soli_tab.
CONSTANTS : c_object TYPE dokob VALUE 'EKPO' .
FIELD-SYMBOLS : <ekpo> TYPE ekpo,
<drad> TYPE drad ,
<draw> TYPE draw,
<drat> TYPE drat .
DATA : my_mail TYPE REF TO zcl_send_mail . => Specific object
** Here write your own code like you print the PO form in order to be able to retrieve it from memory
** don't send it to the printer only in spool .
* Get OTF from Memory.
CALL FUNCTION 'READ_OTF_FROM_MEMORY'
EXPORTING
memory_key = nast-objky
TABLES
otf = it_otf
EXCEPTIONS
memory_empty = 1.
CHECK sy-subrc EQ 0.
* Transform OTF into PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_filesize
bin_file = bin_file
TABLES
otf = it_otf
lines = it_line
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4.
* Transform PDF as Binary Table
it_hexa = cl_document_bcs=>xstring_to_solix( ip_xstring = bin_file ).
* Add PO as PDF file to the mail
zcl_send_mail=>add_attachement_to_list(
EXPORTING
type = 'PDF'
subject = 'PO'
content_hexa = it_hexa
CHANGING
attachement_list = my_attachement_list
EXCEPTIONS
no_content_for_attachement = 1
no_application_type = 2 ).
* Get PO Item because DIR are link to item only.
SELECT * FROM ekpo
APPENDING CORRESPONDING FIELDS OF TABLE it_ekpo
WHERE ebeln = nast-objky.
* Search for DIR .
FREE : it_draw , it_drat .
LOOP AT it_ekpo ASSIGNING <ekpo>.
FREE : it_fill , it_new.
CONCATENATE <ekpo>-ebeln <ekpo>-ebelp INTO w_objky.
CALL FUNCTION 'CV140_SELECT_DRAD_DOCUMENTS'
EXPORTING
pf_key = w_objky
pf_object = c_object
TABLES
pt_fill_drad = it_fill
pt_new_drad = it_new
EXCEPTIONS
no_document = 1.
* For each DIR , retrieve physical content
LOOP AT it_fill ASSIGNING <drad>.
IF <draw> IS ASSIGNED.
UNASSIGN <draw>.
ENDIF.
READ TABLE it_draw ASSIGNING <draw>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl.
IF NOT <draw> IS ASSIGNED.
SELECT * FROM draw
APPENDING CORRESPONDING FIELDS OF TABLE it_draw
WHERE dokar = <drad>-dokar
AND doknr = <drad>-doknr
AND dokvr = <drad>-dokvr
AND doktl = <drad>-doktl.
SELECT * FROM drat
APPENDING CORRESPONDING FIELDS OF TABLE it_drat
WHERE dokar = <drad>-dokar
AND doknr = <drad>-doknr
AND dokvr = <drad>-dokvr
AND doktl = <drad>-doktl
AND langu = sy-langu.
READ TABLE it_draw ASSIGNING <draw>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl.
ENDIF.
CHECK <draw> IS ASSIGNED.
READ TABLE it_drat ASSIGNING <drat>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl
langu = sy-langu.
IF <drat> IS ASSIGNED.
w_attsub = <drat>-dktxt.
ELSE.
CONCATENATE <drad>-dokar <drad>-doknr <drad>-dokvr <drad>-doktl
INTO w_attsub SEPARATED BY '/'.
ENDIF.
PERFORM add_fid_to_attachement USING <draw>
w_attsub
CHANGING my_attachement_list.
CHECK <drat> IS ASSIGNED.
UNASSIGN <drat>.
ENDLOOP.
LOOP AT it_new ASSIGNING <drad>.
IF <draw> IS ASSIGNED.
UNASSIGN <draw>.
ENDIF.
READ TABLE it_draw ASSIGNING <draw>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl.
IF NOT <draw> IS ASSIGNED.
SELECT * FROM draw
APPENDING CORRESPONDING FIELDS OF TABLE it_draw
WHERE dokar = <drad>-dokar
AND doknr = <drad>-doknr
AND dokvr = <drad>-dokvr
AND doktl = <drad>-doktl.
SELECT * FROM drat
APPENDING CORRESPONDING FIELDS OF TABLE it_drat
WHERE dokar = <drad>-dokar
AND doknr = <drad>-doknr
AND dokvr = <drad>-dokvr
AND doktl = <drad>-doktl
AND langu = sy-langu.
READ TABLE it_draw ASSIGNING <draw>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl.
ENDIF.
CHECK <draw> IS ASSIGNED.
READ TABLE it_drat ASSIGNING <drat>
WITH TABLE KEY dokar = <drad>-dokar
doknr = <drad>-doknr
dokvr = <drad>-dokvr
doktl = <drad>-doktl
langu = sy-langu.
IF <drat> IS ASSIGNED.
w_attsub = <drat>-dktxt.
ELSE.
CONCATENATE <drad>-dokar <drad>-doknr <drad>-dokvr <drad>-doktl
INTO w_attsub SEPARATED BY '/'.
ENDIF.
PERFORM add_fid_to_attachement USING <draw>
w_attsub
CHANGING my_attachement_list.
CHECK <drat> IS ASSIGNED.
UNASSIGN <drat>.
ENDLOOP.
ENDLOOP.
* Send mail to PO creator
* Sender
my_sender-mail = '****' . => Set the sender mail adress
* Add Recipient
zcl_send_mail=>add_recipient_to_list(
EXPORTING
uname = sy-uname
CHANGING
recipient_list = my_recipient_list
EXCEPTIONS
no_recipient_to_add = 1 ).
* Mail body
mail_line = 'PO by mail with Attachment'.
APPEND mail_line TO it_body.
* Create send request
CREATE OBJECT my_mail.
* Send Mail
my_mail->send_mail(
sender = my_sender
mail_subject = 'E-mail PO'
mail_body = it_body
recipient_list = my_recipient_list
attachement_list = my_attachement_list ).
Bellow the code for the routine ADD_FID_TO_ATTACHEMENT
DATA : w_cout TYPE dms_checkout_def,
w_dttrg TYPE dttrg, "Name of data carrier
w_docfile TYPE dms_doc_file,
w_dappl TYPE dappl, "Application
w_tabix TYPE i ,
w_tdwa TYPE tdwa ,
w_phio TYPE dms_phio,
w_frontend TYPE dms_frontend_data.
DATA : it_drao TYPE STANDARD TABLE OF drao WITH HEADER LINE,
it_kpro TYPE dms_tbl_file .
CONSTANTS : "c_print_option TYPE apptp VALUE '3', "Print option
c_hostname TYPE ntadr VALUE 'DEFAULT', "Hostname
c_type TYPE typdt VALUE 'PC', "Type
c_system TYPE char4 VALUE 'WN32'. "System
FIELD-SYMBOLS : <kpro> TYPE LINE OF dms_tbl_file,
<phio> TYPE LINE OF dms_tbl_phio .
CLEAR : w_tdwa .
* Check if for DIR type KPRO is used
CALL FUNCTION 'CV200_DB_TDWA_SELECT'
EXPORTING
pf_dokar = in_draw-dokar
IMPORTING
psx_tdwa = w_tdwa
EXCEPTIONS
not_found = 1.
w_frontend-frontend_type = c_type. "'PC'.
w_frontend-hostname = c_hostname. "'DEFAULT'.
w_frontend-winsys = c_system. "'WN32'.
w_frontend-platform = 0.
w_cout-comp_get = abap_true.
w_cout-kpro_use = w_tdwa-kpro_use.
w_cout-batchmode = abap_true.
w_cout-content_provide = 'TBL'.
CALL FUNCTION 'CV120_KPRO_MASTER_DATA_GET'
EXPORTING
pf_dokar = in_draw-dokar
pf_doknr = in_draw-doknr
pf_dokvr = in_draw-dokvr
pf_doktl = in_draw-doktl
TABLES
ptx_data = it_kpro
EXCEPTIONS
not_found = 1
error = 2.
CASE w_tdwa-kpro_use.
WHEN abap_true.
CALL FUNCTION 'CV120_KPRO_MASTER_DATA_GET'
EXPORTING
pf_dokar = in_draw-dokar
pf_doknr = in_draw-doknr
pf_dokvr = in_draw-dokvr
pf_doktl = in_draw-doktl
TABLES
ptx_data = it_kpro
EXCEPTIONS
not_found = 1
error = 2.
w_frontend-frontend_type = 'KP'.
LOOP AT it_kpro ASSIGNING <kpro>.
FREE it_drao.
LOOP AT <kpro>-tbl_phios ASSIGNING <phio>.
MOVE-CORRESPONDING <phio> TO w_phio.
CALL FUNCTION 'CV120_DOC_CHECKOUT_VIEW'
EXPORTING
ps_cout_def = w_cout
ps_doc_file = w_docfile
ps_draw = in_draw
ps_phio = w_phio
ps_frontend = w_frontend
TABLES
ptx_content = it_drao
EXCEPTIONS
error = 1.
PERFORM transform_fid_to_binary TABLES it_drao
USING <kpro>-dappl
in_attsub
CHANGING attachement_list .
ENDLOOP.
ENDLOOP.
WHEN abap_false.
DO 2 TIMES.
CLEAR : w_docfile .
FREE : it_drao.
w_tabix = sy-index.
w_docfile-fileno = w_tabix.
CASE w_tabix.
WHEN 1.
w_dappl = in_draw-dappl.
w_dttrg = in_draw-dttrg.
WHEN 2.
w_dappl = in_draw-dappl1.
w_dttrg = in_draw-dttrg1.
ENDCASE.
w_docfile-dappl = w_dappl.
w_docfile-dttrg = w_dttrg.
CALL FUNCTION 'CV120_DOC_CHECKOUT'
EXPORTING
ps_cout_def = w_cout
ps_draw = in_draw
ps_doc_file = w_docfile
TABLES
ptx_drao = it_drao
EXCEPTIONS
error = 1
OTHERS = 2.
PERFORM transform_fid_to_binary TABLES it_drao
USING w_dappl
in_attsub
CHANGING attachement_list .
ENDDO.
ENDCASE.
Bellow the code for routine TRANSFORM_FID_TO_BINARY
FIELD-SYMBOLS : <drao> TYPE drao ,
<source> TYPE x ,
<dest> TYPE x,
<hexa> TYPE solix .
DATA : w_filelong TYPE i ,
w_long TYPE i,
w_longdes TYPE i .
DATA : it_hexa TYPE solix_tab .
CHECK it_drao[] IS NOT INITIAL.
* Transform Physical document into Binary
LOOP AT it_drao ASSIGNING <drao>.
IF w_filelong IS INITIAL.
w_filelong = <drao>-orln.
ENDIF.
ASSIGN <drao>-orblk TO <source>.
DESCRIBE FIELD <source> LENGTH w_long IN BYTE MODE.
CLEAR w_longdes.
WHILE w_long GT 0.
ASSIGN <source>+w_longdes(w_long) TO <source>.
APPEND INITIAL LINE TO it_hexa ASSIGNING <hexa>.
ASSIGN <hexa>-line TO <dest>.
DESCRIBE FIELD <dest> LENGTH w_longdes IN BYTE MODE.
MOVE <source> TO <dest>.
w_filelong = w_filelong - w_longdes.
w_long = w_long - w_longdes.
CHECK w_filelong LE w_longdes.
IF w_long NE 0.
w_long = w_filelong.
ENDIF.
CHECK w_long LE 0.
w_long = 0.
ENDWHILE.
ENDLOOP.
* Add file to list of attachment
CHECK NOT it_hexa[] IS INITIAL.
zcl_send_mail=>add_attachement_to_list(
EXPORTING
type = w_dappl
subject = in_attsub
content_hexa = it_hexa
CHANGING
attachement_list = attachement_list
EXCEPTIONS
no_content_for_attachement = 1
no_application_type = 2 ).
In my complete solution, an additionnal screen have been define in the header of PO to allow user managing recipient list . If you need so i can give you the code also .
Let me know.
Best regards -
There was a problem reading this document (109) on Japanese PC
We have an app written with Delphi 2006 and using Rave Reports to generate PDFs. A Japanese user of our software cannot open the PDFs (with Acrobat reader) our software produces when they run our software on a Japanese version of Windows (probably Win7). I have the same problem if I try to open the same PDF (which they have sent us) with Acrobat reader on an English-language Win XP machine :
There was an error processing a page. There was a problem reading this document (109)..
Ctrl-OK produces "object label badly formatted"
PDF files produced on English installations of our software read fine on our PCs and on the Japanese user's PC
Does anyone have any idea where this error is coming from?
Thanks,
RossHi Pat,
Thanks for looking at this.
Yes, there are almost certainly Japanese characters. If you look at the second (readable) version I sent you can see where part of the date has been rendered incorrectly - this is because they have their regional settings arranged so that the Japanese year character is used, and the version of Delphi we use doesn't support those multibyte characters.
It seems unreasonable for Acrobat Reader to choke on this however.
Here'a binary dump of the relevant part of the file -
Hi,
I am trying to get a document stored in DMS in binary format (or string/xstring) to get it displayed in BSP screen.
I tried using the FM - SCMS_DOC_READ (as mentioned in one of the forum thread), but couldn't figure out the inputs to the same.
Kindly help me in this.
Thanks,
KrishThanks Manasa.
But my question is how to get a document from SAP - DMS (say CV03N). If I get a document then I can convert and make it display on the BSP screen.
Thanks,
Krish -
Not able to upload file in DMS(Document Mang. system) using Web dynpro ABAP
Hi All,
I am facing a problem while uploading the file into the DMS ( Document Management System ) from Webdnrpo .
I am using the BAPI - BAPI_DOCUMENT_CREATE2 to create the document .
CASE - 1
when i am providing the storage category mention below and no data carrier1
ls_documentfiles-storagecategory = 'ZHMEL_CS'. it is not able to upload the document in the DMS system and when i check
in the debugg mode it giving error as ""Error while checking in and storing: C:\TEST.TXT "" .
CASE - 2
When i am not using the storage category and providing the the data carrier as default
ls_documentdata-DATACARRIER1 = 'DEFAULT'. It is able to create the document in the DMS but i am not able to read that document .
I checked with DMS Consultant that DMS is configured for ZOL ( documenttype) with a storage category as 'ZHMEL_CS'.
The code which i have used is below :
ls_documentdata-documenttype = 'ZOL'.
ls_documentdata-documentversion = '00'.
ls_documentdata-documentpart = '000'.
ls_documentdata-description = 'Test Document'.
ls_documentdata-laboratory = '001'.
ls_documentdata-WSAPPLICATION1 = 'TXT'.
ls_documentdata-DOCFILE1 = 'C:\TEST.TXT'.
ls_documentdata-SAVEDOCFILE1 = 'C:\TEST.TXT'.
*ls_documentdata-FILESIZE1 = 000000000000.
*ls_documentdata-FILESIZE2 = 000000000000.
ls_documentdata-WSAPPLICATION1 = 'TXT'.
ls_documentfiles-DOCUMENTTYPE = 'ZOL'.
ls_documentfiles-DOCUMENTPART = '000'.
ls_documentfiles-DOCUMENTVERSION = '00'.
ls_documentfiles-storagecategory = 'ZHMEL_CS'.
ls_documentfiles-WSAPPLICATION = 'TXT'.
ls_documentfiles-DOCPATH = 'C:\'.""lv_filename.
ls_documentfiles-DOCFILE = 'TEST.TXT'."lv_filename.
ls_documentfiles-description = 'Test Document'.
ls_documentfiles-language = 'EN'.
ls_documentfiles-CHECKEDIN = 'X'.
APPEND ls_documentfiles to lt_documentfiles .
*&----Fill Descriptions
w_descr-language = 'EN'.
w_descr-language_iso = 'EN'.
w_descr-description = 'Test'.
append w_descr to lt_descr.
clear w_descr.
**w_hostname = 'HMEL-DV1R3_DR3_00'.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_documentdata
*hostname = 'content-srv'
*pf_http_dest = 'SAPHTTPA'
*pf_ftp_dest = 'SAPFTPA'
IMPORTING
DOCUMENTNUMBER = lv_DOCUMENTNUMBER
return = gv_return
TABLES
documentdescriptions = lt_descr
documentfiles = lt_documentfiles.
Please let me know your valuable inputs on the same ..
Edited by: Omm Awasthi on Dec 30, 2010 12:22 AM
Edited by: Omm Awasthi on Dec 30, 2010 12:25 AMHi omm , from functional side your require a document type and content repository
I have used below code in a function module to create document , we have create object link as PO to the doc.
FUNCTION ZFM_SR_CREATE_FROM_EXTERNAL .
""Local Interface:
*" IMPORTING
*" VALUE(IV_DOCUMENTNUMBER) TYPE DOKNR OPTIONAL
*" VALUE(IV_DOCUMENTTYPE) TYPE DOKAR OPTIONAL
*" VALUE(IV_DOCUMENTVERSION) TYPE DOKVR OPTIONAL
*" VALUE(IV_DOCUMENTPART) TYPE DOKTL_D OPTIONAL
*" VALUE(IV_STORAGE_CAT) TYPE CV_STORAGE_CAT OPTIONAL
*" VALUE(IV_DOKST) TYPE DOKST OPTIONAL
*" VALUE(IT_DM_FILES) TYPE ZDM_TT_FILES OPTIONAL
*" VALUE(IV_EBELN) TYPE EBELN
*" EXPORTING
*" VALUE(EV_DOCUMENTNUMBER) TYPE DOKNR
*" VALUE(ES_RETURN) TYPE BAPIRET2
V00.00 DD.MM.YYYY *
*********************New Method of Uploading File*********************************
CONSTANTS path_name TYPE dms_path
VALUE '/tmp/'.
CONSTANTS log TYPE dms_path VALUE '/tmp/logFO.txt'.
DATA: ls_draw TYPE bapi_doc_draw2,
lt_documentfiles TYPE TABLE OF bapi_doc_files2,
ls_documentfiles TYPE bapi_doc_files2,
ls_dm_files TYPE zdm_files,
lv_filename TYPE string,
lv_ext TYPE string,
lv_file_type TYPE draw-dappl,
lv_file_name TYPE dms_path,
lv_msg(80) TYPE c,
lt_objectlinks TYPE TABLE OF bapi_doc_drad,
ls_objectlinks TYPE bapi_doc_drad,
lv_ebelp TYPE ebelp
Prepare Data
MOVE iv_documentnumber TO ls_draw-documentnumber.
MOVE iv_documenttype TO ls_draw-documenttype.
MOVE iv_documentversion TO ls_draw-documentversion.
MOVE iv_documentpart TO ls_draw-documentpart.
ls_draw-statusextern = iv_dokst.
ls_draw-statusintern = iv_dokst.
ls_draw-username = sy-uname.
LOOP AT it_dm_files INTO ls_dm_files.
SPLIT ls_dm_files-filepath AT '.' INTO lv_filename lv_ext.
CALL FUNCTION 'CV120_DOC_GET_APPL'
EXPORTING
pf_file = ls_dm_files-filepath
IMPORTING
pfx_dappl = lv_file_type.
TRANSLATE lv_file_type TO UPPER CASE.
OPEN DATASET log FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER lv_ext TO log.
ls_documentfiles-wsapplication = lv_file_type.
TRANSLATE ls_documentfiles-wsapplication TO UPPER CASE.
CONCATENATE path_name
lv_filename
lv_ext
INTO lv_file_name.
CONDENSE lv_file_name NO-GAPS.
TRANSFER lv_file_name TO log.
OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.
*Transfer Attachment Content to Application Server
TRANSFER ls_dm_files-content TO lv_file_name.
CLOSE DATASET lv_file_name.
TRANSFER 'move data to lt_files' TO log.
ls_documentfiles-storagecategory = iv_storage_cat.
ls_documentfiles-docfile = lv_file_name.
ls_documentfiles-DOCUMENTVERSION = IV_DOCUMENTVERSION.
APPEND ls_documentfiles TO lt_documentfiles.
CLEAR lv_file_name.
CLOSE DATASET log.
ENDLOOP.
IF iv_ebeln IS NOT INITIAL.
ls_objectlinks-objecttype = 'EKPO'.
SELECT SINGLE ebelp INTO lv_ebelp FROM ekpo WHERE
ebeln = iv_ebeln
AND loekz eq space.
CONCATENATE iv_ebeln lv_ebelp INTO ls_objectlinks-objectkey.
APPEND ls_objectlinks TO lt_objectlinks.
ENDIF.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_draw
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
IMPORTING
documentnumber = ev_documentnumber
return = es_return
TABLES
objectlinks = lt_objectlinks
documentfiles = lt_documentfiles.
DATA: ls_doc_data type bapi_doc_draw2,
ls_doc_datax type bapi_doc_drawx2,
ls_return type bapiret2.
Set value for document data
ls_doc_data-statusextern = 'IW'.
ls_doc_data-statusintern = 'IW'.
Set value for document data check
ls_doc_datax-statusextern = 'X'.
ls_doc_datax-statusintern = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
EXPORTING
DOCUMENTTYPE = 'ROS'
DOCUMENTNUMBER = IV_DOCUMENTNUMBER
DOCUMENTPART = IV_DOCUMENTPART
DOCUMENTVERSION = IV_DOCUMENTVERSION
DOCUMENTDATA = ls_doc_data
DOCUMENTDATAX = ls_doc_datax
HOSTNAME =
DOCBOMCHANGENUMBER =
DOCBOMVALIDFROM =
DOCBOMREVISIONLEVEL =
SENDCOMPLETEBOM = ' '
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
CAD_MODE = ' '
ACCEPT_EMPTY_BOM = ' '
IMPORTING
RETURN = ls_return
TABLES
CHARACTERISTICVALUES =
CLASSALLOCATIONS =
DOCUMENTDESCRIPTIONS =
OBJECTLINKS =
DOCUMENTSTRUCTURE =
DOCUMENTFILES = lt_documentfiles.
LONGTEXTS =
COMPONENTS =
move es_return to ES_RETURN.
IF es_return-type CA 'EA' ."NE 'E' AND es_return-type NE 'A'.
"do nothing
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
LOOP AT lt_documentfiles INTO ls_documentfiles.
DELETE DATASET ls_documentfiles-docfile.
ENDLOOP.
ENDFUNCTION. -
How to upload the data to SAP-DMS(Document Management System)
Dear sir,
How to upload the data to SAP-DMS (Document Management System) please give me the code for this .ex for (excel format or tab deliminated) to sap system through BAPI i have to pass.
regards
R M PatilHi,
May be following link may help you.
/thread/315373 [original link is broken]
/message/205534#205534 [original link is broken]
Thanks,
Sree. -
How to attach HTML content to DMS Document?
Hello,
I have a requirement in which I have to make a HTML file which contains the current Dispaly on screen, I have to attach this HTML file inside the DMS document.
For this I am doing following steps.
1 ) FM SAVE_LIST
2) FM WWW_HTML_FROM_LISTOBJECT, form this FM I am getting the Internal table which is containing the HTML content.
a) I am converting this internal table content ot first in XSTRING using FM SCMS_TEXT_TO_XSTRING
b) And XSTRING to Binary format.
3) After this I am creating a DMS cocument using FM CVAPI_DOC_CREATE
3) After DMS document creation I am using FM CVAPI_DOC_CHECKIN to attach HTML file content to this DMS Document.
Everthing seems to be ok, but when I am using CV03N to view the document, its showing the HTML file bu not showing the original content(HTML)
Please help to find the problem, Is there any other way from which I could CHECKIN HTML content directly inside DMS document in HTML form without converting it to binary.HI,
I have not understood the requirement.
As far as I know, HTML need not to be checked in.
Refer also link below
Re: some questions on SAP DMS
May be useful in choice of FM.
Regards
Nitin
Maybe you are looking for
-
How can I transfer contact from first icloud user to second icloud user ?
i have first i cloud user and i add all contact in my iphone in to it. but in present, i want to change my icloud user in to the other, so i want to transfer all contact to my new icloud user. How can i do? thk
-
Export excel option is not working in test environment in Firefox.
In our application 'export excel' option is present in 4 different pages. All the excels working in development environment in both IE and FF. In testing env, all the excels working fine in IE. But only two excels are working in FF in testing env. Re
-
ATP Check through programme (any function module? )
Hi, I want to do ATP check for a sales order through a programme. Could you please help me out with any Function module or any process? Thanks, Sandeep
-
Hi, All: I wondering why the XML file size changed after go through DB using CLOB. The original size is 1KB, but after I use the PUT and GET method, the size changed to 8KB. There is a lot of space appened to the content. Thanks a lot!
-
Why is my lock screen zoomed in?
When i turn on my 4th gen iPod lock screen is zoomed in and i can do anything.I even did a system restore and it is still that way. What do i do