Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
field_widths = [20, 17, 10, 10, 9, 9, 10, 15]
sys.stdout.write(u" " * 4 + u"-----------( Structure of {0.name} (n/uc_length={0.nuc_length}/{0.uc_length})--\n".format(type_desc))
for key, width in zip(field_keys, field_widths):
sys.stdout.write(u"{0}".format(key).ljust(width).upper() + u" ")
sys.stdout.write(u"\n")
for field_description in type_desc.fields:
for key, width in zip(field_keys, field_widths):
sys.stdout.write(u"{0}".format(field_description[key]).ljust(width) + u" ")
sys.stdout.write(u"\n")
sys.stdout.write(u" " * 4 + u"-----------( Structure of {0.name} )-----------\n".format(type_desc))
sys.stdout.write(u"-" * sum(parameter_widths) + u"\n")
connection.close()
except CommunicationError:
print ("Could not connect to server.")
raise
except LogonError:
print ("Could not log in. Wrong credentials?")
raise
except (ABAPApplicationError, ABAPRuntimeError):
print ("An error occurred.")
raise