09-30-2007 4:25 PM
I am using Bapi_document_change.Its not changing the document fields.How to proceed?
10-01-2007 5:17 AM
Hi,
Please check the FM documentation. There is a Limitations section also. There is an example coding part also.
Also not sure of your exact requirement since there is no details explaining the problem or piece of code.
Best Regards, Murugesh AS
10-02-2007 7:46 AM
Thanks for ur answer.
The error message it shows is "the knowledge provider is using this document type".Dnt know if there is mistake in my code or some other problem.Could you tell me what is the problem.
10-02-2007 7:50 AM
hi
good
go through this
**..... Document data
DATA: ls_doc LIKE bapi_doc_draw2.
**..... Indicator for change relevance
ls_docx LIKE bapi_doc_drawx2,
**..... Bapi return structure
ls_return LIKE bapiret2.
**.... Originals that are checked in simultaneously
lt_files LIKE bapi_doc_files OCCURS 0 WITH HEADER LINE,
**.... Short texts
lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,
**.... Object links
lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
**----
ls_doc-documenttype = 'DRW'.
ls_doc-documentnumber = '4711'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-description = 'Transmission'.
ls_doc-laboratory = ''.
Set indicator for change relevance
ls_docx-description = 'X'.
ls_docX-laboratory = 'X'.
Insert object links
CLEAR lt_drad.
REFRESH lt_drad.
lt_drad-objecttype = 'MARA'.
lt_drad-objectkey = 'M0815'.
APPEND lt_drad.
**----
Change document
**----
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
EXPORTING: documenttype = ls_doc-documenttype
documentnumber = ls_doc-documentnumber
documentpart = ls_doc-documentpart
documentversion = ls_doc-documentversion
documentdata = ls_doc
documentdatax = ls_docx
IMPORTING: return = ls_return
TABLES: objectlinks = lt_drad.
Did an error occur ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Notes
In addition to the document data you can also change the following data:
Object links
Classification and characteristic valuations
Language dependent document descriptions
Document long texts
Document structures
Original application files
thanks
mrutyun^
10-02-2007 8:16 AM
Hi
Its given in the documentation part itself.The error I get reads like the knowledge provider is using the document type.I dnt understand this.