cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Tables as Input to BAPI

sunilachyut
Contributor
0 Kudos

Hello

Am trying to implement search help for 3 different fields (Plant, Shipping Condition, and SCAC Code) in my model. I have created a data service for these in SAP R/3 and am populating these in 3 different tables in the model. All the tables are tied to an event and when it is triggered all the selected table rows is sent to the BAPI. All the data is sent to the BAPI but, it is sent 3 times once for every field when the event is triggered causing blanking out the returned dataset when the event is triggered second and third time (the system is triggering the second and third time automatically). Is there a way we can avoid triggering the event for every single field and send all the data only once, if so would appreciate any help in this regard.

Thanks

Sunil Achyut

Accepted Solutions (0)

Answers (2)

Answers (2)

sunilachyut
Contributor
0 Kudos

Hi Navneet

Thanks for the reply. The following is how I have modelled my process:

1) Call a BAPI to get the possible values for 3 different fields.

2) Defined a Layer and added the populated all the three fields using a Table View for each field with option to select multiple values.

3) Defined an event that gets triggered with a Custom Action ie., a Submit button (EvtGetDetails is the event name).

4) To send the selected values of 3 fields to the BAPI I added the event *EvtGetDetails with mapping scope of sending only the selected data rows.

5) When the event is triggered ie., the Submit button is pressed the BAPI is being called 3 times, once for each field instead of only once. The second and third call are blanking out the data returned in the first call to the BAPI.

Is there a way to avoid the second and third call to the BAPI.

Thanks

Sunil Achyut

Former Member
0 Kudos

Hi Sunil

You can use the UNION (if the table have the same output) or Combine (for table that have different field) in additionnal Operators under the Compose Panel. Basically the UNION of 2 table view as input and 1 table View as output. You have to choose a key to determine how the table are to be combined.

I hope this helps.

Also please go through this link:-

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/combining%2btwo%2btables%2c%2bbapis%2bor%2bque...

Message was edited by:

Navneet Giria

sunilachyut
Contributor
0 Kudos

Navneet,

Thanks for your reply but, for the problem that I have I dont think using the UNION operator will help. All the 3 fields in my case are different and all the three have to be sent to the BAPI. The only problem that I am facing is BAPI is getting invoked 3 times instead of one.

Thanks

Sunil Achyut

sunilachyut
Contributor
0 Kudos

I was able to resolve it. The following is what I had in my layer 3 table views (returns from the function module) and a Date form (with date and submit button). I had dragged the table views first and then defined the date form and added the events. The Submit event was tied to the Date form. When I did it this way it the function module was getting invoked 4 times, once for each table view and once for the form.

I deleted everything in the layer and redefined the fields, only this time I defined the Date form first and then add the table views for the 3 fields and voila it worked, the function module was invoked only once per event. Am sure this is a bug that SAP has to fix.

Thanks

Sunil Achyut

Former Member
0 Kudos

Hi Sunil

Could you please elaborate as to how have you modelled it in VC?

The picture is not very clear.

Regards

Navneet