REPORT zre_cont_cust_update.
data: COMPCODE2 LIKE BAPI_RE_BUS_ENTITY_KEY-COMP_CODE,
BNUMBER2 LIKE BAPI_RE_BUS_ENTITY_KEY-BUSINESS_ENTITY,
EXTENSION_IN2 type table of BAPIPAREX with header line,
RETURN2 type table of BAPIRET2 with header line.
parameters: p_comp2 LIKE BAPI_RE_BUS_ENTITY_KEY-COMP_CODE,
p_bno2 LIKE BAPI_RE_BUS_ENTITY_KEY-BUSINESS_ENTITY.
DATA: lt_extension_in TYPE TABLE OF bapiparex,
ls_extension_in TYPE bapiparex,
ls_ci_data TYPE rebd_business_entity_ci,
ls_ci_data1 TYPE REF TO ZCL_REBE_TABLE_EXT_EXM1,
LT_TABLE TYPE TABLE OF RE_T_EXT_DATA,
WA_TABLE LIKE LINE OF LT_TABLE.
* Fill values for user fields
ls_ci_data-ZPCS = 'X'.
ls_ci_data-ZPDATE = sy-datum + 1.
ls_ci_data-ZRSDATE = sy-datum + 10.
ls_ci_data-ZREDATE = sy-datum + 20.
ls_ci_data-ZAMOUNT = '1'.
* Prepare BAPI-parameter
ls_extension_in-structure = 'CI_DATA'.
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = ls_ci_data
IMPORTING
ex_container = ls_extension_in-valuepart1
EXCEPTIONS
illegal_parameter_type = 1
others = 2.
APPEND ls_extension_in TO lt_extension_in.
ls_extension_in-valuepart2 = '100'.
COMPCODE2 = p_Comp2.
BNUMBER2 = p_bno2.
** Call BAPI
CALL FUNCTION 'BAPI_RE_BE_CHANGE'
EXPORTING
compcode = COMPCODE2
businessentitynumber = BNUMBER2
tables
EXTENSION_IN = lt_extension_in
return = RETURN2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
No comments:
Post a Comment