T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
TPSAP::BOM::BAPI Namespace Reference

Functions

 checkBillOfMaterialExistence2 inputDict ?blnUseInternalMaterialNumber?
 check if a BOM exists More...
 
 createBillOfMaterial args
 This function creates a BOM via the CSAP_MAT_BOM_CREATE function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. More...
 
 createBillOfMaterial2 args
 This function creates a BOM via the CSAP_MAT_BOM_CREATE function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. More...
 
 deleteBillOfMaterial args
 Deletes an existing SAP BOM object via CSAP_MAT_BOM_DELETE. More...
 
 findBom4Material Material ?Plant? ?BomUsage? ?blnCheckMaterial? ?blnForeignKeyCheck? args
 Finds all BOMs for a given Material. Transport package /TESISPLM/T4S_BOM must be available. More...
 
 findBom4Material2 inputDict ?assignmentToMaterialBomList?
 Finds all BOMs for a given Material. Transport package /TESISPLM/T4S_BOM must be available. More...
 
 init_CT_EX_S_PATH_UPD4BOM_PARAMETER args
 Init of paramters for the /TESISPLM/CT_EX_S_PATH_UPD4BOM function call. More...
 
 initSAPBomHeaderStructure ?CleanMode? args
 Resets the corresponding global TCL ::SAPDat array within the section BillOfMaterial. More...
 
 maintainBillOfMaterial args
 This function changes a BOM via the CSAP_MAT_BOM_MAINTAIN function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. If necessary, the function is also able creates BOMs. More...
 
 maintainBillOfMaterial2 args
 This function changes a BOM via the CSAP_MAT_BOM_MAINTAIN function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. If necessary, the function is also able creates BOMs. More...
 
 readBillOfMaterial args
 Retrieves information about an existing SAP BOM. All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial. More...
 
 readBillOfMaterial2 args
 Retrieves information about an existing SAP BOM. All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial. More...
 
 readBillOfMaterialWithAssemblyFlag args
 Retrieves information about an existing SAP BOM including the assembly flag per BOM line (like CS03 does). All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial. This procedure requires the ABAP function /TESISPLM/MAT_BOM_READ. More...
 

Function Documentation

◆ checkBillOfMaterialExistence2()

TPSAP::BOM::BAPI::checkBillOfMaterialExistence2   inputDict ?blnUseInternalMaterialNumber?  

check if a BOM exists

Parameters
inputDicta dictionary with required keys what are:
  • MATERIAL
  • BOMUSAGE the possible keys are:
  • ALTERNATIVE The material of BOM header
  • BOMUSAGE Usage of BOM
  • PLANT plant
  • VALID_FROM_DATE valid from date, 19900119 for example or ""
  • VALID_TO_DATE valid to date, 99991231 for example or ""
blnUseInternalMaterialNumberuse internal number TRUE, else FALSE
Returns
dict structure with the following elements:
  • Status OK|ERROR
  • NWPStatus OK|ERROR
  • ErrorMessage last error message
  • MessageList message list and the global TCL array ::BomExistenceCheckArray

Sample code sequence for checkBillOfMaterialExistence2

1 dict set inputDict MATERIAL 92389
2 dict set inputDict BOMUSAGE 4
4 if { [dict get $returnDict Status] eq "OK" } {
5  foreach key [array names ::BomExistenceCheckArray] {
6  puts "$key => $::BomExistenceCheckArray($key)"
7  }
8 } else {
9  puts [dict get $returnDict Status]
10  puts [dict get $returnDict ErrorMessage]
11 }

◆ createBillOfMaterial()

TPSAP::BOM::BAPI::createBillOfMaterial   args  

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

This function is only able to create the BOM alternative 1.

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

◆ createBillOfMaterial2()

TPSAP::BOM::BAPI::createBillOfMaterial2   args  

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

This function is only able to create the BOM alternative 1.

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)

◆ deleteBillOfMaterial()

TPSAP::BOM::BAPI::deleteBillOfMaterial   args  

Deletes an existing SAP BOM object via CSAP_MAT_BOM_DELETE.

Parameters
argsnone
Returns
DELETED or ERROR

Sample code sequence

