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

Functions

 call_TESISPLM_MM_GET_CONFIGURATION args
 Calls SAP function '/TESISPLM/MM_GET_CONFIGURATION'. This call requires the function /TESISPLM/MM_GET_CONFIGURATION to be imported into the SAP system. More...
 
 call_TESISPLM_T4S_READ_PROD_VERS args
 Calls SAP function '/TESISPLM/T4S_READ_PROD_VERS'. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system. More...
 
 changeProductionVersion ?intProdVersionTableIndex? args
 Creates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU) More...
 
 checkConfigProfilExists args
 Checks if a configuration profile exists in SAP for a given material master. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well. All import parameters are transferred via the global ::SAPDat TCL array within the section ConfigProfil. More...
 
 checkMaterialMasterAvailability MaterialNumber Plant Unit args
 Checks if a material master is available in SAP within a given plant an unit. More...
 
 checkMaterialMasterExistence MaterialNumber args
 Checks if a material master exists in SAP. More...
 
 checkProductionVersion ?intProdVersionTableIndex? args
 Checks a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU) More...
 
 createProductionVersion args
 Creates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU) More...
 
 deleteProductionVersion MaterialNumber Plant VersionId ?intProdVersionTableIndex? args
 Deletes a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" and TESISPLM_T4S_MM must be imported in the corresponding SAP system. More...
 
 futureChangeMaterialMasterXPlantStatus MaterialNumber ChangeNumber XPlantMatStatus args
 Performs a X-Plant status future change on the given Material Master using transaction MM12. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well. More...
 
 getAllMaterialMasterInfos MaterialNumber ?Plant? ?CompCode? ?ValuationArea? ?ValuationType? ?StorageLoc? ?SalesOrg? ?DistrChannel? ?WhseNumber? ?StorageType? args
 Retrieves SAP material master information using the BAPI BAPI_MATERIAL_GET_ALL. More...
 
 getAllMaterialMasterInfosReadSingle args
 Retrieves SAP material master information using the RFC function MATERIAL_READ_ALL_SINGLE. More...
 
 getExternalMaterialNumber InternalNumber
 Retrieves the SAP external material id for a given SAP internal material id. More...
 
 getInternalMaterialNumber ExternalNumber
 Retrieves the SAP internal material id for a given SAP external material id. More...
 
 getMaterialList args
 Matchcode search for material masters in SAP. More...
 
 getMaterialMasterInfo MaterialNumber ?Plant? ?ValuationArea? ?ValuationType? args
 Retrieves SAP material master information using the BAPI BAPI_MATERIAL_GET_DETAIL. More...
 
 getMaterialMasterInfoRfc MaterialNumber args
 Retrieves SAP material master information using the BAPI RFC_GET_MATERIAL_DATA. More...
 
 getMaterialMasterLongText MaterialNumber args
 Retrieves the SAP material master long text. More...
 
 getPlantsOfMaterial MaterialNumber args
 Retrieves all existing SAP plants including the maintained views for a given material master. The views are returned using the PSTAT attribute using one character per plant. The following mapping can be used to determine which view is maintained in which plant:

