SAP TR_SE_POSTING_DOCUMENT_REVERSE Function Module for TR-TM-SE: Reverse a Securities Posting Document









TR_SE_POSTING_DOCUMENT_REVERSE is a standard tr se posting document reverse SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for TR-TM-SE: Reverse a Securities Posting Document 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 tr se posting document reverse FM, simply by entering the name TR_SE_POSTING_DOCUMENT_REVERSE into the relevant SAP transaction such as SE37 or SE38.

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



Function TR_SE_POSTING_DOCUMENT_REVERSE 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 'TR_SE_POSTING_DOCUMENT_REVERSE'"TR-TM-SE: Reverse a Securities Posting Document
EXPORTING
I_REVERSAL_TYPE = "Storno nur im Nebenbuch oder FI + WP
I_REVERSAL_REASON = "Reversal reason
I_BUDAT = "Posting Date for Reversal
I_STO_DOCFI = "FI-Storno-Belegnummer
I_STO_GJAHR = "FI-Storno-Beleg Geschäftsjahr
I_STO_PERIOD = "FI-Periode für Storno

CHANGING
C_VWPOSTDOC = "zu stornierender Wertpapier-Buchungsbeleg

EXCEPTIONS
DOCUMENT_ALREADY_REVERSED = 1 WRONG_REVERSAL_TYPE = 2
.



IMPORTING Parameters details for TR_SE_POSTING_DOCUMENT_REVERSE

I_REVERSAL_TYPE - Storno nur im Nebenbuch oder FI + WP

Data type: I
Optional: No
Call by Reference: No ( called with pass by value option)

I_REVERSAL_REASON - Reversal reason

Data type: TZST-SSTOGRD
Optional: No
Call by Reference: No ( called with pass by value option)

I_BUDAT - Posting Date for Reversal

Data type: VWPOSTDOC-STO_BUDAT
Optional: No
Call by Reference: No ( called with pass by value option)

I_STO_DOCFI - FI-Storno-Belegnummer

Data type: VWPOSTDOC-STO_DOCFI
Optional: No
Call by Reference: No ( called with pass by value option)

I_STO_GJAHR - FI-Storno-Beleg Geschäftsjahr

Data type: VWPOSTDOC-STO_GJAHR
Optional: No
Call by Reference: No ( called with pass by value option)

I_STO_PERIOD - FI-Periode für Storno

Data type: VWPOSTDOC-STO_PERIOD
Optional: No
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for TR_SE_POSTING_DOCUMENT_REVERSE

C_VWPOSTDOC - zu stornierender Wertpapier-Buchungsbeleg

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

EXCEPTIONS details

DOCUMENT_ALREADY_REVERSED - WP-Buchungsbeleg ist bereits storniert

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_REVERSAL_TYPE - Kein erlaubter Storno-Typ mitgegeben

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for TR_SE_POSTING_DOCUMENT_REVERSE 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_c_vwpostdoc  TYPE VWPOSTDOC, "   
lv_i_reversal_type  TYPE I, "   
lv_document_already_reversed  TYPE I, "   
lv_i_reversal_reason  TYPE TZST-SSTOGRD, "   
lv_wrong_reversal_type  TYPE TZST, "   
lv_i_budat  TYPE VWPOSTDOC-STO_BUDAT, "   
lv_i_sto_docfi  TYPE VWPOSTDOC-STO_DOCFI, "   
lv_i_sto_gjahr  TYPE VWPOSTDOC-STO_GJAHR, "   
lv_i_sto_period  TYPE VWPOSTDOC-STO_PERIOD. "   

  CALL FUNCTION 'TR_SE_POSTING_DOCUMENT_REVERSE'  "TR-TM-SE: Reverse a Securities Posting Document
    EXPORTING
         I_REVERSAL_TYPE = lv_i_reversal_type
         I_REVERSAL_REASON = lv_i_reversal_reason
         I_BUDAT = lv_i_budat
         I_STO_DOCFI = lv_i_sto_docfi
         I_STO_GJAHR = lv_i_sto_gjahr
         I_STO_PERIOD = lv_i_sto_period
    CHANGING
         C_VWPOSTDOC = lv_c_vwpostdoc
    EXCEPTIONS
        DOCUMENT_ALREADY_REVERSED = 1
        WRONG_REVERSAL_TYPE = 2
. " TR_SE_POSTING_DOCUMENT_REVERSE




ABAP code using 7.40 inline data declarations to call FM TR_SE_POSTING_DOCUMENT_REVERSE

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 SSTOGRD FROM TZST INTO @DATA(ld_i_reversal_reason).
 
 
"SELECT single STO_BUDAT FROM VWPOSTDOC INTO @DATA(ld_i_budat).
 
"SELECT single STO_DOCFI FROM VWPOSTDOC INTO @DATA(ld_i_sto_docfi).
 
"SELECT single STO_GJAHR FROM VWPOSTDOC INTO @DATA(ld_i_sto_gjahr).
 
"SELECT single STO_PERIOD FROM VWPOSTDOC INTO @DATA(ld_i_sto_period).
 


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!