SAP Function Modules

RH_GET_COMPANY_CANCELLATION SAP Function module







RH_GET_COMPANY_CANCELLATION is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RH_GET_COMPANY_CANCELLATION into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: RHV3
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RH_GET_COMPANY_CANCELLATION - RH GET COMPANY CANCELLATION





CALL FUNCTION 'RH_GET_COMPANY_CANCELLATION' "
* EXPORTING
*   begda = '19000101'          " p1001-begda
*   endda = '99991231'          " p1001-endda
*   istat = ' '                 " p1001-istat
*   evtyp =                     " plog-objid
*   reason =                    " t77car-caatr
*   auth_sobid = SPACE          "
  TABLES
    company_tab =               " hrsobid
    company_stor_tab =          " hrvpstor
*   infotype_1001 =             " hri1001
  EXCEPTIONS
    WRONG_OTYPE = 1             "
    .  "  RH_GET_COMPANY_CANCELLATION

ABAP code example for Function Module RH_GET_COMPANY_CANCELLATION





The ABAP code below is a full code listing to execute function module RH_GET_COMPANY_CANCELLATION including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_company_tab  TYPE STANDARD TABLE OF HRSOBID,"TABLES PARAM
wa_company_tab  LIKE LINE OF it_company_tab ,
it_company_stor_tab  TYPE STANDARD TABLE OF HRVPSTOR,"TABLES PARAM
wa_company_stor_tab  LIKE LINE OF it_company_stor_tab ,
it_infotype_1001  TYPE STANDARD TABLE OF HRI1001,"TABLES PARAM
wa_infotype_1001  LIKE LINE OF it_infotype_1001 .


DATA(ld_begda) = 20210129

DATA(ld_endda) = 20210129

DATA(ld_istat) = some text here

SELECT single OBJID
FROM PLOG
INTO @DATA(ld_evtyp).


SELECT single CAATR
FROM T77CAR
INTO @DATA(ld_reason).

DATA(ld_auth_sobid) = 'some text here'.

"populate fields of struture and append to itab
append wa_company_tab to it_company_tab.

"populate fields of struture and append to itab
append wa_company_stor_tab to it_company_stor_tab.

"populate fields of struture and append to itab
append wa_infotype_1001 to it_infotype_1001. . CALL FUNCTION 'RH_GET_COMPANY_CANCELLATION' * EXPORTING * begda = ld_begda * endda = ld_endda * istat = ld_istat * evtyp = ld_evtyp * reason = ld_reason * auth_sobid = ld_auth_sobid TABLES company_tab = it_company_tab company_stor_tab = it_company_stor_tab * infotype_1001 = it_infotype_1001 EXCEPTIONS WRONG_OTYPE = 1 . " RH_GET_COMPANY_CANCELLATION
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_begda  TYPE P1001-BEGDA ,
it_company_tab  TYPE STANDARD TABLE OF HRSOBID ,
wa_company_tab  LIKE LINE OF it_company_tab,
ld_endda  TYPE P1001-ENDDA ,
it_company_stor_tab  TYPE STANDARD TABLE OF HRVPSTOR ,
wa_company_stor_tab  LIKE LINE OF it_company_stor_tab,
ld_istat  TYPE P1001-ISTAT ,
it_infotype_1001  TYPE STANDARD TABLE OF HRI1001 ,
wa_infotype_1001  LIKE LINE OF it_infotype_1001,
ld_evtyp  TYPE PLOG-OBJID ,
ld_reason  TYPE T77CAR-CAATR ,
ld_auth_sobid  TYPE STRING .


ld_begda = 20210129

"populate fields of struture and append to itab
append wa_company_tab to it_company_tab.

ld_endda = 20210129

"populate fields of struture and append to itab
append wa_company_stor_tab to it_company_stor_tab.

ld_istat = some text here

"populate fields of struture and append to itab
append wa_infotype_1001 to it_infotype_1001.

SELECT single OBJID
FROM PLOG
INTO ld_evtyp.


SELECT single CAATR
FROM T77CAR
INTO ld_reason.

ld_auth_sobid = 'some text here'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RH_GET_COMPANY_CANCELLATION or its description.