cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro - How to pass a single field value to BAPI table?

former_member199351
Active Participant
0 Kudos

Hello,

I have just come from WebDynpro ABAP training and being a novice hit my first issue right away.

I need to use BAPI - BAPI_CONTRACT_CREATEFROMDATA to create SD contract (I have used this BAPI to create a service call inside Webdynpro). I have two required fields: contract start and end dates. These fields passed in a table called CONTRACT_DATA_IN.

When I use the fields from the structures or individual fields, all I need to do is just put them on the view, and when I hit my submit button they will be passed to the BAPI. They are a part of COMPONENTCONTROLLER context (I have also mapped them in View context), but tables are obviously different.

Is there any way to pass data to tables as seamlessly without any code as for structures? Or do I need to write code to get the values from the input fields and then populate the table manually?

Thanks,

Alex

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199351
Active Participant
0 Kudos

Hi Lekha,

Thank you very much for your answer. I just want to double check what needs to be done.

I will create 2 input fields, then within the action method I will get the values of these fields and then will write the code to insert header record into CONTRACT_DATA_IN BAPI table.

And there is no other way to accomplish this?

Thanks,

Alex

Former Member
0 Kudos

Hi,

Single customer contract creation use the struture-

If you want to pass only one record then using the input fields for those 2 fields we can pass them to BAPI and then create the Customer Contract. This will work for only one record of customer contract.

then we can directly read these input fields and pass to BAPI.

Creating many customer contracts -

For example, If you want to provide the group of records at a time and then you want to create the cusotmer contracts for so many records then you fill these fields and pass them to table then pass this table to the tables parameters of that BAPI.

Here we need not create the Table UI element separate input fields would serve the purpose.

Now we can create the batch of contracts for N customers.

these input fields of a customer will be passed to table, then next set of input fields etc.

For this create the Table UI element and fill all the records and then pass it to the Tables of the BAPI.

Regards

Lekha