CheckOutViewMultiple
This function module makes it possible to display several documents at once. You have two possbilities: You can list documents in the table Documents and in enter in the workstation applications in the table
WSApplication that more clearly identify the originals.The data of the documents is read. The first original found is checkedout that has the same workstation application as a workstation application in the table WSApplication.
You can olso enter originals directly in the table DocumentFiles.Restrictions: Additional files are not supported.ExampleDATA: lt_documentdata LIKE bapi_doc_draw2 OCCURS 0 WITH HEADER LINE, lt_documentfiles_in LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
lt_documentfiles_out LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE, lt_wsapplication LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE, DATA: return LIKE bapiret2. CLEAR lt_documentdata. REFRESH lt_documentdata.
(a) lt_documentdata-documentnumber = 'dd01'. lt_documentdata-documenttype = 'drw'. lt_documentdata-documentversion = '00'. lt_documentdata-documentpart = '000'. APPEND lt_documentdata. lt_documentdata-documentnumber = 'dd01'.
lt_documentdata-documenttype = 'drw'. lt_documentdata-documentversion = '01'. lt_documentdata-documentpart = '000'. APPEND lt_documentdata. lt_documentdata-documentnumber = 'dd01'. lt_documentdata-documenttype = 'drw'.
lt_documentdata-documentversion = '02'. lt_documentdata-documentpart = '000'. APPEND lt_documentdata. CLEAR lt_wsapplication. REFRESH lt_wsapplication. lt_wsapplication-wsappl = 'ASM'. APPEND lt_wsapplication.
lt_wsapplication-wsappl = 'PRT'. APPEND lt_wsapplication. CLEAR: lt_documentfiles_out. REFRESH: lt_documentfiles_out. CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEWX' EXPORTING getcomponents = '1'
originalpath = 'C:\TEMP\trash\' hostname = ' ' IMPORTING return = return TABLES documents = lt_documentdata documentfiles_out = lt_documentfiles_out
wsapplication = lt_wsapplication. (b) CLEAR: lt_documentfiles_in, lt_documentfiles_out. REFRESH: lt_documentfiles_in, lt_documentfiles_out. lt_documentfiles_in-originaltype = '1'.
lt_documentfiles_in-documentnumber = 'dd01'. lt_documentfiles_in-documenttype = 'drw'. lt_documentfiles_in-documentversion = '00'. lt_documentfiles_in-documentpart = '000'. lt_documentfiles_in-originaltype = '1'. APPEND lt_documentfiles_in.
lt_documentfiles_in-originaltype = '1'. lt_documentfiles_in-documentnumber = 'dd01'. lt_documentfiles_in-documenttype = 'drw'. lt_documentfiles_in-documentversion = '01'. lt_documentfiles_in-documentpart = '000'. lt_documentfiles_in-originaltype = '1'.
APPEND lt_documentfiles_in. lt_documentfiles_in-originaltype = '1'. lt_documentfiles_in-documentnumber = 'dd01'. lt_documentfiles_in-documenttype = 'drw'. lt_documentfiles_in-documentversion = '02'. lt_documentfiles_in-documentpart = '000'.
lt_documentfiles_in-originaltype = '1'. APPEND lt_documentfiles_in. CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEWX' EXPORTING getcomponents = '1' originalpath = 'C:\TEMP\trash\' hostname = ' '
IMPORTING return = return TABLES documentfiles_in = lt_documentfiles_in documentfiles_out = lt_documentfiles_out wsapplication = lt_wsapplication. IF return-type CA 'EA'.
ROLLBACK WORK. WRITE: / '**************** FEHLER ******************'. WRITE:/ return-message. ELSE. COMMIT WORK. WRITE: / '**************** ERFOLG ******************'. ENDIF.
|