T4S4  18.2 C7549 A21431
Teamcenter Gateway for SAP S/4HANA API Reference
TPSAP::BOM Namespace Reference

Namespaces

 BAPI
 

Functions

 addSAPBomSubPosition PositionIndex POSID EBORT UPMNG UPOSZ ?UPTXT?
 Stores the given SAP BOM sub position informationinto the the global TCL ::SAPDat (section Bom:SubPosition:*) array for the BOM transfer. More...
 
 changeBillOfMaterial args
 This function updates a BOM via the CAD_CHANGE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping. More...
 
 changeBillOfMaterial2 args
 This function updates a BOM via the CAD_CHANGE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping. More...
 
 createBillOfMaterial args
 This function creates a BOM via the CAD_CREATE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping. More...
 
 createBillOfMaterial2 args
 This function creates a BOM via the CAD_CREATE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping. More...
 
 deletePositionStructure Index args
 Removes all stored information for one BOM position out of the corresponding global TCL ::SAPDat array within the section Bom:Position at a given index, so that this position will not be send to SAP within a future transfer. More...
 
 initPositionStructure Index args
 Resets part the corresponding global TCL ::SAPDat array within the section Bom:Position. More...
 
 readBillOfMaterial args
 Retrieves information about an existing SAP BOM. More...
 
 readBillOfMaterial2 args
 Retrieves information about an existing SAP BOM. More...
 
 setDependencyDescription Index LanuageId Description ?Language? ?LanguageIso? args
 Stores the given SAP BOM dependency description params into the the global TCL ::SAPDat (section Bom:Dependency:Description:*) array for a future transfer. More...
 
 setSAPBomSubPositionStructure Index POSID EBORT UPMNG UPOSZ ?UPTXT?
 Stores the given SAP BOM sub position informationinto the the global TCL ::SAPDat (section Bom:SubPosition:*) array for the BOM transfer. More...
 
 setSelectionCondition Index Condition ?InternName? ?ExternName? ?Status? ?Group? ?SortOrder? ?lstDescription? ?lstDescriptionLang? ?lstDescriptionLangIso? ?ChangeNumber?
 Stores the given SAP BOM selection condition params into the the global TCL ::SAPDat (section Bom:Dependency:*) array for the BOM transfer. More...
 

Function Documentation

◆ addSAPBomSubPosition()

TPSAP::BOM::addSAPBomSubPosition   PositionIndex POSID EBORT UPMNG UPOSZ ?UPTXT?  

Stores the given SAP BOM sub position informationinto the the global TCL ::SAPDat (section Bom:SubPosition:*) array for the BOM transfer.

Parameters
PositionIndex- array index of the position that has the sub-positions
POSID- Position number
EBORT- Installation Point for Subitem
UPMNG- Subitem quantity
UPOSZ- Subitem Number
UPTXT- Subitem text
Returns
OK

References TPSAP::getSessionLogChannel(), and setSAPBomSubPositionStructure().

◆ changeBillOfMaterial()

TPSAP::BOM::changeBillOfMaterial   args  

This function updates a BOM via the CAD_CHANGE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping.

Deprecated:
The function is deprecated, please use TPSAP::BOM::changeBillOfMaterial2
Parameters
argsnone
Returns
List of Status CHANGED and MaterialNumber or ERROR, MaterialNumber and list or error messages

References changeBillOfMaterial2(), and TPSAP::getSessionLogChannel().

◆ changeBillOfMaterial2()

TPSAP::BOM::changeBillOfMaterial2   args  

This function updates a BOM via the CAD_CHANGE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping.

Parameters
argsnone
Returns
StatusDict dict structure with the following elements:
  • Status OK|ERROR|JCO_ERROR
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n)

References TPSAP::doCommitOrRollBackBasedOnStatusDict(), and TPSAP::getSessionLogChannel().

Referenced by changeBillOfMaterial().

◆ createBillOfMaterial()

TPSAP::BOM::createBillOfMaterial   args  

