cancel
Showing results for 
Search instead for 
Did you mean: 

Type and Lenght information about retrieved "tables"

eduardo_gironas
Participant
0 Kudos

Hello:

I have the next two code lines, they work well:

ZHRRESNOMTable tEmp = new ZHRRESNOMTable();

proxy.Z_Hrpfpa00105("20051231", "A", out sts, ref tEmp);

Using a loop, I would like to know the the abap name, type and length of the fields that structure tEmp has. Is this possible? I would like to use class SAPField but I can not find a connection with tEmp.

Any help will be appreciated.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

Like all SAPTables ZHRRESNOMTable has a virtual method "GetElementType" that return the type of the structures that is basis of the table.

Using the returned type you can find all fields by reflection or SAPStructure.GetSAPFieldsSchema().

ZHRRESNOMTable tEmp = new ZHRRESNOMTable();

Type structureType = tEmp.GetElementType();

SAPField[] fields = SAPStructure.GetSAPFieldsSchema(structureType);

// ...

Answers (0)