T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
IDOC_CLASS Class Reference

Public Member Functions

 getAttribute fullPath attributeName
 This method returns the attribute value of the given attribute name. More...
 
 getAttributes fullPath
 This method returns all segment attributes (name/value) as Tcl Dict. More...
 
 getFilteredAttributes fullPath filterAttributeName filterAttributeValue ?filterAttributeDefaultValue?
 This method returns the segment which has a specific attribute (name/value) More...
 
 getSegments fullPath ?filter?
 This method returns all segment names. More...
 

Detailed Description

Member Function Documentation

◆ getAttribute()

getAttribute   fullPath attributeName  

This method returns the attribute value of the given attribute name.

Parameters
fullPathunique full address to segment
attributeNametarget attribute name
1 set res [$idocObj getAttribute "MATMAS05/IDOC:1/E1MARAM:1/E1MAKTM:2" "SPRAS_ISO"]
2 
3 # Result would be: DE
Warning
An error will be thrown if no segment was found under the given address
An error will be thrown if the target segment had no attribute name = $attributeName
Returns
attribute value (Tcl string)

◆ getAttributes()

getAttributes   fullPath  

This method returns all segment attributes (name/value) as Tcl Dict.

Parameters
fullPathunique full address to segment
1 # We would have all attributes as Tcl Dict
2 set res [$idocObj getAttributes "MATMAS05/IDOC:1/E1MARAM:1/E1MAKTM:1"]
3 
4 # Result would be a dict of: Attr_1 Val_1 Attr_2 Val_2 ... Attr_n Val_n
Warning
An error will be thrown if no segment was found under the given address
An error will be thrown if the target segment had no attributes
Returns
Tcl dict

◆ getFilteredAttributes()

getFilteredAttributes   fullPath filterAttributeName filterAttributeValue ?filterAttributeDefaultValue?  

This method returns the segment which has a specific attribute (name/value)

Get segment by attribute (e.g. because the index of target segment is unknown)

Parameters
fullPathunique full address to parent segment
filterAttributeNamefilter by attribute name
filterAttributeValuefilter by attribute value
filterAttributeDefaultValue(optional) alternative filter by attribute value (second chance)
1 set res [$idocObj getFilteredAttributes "MATMAS05/IDOC:1/E1MARAM:1/E1MAKTM" "SPRAS_ISO" "EN"]
2 
3 # Result would be a Tcl Dict: MSGFN 005 SPRAS E MAKTX xxx SPRAS_ISO EN
4 
5 set res [$idocObj getFilteredAttributes "MATMAS05/IDOC:1/E1MARAM:1/E1MAKTM" "SPRAS_ISO" "NOT_FOUND" "EN"]
6 
7 # Result would be a Tcl Dict: MSGFN 005 SPRAS E MAKTX xxx SPRAS_ISO EN
Warning
An error will be thrown if the parent segment cannot be found
An error will be thrown if the target segment had no attribute with the following properties:
  • name := $filterAttributeName
  • value := $filterAttributeValue or $filterAttributeDefaultValue (if specified)
Returns
segment attributes as Tcl Dict

◆ getSegments()

getSegments   fullPath ?filter?  

This method returns all segment names.

Parameters
fullPathunique address to segment
filter(optional) pattern of segments (glob matching)
1 # <filter> argument is omitted. So we would not filter the result list. The pattern "*" is not required.
2 set res [$idocObj getSegments "MATMAS05/IDOC:1/E1MARAM:1"]
3 
4 # We would have only names which match the pattern "E1MAK*".
5 set res [$idocObj getSegments "MATMAS05/IDOC:1/E1MARAM:1" "E1MAK*"]
6 
7 # Please refer to the documentation of glob matching in Tcl.
Warning
An error will be thrown if no segment was found under the given address
The result may be an empty list if no subsegments were found
Returns
list of segment names