A Work scheduling
B Accounting
C Classification
D MRP
E Purchasing
F Production resources/tools
G Costing
K Basic data
L Storage
P Forecasting
Q Quality management
S Warehouse management
V Sales
X Plant stocks
Z Storage location stocks
. More...
 
 getProductionVersionTableIndex MaterialNumber Plant VersionId args
 Reads all production versions for a given MM and returns the table index for this version. This index can then be used as as input for the call transaction prod version update. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system. More...
 
 getTaxIndicator4MaterialMaster MaterialNumber ?Plant? args
 Returns the tax indicator (purchase view) for a given MM. More...
 
 getTaxIndicator4MaterialMaster2 MaterialNumber ?Plant?
 Returns the tax indicator (purchase view) for a given MM. More...
 
 getViewList4Plant MaterialMaster Plant
 Retrieves all existing views for a given SAP material master and plant. More...
 
 linkMaterialMaster2DIR strMatNr strDocNr strDocType strDocPart strDocVers ?intLinkTabIndex? ?blnSelectAllVersions? args
 Links a Material Master to an existing DIR. The link is created from the MM to the DIR (and not the other way around), so it will be created even if the DIR is already released. To achieve this functionality, the T4S call transaction mechanism is used. Therefore it is necessary to implement the T4S call transaction ABAP as well (T4S SAP Transport Package TESISPLM_T4S_CALL_TRANSACTION). Keep in mind: If the customer uses the ALV Grid in SAP, Call Transaction does not work anymore... More...
 
 maintainProductionVersion args
 Creates or updates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" and TESISPLM_T4S_MM (for the read/update) must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU) More...
 
 readMaterialConfiguration MaterialNumber ?Plant? args
 Reads the configuration of a material variant This call requires the function /TESISPLM/MM_GET_CONFIGURATION to be imported into the SAP system. More...
 
 readProductionVersion MaterialNumber Plant ?VersionId? args
 Reads one or all production versions for a given MM. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system. More...
 
 reserveMaterialNumber MaterialType Industry
 Allocates the next free material master id in SAP. More...
 
 reserveMaterialNumber2 MaterialType Industry
 Allocates the next free material master id in SAP. More...
 
 setClassificationData_by_Reference SourceObjectKey TargetObjectKey ?ExecuteStoreSAPDat2MultiTransferCache4Type?
 Used to create an object classification based on an existing SAP object (reference object). IMPORTANT: In order to activate the multi classification functionality, T4S::storeSAPDat2MultiTransferCache Material (or any other T4S transfer object) must be called in advance. More...
 
 setCrossPlantConfigurableMaterial MaterialNumber CrossPlantConfigurableMaterialNumber args
 Sets the Cross Plant Configurable Material number for a given Material Master. More...
 
 setKonfMatFlag MatNr Flag args
 Set a flag if a material master is a configurable material in SAP. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well. More...
 
 setMaterialMaster_by_Reference DTM_Name blnOverwriteFields MatNr_Reference ?Plant? ?Comp_Code? ?Val_Area? ?Val_Type? ?Storage_Loc? ?SalesOrg? ?Distr_Channel? ?Whse_Number? ?Storage_Type? args
 Used to create a material master on the basis of a existing SAP material master. More...
 
 setMaterialMasterLongText LineIndex LanguageIso TextId TextLine ?FormatColumn? args
 Fills the internal buffer for the corresponding MaterialMaster long text transfer to SAP. More...
 
 setMaterialMasterNoteLongText LineIndex LanguageIso Plant TextLine ?FormatColumn? args
 Fills the internal buffer for the corresponding MaterialMaster Note long text transfer to SAP. More...
 
 setMaterialMasterSalesLongText LineIndex LanguageIso SalesOrg DistrChan TextLine ?FormatColumn? args
 Fills the internal buffer for the corresponding MaterialMaster Sales long text transfer to SAP. More...
 
 setTaxIndicator4MaterialMaster MaterialNumber Plant TaxIndicator ?PurchaseViewIndex? args
 Sets the tax indicator (purchase view) for a given MM. This call requires the function /TESISPLM/T4S_CALL_TRANSACTION to be imported into the SAP system. More...
 
 updateMaterialMaster UpdateMode
 This function creates/updates or extents a MaterialMaster via the BAPi_MATERIAL_SAVEDAT API. If no external material number is specified an new one is generated by the TPSAP::MM::reserveMaterialNumber function. More...
 
 updateMaterialMaster2 UpdateMode
 This function creates/updates or extents a MaterialMaster via the BAPi_MATERIAL_SAVEDAT API. If no external material number is specified an new one is generated by the TPSAP::MM::reserveMaterialNumber function. More...
 

Function Documentation

◆ call_TESISPLM_MM_GET_CONFIGURATION()

TPSAP::MM::call_TESISPLM_MM_GET_CONFIGURATION   args  

Calls SAP function '/TESISPLM/MM_GET_CONFIGURATION'. This call requires the function /TESISPLM/MM_GET_CONFIGURATION to be imported into the SAP system.

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

◆ call_TESISPLM_T4S_READ_PROD_VERS()

TPSAP::MM::call_TESISPLM_T4S_READ_PROD_VERS   args  

Calls SAP function '/TESISPLM/T4S_READ_PROD_VERS'. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system.

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

◆ changeProductionVersion()