1 #
2 ::TPSAP::BOM::initSAPBomHeaderStructure
3 
4 set ::SAPDat(Bom:BomHeader:BomAlternative) $Alternative; # Alternative BOM
5 set ::SAPDat(Bom:BomHeader:BomUsage) $Usage; # BOM usage $Position
6 set ::SAPDat(Bom:BomHeader:MaterialNumber) $MaterialNumber
7 set ::SAPDat(Bom:BomHeader:PLANT) $Plant
8 set ::SAPDat(Bom:BomHeader:BomValidFrom) $ValidFromDate ; # Valid-from date
9 set ::SAPDat(Bom:BomHeader:ChangeNumber) $ChangeNumber
10 

◆ findBom4Material()

TPSAP::BOM::BAPI::findBom4Material   Material ?Plant? ?BomUsage? ?blnCheckMaterial? ?blnForeignKeyCheck? args  

Finds all BOMs for a given Material. Transport package /TESISPLM/T4S_BOM must be available.

Deprecated:
Please use the new function findBom4Material2
Parameters
Materialmaterial number
Plantoptional - Default * - If *, all Plants are returned
BomUsageoptional - Default Empty - If empty, all BUs are returned
blnCheckMaterialoptional - Default X - Checks if the material exists
blnForeignKeyCheckoptional - Default X - Checks if the plant and the bom usage exists
argsnone
Returns
OK and ::sap_result_array or NOT_FOUND

◆ findBom4Material2()

TPSAP::BOM::BAPI::findBom4Material2   inputDict ?assignmentToMaterialBomList?  

Finds all BOMs for a given Material. Transport package /TESISPLM/T4S_BOM must be available.

Parameters
inputDicta dictionary with required keys what are:
  • MATERIAL the possible keys are:
  • MATERIAL material
  • PLANT plant
  • BOM_USAGE bom usage
  • FL_MATERIAL_CHECK check if the material exists X or ""
  • FL_FOREIGN_KEY_CHECK foreign key check X or ""
plantTableLista list with new plants
Returns
dict structure with the following elements:
  • Status OK|ERROR
  • NWPStatus OK|ERROR
  • ErrorMessage last error message
  • MessageList message list and the global TCL array ::BomSelectResultDat

Sample code sequence for findBom4Material2

1 dict set inputDict MATERIAL P-100
2 dict set inputDict PLANT 1000
3 dict set inputDict BOM_USAGE 1
4 dict set inputDict FL_MATERIAL_CHECK X
5 dict set inputDict FL_FOREIGN_KEY_CHECK X
6 set returnDict [::TPSAP::BOM::BAPI::findBom4Material2 $inputDict]
7 if { [dict get $returnDict Status] eq "OK" } {
8  foreach key [array names ::BomSelectResultDat] {
9  puts "$key => $::BomSelectResultDat($key)"
10  }
11 } else {
12  puts [dict get $returnDict Status]
13  puts [dict get $returnDict MessageLists]
14 }

◆ init_CT_EX_S_PATH_UPD4BOM_PARAMETER()

TPSAP::BOM::BAPI::init_CT_EX_S_PATH_UPD4BOM_PARAMETER   args  

Init of paramters for the /TESISPLM/CT_EX_S_PATH_UPD4BOM function call.

Parameters
argsnone
Returns
OK

◆ initSAPBomHeaderStructure()

TPSAP::BOM::BAPI::initSAPBomHeaderStructure   ?CleanMode? args  

Resets the corresponding global TCL ::SAPDat array within the section BillOfMaterial.

Parameters
CleanMode(optional - ALL) -> If ALL is provided, the whole section BillOfMaterial:* will be cleared, otherwise only the section BillOfMaterial:Parameter:* and BillOfMaterial:I_STKO:* will be cleared.
argsnone
Returns
OK

◆ maintainBillOfMaterial()

TPSAP::BOM::BAPI::maintainBillOfMaterial   args  

This function changes a BOM via the CSAP_MAT_BOM_MAINTAIN function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. If necessary, the function is also able creates BOMs.

In case more than one alternative is needed then this function has to be used.

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

◆ maintainBillOfMaterial2()

TPSAP::BOM::BAPI::maintainBillOfMaterial2   args  

