Functionality You use this method to set a new status for a document. You can usefield STATUSLOG> to make an entry in the status log field.Notes The system specifies the internal or external status. The internalstatus is the status in the database. The external status is what theuser sees on the user interface, and depends on the logon language. If the internal status is specified, this has priority. Otherwise, thesystem reads the internal status that corresponds to the external statuskey. Example Example program> *************> **Define variables required> ************> DATA: lf_doctype LIKE bapi_doc_draw-documenttype, lf_docnumber LIKE bapi_doc_draw-documentnumber, lf_docpart LIKE bapi_doc_draw-documentpart, lf_docversion LIKE bapi_doc_draw-documentversion, lf_statusextern LIKE bapi_doc_draw-statusextern, lf_statusintern LIKE bapi_doc_draw-statusintern, lf_statuslog LIKE bapi_doc_draw-statuslog. ** BAPI return structure DATA: ls_return LIKE bapiret2. ********************************************> ** Assign document data> ** The status of this document is to be changed> ******************************************> lf_docnumber = 'DOKUMENTNUMMER'. lf_doctype = 'DRW'. lf_docversion = '00'. lf_docpart = '000'. lf_statusintern = 'AR'. **********************************> **Call BAPI> **********************************> CALL FUNCTION 'BAPI_DOCUMENT_SETSTATUS' EXPORTING: documenttype = lf_doctype documentnumber = lf_docnumber documentpart = lf_docpart documentversion = lf_docversion statusextern = lf_statusextern statusintern = lf_statusintern statuslog = lf_statuslog IMPORTING: return = ls_return. ** Any errors?> IF ls_return-type CA 'EA'. ROLLBACK WORK. MESSAGE ID '26' TYPE 'I' NUMBER '000' WITH ls_return-message. ELSE. COMMIT WORK. ENDIF.Description Return structure for messages Description New (external) status abbreviation for the document If the internal status is transferred, this always has priority over the external status abbreviation. Description New (internal) status for the document. If the internal status is transferred, this always has priority over the external status abbreviation. Description Entry in status log |