TPSAP::MM::changeProductionVersion   ?intProdVersionTableIndex? args  

Creates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU)

Parameters
intProdVersionTableIndex- Optional (Default Empty) - The SAP table/row index of the given production version. If empty, T4S will calculate the right index internally.
Returns
OK or ERROR with hex message

◆ checkConfigProfilExists()

TPSAP::MM::checkConfigProfilExists   args  

Checks if a configuration profile exists in SAP for a given material master. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well. All import parameters are transferred via the global ::SAPDat TCL array within the section ConfigProfil.

Returns
OK or ERROR

◆ checkMaterialMasterAvailability()

TPSAP::MM::checkMaterialMasterAvailability   MaterialNumber Plant Unit args  

Checks if a material master is available in SAP within a given plant an unit.

Parameters
MaterialNumber
Plant
Unit
argsnone
Returns
OK or NOT_FOUND

◆ checkMaterialMasterExistence()

TPSAP::MM::checkMaterialMasterExistence   MaterialNumber args  

Checks if a material master exists in SAP.

Parameters
MaterialNumber
argsnone
Returns
OK or NOT_FOUND

◆ checkProductionVersion()

TPSAP::MM::checkProductionVersion   ?intProdVersionTableIndex? args  

Checks a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU)

Parameters
intProdVersionTableIndex- Optional (Default Empty) - The SAP table/row index of the given production version. If empty, T4S will calculate the right index internally.
Returns
OK or ERROR with hex message

◆ createProductionVersion()

TPSAP::MM::createProductionVersion   args  

Creates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU)

Returns
OK or ERROR with hex message

◆ deleteProductionVersion()

TPSAP::MM::deleteProductionVersion   MaterialNumber Plant VersionId ?intProdVersionTableIndex? args  

Deletes a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" and TESISPLM_T4S_MM must be imported in the corresponding SAP system.

Parameters
MaterialNumber
Plant
VersionId
intProdVersionTableIndex- optional (default = empty) - If provided, this table index will be used by call transaction for the prod version deletion instead of calculating the index automatically using TPSAP::MM::getProductionVersionTableIndex
Returns
OK or ERROR with hex message

◆ futureChangeMaterialMasterXPlantStatus()

TPSAP::MM::futureChangeMaterialMasterXPlantStatus   MaterialNumber ChangeNumber XPlantMatStatus args  

Performs a X-Plant status future change on the given Material Master using transaction MM12. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well.

Parameters
MaterialNumber
ChangeNumber
XPlantMatStatus
Returns
OK or ERROR (with message)

◆ getAllMaterialMasterInfos()

TPSAP::MM::getAllMaterialMasterInfos   MaterialNumber ?Plant? ?CompCode? ?ValuationArea? ?ValuationType? ?StorageLoc? ?SalesOrg? ?DistrChannel? ?WhseNumber? ?StorageType? args  

Retrieves SAP material master information using the BAPI BAPI_MATERIAL_GET_ALL.

Parameters
MaterialNumber
Plant(optional - empty)
CompCode(optional - empty)
ValuationArea(optional - empty)
ValuationType(optional - empty)
StorageLoc(optional - empty)
SalesOrg(optional - empty)
DistrChannel(optional - empty)
WhseNumber(optional - empty)
StorageType(optional - empty)
argsnone
Returns
OK and global TCL array ::SapMatDat or NOT_FOUND

◆ getAllMaterialMasterInfosReadSingle()

TPSAP::MM::getAllMaterialMasterInfosReadSingle   args  

Retrieves SAP material master information using the RFC function MATERIAL_READ_ALL_SINGLE.

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

Parameters
argsnone
Returns
OK and global TCL array ::SapMatDat, NOT_FOUND or ERROR

Sample code sequence

