cancel
Showing results for 
Search instead for 
Did you mean: 

Open a pdf with a model.

Former Member
0 Kudos

Hi.

I've a portal application. In a class, I call to one Bapi, and this Bapi return a table and I keep the table into a model. I want open a pdf with my model.

How can I do it? What are the java import?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi guillermo,

i assume you have choosen a webdynpro approach and use a wd model for your bapi call.

two approaches:

use a adobe interactive form view and bring your modeldata up to it, but be aware of the license fees you have to pay for, or

code it on the easy use itext api:

/people/prakash.singh4/blog/2005/04/05/create-a-pdf-file-using-java

Regards, Jens

Former Member
0 Kudos

Hi Jens,

I'm developing a portar archive (.par).

This is the code by which I call the BAPI and it gives back to me the model:


              if(miCliente == null) throw new Exception("CONEXION NO DISPONIBLE");
				if (!this.getbegda().equals(""))
			    {funcion.getImportParameterList().setValue(this.getbegda(),"JBEGDA");} 
				if (!this.getendda().equals(""))
				{funcion.getImportParameterList().setValue(this.getendda(),"JENDDA");} 
				miCliente.execute(funcion);
                com.sap.mw.jco.JCO.Table out = funcion.getTableParameterList().getTable("OUT");
				com.sap.mw.jco.JCO.Field retorno = funcion.getExportParameterList().getField("RETURN_CODE");
                for(int i = 0; i < out.getNumRows(); i++)
				{ out.setRow(i);
				  fila.addElement(out.getString("CODIGO"));
				  fila.addElement(out.getString("NOMBRE"));
				  tabla.addElement(fila);
                  fila = new Vector(); 
                }
				 Vector nombreColumnas = new Vector();
           		 nombreColumnas.addElement("Código Empresa");
            	 nombreColumnas.addElement("Nombre o razón social");
 	        	 modelo = new DefaultTableViewModel(tabla, nombreColumnas);

Former Member
0 Kudos

Hi Jens,

I've solved the problem.

Thanks.

Answers (0)