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: 

BAPI Doubt

Former Member
0 Kudos

Hi all,

I will be loading data for Real Estate using LSMW through BAPI's.

Here's my scenario--

Let's say I have identified couple of fields in the database table which are not there in the BAPI.

So, I need to add these fields in the BAPI.

I have gone through documents in SDN.

They say add the fields in BAPI Table extension.---

What is confusing to me is, if the field already exists in the database table; why should I Create a structure with these fields and then pass to the (ExtensionIn).

I need some clarity here please.

Any inputs are welcome.

Warm regards,

Hari Kiran.

5 REPLIES 5

Former Member
0 Kudos

It seems,

I need to create the structure in SE11 with the key field and the fields which I want to add to the BAPI.

Then in the BAPI, I need to pass this structure name to "ExtensionIn ".

That's it.

I am not adding the already exiting fields in the table to the table. I am only creating the structure with those fields and pass the structure name to the BAPI.

Regards,

Hari Kiran

0 Kudos

You are right, you should created one extension structure in SE11.

Each table can have only one table extension, please be sure with the name of the extension.

In import parameters of BAPI, there will be one parameter saying extensions required make it as 'X'.

In tables parameters there will be EXTENSIONIN and EXTENSIONOUT parameters where you can pass in and get out the data from the BAPI.Try to use VALUEPART1 to VALUEPART4 for data.

Inside the BAPI there will be 2 BADI's one at the starting for taking data from EXTENSIONIN and doing the required operation.

Second BADI at the end of the BAPI, for populating the EXTENSIONOUT parameter values, that will come out of the BAPI.

Outside the BAPI call, You can use the data from EXTENSIONOUT after the bapi call.

0 Kudos

hi Prasanth ,

Thank you for replying.

Here's my code which I have written in "Field mapping and conversion rules" step in LSMW for the BAPI.

'CI_VIBDAO'----> This is the structure created in SE11.

  • Target Field: E1BPPAREX-VALUEPART1 Data part of BAPI *extension paramet

*concatenate HSW-ZGISX

  • HSW-ZGISY HSW-ZDEED HSW-ZLAND

*HSW-ZSITE

*into E1BPPAREX-VALUEPART1

*separated by space.

DATA:

lt_extension_in TYPE TABLE OF bapiparex,

ls_extension_in TYPE bapiparex,

ls_ci_data TYPE REBD_ARCH_OBJECT_CI.

*ls_ci_data-structure = 'CI_VIBDAO'.

ls_ci_data-ZGISX = HSW-ZGISX.

ls_ci_data-ZGISY = HSW-ZGISY.

ls_ci_data-ZDEED = HSW-ZDEED.

ls_ci_data-ZLAND = HSW-ZLAND.

ls_ci_data-ZSITE = HSW-ZSITE.

ls_extension_in-structure = 'CI_VIBDAO'.

*ls_extension_in-valuepart1 = ls_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

OTHERS = 0.

  • APPEND ls_extension_in TO lt_extension_in.

E1BPPAREX-VALUEPART1 = ls_extension_in-valuepart1.

**move-corresponding ls_extension_in to E1BPPAREX.

**APPEND ls_extension_in TO E1BPPAREX.

**append E1BPPAREX.

Data is not getting populated.

Do I need to do anything else.??

Inputs please.

0 Kudos

Hi,

In my case I am using BAPI "BAPI_RE_AO_CREATE" , where it doesn't contain any check like "extension required".

Please let me know how to handle this.

0 Kudos

inputs please...