4.5 class struct

== Class struct

struct - Python extension for parsing and creating Structure definitions to be added to an RFC Parameter and Table objects.

Generally you would not create one of these manually as it is far easier to use the "discovery" functionality of the conn.discover("RFCNAME") method. This returns a fully formed interface object. This is achieved by using standard RFCs supplied by SAP to look up the definition of an RFC interface and any associated structures.

	import saprfc
	s = struct(name="struct_name")
	s.addField( field(field, exid, decs, intlen, off)
	...

or more commonly:

	import saprfc
	rfc = conn(...)
	str = rfc.structure("TRDIR")

struct(name="DDIC structure name")
creates a new RFC Structure object. You must subsequently add fields to this structure for it to be of any use. The resulting structure object is then used for parms, and tab objects to manipulate complex data elements. This is normally created through the conn.structure('STRUCT_NAME') method that does an auto look up of the data dictionary definition of a structure, or as a result of conn.discover ( which create an entire interface definition).


Subsections