1 set ::SAPDat(READSINGLE:SCHLUESSEL:MATNR) $MaterialMaster ; # Material Number
2 set ::SAPDat(READSINGLE:SCHLUESSEL:WERKS) $Plant ; # Plant
3 set ::SAPDat(READSINGLE:SCHLUESSEL:LGORT) $Storage_Loc ; # Storage Location
4 set ::SAPDat(READSINGLE:SCHLUESSEL:LGTYP) $Storage_Type ; # Storage Type
5 set ::SAPDat(READSINGLE:SCHLUESSEL:LGNUM) $Whse_Number ; # Warehouse Number / Warehouse Complex
6 set ::SAPDat(READSINGLE:SCHLUESSEL:BWKEY) $Val_Area ; # Valuation Area
7 set ::SAPDat(READSINGLE:SCHLUESSEL:BWTAR) $Val_Type ; # Valuation Type
8 set ::SAPDat(READSINGLE:SCHLUESSEL:VKORG) $SalesOrg ; # Sales Organization
9 set ::SAPDat(READSINGLE:SCHLUESSEL:VTWEG) $Distr_Channel ; # Distribution Channel
10 
12 
13 if {[lindex $ResultList 0] eq "OK"} {
14  # everything thing was okay
15 } else {
16  # some error occurs
17 }
18 
19 # print out the resulting ::SapMatDat content
20 
21 foreach elem [array names ::SapMatDat] {
22  puts "::SapMatDat($elem) = $::SapMatDat($elem)"
23 }

◆ getExternalMaterialNumber()

TPSAP::MM::getExternalMaterialNumber   InternalNumber  

Retrieves the SAP external material id for a given SAP internal material id.

Parameters
InternalNumberSAP internal material id
Returns
External number

◆ getInternalMaterialNumber()

TPSAP::MM::getInternalMaterialNumber   ExternalNumber  

Retrieves the SAP internal material id for a given SAP external material id.

Parameters
ExternalNumberSAP external material id
Returns
Internal number

◆ getMaterialList()

TPSAP::MM::getMaterialList   args  

Matchcode search for material masters in SAP.

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

Parameters
argsnone
Returns
OK and global TCL array ::MMResultDat

◆ getMaterialMasterInfo()

TPSAP::MM::getMaterialMasterInfo   MaterialNumber ?Plant? ?ValuationArea? ?ValuationType? args  

Retrieves SAP material master information using the BAPI BAPI_MATERIAL_GET_DETAIL.

Parameters
MaterialNumber
Plant(optional - empty)
ValuationArea(optional - empty)
ValuationType(optional - empty)
argsnone
Returns
OK and global TCL array ::SapMatDat or NOT_FOUND

◆ getMaterialMasterInfoRfc()

TPSAP::MM::getMaterialMasterInfoRfc   MaterialNumber args  

Retrieves SAP material master information using the BAPI RFC_GET_MATERIAL_DATA.

Parameters
MaterialNumber
argsnone
Returns
OK and global TCL array ::SapMatDat, NOT_FOUND or ERROR

◆ getMaterialMasterLongText()

TPSAP::MM::getMaterialMasterLongText   MaterialNumber args  

Retrieves the SAP material master long text.

Parameters
MaterialNumber
argsnone
Returns
SAP long text as a string

◆ getPlantsOfMaterial()

TPSAP::MM::getPlantsOfMaterial   MaterialNumber args  

Retrieves all existing SAP plants including the maintained views for a given material master. The views are returned using the PSTAT attribute using one character per plant. The following mapping can be used to determine which view is maintained in which plant:

A Work scheduling
B Accounting
C Classification
D MRP
E Purchasing
F Production resources/tools
G Costing
K Basic data
L Storage
P Forecasting
Q Quality management
S Warehouse management
V Sales
X Plant stocks
Z Storage location stocks
.

Parameters
MaterialNumber
argsnone
Returns
OK and global TCL array ::MMResultDat, NOT_EXIST or ERROR

◆ getProductionVersionTableIndex()

TPSAP::MM::getProductionVersionTableIndex   MaterialNumber Plant VersionId args  

Reads all production versions for a given MM and returns the table index for this version. This index can then be used as as input for the call transaction prod version update. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system.

Parameters
MaterialNumber
Plant
VersionId
Returns
OK and Table Index as TCL list, NOT_FOUND or ERROR with message

◆ getTaxIndicator4MaterialMaster()

TPSAP::MM::getTaxIndicator4MaterialMaster   MaterialNumber ?Plant? args  

Returns the tax indicator (purchase view) for a given MM.

Deprecated:
Please use the new getTaxIndicator4MaterialMaster2 function
Parameters
MaterialNumber
Plant- optional (default - Empty) - If empty, the tax indicator is returned for all countries the MM exists for (based on the plant)
Returns
OK and global ::sap_result_array, NOT_FOUND or ERROR with hex message

