Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Passing Customer Specific Fields in BAPI

Former Member
0 Kudos
587

Dear All,

Background -  Recently we Upgraded our system from ECC 6.0 to ECC 6.0 EHP6, After the Upgrade BAPI_RE_RO_CREATE stopped working and causing Short Dump after calling BAPI_TRANSACTION_COMMIT, which is called after the BAPI_RE_RO_CREATE. The Short Dump states that DBIF_RSQL_INVALID_RSQL in Program SAPLREDB_VIBDRO_UPDATE and in the line. -  INSERT vibdro FROM TABLE gt_buffer_i  ACCEPTING DUPLICATE KEYS. This BAPI is working fine without any issue in the non-upgraded system.

Issue Cause :  I am using  BAPI_RE_RO_CREATE to create a Rental Object, In this BAPI I am passing the Customer Specific Fields using the Parameter  extension_in. Since I am in uni-code system I am using  CL_ABAP_CONTAINER_UTILITIES to fill the additional fields. The BAPI Return parameter is returning the Rental Object number but as soon as the  BAPI_TRANSACTION_COMMIT  is called it is popping up the "Update was Terminated" Message with the above dump in ST22. But when i don't pass the parameter extension_in then everything is working fine. The same BAPI with parameter extension_in is working fine without any issue in the non-upgraded system.

I have checked everything but not able to find the root cause. Please advice.

Source Code:

REPORT zretest.

TYPE-POOLS: rebd1.

DATA:

   ls_bapi_ro              TYPE bapi_re_rental_object_dat,

   ld_compcode             TYPE bapi_re_rental_object_key-comp_code,

   ld_businessentitynumber TYPE bapi_re_rental_object_key-business_entity,

   ld_rentalobjectnumber   TYPE bapi_re_rental_object_key-rental_object,

   lt_bapi_error           TYPE bapirettab.

DATA : lt_extension_in  TYPE STANDARD TABLE OF bapiparex.

DATA :ls_cidata  TYPE ci_vibdro.

DATA : ls_extension_in TYPE bapiparex.

*Basic Data

ls_bapi_ro-rental_object_text = 'Tim Houtins Cafe Kiosk'.

ls_bapi_ro-building = '10001'.

ls_bapi_ro-floor = '109'.

*>>>> Additional Fields

ls_cidata-zzfar           = '5'.

ls_cidata-zzbuild         = 'G+M+3P+30'.

ls_cidata-zzpod_height    = '1000'.

ls_cidata-zzbuild_height  = '2100'.

ls_cidata-zzcomnencedt    = '20140101'.

ls_cidata-zzcompletiondt  = '20140101'.

ls_cidata-zzremarks       = 'Remarks'.

*--- Fill the additional fields using the class 'CL_ABAP_CONTAINER_UTILITIES'

ls_extension_in-structure       = 'CI_DATA'.

CALL METHOD cl_abap_container_utilities=>fill_container_c

   EXPORTING

     im_value               = ls_cidata

   IMPORTING

     ex_container           = ls_extension_in-valuepart1

   EXCEPTIONS

     illegal_parameter_type = 1

     OTHERS                 = 2.

APPEND ls_extension_in TO lt_extension_in.        " Table for additional data

CALL FUNCTION 'BAPI_RE_RO_CREATE'

   EXPORTING

     comp_code_ext              = '1200'

     business_entity_number_ext = '115'

     rental_object_type         = 'RS'

     usage_type                 = '1001'

     pool_space_number_ext      = '1'

     rental_object              = ls_bapi_ro

*   test_run                   = 'X'

   IMPORTING

     compcode                   = ld_compcode

     businessentitynumber       = ld_businessentitynumber

     rentalobjectnumber         = ld_rentalobjectnumber

   TABLES

     extension_in               = lt_extension_in

     return                     = lt_bapi_error.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' . " Calling commit work for BAPI

WRITE : ld_rentalobjectnumber.

2 REPLIES 2

Former Member
0 Kudos
222

Hi - did you ever raise this with SAP themselves (I have searched OSS for the same problem without success)

jordi_escodaruiz
Active Participant
0 Kudos
222

Hi Ibrahim,

Today I faced the same problem.

Sure it's late for you, but anyway I document the solution.

You declared ls_cidata as:

DATA :ls_cidata  TYPE ci_vibdro.


ls_cidata should be declared as:

DATA :ls_cidata  TYPE REBD_RENTAL_OBJECT_CI.


Reason: BAPI_RE_RO_CREATE has the macro mac_bapi_conv_extension_cre which calls to FM CONV_FROM_RE_T_EXT_IN, where the parameter type any is informed with ls_ci_data type rebd_rental_object_ci


Best regards

Jordi