This function creates a BOM via the CAD_CREATE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping.

Deprecated:
The function is deprecated, please use TPSAP::BOM::createBillOfMaterial2
Parameters
argsnone
Returns
List of Status CREATED and MaterialNumber or ERROR, MaterialNumber and list or error messages

References createBillOfMaterial2(), and TPSAP::getSessionLogChannel().

◆ createBillOfMaterial2()

TPSAP::BOM::createBillOfMaterial2   args  

This function creates a BOM via the CAD_CREATE_BOM_WITH_SUB_ITEMS function based on the content of the corresponding ::SAPDat(BOM:*) array attributes provided after the mapping.

Parameters
argsnone
Returns
StatusDict dict structure with the following elements:
  • Status OK|ERROR|JCO_ERROR
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n)

References TPSAP::doCommitOrRollBackBasedOnStatusDict(), and TPSAP::getSessionLogChannel().

Referenced by createBillOfMaterial().

◆ deletePositionStructure()

TPSAP::BOM::deletePositionStructure   Index args  

Removes all stored information for one BOM position out of the corresponding global TCL ::SAPDat array within the section Bom:Position at a given index, so that this position will not be send to SAP within a future transfer.

Parameters
Index- internal TCL array index
argsnone
Returns
OK

References TPSAP::getSessionLogChannel().

◆ initPositionStructure()

TPSAP::BOM::initPositionStructure   Index args  

Resets part the corresponding global TCL ::SAPDat array within the section Bom:Position.

Parameters
Index- internal TCL array index
Returns
OK

Referenced by T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterialPosition().

◆ readBillOfMaterial()

TPSAP::BOM::readBillOfMaterial   args  

Retrieves information about an existing SAP BOM.

All import parameters are transferred via the global ::SAPDat TCL array within the section Bom.

Deprecated:
The function is deprecated, please use TPSAP::BOM::readBillOfMaterial2

Sample code sequence

1 ::TPSAP::BOM::initSAPBomHeaderStructure
2 
3 set ::SAPDat(Bom:BomHeader:MaterialNumber) $MatNr
4 set ::SAPDat(Bom:BomHeader:Plant) $Plant
5 set ::SAPDat(Bom:BomHeader:BomAlternative) $BomAlternative ; # (optional)
6 set ::SAPDat(Bom:BomHeader:BomUsage) $BomUsage
7 set ::SAPDat(Bom:BomHeader:ChangeNumber) $ChangeNr ; # (optional)
8 set ::SAPDat(Bom:BomHeader:BomValidFrom) $ValidFrom ; # (optional)
9 
Returns
TCL list with BOM_FOUND and position information for each position (and global TCL array ::BOMResultDat with the complete BOM information) or BOM_NOT_FOUND

References TPSAP::getDecimalSigns(), TPSAP::getSessionLogChannel(), and readBillOfMaterial2().

◆ readBillOfMaterial2()

TPSAP::BOM::readBillOfMaterial2   args  

Retrieves information about an existing SAP BOM.

All import parameters are transferred via the global ::SAPDat TCL array within the section Bom. The caller needs to define how to use the received results.

Sample code sequence

