How to use the pyrfc.TypeDescription function in pyrfc

To help you get started, we’ve selected a few pyrfc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / PyRFC / material / test_server.py View on Github external
def test_func_desc_manual(self):
        # Example taken from hardCodedServer (cf. Schmidt and Li, 2009c)
        animals = TypeDescription("animals", nuc_length=20, uc_length=28)
        self.assertEqual(animals.nuc_length,20)
        self.assertEqual(animals.uc_length,28)
        animals.add_field(name=u'LION', field_type='RFCTYPE_CHAR', nuc_length=5, uc_length=10, nuc_offset=0, uc_offset=0)
        animals.add_field(name=u'ELEPHANT', field_type='RFCTYPE_FLOAT', nuc_length=8, uc_length=8, decimals=16, nuc_offset=8, uc_offset=16)
        animals.add_field(name=u'ZEBRA', field_type='RFCTYPE_INT', nuc_length=4, uc_length=4, nuc_offset=16, uc_offset=24)

        i_dont_exist = FunctionDescription(u"I_DONT_EXIST")
        i_dont_exist.add_parameter(name=u"DOG", parameter_type="RFCTYPE_INT",
            direction="RFC_IMPORT", nuc_length=4, uc_length=4)
        i_dont_exist.add_parameter(name=u"CAT", parameter_type="RFCTYPE_CHAR",
            direction="RFC_IMPORT", nuc_length=5, uc_length=10)
        i_dont_exist.add_parameter(name=u"ZOO", parameter_type="RFCTYPE_STRUCTURE",
            direction="RFC_IMPORT", nuc_length=20, uc_length=28, type_description=animals)
        i_dont_exist.add_parameter(name=u"BIRD", parameter_type="RFCTYPE_FLOAT",
            direction="RFC_IMPORT", nuc_length=8, uc_length=8, decimals=16)
github SAP / PyRFC / examples / serverFunctionDescription.py View on Github external
from pyrfc import FunctionDescription, TypeDescription

animals = TypeDescription("ANIMALS", nuc_length=20, uc_length=28)
animals.add_field(
    name=u"LION",
    field_type="RFCTYPE_CHAR",
    nuc_length=5,
    uc_length=10,
    nuc_offset=0,
    uc_offset=0,
)
animals.add_field(
    name=u"ELEPHANT",
    field_type="RFCTYPE_FLOAT",
    decimals=16,
    nuc_length=8,
    uc_length=8,
    nuc_offset=8,
    uc_offset=16,