◆ getTaxIndicator4MaterialMaster2()

TPSAP::MM::getTaxIndicator4MaterialMaster2   MaterialNumber ?Plant?  

Returns the tax indicator (purchase view) for a given MM.

Parameters
MaterialNumber
Plant- optional (default - Empty) - If empty, the tax indicator is returned for all countries the MM exists for (based on the plant)
Returns
dict structure with the following elements:
  • Status OK|ERROR
  • JCoStatus OK|ERROR
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n) and TCL array ::MMReadTaxInd

Sample code sequence

1 set resultDict [::TPSAP::MM::getTaxIndicator4MaterialMaster2 200-200 1000]
2 if { [dict get $resultDict Status] eq "OK" } {
3  # data found
4  # data can be evaluated in the array ::MMReadTaxInd
5  foreach e [array names ::MMReadTaxInd] {
6  puts "$e => $::MMReadTaxInd($e)"
7  }
8 } else {
9  # not found or error
10 }

◆ getViewList4Plant()

TPSAP::MM::getViewList4Plant   MaterialMaster Plant  

Retrieves all existing views for a given SAP material master and plant.

Parameters
MaterialMaster
Plant
Returns
TCL list with all existing views

◆ linkMaterialMaster2DIR()

TPSAP::MM::linkMaterialMaster2DIR   strMatNr strDocNr strDocType strDocPart strDocVers ?intLinkTabIndex? ?blnSelectAllVersions? args  

Links a Material Master to an existing DIR. The link is created from the MM to the DIR (and not the other way around), so it will be created even if the DIR is already released. To achieve this functionality, the T4S call transaction mechanism is used. Therefore it is necessary to implement the T4S call transaction ABAP as well (T4S SAP Transport Package TESISPLM_T4S_CALL_TRANSACTION). Keep in mind: If the customer uses the ALV Grid in SAP, Call Transaction does not work anymore...

Parameters
strMatNr- Material Master
strDocNr- DIR number
strDocType- DIR type
strDocPart- DIR part
strDocVers- DIR version
intLinkTabIndex- optional (default = 04) - Index of MM-DIR link Tab in SAP MM02 additional data section
blnSelectAllVersions- optional (default = true) - If true, the checkbox "all versions" will be checked so that a new row can be added to the DIR link table
Returns
OK or ERROR with message

◆ maintainProductionVersion()

TPSAP::MM::maintainProductionVersion   args  

Creates or updates a production version in SAP using CALL TRANSACTION and SAP transaction C223. In order to use this function, the T4S SAP transport package "TESISPLM_T4S_CALL_TRANSACTION" and TESISPLM_T4S_MM (for the read/update) must be imported in the corresponding SAP system. All input parameters are transported using the global TCL array ::SAPDat and the array pattern ProdVersion. Mandatory attributes are: ::SAPDat(ProdVersion:MKAL:WERKS) ::SAPDat(ProdVersion:MKAL:MATNR) ::SAPDat(ProdVersion:MKAL_EXPAND:VERID) ::SAPDat(ProdVersion:MKAL_EXPAND:TEXT1) ::SAPDat(ProdVersion:MKAL_EXPAND:ADATU) ::SAPDat(ProdVersion:MKAL_EXPAND:BDATU)

Returns
OK or ERROR with hex message

◆ readMaterialConfiguration()

TPSAP::MM::readMaterialConfiguration   MaterialNumber ?Plant? args  

Reads the configuration of a material variant This call requires the function /TESISPLM/MM_GET_CONFIGURATION to be imported into the SAP system.

Parameters
MaterialNumber
Plant- Optional - Default: Empty
Returns
OK and global TCL array ::MMConfResultDat, NOT_FOUND or ERROR with message

◆ readProductionVersion()

TPSAP::MM::readProductionVersion   MaterialNumber Plant ?VersionId? args  

Reads one or all production versions for a given MM. This call requires the function /TESISPLM/T4S_READ_PROD_VERS to be imported into the SAP system.

Parameters
MaterialNumber
Plant
VersionId- optional (default = empty); If provided, only this version is read from SAP.
Returns
OK and global TCL array ::sap_result_array, NOT_FOUND or ERROR with message

