SAP Function Modules

BUB_RELATION_GET SAP Function module







BUB_RELATION_GET 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 BUB_RELATION_GET into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM BUB_RELATION_GET - BUB RELATION GET





CALL FUNCTION 'BUB_RELATION_GET' "
  EXPORTING
    i_partner1 =                " but050-partner1  Business Partner 1
    i_partner2 =                " but050-partner2  Business Partner 2
*   i_date_to =                 " but050-date_to
*   i_date_from =               " but050-date_from
*   i_date_fix =                " bus050dfld-date_fix  Validity Key Date
    i_reltyp =                  " but050-reltyp  Relationship/Role Def.Category
    i_xrf =                     " but050-xrf
*   i_dftval =                  " but050-dftval  Differentiation Type Characteristic
*   i_rltyp =                   " but050-rltyp
*   i_xwa = SPACE               " boole-boole
*   i_xlm1 = SPACE              " boole-boole
*   i_xlm2 = SPACE              " boole-boole
  IMPORTING
    e_key =                     " bus05x_key
    e_relation =                " but050
    e_relation_ext =            " bub01_rel_admin_type
  EXCEPTIONS
    RELATION_NOT_FOUND = 1      "
    WRONG_PARAMETERS = 2        "               Wrong parameter
    .  "  BUB_RELATION_GET

ABAP code example for Function Module BUB_RELATION_GET





The ABAP code below is a full code listing to execute function module BUB_RELATION_GET 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:
ld_e_key  TYPE BUS05X_KEY ,
ld_e_relation  TYPE BUT050 ,
ld_e_relation_ext  TYPE BUB01_REL_ADMIN_TYPE .


SELECT single PARTNER1
FROM BUT050
INTO @DATA(ld_i_partner1).


SELECT single PARTNER2
FROM BUT050
INTO @DATA(ld_i_partner2).


SELECT single DATE_TO
FROM BUT050
INTO @DATA(ld_i_date_to).


SELECT single DATE_FROM
FROM BUT050
INTO @DATA(ld_i_date_from).


DATA(ld_i_date_fix) = 20210129

SELECT single RELTYP
FROM BUT050
INTO @DATA(ld_i_reltyp).


SELECT single XRF
FROM BUT050
INTO @DATA(ld_i_xrf).


SELECT single DFTVAL
FROM BUT050
INTO @DATA(ld_i_dftval).


SELECT single RLTYP
FROM BUT050
INTO @DATA(ld_i_rltyp).


DATA(ld_i_xwa) = some text here

DATA(ld_i_xlm1) = some text here

DATA(ld_i_xlm2) = some text here . CALL FUNCTION 'BUB_RELATION_GET' EXPORTING i_partner1 = ld_i_partner1 i_partner2 = ld_i_partner2 * i_date_to = ld_i_date_to * i_date_from = ld_i_date_from * i_date_fix = ld_i_date_fix i_reltyp = ld_i_reltyp i_xrf = ld_i_xrf * i_dftval = ld_i_dftval * i_rltyp = ld_i_rltyp * i_xwa = ld_i_xwa * i_xlm1 = ld_i_xlm1 * i_xlm2 = ld_i_xlm2 IMPORTING e_key = ld_e_key e_relation = ld_e_relation e_relation_ext = ld_e_relation_ext EXCEPTIONS RELATION_NOT_FOUND = 1 WRONG_PARAMETERS = 2 . " BUB_RELATION_GET
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "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_e_key  TYPE BUS05X_KEY ,
ld_i_partner1  TYPE BUT050-PARTNER1 ,
ld_e_relation  TYPE BUT050 ,
ld_i_partner2  TYPE BUT050-PARTNER2 ,
ld_e_relation_ext  TYPE BUB01_REL_ADMIN_TYPE ,
ld_i_date_to  TYPE BUT050-DATE_TO ,
ld_i_date_from  TYPE BUT050-DATE_FROM ,
ld_i_date_fix  TYPE BUS050DFLD-DATE_FIX ,
ld_i_reltyp  TYPE BUT050-RELTYP ,
ld_i_xrf  TYPE BUT050-XRF ,
ld_i_dftval  TYPE BUT050-DFTVAL ,
ld_i_rltyp  TYPE BUT050-RLTYP ,
ld_i_xwa  TYPE BOOLE-BOOLE ,
ld_i_xlm1  TYPE BOOLE-BOOLE ,
ld_i_xlm2  TYPE BOOLE-BOOLE .


SELECT single PARTNER1
FROM BUT050
INTO ld_i_partner1.


SELECT single PARTNER2
FROM BUT050
INTO ld_i_partner2.


SELECT single DATE_TO
FROM BUT050
INTO ld_i_date_to.


SELECT single DATE_FROM
FROM BUT050
INTO ld_i_date_from.


ld_i_date_fix = 20210129

SELECT single RELTYP
FROM BUT050
INTO ld_i_reltyp.


SELECT single XRF
FROM BUT050
INTO ld_i_xrf.


SELECT single DFTVAL
FROM BUT050
INTO ld_i_dftval.


SELECT single RLTYP
FROM BUT050
INTO ld_i_rltyp.


ld_i_xwa = some text here

ld_i_xlm1 = some text here

ld_i_xlm2 = 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 BUB_RELATION_GET or its description.