on 04-25-2005 4:17 PM
Hello,
I'm executing a BAPI_XX_GETLIST with multiple "Tables" selected with the REQUESTEDTABLESX import parameter. What is the best way to combine/merge data from multiple "Tables" and bind them into a single webdynpro UI Table?
Thanks.
Hi Yakima
If your requirement is that some columns in table1 and some columns in table2 then
1. create a table ui element.
2. Add columns manually and bind them to the RFC table columns you like.
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore,
Can you give me some code sample?
If I bind all columns from table 1 and add one column from table 2, the result UI table will have repeating value of the column from table 2.
I might need to tie the primary key of each BAPI tables and create a new structured context with merged columns to fill the UI table.
Thanks.
Hi Yakima,
To elabrate on this, add a value node to ur first table structure with cardinality 1:1. And add a value attribute. Create a supply function for the value node. Set the value attribute with the data based on the primark key.
In the UI table add another column and bind it to the new value attribute.
IPrivateCO_Component.IValueNodeElement nodeX = node.createValueNodeElement();
nodeX.setValuAttributeValue(parentElement.getValueFromSecondTable());
node.bind(nodeX);
Refer the blog "Supply functions in WebDynpro"
/people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro
Hope this helps. If you require more info on this send a reply.
Regards,
Santhosh.C
Hi,
Lets say the BAPI name is BAPI_XX_GETLIST and the table names are ET_TABLE1(Field1, Field2, Field3) and ET_TABLE2 (FieldA, FieldB). You have display the fields of ET_TABLE1 (Field1, Field2, Field3) and one field from ET_TABLE2 (FieldB). "FieldA" id the key field.
Create a value node (vnField) under the model node table ET_TABLE1 with cardinality 1:1. Create a value attribute (vaFieldB). For "vnField" create a supply function (supplyfunction). If you goto the implementation you can see a method "supplyVnField(IPrivateCO_ComponentName.IVnFieldNode node, IPrivateCO_ComponentName.IET_Table1Element parentElement)".
Write the following code in the implementation.
IPrivateCO_ComponentName.IVnFieldNode nodeX = node.createValueFieldElement();
for(int i=0;i<wdContext.nodeET_Table2().size();i++){
if(parentElement.getField3Value().equals(wdContext.nodeET_Table2().getET_Table2ElementAt(i).getFieldA())){
nodeX.setValuAttributeValue(wdContext.nodeET_Table2().getET_Table2ElementAt(i).getFieldB());
}
}
node.bind(nodeX);
Hope this solves your problem.
Regards,
Santhosh.C
Hi Yakim
Taking the santhosh example you can combine the data much easier as follows with out any coding.
Sort the values in both the tables by the key field ie Field A in SAP.
Create a table in webdynpro and bind the table to ET_table1. Add a column in the table and bind this column to field b of ET_table2 manually.
Kishore
Hi,
You have to create Value node and value attributes (as per your display requirements bind the node to the Table UI element), read the data from the model and set the data to the value attributes.
Or you can do another thing,
If it is a custom built BAPI/RFC, add/modify the table strcuture you want and send it as a export table. If it is standard BAPI, write a wrapper BAP/RFC to send the data as per your requirements.
So you can directly bind it to your table UI element.
Regards,
Santhosh.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.