FM Z_EASYDMS_GETDOCDEFAULTS
Hi Gurus,
I am having problems in which when I create a document in a folder in Easy DMS. Site specific information from the folder are not copied in the new document. Can you please help me on this?
Thank you!
Hi Surjit,
Thanks for the response!
Please see below the coding I have on the system.
FUNCTION z_easydms_getdocdefaults .
""Local interface:
*" IMPORTING
*" VALUE(FOLDERDOCUMENT) TYPE BAPI_DOC_KEYS OPTIONAL
*" VALUE(DOCUMENTTYPE) LIKE BAPI_DOC_DRAW2-DOCUMENTTYPE OPTIONAL
*" VALUE(ISFOLDER) LIKE BAPI_DOC_DRAW2-CADINDICATOR OPTIONAL
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" VALUE(DOCUMENTDATA) TYPE BAPI_DOC_DRAW2
*" TABLES
*" CLASSALLOCATIONS STRUCTURE BAPI_CLASS_ALLOCATION OPTIONAL
*" CHARACTERISTICVALUES STRUCTURE BAPI_CHARACTERISTIC_VALUES
*" OPTIONAL
read document structure of source folder
DATA: docdata LIKE bapi_doc_draw2,
lt_charvalues TYPE TABLE OF bapi_characteristic_values,
ret LIKE bapiret2,
wa_charvalues TYPE bapi_characteristic_values.
Class data
DATA : BEGIN OF lt_klah OCCURS 0,
class TYPE klah-class,
klart TYPE klah-klart,
statu TYPE klah-statu,
klagr TYPE klah-klagr,
END OF lt_klah.
Class number & type
DATA: lv_classnum LIKE tdwa-klasse,
lv_classtype LIKE tdwa-klassenart.
Class Characteristic & Values Internal table
DATA: lt_char LIKE TABLE OF klmerka WITH HEADER LINE,
lt_values LIKE TABLE OF clx2v WITH HEADER LINE.
CONSTANTS : c_doctype(3) TYPE c VALUE 'PQS',
c_x(1) TYPE c VALUE 'X',
c_wpqs(5) TYPE c VALUE 'WPQS-',
c_017(3) TYPE c VALUE '017',
c_wpqs_data(9) TYPE c VALUE 'WPQS_DATA',
c_doc_num(7) TYPE c VALUE 'DOC_NUM',
c_doc_type(4) TYPE c VALUE 'WPQS',
c_1(1) TYPE c VALUE '1',
c_facility(8) TYPE c VALUE 'FACILITY',
c_nr_range_nr TYPE inri-nrrangenr VALUE '01',
c_object TYPE inri-object VALUE 'ZWPQSDOCNU'.
DATA: lv_value_int(7) TYPE n,
lv_docnum(12) TYPE c.
Check document type for the new entry document
IF folderdocument+0(3) = c_doctype.
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = folderdocument+0(3)
documentnumber = folderdocument+3(25)
documentpart = folderdocument+30(3)
documentversion = folderdocument+28(2)
getclassification = c_x
IMPORTING
documentdata = docdata
return = ret
TABLES
characteristicvalues = lt_charvalues.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = c_nr_range_nr
object = c_object
IMPORTING
number = lv_value_int
EXCEPTIONS
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
OTHERS = 8.
IF sy-subrc EQ 0.
CONCATENATE c_wpqs lv_value_int INTO lv_docnum.
characteristicvalues-classtype = c_017.
characteristicvalues-classname = c_wpqs_data.
characteristicvalues-charname = c_doc_num.
characteristicvalues-charvalue = lv_docnum.
APPEND characteristicvalues.
ENDIF.
Check Facility Location
SELECT class klart statu klagr
INTO TABLE lt_klah FROM klah
WHERE klart = c_017
AND statu = c_1
AND klagr = c_wpqs.
IF sy-subrc EQ 0.
SORT lt_klah BY class.
ENDIF.
*Get default classification for document type
SELECT SINGLE klasse klassenart INTO (lv_classnum,lv_classtype) FROM tdwa
WHERE dokar = folderdocument+0(3).
*Get values for characteristics
CALL FUNCTION 'CLME_FEATURE_ATTR_OF_CLASS'
EXPORTING
class = lv_classnum
classtype = lv_classtype
TABLES
tfeatures = lt_char
tvalues = lt_values
EXCEPTIONS
class_not_found = 1
no_authority = 2
OTHERS = 3.
IF sy-subrc EQ 0.
SORT lt_values BY atwtb.
ENDIF.
Add Classification for facility characteristics
LOOP AT lt_charvalues INTO wa_charvalues WHERE charname = c_facility.
READ TABLE lt_values WITH KEY atwtb = wa_charvalues-charvalue
BINARY SEARCH.
IF sy-subrc EQ 0.
READ TABLE lt_klah WITH KEY class = lt_values-atwrt
BINARY SEARCH.
IF sy-subrc EQ 0.
classallocations-classtype = lt_klah-klart.
classallocations-classname = lt_klah-class.
classallocations-status = lt_klah-statu.
APPEND classallocations.
ENDIF.
ENDIF.
ENDLOOP.
Inherit Characteristic Values from Parent folder.
LOOP AT lt_charvalues INTO wa_charvalues WHERE charname NE c_doc_num.
characteristicvalues-classtype = c_017.
characteristicvalues-classname = c_wpqs_data.
characteristicvalues-charname = wa_charvalues-charname.
characteristicvalues-charvalue = wa_charvalues-charvalue.
APPEND characteristicvalues.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Similar Messages
-
Dear all
I have created on user ID through SU01. then i have logged easy DMS at that time system asked me "do you want to create private folder " i said yes and private folder is created
Question: How to create public folder in easy DMS?hi,
You can create new folders and documents in one of the following ways:
Create folders and/or documents in Microsoft Windows Explorer
In the context menu with Create Folder and Create Document
In the toolbar with (New Document) and (New Folder)
In a workstation application such as Microsoft Word You create a new file and save it to a private or public folder in SAP Easy Document Management with Save As. The file is saved in the selected folder as a new document, or as an existing or new original application file for an existing document.
When you create the document or folder, the system requests document data such as a description and a document type. You can add a link to a local file. When you confirm the entries, the system copies the file to the selected folder and automatically checks it in to the central storage area.
Note:To be able to do this you have to implement the Z_EASYDMS_GETDOCTYPES function module.
When creating new documents or folders, you can define default document data. To be able to do this you have to
implement the Z_EASYDMS_GETDOCDEFAULTS function module.
Benakaraj
??P
Maybe you are looking for
-
How to include CSS file in JSP
Hi Experts, CSS file availabe in server. I need user that CSS in one of PDK application. Example: "/usr/sap/ED1/JC03/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/portalapps/style1.css" I need to include this in one of JSP file. Regards,
-
HELP! Iphone 4S and Outlook 2007
I have outlook 2007 and an iphone 4s and here are a few issues: 1) I can delete messages on my phone and they will delete on my outlook, however if I delete on my outlook it won't delete on my phone. 2) If I put an event in my outlook calendar it wil
-
I have two programs, the Server.java and Client.java. The Client creates a simple SOAP message and send to the server. The server listens to the port and print out whatever it received from the port: // Server.java ----------------------------------
-
I am not a Firefox OS user, but I'd like to be. The main holdup for me is that the worry that the other major privacy based mobile software I use is not transferrable to a Firefox phone. Can you verify that apps like the above will work on a Firefox
-
What is the difference btw Flux
I was reading the discussion titled "Is this the end of iWeb?" (9.25.11 - 1.2.12) and the web design software Flux and MacFlux was mentioned. I was wondering if anyone knew the difference btw the two. Why is one called "MacFlux"? Is it more "Mac-l