This function changes a BOM via the CSAP_MAT_BOM_MAINTAIN function based on the content of the corresponding ::SAPDat(BillOfMaterial:*) array attributes provided after the mapping. If necessary, the function is also able creates BOMs.

In case more than one alternative is needed then this function has to be used.

Parameters
argsnone
Returns
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)

◆ readBillOfMaterial()

TPSAP::BOM::BAPI::readBillOfMaterial   args  

Retrieves information about an existing SAP BOM. All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial.

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

Sample code sequence

1 #
3 
4 set ::SAPDat(BillOfMaterial:Parameter:MATERIAL) $MatNr
5 set ::SAPDat(BillOfMaterial:Parameter:PLANT) $Plant
6 set ::SAPDat(BillOfMaterial:Parameter:BOM_USAGE) $BomUsage
7 set ::SAPDat(BillOfMaterial:Parameter:CHANGE_NO) $ChangeNr ; # (optional)
8 set ::SAPDat(BillOfMaterial:Parameter:VALID_FROM) $ValidFrom ; # (optional)
9 set ::SAPDat(BillOfMaterial:Parameter:VALID_TO) $ValidTo ; # (optional)
10 set ::SAPDat(BillOfMaterial:Parameter:REVISION_LEVEL) $RevLevel ; # (optional)
11 set ::SAPDat(BillOfMaterial:Parameter:ALTERNATIVE) $BomAlternative ; # (optional)
12 
Returns
TCL list with BOM_FOUND or BOM_NOT_FOUND, material number and error message (empty if no such message does exist) and global TCL array ::BOMResultDat

◆ readBillOfMaterial2()

TPSAP::BOM::BAPI::readBillOfMaterial2   args  

Retrieves information about an existing SAP BOM. All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial.

Sample code sequence

1 #
3 
4 set ::SAPDat(BillOfMaterial:Parameter:MATERIAL) $MatNr
5 set ::SAPDat(BillOfMaterial:Parameter:PLANT) $Plant
6 set ::SAPDat(BillOfMaterial:Parameter:BOM_USAGE) $BomUsage
7 set ::SAPDat(BillOfMaterial:Parameter:CHANGE_NO) $ChangeNr ; # (optional)
8 set ::SAPDat(BillOfMaterial:Parameter:VALID_FROM) $ValidFrom ; # (optional)
9 set ::SAPDat(BillOfMaterial:Parameter:VALID_TO) $ValidTo ; # (optional)
10 set ::SAPDat(BillOfMaterial:Parameter:REVISION_LEVEL) $RevLevel ; # (optional)
11 set ::SAPDat(BillOfMaterial:Parameter:ALTERNATIVE) $BomAlternative ; # (optional)
12 
Returns
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

◆ readBillOfMaterialWithAssemblyFlag()

TPSAP::BOM::BAPI::readBillOfMaterialWithAssemblyFlag   args  

Retrieves information about an existing SAP BOM including the assembly flag per BOM line (like CS03 does). All import parameters are transferred via the global ::SAPDat TCL array within the section BillOfMaterial. This procedure requires the ABAP function /TESISPLM/MAT_BOM_READ.

Sample code sequence

1 #
3 
4 set ::SAPDat(BillOfMaterial:Parameter:MATERIAL) $MatNr
5 set ::SAPDat(BillOfMaterial:Parameter:PLANT) $Plant
6 set ::SAPDat(BillOfMaterial:Parameter:BOM_USAGE) $BomUsage
7 set ::SAPDat(BillOfMaterial:Parameter:CHANGE_NO) $ChangeNr ; # (optional)
8 set ::SAPDat(BillOfMaterial:Parameter:VALID_FROM) $ValidFrom ; # (optional)
9 set ::SAPDat(BillOfMaterial:Parameter:VALID_TO) $ValidTo ; # (optional)
10 set ::SAPDat(BillOfMaterial:Parameter:REVISION_LEVEL) $RevLevel ; # (optional)
11 set ::SAPDat(BillOfMaterial:Parameter:ALTERNATIVE) $BomAlternative ; # (optional)
12 
Returns
TCL list with BOM_FOUND or BOM_NOT_FOUND, material number and error message (empty if no such message does exist) and global TCL array ::BOMResultDat