SAP Function Modules

BBP_IV_COMPANYCODE_GET SAP Function module - Get companycode







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

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


Pattern for FM BBP_IV_COMPANYCODE_GET - BBP IV COMPANYCODE GET





CALL FUNCTION 'BBP_IV_COMPANYCODE_GET' "Get companycode
  EXPORTING
    is_inv_header =             " bbp_iv_header  invoice header
*   iv_user =                   " baluser       Anwendungs-Log: Benutzername
*   iv_user_type =              " bbp_iv_user_type  Rolle des Users des Invoice-Szenarios
  IMPORTING
    ev_logsys_fi =              " logsys        Logisches System
    ev_cocode_dft =             " bbp_co_code   Buchungskreis im FI-System
* TABLES
*   et_cocode =                 " bbps_cocode   company code
*   it_partner =                " bbp_pds_partner  Geschäftspartner
  EXCEPTIONS
    WRONG_CALL = 1              "               Input parameter initial
    LOGSYS_NOT_FOUND = 2        "               Error while reading attributes
    COCODE_NOT_FOUND = 3        "               Error while reading attributes
    .  "  BBP_IV_COMPANYCODE_GET

ABAP code example for Function Module BBP_IV_COMPANYCODE_GET





The ABAP code below is a full code listing to execute function module BBP_IV_COMPANYCODE_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_ev_logsys_fi  TYPE LOGSYS ,
ld_ev_cocode_dft  TYPE BBP_CO_CODE ,
it_et_cocode  TYPE STANDARD TABLE OF BBPS_COCODE,"TABLES PARAM
wa_et_cocode  LIKE LINE OF it_et_cocode ,
it_it_partner  TYPE STANDARD TABLE OF BBP_PDS_PARTNER,"TABLES PARAM
wa_it_partner  LIKE LINE OF it_it_partner .

DATA(ld_is_inv_header) = 'Check type of data required'.
DATA(ld_iv_user) = 'Check type of data required'.
DATA(ld_iv_user_type) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_cocode to it_et_cocode.

"populate fields of struture and append to itab
append wa_it_partner to it_it_partner. . CALL FUNCTION 'BBP_IV_COMPANYCODE_GET' EXPORTING is_inv_header = ld_is_inv_header * iv_user = ld_iv_user * iv_user_type = ld_iv_user_type IMPORTING ev_logsys_fi = ld_ev_logsys_fi ev_cocode_dft = ld_ev_cocode_dft * TABLES * et_cocode = it_et_cocode * it_partner = it_it_partner EXCEPTIONS WRONG_CALL = 1 LOGSYS_NOT_FOUND = 2 COCODE_NOT_FOUND = 3 . " BBP_IV_COMPANYCODE_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 ELSEIF SY-SUBRC EQ 3. "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_ev_logsys_fi  TYPE LOGSYS ,
ld_is_inv_header  TYPE BBP_IV_HEADER ,
it_et_cocode  TYPE STANDARD TABLE OF BBPS_COCODE ,
wa_et_cocode  LIKE LINE OF it_et_cocode,
ld_ev_cocode_dft  TYPE BBP_CO_CODE ,
ld_iv_user  TYPE BALUSER ,
it_it_partner  TYPE STANDARD TABLE OF BBP_PDS_PARTNER ,
wa_it_partner  LIKE LINE OF it_it_partner,
ld_iv_user_type  TYPE BBP_IV_USER_TYPE .

ld_is_inv_header = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_cocode to it_et_cocode.
ld_iv_user = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_partner to it_it_partner.
ld_iv_user_type = 'Check type of data required'.

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 BBP_IV_COMPANYCODE_GET or its description.