Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
ABAP developers can get SAP document flow for a sales document using ABAP function module SD_DOCUMENT_FLOW_GET. It is enough to call function module SD_DOCUMENT_FLOW_GET using document number of the target SAP Sales document as an input value for IV_DOCNUM parameter.
Here is the ABAP codes of an ABAP report which reads sales document number as an input from SAP user and then display document flow using ABAP function module SD_DOCUMENT_FLOW_GET
REPORT ZSD_DOCUMENT_FLOW_GET.
PARAMETERS gv_docno TYPE vbeln.
DATA :
gt_docflow TYPE TDT_DOCFLOW,
gs_docflow TYPE TDS_DOCFLOW.
CALL FUNCTION 'SD_DOCUMENT_FLOW_GET'
EXPORTING
IV_DOCNUM = gv_docno
* IV_ITEMNUM =
* IV_ALL_ITEMS =
* IV_SELF_IF_EMPTY = ' '
IMPORTING
ET_DOCFLOW = gt_docflow.
LOOP AT gt_docflow INTO gs_docflow.
WRITE :/
gs_docflow-DOCNUM,
gs_docflow-DESCRIPTION,
gs_docflow-ERDAT,
gs_docflow-STATUS.
ENDLOOP.
And here is the output of the above ABAP report