on 07-26-2008 10:41 AM
Hi
I would like to find the solution to display the data in the table of
interactive form, whcih is fecthing data from BAPI.
Here is the flow what i followed
Created a Model using BAPI_FLGHT_GETLIST
Created a view and named it as PDFReortView
Context of the View
Bapi_Flight_Geltist_Input(Root Node)
-
Destination_From(Child Node)
-
City(Attribute)
-
Destination_To(ChildNode)*
-
City(Attribute)
-
Flight_List_1(ChildNode)
-
Airline(Attributes)
-
Airlineid( " " )
-
Airportfr( " " )
-
Airportto( " " )
.......
-
Output(Node)
-
Flight_List(sub node)
-
Airline(Attributes)
-
Airlineid( " " )
-
Airportfr( " " )
-
Airportto( " " )
.......
-
PdfSource(Binary Type Attribute)
My View's Layout is having an interactive form inside the Group(UI Element)
I binded interactive form's data source with the Context node Bapi_Flight_Getlist_Input
and binded pdf source with PdfSource attibute
In my interactive form i placed two input fields(City from,City to) and one button.
I placed one table to get details in that table and write below code to perform action when clicked onbutton
public void onActionSubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSubmit(ServerEvent)
wdThis.wdGetPDFReportCompController().executeBapi_Flight_Getlist_Input();
wdContext.nodeFlight_List_1().invalidate();
IWDMessageManager msgmgr = wdComponentAPI.getMessageManager();
IPrivatePDFReportView.IFlight_List_1Node node = wdContext.nodeFlight_List_1();
for(int i=0;i<wdContext.nodeFlight_List().size();i++)
{
IPrivatePDFReportView.IFlight_List_1Element thisEl = wdContext.createFlight_List_1Element(new Bapisfldat());
thisEl.setAirline(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Airline").toString());
thisEl.setAirlineid(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Airlineid").toString());
thisEl.setAirportfr(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Airportfr").toString());
thisEl.setAirportto(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Airportto").toString());
thisEl.setCityto(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Cityto").toString());
thisEl.setConnectid(wdContext.nodeFlight_List().getElementAt(i).getAttributeValue("Connectid").toString());
node.addElement(thisEl);
}
//@@end
}
but i couldnt able to fill the table in the interactive form. its displaying only one row.
kindly guide me what i m missing to ocnfigure
thanks in advance
Venkat
Refer this code and use collection as shown and put under OnSubmit() Action
try{
wdContext.currentFlight_List().modelObject().execute();
// Auto increment in table rows
Collection myRecords = new ArrayList();
myRecords.clear();
int size = wdContext.nodeFlight_List().size();
IPublic<view name>Comp.IFlight_ListNode flightnode = wdContext.nodeFlight_List();
IPublic<view name>Comp.IFlight_List_1Element flightelement = wdContext.createFlight_List_1Element();
IPublic<view name>Comp.IFlight_ListElement flight_elt = null;
for(int i=0 ; i<size; ++i ) {
flight_elt = wdContext.createFlight_ListElement();
flightelement.setQuestion_Text(wdContext.nodeFlight_List().getFlight_ListElementAt(i).getQuestion_Text());
myRecords.add(flightelement);
wdContext.nodeFlight_List().moveNext();
}
flightnode.bind(myRecords);
}catch(Exception e){
wdComponentAPI.getMessageManager().reportWarning("Questions" + e.getLocalizedMessage());
wdComponentAPI.getMessageManager().reportException("Error Getting Data in Table" + e.getLocalizedMessage(),false);
}
// Resynchronize data in context with data in model.
wdContext.nodeOutput().invalidate();
//@@end
}
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mandeep
i used the code provided by u, still i m getting the single row in table
it might b the problem with the settings...not with the code
coz wen i use ui element table, its filling all rows in talbe, but when i use talbe of interactive form i couldnt able to get it
i used subforms also to display the data, still facing same problem
I placed a button in interactvieform n when i click on button table should fill with the data. The above code iis for to perform an action.
now i placed one subform1 and inside subform1 placed another subform named it as subform2 and in subform2 placed table with the following properties
subform1 --> content type flowed and flow direction is top to bottom
subform2 --> content type flowed and flow direction is top to bottom, Binding type Repeat subform for each data item
Table --> Binding type Repeat table for each data item
row -->Binding type Repeat row for each data item
i tried with all options like without subforms in talbe, with subforms, with out subforms by placing text fields in two subforms...
alll ways i tried...still i couldnt able to solve the issue
kindly put some light on this
thanks in advance
venkat
I tried this scenario
structure DataSource 1:1, FlightList 0:n
pdfMode updateDataInpdf
if i use adobe In same view it is giving only one row as output.
I used Interactive form in another view and embed second view in main view using viewset.
OnSubmit() button it will executing bapi. Fill data in form and navigate to second view containing form.
Concept: We have to fill context of adobe on initialization ie before displaying contents on page.
When it will navigate it will solve the purpose and you can still display it in same page using view sets.
Mandeep Virk
I mentioned in previous post that we have to fill the context of adobe before displaying it.By doin this it will automatically populate data coming dynamically.Otherwise if it is displayed first then it will only display those contents which are used at design time.
If u are satisfied then please close this thread.
Mandeep Virk
Hi Venkat,
To display table in Adobe forms.
Follow these steps :
1. Insert one sub furm.
2. make its type to flow content and flow direction to Table in object property.
3. Insert another subform in above sub form and makes its type to flow content and flow direction to Table row.
4.In binding tab for this subform check the checkbox for "Repeat subform for each Data Item" and in min count you can specify at a time how much rows you want to display.
5. Now place your UI Elements for Data view into this sub form.
6. format these ui elements as you required.
Run application now u can see multiple rows in adobe forms, if you have multiple elements in your table node.
Refer to the following document for more info:
Thanks & Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the size of nodeFlight_List_() in adobe from where u are getting values in nodeFlight_List_1().
wdContext.nodeFlight_List().size();
Print the size of node and check if correct no of records are coming. through this we can get that their is problem with code or adobe for settings.
Also after this try without invalidating nodeFlight_List_1() .
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this size in OnActionSubmit. If it is same then there is some problem with adobe.
Again check settings in adobe
Select the Table1Subform subform in the Hierarch window, and change its content type to Flowed.
Select the Header Row from the Hierarchy window, and uncheck the u201CRepeat Row for Each Data Itemu201D option
Select the Row1 from the Hierarchy window, and Check the u201CRepeat Row for Each Data Itemu201D option
Mandeep Virk
For designing a table in adobe interactive form you have consider following
You have to design the view context upto three level, I am explaining you the properties
PDFDataSource (Parent Level1) - Cardinality 1:1 - Signetone -True - This is assigned to datasource
TableData (Parent Level2) - Cardinality (0:1) - Signetone - false This is the main point
Then under TableData value node, you have to put all your table attributes.
This Value Node name can be anything but hierarchy should be same as I have mentioned above
One question from u that Are u able to get a single value (row) in table?
If not try after commenting VALIDATION code row.
Mandeep Virk
Edited by: Mandeep Virk on Jul 26, 2008 3:33 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Refer these Blogs
[Dynamic Table Length in Adobe|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0859ad1-53aa-2a10-78ae-99e41c407669]
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.