SAP ADD_IDOC_STATUS Function Module for Add status line to an existing Idoc









ADD_IDOC_STATUS is a standard add idoc status SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Add status line to an existing Idoc processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for add idoc status FM, simply by entering the name ADD_IDOC_STATUS into the relevant SAP transaction such as SE37 or SE38.

Function Group: ADSPCM06
Program Name: SAPLADSPCM06
Main Program: SAPLADSPCM06
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ADD_IDOC_STATUS pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'ADD_IDOC_STATUS'"Add status line to an existing Idoc
EXPORTING
I_EDIDC = "Control record (IDoc)
I_STATYP = "Type of system error message (A, W, E, S, I)
I_ROUTID = "Name of subroutine (routine, function module)
* I_STATUS = "Status of IDoc
* I_STAMNO = "Status message number
* I_STAPA1 = "Parameter 1
* I_STAPA2 = "Parameter 2
* I_STAPA3 = "Parameter 3
* I_STAPA4 = "Parameter 4
.



IMPORTING Parameters details for ADD_IDOC_STATUS

I_EDIDC - Control record (IDoc)

Data type: EDIDC
Optional: No
Call by Reference: Yes

I_STATYP - Type of system error message (A, W, E, S, I)

Data type: EDI_DS-STATYP
Optional: No
Call by Reference: Yes

I_ROUTID - Name of subroutine (routine, function module)

Data type: EDI_DS-ROUTID
Optional: No
Call by Reference: Yes

I_STATUS - Status of IDoc

Data type: EDI_DS-STATUS
Optional: Yes
Call by Reference: Yes

I_STAMNO - Status message number

Data type: EDI_DS-STAMNO
Optional: Yes
Call by Reference: Yes

I_STAPA1 - Parameter 1

Data type: EDI_DS-STAPA1
Optional: Yes
Call by Reference: Yes

I_STAPA2 - Parameter 2

Data type: EDI_DS-STAPA2
Optional: Yes
Call by Reference: Yes

I_STAPA3 - Parameter 3

Data type: EDI_DS-STAPA3
Optional: Yes
Call by Reference: Yes

I_STAPA4 - Parameter 4

Data type: EDI_DS-STAPA4
Optional: Yes
Call by Reference: Yes

Copy and paste ABAP code example for ADD_IDOC_STATUS Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_i_edidc  TYPE EDIDC, "   
lv_i_statyp  TYPE EDI_DS-STATYP, "   
lv_i_routid  TYPE EDI_DS-ROUTID, "   
lv_i_status  TYPE EDI_DS-STATUS, "   
lv_i_stamno  TYPE EDI_DS-STAMNO, "   
lv_i_stapa1  TYPE EDI_DS-STAPA1, "   
lv_i_stapa2  TYPE EDI_DS-STAPA2, "   
lv_i_stapa3  TYPE EDI_DS-STAPA3, "   
lv_i_stapa4  TYPE EDI_DS-STAPA4. "   

  CALL FUNCTION 'ADD_IDOC_STATUS'  "Add status line to an existing Idoc
    EXPORTING
         I_EDIDC = lv_i_edidc
         I_STATYP = lv_i_statyp
         I_ROUTID = lv_i_routid
         I_STATUS = lv_i_status
         I_STAMNO = lv_i_stamno
         I_STAPA1 = lv_i_stapa1
         I_STAPA2 = lv_i_stapa2
         I_STAPA3 = lv_i_stapa3
         I_STAPA4 = lv_i_stapa4
. " ADD_IDOC_STATUS




ABAP code using 7.40 inline data declarations to call FM ADD_IDOC_STATUS

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single STATYP FROM EDI_DS INTO @DATA(ld_i_statyp).
 
"SELECT single ROUTID FROM EDI_DS INTO @DATA(ld_i_routid).
 
"SELECT single STATUS FROM EDI_DS INTO @DATA(ld_i_status).
 
"SELECT single STAMNO FROM EDI_DS INTO @DATA(ld_i_stamno).
 
"SELECT single STAPA1 FROM EDI_DS INTO @DATA(ld_i_stapa1).
 
"SELECT single STAPA2 FROM EDI_DS INTO @DATA(ld_i_stapa2).
 
"SELECT single STAPA3 FROM EDI_DS INTO @DATA(ld_i_stapa3).
 
"SELECT single STAPA4 FROM EDI_DS INTO @DATA(ld_i_stapa4).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!