cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to display table with multiple record in interactive form

former_member1193316
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

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

Former Member
0 Kudos

Ok

Then give me some input How u used table in adobe form? and what settings u have done so far.

What is cardinality of your nodes hierarchy?

Your input will help us to sort out problem.

Mandeep Virk

former_member1193316
Participant
0 Kudos

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

former_member1193316
Participant
0 Kudos

CaN anybody do the sample example to display data in a table format in interactive form, using bapi.....

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

Hi Mandeep,

When i followed ur scenario, i m getting all the values in table.

But y i donno in my scenario those values are not coming...

Thanks for ur kind support throughout my thread

Former Member
0 Kudos

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

Answers (4)

Answers (4)

Former Member
0 Kudos

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:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

Thanks & Regards,

Jhansi Miryala

former_member1193316
Participant
0 Kudos

Hi Jhansi...

I follwed the same which u mentioned.

Still i couldnt able to find the solution....kindly anyone help me out.....

PLZ

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

I read the size of Flight_List as well as Flight_List_1, size is 7...dat means 7 records are there. I took UI Element table, all 7 records are displaying in UI Element Table, not in interactive forms Table.

Kinldy let me knw what i m missing. I invalidated and cheked. Still same prblm

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

Hello Mandeep,

I checked all the Settings of Adobe....The things which u mentioned, i followed the same......

Still i couldnt able to solve my problme

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

I followed the same cardinality...Still its showing only one row in table.

its not giving all data. Its giving first row...

Plz kindly put some light on this

Thanks in advance

Venkat

Former Member
0 Kudos

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

former_member1193316
Participant
0 Kudos

I follwed the same which u sent. kindly hav a look at my program

still i m facing same problem....plz