◆ reserveMaterialNumber()

TPSAP::MM::reserveMaterialNumber   MaterialType Industry  

Allocates the next free material master id in SAP.

Deprecated:
The function is deprecated, please use TPSAP::MM::reserveMaterialNumber2
Parameters
MaterialType- SAP material type for which the number should be allocated
Industry- SAP industry sector for which the number should be allocated
Returns
Allocated material master id or an empty string in case of an error

◆ reserveMaterialNumber2()

TPSAP::MM::reserveMaterialNumber2   MaterialType Industry  

Allocates the next free material master id in SAP.

Parameters
MaterialType- SAP material type for which the number should be allocated
Industry- SAP industry sector for which the number should be allocated
Returns
StatusDict dict structure with the following elements:
  • Status OK|ERROR|JCO_ERROR
  • MATERIAL reserved material number (only exists if the reservation of the material number was successful)
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n)

◆ setClassificationData_by_Reference()

TPSAP::MM::setClassificationData_by_Reference   SourceObjectKey TargetObjectKey ?ExecuteStoreSAPDat2MultiTransferCache4Type?  

Used to create an object classification based on an existing SAP object (reference object). IMPORTANT: In order to activate the multi classification functionality, T4S::storeSAPDat2MultiTransferCache Material (or any other T4S transfer object) must be called in advance.

Parameters
SourceObjectKey- The SAP object, from which the classification data should be read.
TargetObjectKey- The SAP object, to which the classification data should be copied to.
ExecuteStoreSAPDat2MultiTransferCache4Type(optional - empty) - If set, the function T4S::storeSAPDat2MultiTransferCache will be called using this type
Returns
TCL list with all existing views

◆ setCrossPlantConfigurableMaterial()

TPSAP::MM::setCrossPlantConfigurableMaterial   MaterialNumber CrossPlantConfigurableMaterialNumber args  

Sets the Cross Plant Configurable Material number for a given Material Master.

Parameters
MaterialNumber
CrossPlantConfigurableMaterialNumber
Returns
OK or ERROR (with message)

◆ setKonfMatFlag()

TPSAP::MM::setKonfMatFlag   MatNr Flag args  

Set a flag if a material master is a configurable material in SAP. To achieve this functionality, the T4S call transaction mechanism is used. Therefor it is necessary to implement the T4S call transaction ABAP as well.

Parameters
MatNr
Flag- X or empty
Returns
OK or ERROR (with message)

◆ setMaterialMaster_by_Reference()

TPSAP::MM::setMaterialMaster_by_Reference   DTM_Name blnOverwriteFields MatNr_Reference ?Plant? ?Comp_Code? ?Val_Area? ?Val_Type? ?Storage_Loc? ?SalesOrg? ?Distr_Channel? ?Whse_Number? ?Storage_Type? args  

Used to create a material master on the basis of a existing SAP material master.

Parameters
DTM_Name
blnOverwriteFields- if "false", no value already set in the global TCL array ::SAPDat will be overwritten
MatNr_Reference- template material master id
Plant(optional - empty)
Comp_Code(optional - empty)
Val_Area(optional - empty)
Val_Type(optional - empty)
Storage_Loc(optional - empty)
SalesOrg(optional - empty)
Distr_Channel(optional - empty)
Whse_Number(optional - empty)
Storage_Type(optional - empty)
Returns

◆ setMaterialMasterLongText()

TPSAP::MM::setMaterialMasterLongText   LineIndex LanguageIso TextId TextLine ?FormatColumn? args  

Fills the internal buffer for the corresponding MaterialMaster long text transfer to SAP.