1 ::TPSAP::BOM::initSAPBomHeaderStructure
2 
3 set ::SAPDat(Bom:BomHeader:MaterialNumber) $MatNr
4 set ::SAPDat(Bom:BomHeader:Plant) $Plant
5 set ::SAPDat(Bom:BomHeader:BomAlternative) $BomAlternative ; # (optional)
6 set ::SAPDat(Bom:BomHeader:BomUsage) $BomUsage
7 set ::SAPDat(Bom:BomHeader:ChangeNumber) $ChangeNr ; # (optional)
8 set ::SAPDat(Bom:BomHeader:BomValidFrom) $ValidFrom ; # (optional)
9 
10 set resultDict [::TPSAP::BOM::readBillOfMaterial2]
11 if {$SAPBomList eq "BOM_FOUND"} {
12  foreach PositionElement [::T4X::CORE::sortIndexedInterfaceTable [array names ::BOMResultDat CAD_BOM_ITEM:POSNR:*]] {
13  set PositionIndex [lindex [split $LastElement ":"] end]
14  set ItemNo [string trimleft $::BOMResultDat(CAD_BOM_ITEM:POSNR:$PositionIndex) 0]
15  set MaterialNo [string trim $::BOMResultDat(CAD_BOM_ITEM:IDNRK:$PositionIndex)]
16  set Description [string trim $::BOMResultDat(CAD_BOM_ITEM:POTX1:$PositionIndex)]
17  set Quantity [string trim $::BOMResultDat(CAD_BOM_ITEM:MENGE:$PositionIndex)]
18  puts "ItemNo $ItemNo MaterialNo $MaterialNo Description $Description Quantity $Quantity"
19  }
20 }
Returns
StatusDict dict structure with the following elements:
  • Status OK|ERROR|JCO_ERROR
  • BomExists BOM_NOT_FOUND|BOM_FOUND
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n)

and global TCL array ::BOMResultDat

References TPSAP::getSessionLogChannel().

Referenced by readBillOfMaterial().

◆ setDependencyDescription()

TPSAP::BOM::setDependencyDescription   Index LanuageId Description ?Language? ?LanguageIso? args  

Stores the given SAP BOM dependency description params into the the global TCL ::SAPDat (section Bom:Dependency:Description:*) array for a future transfer.

Parameters
Index- internal TCL array index
LanuageId
Description
Language(optional - empty)
LanguageIso(optional - empty)
argsnone
Returns
OK

References TPSAP::getSessionLogChannel().

◆ setSAPBomSubPositionStructure()

TPSAP::BOM::setSAPBomSubPositionStructure   Index POSID EBORT UPMNG UPOSZ ?UPTXT?  

Stores the given SAP BOM sub position informationinto the the global TCL ::SAPDat (section Bom:SubPosition:*) array for the BOM transfer.

Parameters
Index- internal TCL array index
POSID- Position number
EBORT- Installation Point for Subitem
UPMNG- Subitem quantity
UPOSZ- Subitem Number
UPTXT- Subitem text
Returns
OK

References TPSAP::getSessionLogChannel().

Referenced by addSAPBomSubPosition().

◆ setSelectionCondition()

TPSAP::BOM::setSelectionCondition   Index Condition ?InternName? ?ExternName? ?Status? ?Group? ?SortOrder? ?lstDescription? ?lstDescriptionLang? ?lstDescriptionLangIso? ?ChangeNumber?  

Stores the given SAP BOM selection condition params into the the global TCL ::SAPDat (section Bom:Dependency:*) array for the BOM transfer.

Parameters
Indexpoints to the corresponding BomPosition index of the ::SAPDat(Bom:Position:???:$Index) structure
Conditionselection condition in SAP syntax
InternNameInternal name of the object dependency, if specified it typically should be treated as a global dependency (optional - empty)
ExternNameExternal name of the object dependency, if specified it typically should be treated as a global dependency (optional - empty)
StatusObject dependency status (optional - default value 1):
  • 1 stands for "Released"
  • 2 stands for "In Preparation"
  • 3 stands for "Locked", this is typically the case if there is a syntax error in the source code.
GroupDependency group can be defined in the customizing in the variant configuration to group similar dependencies together (optional - emtpy)
SortOrderdefines the processing order of multiple object dependencies not relevant for SelectionConditions (optional - 0000)
lstDescription- Defines the description as a TCL for a global dependency
lstDescriptionLang- Defines the description language as a TCL (in the same order as lstDescription) for a global dependency
lstDescriptionLangIso- Defines the description language in ISO format as a TCL (in the same order as lstDescription) for a global dependency
ChangeNumber- Defines the change number in case of global dependencies (optional - Empty)
Returns
OK

References TPSAP::getSessionLogChannel().