cancel
Showing results for 
Search instead for 
Did you mean: 

multiple inserts

Former Member
0 Kudos

Hi

I have to create one structure which will take airline as input and will produce output as air-from and air-to ,but this thing i want show in table which will take airline as i/p field and on the button click of Go it will show air-from and air-to in the same table

one more thing is i should be able to enter multiple airline in multiple rows and corr values should get displayed for o/p param

please do the needful

thanks

prajakta

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

But in ABAP function module that airline can accept differnt i/p say

AA

ABC

PP

that means we should be able to give all the values at a time

thanks

prajakta

Former Member
0 Kudos

If it accpets multiple inputs then there needs to a be a table defined in your Tables tab in FM. Just see the logic of your FM and confirm which is the table that is used as an input.

You would find a node for that tablename in your WD under input node. Just fill in the node as being told by me in the previous reply and execute the BAPI.

Regards,

Murtuza

Former Member
0 Kudos

Hi

now it is enabling 2 rows of the table.

i have written the following code in search view init method, which i got on sdn.

the ans was there also given by u only

but on click of submit button .it is not showing o/p values in table.

it displays empty table.

so i tried to write the code in controller

but then it again enables the single row of the table.

so how will i get values now.

Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();

IPrivateFcust.IBapi_Flight_Getlist_InputElement ele = null;

for(int i=0;i<5;i++)

{

ele = wdContext.createBapi_Flight_Getlist_InputElement(input);

wdContext.nodeBapi_Flight_Getlist_Input().addElement(ele);

}

thanks

prajakta

Former Member
0 Kudos

HI,

Which is the node that you have binded to the input table and the node that you have binded to the output table.

Regards,

Murtuza

Former Member
0 Kudos

Hi

thanks a lot ,the app is running now.

it is giving output also

but just resolve my problem of enabling the other rows

means it is right now taking only for first row and second row,but please help for 3,4,5....

thanks a lot again

prajakta

Former Member
0 Kudos

Hi,

You can create an Add button that adds an empty row to your table

IPrivate<viewname>.I<input table node>Element ele = wdContext.node<input table node>().create<input table node>Element();

You will get an empty row in your table.

Regards,

Murtuza

Former Member
0 Kudos

Hi

i have written this code to add button but no difference ,it is taking values for 2 rows only.

ican enter value for first row then after i enter value for second row then after when i click on 3rd row ,the table becomes of 2 rows only.

what should i do?

thanks

prajakta

Former Member
0 Kudos

Hi,

what is the number of visible rows you have set for your Table UI element.

Regards,

Murtuza

Former Member
0 Kudos

Hi

when i click on third row the table becomes of 2 ros only and i cannot insert values for other rows

add button is also not wrkg.i have added this code given by you on add btn

please rply wat should i do?

thanks

prajakta

Former Member
0 Kudos

Hi,

5 and in loop i have given (i<5)

thanks

prajakta

Former Member
0 Kudos

As far as I understand.

You have a table UI element with its visible row count set to 5 and input field as your cell editor.

You are getting 2 rows as enabled.

You have added a button and written the code being given by me.

If you are following these steps then you should ideally get an additional row whenever you click on the add button.

Also, cofirm are you writing any code in your WDDoModify view. If yes then please paste your code here.

Regards,

Murtuza

Former Member
0 Kudos

Hi

no i havn't written any code in WDDoModify().

only writting that much code on add button is sufficient?

thanks

prajakta

Former Member
0 Kudos

Hi

its working now.

but my major task is to insert multiple rows.here i can input only 1 value but i have to insert number of values for the same attribute in the form of number of rows

thanks

prajakta

Former Member
0 Kudos

Hi,

If your input is a table then you would find a node with the name of the table defined in your FM within your input node.

Instantiate an object of that node and add all the values to that node that you need to pass.

Finally set this node to your inputnode.

Then execute your BAPI.

Regards,

Murtuza

Former Member
0 Kudos

Hi

Sorry i am not getting the steps ,will u please explain again,

see here in search view i have only one attr and structure is like,

context:

Bapi_input_node

airline_attr

now in webdynpro i have created one table in search view so that i can give airline no multiple times in multiple rows and on the click of one submit button,it will go to other view giving description for every airline no i entered.

thanks

prajakta

Former Member
0 Kudos

Hi,

Bapi_input_node

airline_attr

As being told by you, you have only one attribute in your input node then you can't pass multiple values to it as your BAPI accepts a single parameter.

If you need to pass multiple parameters to your BAPI then you need to change your BAPI so that it accepts table as input and not a single value.

Hope, it's clear now

Regards,

Murtuza

Former Member
0 Kudos

Hi

I have created two views.

in one view the table takes input as airline

another table should show op attributes

but on click of sub button table appears but no values inside

Former Member
0 Kudos

Hi Prajakta,

have u checked the size of output node?? if its not returning any values,check whether data is available in backend. If its available try to debug it with r/3 system or u can paste the code here,so we can check it.

regards

Sumit

Former Member
0 Kudos

Hi,

1. Check the size of the output node so that you wil get to know what is the output returned(it should be >0 if there is some output returned).

2. You are passing valid values to your BAPI.

3. Check that you have binded the output table to the output node within your input node.

Regards,

Murtuza

Former Member
0 Kudos

Hi Prajakta,

One personal suggestion that I would like to give you is you can have 2 different tables for input and output because user should know for which input is he getting the output. If you overwrite the input with output he would be unaware of that.

I am giving you the basic steps for model creation.

follow these steps:

1.Create a new WD Project.

2. Right click on models and select create model.

3. Select import Adaptive RFC Model.

3. Give any name and package to your model.

select WD_MODELDATA_DEST/or if you have defined any other name for

your JCo destination for default logical system name for model instances.

select WD_RFC_METADATA_DEST /or if you have defined any other

name for your JCo destination for default logical system name for RFC

metadata.

4. Select single server/Load Balancing as per your system.

Give name, system number, client, logon name, password and language of

your R/3 system.

5. Search for the BAPI name and select the BAPI on search and click NEXT.

You have imported RFC Model by this time.

Now create a WD component and then you will find Used Models. Select the name of the model just created above.

6. Open Data Modeler(Right Click on your component name and select Open Data Modeler). Do mapping here from model to controller and from controller to view as per your requirement.

7. To execute BAPI create an element of the input node of your BAPI, set any parameters if required and bind it again to the input node.

say if name of your input node is input

IPrivate<viewname>.IinputElement element = wdContext.nodeInput().createInputElement();

element.set<parametername>("<value>");

wdContext.nodeInput().bind(element);

8. Last step is to execute BAPI

try

{

wdContext.currentInputElement().modelObject().execute();

//say name of your output node is output

wdContext.nodeOutput().invalidate();

}

Bind your output node the one that is found inside the input node to table or other UI element so that you can see the result of the BAPI after its execution.

If you have further doubt then do write to me.

Also, if you want the output in the same table then at runtime you need to change the binding of your table.

NOTE: I have not mentioned the steps for JCO destinations.

Regards,

Murtuza