SAP Function Modules

BAPI_BUPR_RELATIONSHIP_CHANGE SAP Function module - SAP BP, BAPI: Change General Relationship







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

Associated Function Group: BUBA_3
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_BUPR_RELATIONSHIP_CHANGE - BAPI BUPR RELATIONSHIP CHANGE





CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CHANGE' "SAP BP, BAPI: Change General Relationship
  EXPORTING
    businesspartner1 =          " bapibus1006_head-bpartner  Business Partner 1
    businesspartner2 =          " bapibus1006_head-bpartner  Business Partner 2
    relationshipcategory =      " but050-reltyp  Business Partner Relationship Category
*   validfromdate = SY-DATLO    " bapibus1006002_header-validfromdate  Validity Interval: Valid From
*   validuntildate = '99991231'  " bapibus1006002_header-validuntildate  Validity Interval: Valid To
*   differentiationtypevalue =   " but050-dftval
*   validfromdatenew =          " bapibus1006002_header-validfromdate  Validity Interval: Valid From, New
*   validuntildatenew =         " bapibus1006002_header-validuntildate  Validity Interval: Valid To, New
*   relationshiptypenew =       " but050-relkind  Business Partner Relationship Type New
*   datefromx =                 " boole-boole   Update Flag
*   datetox =                   " boole-boole   Update Flag
*   relationtypex =             " boole-boole   Update Flag
*   xdfrel =                    " but050-xdfrel
*   xdfrelx =                   " boole-boole
* TABLES
*   return =                    " bapiret2      Messages
    .  "  BAPI_BUPR_RELATIONSHIP_CHANGE

ABAP code example for Function Module BAPI_BUPR_RELATIONSHIP_CHANGE





The ABAP code below is a full code listing to execute function module BAPI_BUPR_RELATIONSHIP_CHANGE 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_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


DATA(ld_businesspartner1) = some text here

DATA(ld_businesspartner2) = some text here

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


DATA(ld_validfromdate) = 20210129

DATA(ld_validuntildate) = 20210129

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


DATA(ld_validfromdatenew) = 20210129

DATA(ld_validuntildatenew) = 20210129

SELECT single RELKIND
FROM BUT050
INTO @DATA(ld_relationshiptypenew).


DATA(ld_datefromx) = some text here

DATA(ld_datetox) = some text here

DATA(ld_relationtypex) = some text here

SELECT single XDFREL
FROM BUT050
INTO @DATA(ld_xdfrel).


DATA(ld_xdfrelx) = some text here

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CHANGE' EXPORTING businesspartner1 = ld_businesspartner1 businesspartner2 = ld_businesspartner2 relationshipcategory = ld_relationshipcategory * validfromdate = ld_validfromdate * validuntildate = ld_validuntildate * differentiationtypevalue = ld_differentiationtypevalue * validfromdatenew = ld_validfromdatenew * validuntildatenew = ld_validuntildatenew * relationshiptypenew = ld_relationshiptypenew * datefromx = ld_datefromx * datetox = ld_datetox * relationtypex = ld_relationtypex * xdfrel = ld_xdfrel * xdfrelx = ld_xdfrelx * TABLES * return = it_return . " BAPI_BUPR_RELATIONSHIP_CHANGE
IF SY-SUBRC EQ 0. "All OK 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_businesspartner1  TYPE BAPIBUS1006_HEAD-BPARTNER ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_businesspartner2  TYPE BAPIBUS1006_HEAD-BPARTNER ,
ld_relationshipcategory  TYPE BUT050-RELTYP ,
ld_validfromdate  TYPE BAPIBUS1006002_HEADER-VALIDFROMDATE ,
ld_validuntildate  TYPE BAPIBUS1006002_HEADER-VALIDUNTILDATE ,
ld_differentiationtypevalue  TYPE BUT050-DFTVAL ,
ld_validfromdatenew  TYPE BAPIBUS1006002_HEADER-VALIDFROMDATE ,
ld_validuntildatenew  TYPE BAPIBUS1006002_HEADER-VALIDUNTILDATE ,
ld_relationshiptypenew  TYPE BUT050-RELKIND ,
ld_datefromx  TYPE BOOLE-BOOLE ,
ld_datetox  TYPE BOOLE-BOOLE ,
ld_relationtypex  TYPE BOOLE-BOOLE ,
ld_xdfrel  TYPE BUT050-XDFREL ,
ld_xdfrelx  TYPE BOOLE-BOOLE .


ld_businesspartner1 = some text here

"populate fields of struture and append to itab
append wa_return to it_return.

ld_businesspartner2 = some text here

SELECT single RELTYP
FROM BUT050
INTO ld_relationshipcategory.


ld_validfromdate = 20210129

ld_validuntildate = 20210129

SELECT single DFTVAL
FROM BUT050
INTO ld_differentiationtypevalue.


ld_validfromdatenew = 20210129

ld_validuntildatenew = 20210129

SELECT single RELKIND
FROM BUT050
INTO ld_relationshiptypenew.


ld_datefromx = some text here

ld_datetox = some text here

ld_relationtypex = some text here

SELECT single XDFREL
FROM BUT050
INTO ld_xdfrel.


ld_xdfrelx = 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 BAPI_BUPR_RELATIONSHIP_CHANGE or its description.