-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,840 additions
and
1,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.9.96 | ||
1.9.97 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,82 @@ | ||
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"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, | ||
animals.add_field( | ||
name=u"ELEPHANT", | ||
field_type="RFCTYPE_FLOAT", | ||
decimals=16, | ||
nuc_length=8, | ||
uc_length=8, | ||
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 | ||
animals.add_field( | ||
name=u"ZEBRA", | ||
field_type="RFCTYPE_INT", | ||
nuc_length=4, | ||
uc_length=4, | ||
nuc_offset=16, | ||
uc_offset=24, | ||
) | ||
|
||
func_desc = FunctionDescription("I_DONT_EXIST") | ||
func_desc.add_parameter(name=u'DOC', field_type='RFCTYPE_INT', | ||
direction='RFC_IMPORT', | ||
func_desc.add_parameter( | ||
name=u"DOC", | ||
field_type="RFCTYPE_INT", | ||
direction="RFC_IMPORT", | ||
nuc_length=4, | ||
uc_length=4 | ||
uc_length=4, | ||
) | ||
func_desc.add_parameter(name=u'CAT', field_type='RFCTYPE_CHAR', | ||
direction='RFC_IMPORT', | ||
func_desc.add_parameter( | ||
name=u"CAT", | ||
field_type="RFCTYPE_CHAR", | ||
direction="RFC_IMPORT", | ||
nuc_length=5, | ||
uc_length=10 | ||
uc_length=10, | ||
) | ||
func_desc.add_parameter(name=u'ZOO', field_type='RFCTYPE_STRUCTURE', | ||
direction='RFC_IMPORT', | ||
func_desc.add_parameter( | ||
name=u"ZOO", | ||
field_type="RFCTYPE_STRUCTURE", | ||
direction="RFC_IMPORT", | ||
nuc_length=20, | ||
uc_length=28, | ||
type_description=animals | ||
type_description=animals, | ||
) | ||
func_desc.add_parameter(name=u'BIRD', field_type='RFCTYPE_FLOAT', | ||
direction='RFC_IMPORT', | ||
func_desc.add_parameter( | ||
name=u"BIRD", | ||
field_type="RFCTYPE_FLOAT", | ||
direction="RFC_IMPORT", | ||
nuc_length=8, | ||
uc_length=8, | ||
decimals=16 | ||
decimals=16, | ||
) | ||
func_desc.add_parameter(name=u'COW', field_type='RFCTYPE_CHAR', | ||
direction='RFC_EXPORT', | ||
func_desc.add_parameter( | ||
name=u"COW", | ||
field_type="RFCTYPE_CHAR", | ||
direction="RFC_EXPORT", | ||
nuc_length=3, | ||
uc_length=6 | ||
uc_length=6, | ||
) | ||
func_desc.add_parameter(name=u'STABLE', field_type='RFCTYPE_STRUCTURE', | ||
direction='RFC_EXPORT', | ||
func_desc.add_parameter( | ||
name=u"STABLE", | ||
field_type="RFCTYPE_STRUCTURE", | ||
direction="RFC_EXPORT", | ||
nuc_length=20, | ||
uc_length=28, | ||
type_description=animals | ||
type_description=animals, | ||
) | ||
func_desc.add_parameter(name=u'HORSE', field_type='RFCTYPE_INT', | ||
direction='RFC_EXPORT', | ||
func_desc.add_parameter( | ||
name=u"HORSE", | ||
field_type="RFCTYPE_INT", | ||
direction="RFC_EXPORT", | ||
nuc_length=4, | ||
uc_length=4 | ||
uc_length=4, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from pyrfc import Connection | ||
|
||
MME = { | ||
'user': 'demo', | ||
'passwd': 'welcome', | ||
'ashost': '10.68.110.51', | ||
'sysnr': '00', | ||
'lang': 'EN', | ||
'client': '620', | ||
'sysid': 'MME' | ||
} | ||
|
||
|
||
QI3 = { | ||
'user': 'BOSKOVIC', | ||
'passwd': 'Koliko11', | ||
'ashost': 'ldciqi3.wdf.sap.corp', | ||
'sysnr': '75', | ||
'lang': 'EN', | ||
'client': '005', | ||
'sysid': 'QI3' | ||
} | ||
|
||
ABAP = MME | ||
|
||
RFM = '/coe/rbp_fe_datatypes' | ||
BAPI = 'BAPI_PERSDATANL_CREATE' | ||
STRUCTURE = '/COE/RBP_S_FE_RFM_STRUCTURE' | ||
STR_INCLUDE = 'bapi_shp_material' | ||
TABLE = '/COE/RBP_T_FE_RFM_TABLE_TYPE' | ||
|
||
conn = Connection(**ABAP) | ||
|
||
|
||
def rfm(name): | ||
rfm = conn.get_function_description(RFM) | ||
for p in rfm.parameters: | ||
print p['direction'], p['optional'] | ||
if p['type_description'] is None: | ||
field = '%s: %s %u' % ( | ||
p['name'], p['parameter_type'], p['uc_length']) | ||
if p['parameter_type'] in ['RFCTYPE_NUM', 'RFCTYPE_BCD', 'RFCTYPE_FLOAT']: | ||
field += '.%u' % p['decimals'] | ||
print field | ||
else: | ||
for f in p['type_description'].fields: | ||
field = '%s: %s %u' % ( | ||
f['name'], f['field_type'], f['uc_length']) | ||
if f['field_type'] in ['RFCTYPE_NUM', 'RFCTYPE_BCD', 'RFCTYPE_FLOAT']: | ||
field += '.%u' % f['decimals'] | ||
print field | ||
|
||
|
||
if __name__ == "__main__": | ||
rfm(RFM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
|
||
__author__ = """"Srdjan Boskovic""" | ||
__email__ = '[email protected]' | ||
__version__ = '1.9.96' | ||
__version__ = '1.9.97' |
Oops, something went wrong.