SAP Function Modules

BCONTACT_CREATE_ANSWER SAP Function module







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

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


Pattern for FM BCONTACT_CREATE_ANSWER - BCONTACT CREATE ANSWER





CALL FUNCTION 'BCONTACT_CREATE_ANSWER' "
  EXPORTING
    x_bpcontact_origin =        " bcont-bpcontact
*   x_xuse_iobjects = 'X'       " boole-boole
*   x_upd_online =              " bcontgen-upd_online
*   x_no_dialog =               " bcontgen-no_dialog
*   x_auto =                    " bpc01_bcontact_auto
*   x_prgcontext = SPACE        " bcontcfind-prgcontext  Call context - Program
*   x_subcontext = SPACE        " bcontcfind-subcontext  Call context - Subcontext
*   x_bpcconfig = SPACE         " bcontconf-bpcconfig  Contact configuration
  IMPORTING
    y_db_update =               " bcontgen-db_update
    y_new_bpcontact =           " bcont-bpcontact
    y_exit_type =               " bcontgen-exit_type
    y_new_bcont =               " bcont
    y_curfield =                " eeno_gen-feldname
* TABLES
*   y_new_bconto =              " bcont_obj
  EXCEPTIONS
    ORIGIN_NOT_FOUND = 1        "
    EXISTING = 2                "
    FOREIGN_LOCK = 3            "
    NUMBER_ERROR = 4            "
    GENERAL_FAULT = 5           "
    INPUT_ERROR = 6             "
    NOT_AUTHORIZED = 7          "
    .  "  BCONTACT_CREATE_ANSWER

ABAP code example for Function Module BCONTACT_CREATE_ANSWER





The ABAP code below is a full code listing to execute function module BCONTACT_CREATE_ANSWER 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_y_db_update  TYPE BCONTGEN-DB_UPDATE ,
ld_y_new_bpcontact  TYPE BCONT-BPCONTACT ,
ld_y_exit_type  TYPE BCONTGEN-EXIT_TYPE ,
ld_y_new_bcont  TYPE BCONT ,
ld_y_curfield  TYPE EENO_GEN-FELDNAME ,
it_y_new_bconto  TYPE STANDARD TABLE OF BCONT_OBJ,"TABLES PARAM
wa_y_new_bconto  LIKE LINE OF it_y_new_bconto .


SELECT single BPCONTACT
FROM BCONT
INTO @DATA(ld_x_bpcontact_origin).


DATA(ld_x_xuse_iobjects) = some text here

DATA(ld_x_upd_online) = some text here

DATA(ld_x_no_dialog) = some text here
DATA(ld_x_auto) = 'Check type of data required'.

SELECT single PRGCONTEXT
FROM BCONTCFIND
INTO @DATA(ld_x_prgcontext).


SELECT single SUBCONTEXT
FROM BCONTCFIND
INTO @DATA(ld_x_subcontext).


SELECT single BPCCONFIG
FROM BCONTCONF
INTO @DATA(ld_x_bpcconfig).


"populate fields of struture and append to itab
append wa_y_new_bconto to it_y_new_bconto. . CALL FUNCTION 'BCONTACT_CREATE_ANSWER' EXPORTING x_bpcontact_origin = ld_x_bpcontact_origin * x_xuse_iobjects = ld_x_xuse_iobjects * x_upd_online = ld_x_upd_online * x_no_dialog = ld_x_no_dialog * x_auto = ld_x_auto * x_prgcontext = ld_x_prgcontext * x_subcontext = ld_x_subcontext * x_bpcconfig = ld_x_bpcconfig IMPORTING y_db_update = ld_y_db_update y_new_bpcontact = ld_y_new_bpcontact y_exit_type = ld_y_exit_type y_new_bcont = ld_y_new_bcont y_curfield = ld_y_curfield * TABLES * y_new_bconto = it_y_new_bconto EXCEPTIONS ORIGIN_NOT_FOUND = 1 EXISTING = 2 FOREIGN_LOCK = 3 NUMBER_ERROR = 4 GENERAL_FAULT = 5 INPUT_ERROR = 6 NOT_AUTHORIZED = 7 . " BCONTACT_CREATE_ANSWER
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 ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "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_y_db_update  TYPE BCONTGEN-DB_UPDATE ,
ld_x_bpcontact_origin  TYPE BCONT-BPCONTACT ,
it_y_new_bconto  TYPE STANDARD TABLE OF BCONT_OBJ ,
wa_y_new_bconto  LIKE LINE OF it_y_new_bconto,
ld_y_new_bpcontact  TYPE BCONT-BPCONTACT ,
ld_x_xuse_iobjects  TYPE BOOLE-BOOLE ,
ld_y_exit_type  TYPE BCONTGEN-EXIT_TYPE ,
ld_x_upd_online  TYPE BCONTGEN-UPD_ONLINE ,
ld_y_new_bcont  TYPE BCONT ,
ld_x_no_dialog  TYPE BCONTGEN-NO_DIALOG ,
ld_y_curfield  TYPE EENO_GEN-FELDNAME ,
ld_x_auto  TYPE BPC01_BCONTACT_AUTO ,
ld_x_prgcontext  TYPE BCONTCFIND-PRGCONTEXT ,
ld_x_subcontext  TYPE BCONTCFIND-SUBCONTEXT ,
ld_x_bpcconfig  TYPE BCONTCONF-BPCCONFIG .


SELECT single BPCONTACT
FROM BCONT
INTO ld_x_bpcontact_origin.


"populate fields of struture and append to itab
append wa_y_new_bconto to it_y_new_bconto.

ld_x_xuse_iobjects = some text here

ld_x_upd_online = some text here

ld_x_no_dialog = some text here
ld_x_auto = 'Check type of data required'.

SELECT single PRGCONTEXT
FROM BCONTCFIND
INTO ld_x_prgcontext.


SELECT single SUBCONTEXT
FROM BCONTCFIND
INTO ld_x_subcontext.


SELECT single BPCCONFIG
FROM BCONTCONF
INTO ld_x_bpcconfig.

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