Show TOC

Procedure documentationDebugging Locate this document in the navigation structure

 

When you carry out debugging in an application, it is often advantageous to perform a quick check of the parameters that are transferred to and from SAP. SAP JCo provides the method writeHTML() for performing these checks. You can use this method to create an HTML file based on an object of the types.

  • JCO.Function

  • JCO.ParameterList

  • JCO.Structure oder

  • JCO.Table

basiert. For tables, the default setting only includes the first 100 rows of the table. This saves space and avoids very large HTML files which may cause the browser to crash. If you want to output more rows, you can set the parameter jco.html.table_max_rows to control the maximum number of rows. The following diagram shows some example code:

Syntax Syntax

jco.html.table_max_rows

  1. JCO.Function function =
  2.      mRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST").
  3.                            getFunction();
  4. mConnection.execute(function);
  5. JCO.Table codes =
  6.       function.getTableParameterList().getTable("COMPANYCODE_LIST");
  7. String oldMaxRows = JCO.getProperty("jco.html.table_max_rows");
  8. JCO.setProperty("jco.html.table_max_rows", "99999");
  9. codes.writeHTML("c:\\COMPANYCODE_LIST.html");
  10. JCO.setProperty("jco.html.table_max_rows", oldMaxRows);
End of the code.

The example code saves the old parameter value before it is changed. After writeHTML() is called, you can reactivate the old value so you do not affect other users (this parameter is global within the Java Virtual Machine ).

This graphic is explained in the accompanying text.

Fig.: Table Parameters Displayed as an HTML Page