Parameters
LineIndexTable line index in the buffer (not the textline index)
LanguageIsoLangugae indicator according to ISO 639
TextIdText ID
TextLineText line String
FormatColumnThe FormatColumn contains format keys which define the output formatting of the text or initiate control commands. possible values are (extracted from the SAP Help):
/ New line The subsequent text is written to a new line during output formatting. The formatting attributes of the last paragraph format are retained.
/: SAPscript control command The characters contained in the actual text line are not output as text but are regarded as a control command. They are not interpreted or executed until output formatting of the text. Control commands must always fit into a line fully. Subsequent lines are not allowed.
/* Comment line This line is not taken into account during output formatting of the text.
= Extended line This line is not subject to the line formatting in the SAPscript editor. The text contained in this line is appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/= Like extended line But the subsequent text is placed in a new line during output formatting.
( Raw line The subsequent editor line is not interpreted by the SAPscript composer during output formatting. This means that character formats, symbols, tab characters, masking characters, or hypertext links which may be contained in this line are not evaluated and are therefore passed unchanged to the output device. The text contained in this line is also appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/( Like raw line But the subsequent text is placed in a new line during output formatting.
>x Fixed line
argsreserved for future usage
Returns
Always OK

◆ setMaterialMasterNoteLongText()

TPSAP::MM::setMaterialMasterNoteLongText   LineIndex LanguageIso Plant TextLine ?FormatColumn? args  

Fills the internal buffer for the corresponding MaterialMaster Note long text transfer to SAP.

Parameters
LineIndexTable line index in the buffer (not the text-line index)
LanguageIsoLanguage indicator according to ISO 639
PlantPlant Id
TextLineText line String
FormatColumnThe FormatColumn contains format keys which define the output formatting of the text or initiate control commands. possible values are (extracted from the SAP Help):
/ New line The subsequent text is written to a new line during output formatting. The formatting attributes of the last paragraph format are retained.
/: SAPscript control command The characters contained in the actual text line are not output as text but are regarded as a control command. They are not interpreted or executed until output formatting of the text. Control commands must always fit into a line fully. Subsequent lines are not allowed.
/* Comment line This line is not taken into account during output formatting of the text.
= Extended line This line is not subject to the line formatting in the SAPscript editor. The text contained in this line is appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/= Like extended line But the subsequent text is placed in a new line during output formatting.
( Raw line The subsequent editor line is not interpreted by the SAPscript composer during output formatting. This means that character formats, symbols, tab characters, masking characters, or hypertext links which may be contained in this line are not evaluated and are therefore passed unchanged to the output device. The text contained in this line is also appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/( Like raw line But the subsequent text is placed in a new line during output formatting.
>x Fixed line
argsreserved for future usage
Returns
Always OK

◆ setMaterialMasterSalesLongText()

TPSAP::MM::setMaterialMasterSalesLongText   LineIndex LanguageIso SalesOrg DistrChan TextLine ?FormatColumn? args  

Fills the internal buffer for the corresponding MaterialMaster Sales long text transfer to SAP.

Parameters
LineIndexTable line index in the buffer (not the text-line index)
LanguageIsoLanguage indicator according to ISO 639
SalesOrgSales Organization
DistrChanDistribution Channel
TextLineText line String
FormatColumnThe FormatColumn contains format keys which define the output formatting of the text or initiate control commands. possible values are (extracted from the SAP Help):
/ New line The subsequent text is written to a new line during output formatting. The formatting attributes of the last paragraph format are retained.
/: SAPscript control command The characters contained in the actual text line are not output as text but are regarded as a control command. They are not interpreted or executed until output formatting of the text. Control commands must always fit into a line fully. Subsequent lines are not allowed.
/* Comment line This line is not taken into account during output formatting of the text.
= Extended line This line is not subject to the line formatting in the SAPscript editor. The text contained in this line is appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/= Like extended line But the subsequent text is placed in a new line during output formatting.
( Raw line The subsequent editor line is not interpreted by the SAPscript composer during output formatting. This means that character formats, symbols, tab characters, masking characters, or hypertext links which may be contained in this line are not evaluated and are therefore passed unchanged to the output device. The text contained in this line is also appended directly to the character of the preceding text line which was output last. If this is not required, there must be at least one blank at the beginning of the extended line.
/( Like raw line But the subsequent text is placed in a new line during output formatting.
>x Fixed line
argsreserved for future usage
Returns
Always OK

◆ setTaxIndicator4MaterialMaster()

TPSAP::MM::setTaxIndicator4MaterialMaster   MaterialNumber Plant TaxIndicator ?PurchaseViewIndex? args  

Sets the tax indicator (purchase view) for a given MM. This call requires the function /TESISPLM/T4S_CALL_TRANSACTION to be imported into the SAP system.

Parameters
MaterialNumber
Plant
TaxIndicator
PurchaseViewIndex- optional (default empty) - The index of the purchase view in MM02; If empty, this index will be calculated based on the existing views of the given MM.
Returns
OK or ERROR with hex message

◆ updateMaterialMaster()

TPSAP::MM::updateMaterialMaster   UpdateMode  

This function creates/updates or extents a MaterialMaster via the BAPi_MATERIAL_SAVEDAT API. If no external material number is specified an new one is generated by the TPSAP::MM::reserveMaterialNumber function.

Deprecated:
The function is deprecated, please use TPSAP::MM::updateMaterialMaster2
Parameters
UpdateModeDefines the update mode for that transfer
  • SetDeleteFlag marks the Material for deletion
  • Default default update mode functionality is controlled by the mapping
Returns
List of Status, Material number and error message

Sample code sequence

1 ::TPSAP::MM::initMaterialMasterStructure
2 set ::SAPDat(Material:HeadData:MATERIAL) $MaterialNumber
3 set ::SAPDat(Material:HeadData:IND_SECTOR) M
4 set ::SAPDat(Material:HeadData:MATL_TYPE) FERT
5 set ::SAPDat(Material:HeadData:BASIC_VIEW) X ;# Basic Data View
6 
7 # Either set "BASE_UOM" or "BASE_UOM_ISO" (or both consistently):
8 set ::SAPDat(Material:MaraData:BASE_UOM) EA
9 #set ::SAPDat(Material:MaraData:BASE_UOM_ISO) ""
10 set ::SAPDat(Material:MaraData:CAD_ID) "X" ;# CAD indicator
11 set ::SAPDat(Material:MaraData:PUR_STATUS) $Status
12 
13 set ::SAPDat(Material:MaktData:LANGU_ISO:1) EN
14 set ::SAPDat(Material:MaktData:MATL_DESC:1) "English Description"
15 
16 set ResultList [::TPSAP::MM::updateMaterialMaster Default]
17 if {[lindex $ResultList 0] eq "OK"} {
18  # everything thing was okay
19 } else {
20  # some error occurs
21 }

◆ updateMaterialMaster2()

TPSAP::MM::updateMaterialMaster2   UpdateMode  

This function creates/updates or extents a MaterialMaster via the BAPi_MATERIAL_SAVEDAT API. If no external material number is specified an new one is generated by the TPSAP::MM::reserveMaterialNumber function.

Parameters
UpdateModeDefines the update mode for that transfer
  • SetDeleteFlag marks the Material for deletion
  • Default default update mode functionality is controlled by the mapping
Returns
StatusDict dict structure with the following elements:
  • Status OK|ERROR|JCO_ERROR
  • MATERIAL created material number (only exists if the reservation or creation/update of the material was successful)
  • ErrorMessage last error message
  • NoOfMessages number of messages
  • LogMessageMessage(1 .. n)
  • LogMessageSeverity(1 .. n)

Sample code sequence

1 ::TPSAP::MM::initMaterialMasterStructure
2 set ::SAPDat(Material:HeadData:MATERIAL) $MaterialNumber
3 set ::SAPDat(Material:HeadData:IND_SECTOR) M
4 set ::SAPDat(Material:HeadData:MATL_TYPE) FERT
5 set ::SAPDat(Material:HeadData:BASIC_VIEW) X ;# Basic Data View
6 
7 # Either set "BASE_UOM" or "BASE_UOM_ISO" (or both consistently):
8 set ::SAPDat(Material:MaraData:BASE_UOM) EA
9 #set ::SAPDat(Material:MaraData:BASE_UOM_ISO) ""
10 set ::SAPDat(Material:MaraData:CAD_ID) "X" ;# CAD indicator
11 set ::SAPDat(Material:MaraData:PUR_STATUS) $Status
12 
13 set ::SAPDat(Material:MaktData:LANGU_ISO:1) EN
14 set ::SAPDat(Material:MaktData:MATL_DESC:1) "English Description"
15 
16 set ResultDict [::TPSAP::MM::updateMaterialMaster2 Default]
17 if {[dict get $ResultDict Status] eq "OK"} {
18  # everything thing was okay
19 } else {
20  # some error occurs
21 }