T4S4  18.1 C7177 A20283
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::CORE Namespace Reference

Functions

 convertTimeString2Secs TimeString
 This function converts a given time string into the number of seconds of the day. More...
 
 getLogLineMessageType4rc rc_func ?strDefaultMessageType? args
 Calculates the corresponding message type (for tpwrite log lines) based on the input return code. More...
 
 getSessionLogChannel args
 Returns the Session log-file name of the current transfer session. If no session log-file name is available, the default LogChannel is used. More...
 
 getTransactionLogChannel args
 Returns the Log-channel information defined for the active transaction. More...
 
 initStatusInfo args
 Initializes the global StatusInfo buffer array. More...
 
 matchStringWithRegExp compareExpr matchString args
 
 resetLastErrorMessage args
 Initializes the global ErrorMessage buffer array. More...
 
 sendMail2BGS2 addr from smtp port message org subject xmailer ttype prio args
 This function will send a mail via the BGSs and a smtp. More...
 
 sendMailWithErrorList FromMailAddr MailAddr Subject ErrorMessage ?Prio?
 Send an email via the BGS server to a specified receiver including all stored error messages. More...
 
 setTransactionLogChannel TransactionLogChannel
 Stores the name of the Transaction log-file into the internal buffer. More...
 
 storeMessage2 MessageSource Message ?Kind? ?Format?
 writes an entry to the internal error message buffer so so that the information can be displayed to the Teamcenter user More...
 
 storeMessage2DatasetLogfile MessageSource Message ?Kind? ?Format?
 writes an entry to the internal message buffer so that the information can written to the log-file dataset More...
 
 storeUserMessage Severity MessageId ?S1? ?S2? ?S3? ?S4? ?S5?
 writes an user error entry to the internal error message buffer so that the information can be displayed to the Teamcenter user More...
 
 tp_split strInput strSplit ?blnTrim?
 Just like the TCL split, but with the possibility to use more than one character as split parameter. More...
 
 writeLogLineWithAttachment2BGS strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strHost? ?strPort? args
 Creates an attachment on the given server and adds it to the specified log line. More...
 
 writeVersionInfo2LogChannel LogChannel args
 Writes the version info to a given log channel. More...
 

Variables

 CtrlParam
 
 LastError
 
 TransactionLogChannel
 

Function Documentation

◆ convertTimeString2Secs()

T4X::CORE::convertTimeString2Secs   TimeString  

This function converts a given time string into the number of seconds of the day.

Parameters
TimeStringin one of the following formats
  • hh:mm:ss
  • hh:mm
  • hh
Returns
time value converted into seconds of the day

Referenced by T4X::BATCHJOB::EXPORT::createJob(), and T4X::BATCHJOB::IMPORT::createJob().

◆ getLogLineMessageType4rc()

T4X::CORE::getLogLineMessageType4rc   rc_func ?strDefaultMessageType? args  

Calculates the corresponding message type (for tpwrite log lines) based on the input return code.

Deprecated:
Use PL4X::CORE::getLogLineMessageType4rc instead
Parameters
rc_func- return code for which the message type should be calculated
strDefaultMessageType- OPTIONAL - default: INTERN; Can be used to set DEBUG or any other message type as default
Returns
INTERN or ERROR based on the given rc_func

References PL4X::CORE::getLogLineMessageType4rc().

Referenced by T4X::MESSAGING::acknowledgeMessage(), T4X::MESSAGING::closeAll(), T4X::MESSAGING::closeConnection(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object2(), TPSAP::WORKCENTER::getWorkcenterInfoByID(), T4X::CUSTOM::MAPPING::TOOLBOX::importNamedReference(), TPSAP::performSapCall(), T4X::MESSAGING::receiveMessage(), releaseProjectDefinition(), T4X::CUSTOM::MAPPING::TOOLBOX::saveItemWithUnlock(), T4X::CUSTOM::MAPPING::TOOLBOX::selectTC_Object(), and T4X::MESSAGING::startConnection().

◆ getSessionLogChannel()

T4X::CORE::getSessionLogChannel   args  

Returns the Session log-file name of the current transfer session. If no session log-file name is available, the default LogChannel is used.

Deprecated:
Use PL4X::CORE::getSessionLogChannel instead
Parameters
none
Returns
Relative filename of the sessionlogfile

References PL4X::CORE::getSessionLogChannel().

Referenced by T4X::MESSAGING::acknowledgeMessage(), TPSAP::S4::activateUconBlacklistCallWrappers4System(), T4X::USEREXIT::afterTransfer(), T4X::USEREXIT::beforeTransfer(), ITK::BOMLINE_cutbomline(), TPSAP::CALL_TRANSACTION::call_transaction(), TPSAP::REFSETOFOPERATIONS::callBAPI_REFSETOFOPERATIONS_CREATE(), TPSAP::MM::changeProductionVersion(), T4X::BATCHJOB::EXPORT::checkConnection2ERP(), T4X::BATCHJOB::IMPORT::checkConnection2ERP(), T4S::CONNECTION2SAP::checkConnection2SAP(), T4S::CONNECTION2SAP::checkConnection2SAP_legacy(), TPSAP::S4::checkIfCallIsUconBlacklisted(), TPSAP::S4::checkIfTargetSystemIsS4HANA(), TPSAP::MM::checkProductionVersion(), T4S::DIR::MAPPING::checkSAPDocumentKey(), T4X::WORKFLOW::BATCHJOB::CUSTOM::checkTriggerStatus4Retry(), T4X::MESSAGING::closeAll(), T4X::MESSAGING::closeConnection(), T4S::BOM::MAPPING::convertTcClassicSelectionCondition2SAP(), T4S::BOM::MAPPING::convertTcSelectionCondition2SAP(), T4S::BOM::MAPPING::convertTcVariantSelectionCondition2SAP(), T4X::TEST::WORKFLOW::createBatchJob4Workflow(), TPSAP::BOM::BAPI::createBillOfMaterial2(), TPSAP::MM::createProductionVersion(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object(), T4S::MM::CUSTOM::ITEM::IMPORT::createTC_Object(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object2(), T4S::PROP::CUSTOM::MAPPING::defineStyle(), TPSAP::MM::deleteProductionVersion(), T4X::BATCHJOB::EXPORT::executeExportJob(), T4X::BATCHJOB::IMPORT::executeImportJob(), T4S::QUERY::CUSTOM::MAPPING::executeQuery(), T4S::QUERY::CUSTOM::MAPPING::executeQuery4MaterialMaster(), T4X::SOA::executeTCSOACall(), T4X::TEST::WORKFLOW::executeTcWorkflowJob(), T4X::TC::MAPPING::FieldMapping(), T4X::TC::MAPPING::findIndexedObjectId4Value(), T4X::TC::MAPPING::findIndexedObjectList4Attribute(), T4X::TC::MAPPING::findObjectId4Value(), T4X::TC::MAPPING::findObjectList(), T4X::TC::MAPPING::findObjectList4Value(), T4X::TC::MAPPING::findRootTaskObjectList(), TPSAP::S4::get_BAPI_TE_MARA_Name4TargetSystem(), TPSAP::S4::get_BAPI_TE_MARAX_Name4TargetSystem(), T4S::PROP::CUSTOM::MAPPING::GetBOMData(), T4S::PROP::CUSTOM::MAPPING::GetBOMDataView(), T4S::PROP::CUSTOM::MAPPING::GetBUSINESSPARTNERData(), T4S::PROP::CUSTOM::MAPPING::GetBUSINESSPARTNERDataView(), T4X::SOA::getConnectionParameters(), T4S::PROP::CUSTOM::MAPPING::GetDIRData(), T4S::PROP::CUSTOM::MAPPING::GetDIRDataView(), T4S::DIR::MAPPING::getDocumentInfoRecordOriginals(), T4S::PROP::CUSTOM::MAPPING::GetECMData(), T4S::PROP::CUSTOM::MAPPING::GetECMDataView(), T4S::PROP::CUSTOM::MAPPING::GetEQUIData(), T4S::PROP::CUSTOM::MAPPING::GetEQUIDataView(), TPSAP::ECM::getExternalChangeNumber(), TPSAP::DIR::getExternalDocumentNumber(), TPSAP::MM::getExternalMaterialNumber(), T4S::PROP::CUSTOM::MAPPING::GetFUNCLOCData(), T4S::PROP::CUSTOM::MAPPING::GetFUNCLOCDataView(), TPSAP::ECM::getInternalChangeNumber(), TPSAP::DIR::getInternalDocumentNumber(), TPSAP::MM::getInternalMaterialNumber(), T4X::getLocalizationString(), T4X::TC::MAPPING::getLogChannelBasedOnTransactionId(), T4S::MM::CUSTOM::ITEM::IMPORT::getMaterialMasterInfo(), TPSAP::S4::getMatNrLength4TargetSystem(), T4S::PROP::CUSTOM::MAPPING::GetMMData(), T4S::PROP::CUSTOM::MAPPING::GetMMDataView(), T4X::TC::MAPPING::getObjectAttributeValue(), T4X::TC::MAPPING::getObjectsValueList(), T4X::TC::MAPPING::getPreferenceValue(), TPSAP::MM::getProductionVersionTableIndex(), getProjectInfo(), T4X::TC::MAPPING::getQueryArgumentValue(), T4X::TC::MAPPING::getRootTaskFieldMappingValueList(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_BillOfMaterial(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_BusinessPartner(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_ChangeMaster(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_DocumentInfoRecord(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_EquipmentMaster(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_FunctionalLocation(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_MaterialMaster(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_QueryResultObject(), T4S::PROP::CUSTOM::MAPPING::GetSAPData_Vendor(), TPSAP::getSessionLogChannel(), TPSAP::getSystemInfoWithReleaseVersion(), TPSAP::MM::getTaxIndicator4MaterialMaster(), TPSAP::VENDOR::getVendorContacts(), T4S::PROP::CUSTOM::MAPPING::GetVENDORData(), T4S::PROP::CUSTOM::MAPPING::GetVENDORDataView(), TPSAP::WORKCENTER::getWorkcenterHierarchyInfo(), TPSAP::WORKCENTER::getWorkcenterInfoByID(), T4X::TC::MAPPING::getWorkflowArgumentValue(), T4X::TC::MAPPING::getWorkflowArgumentValue2(), T4X::TC::MAPPING::getWorkflowArgumentValue3(), T4X::CUSTOM::MAPPING::TOOLBOX::importNamedReference(), T4S::QUERY::CUSTOM::MAPPING::importQueryRowViaBatch(), T4X::SOA::importSSLCertificate(), T4X::TC::MAPPING::IndexedFieldMapping(), TPSAP::MM::linkMaterialMaster2DIR(), TPSAP::BOM::BAPI::maintainBillOfMaterial2(), TPSAP::MM::maintainProductionVersion(), T4X::SOA::performEBSCall(), T4X::SOA::performGenericWebServiceCall(), T4X::SOA::performGenericWebServiceCall2(), T4X::SOA::performGenericWebServiceCallFireAndForget(), T4X::SOA::performSAPBAPICall(), TPSAP::performSapCall(), T4X::SOA::performSAPESCall(), TPSAP::MM::readMaterialConfiguration(), TPSAP::MM::readProductionVersion(), T4X::MESSAGING::receiveMessage(), T4S::reconnect2SAP(), releaseProjectDefinition(), T4X::TC::MAPPING::RootTaskFieldMapping(), TPSAP::ROUTING::RoutingGetDetail(), TPSAP::S4::runUconBlacklistCheck(), T4S::BOM::CUSTOM::MAPPING::SAP_BillOfMaterial2TC_Object(), T4S::ECM::CUSTOM::MAPPING::SAP_ChangeMaster2TC_Object(), T4S::DIR::CUSTOM::MAPPING::SAP_DocumentInfoRecord2TC_Object(), T4S::EQUI::CUSTOM::MAPPING::SAP_Equipment2TC_Object(), T4S::FUNCLOC::CUSTOM::MAPPING::SAP_FuncLoc2TC_Object(), T4S::MM::CUSTOM::MAPPING::SAP_MaterialMaster2TC_Object(), T4S::MM::CUSTOM::ITEM::IMPORT::SAP_MaterialMasterMapping2TC_Object(), T4S::VENDOR::CUSTOM::MAPPING::SAP_Vendor2TC_Object(), T4X::TC::MAPPING::save_unlockTcObject(), T4X::CUSTOM::MAPPING::TOOLBOX::saveItemWithUnlock(), T4X::CUSTOM::MAPPING::TOOLBOX::selectTC_Object(), T4S::MM::CUSTOM::ITEM::IMPORT::selectTC_Object(), T4X::CUSTOM::MAPPING::TOOLBOX::selectTC_ScheduleObject(), T4X::MESSAGING::sendBinaryMessage(), T4X::MESSAGING::sendStringMessage(), T4X::WORKFLOW::BATCHJOB::CUSTOM::sendTC_InfoEMail(), TPSAP::CLASS::setClassification_by_Reference(), T4X::SOA::setProxy(), TPSAP::MM::setTaxIndicator4MaterialMaster(), T4X::MESSAGING::startConnection(), storeMessage2(), storeMessage2DatasetLogfile(), T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterial(), T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterialPosition(), T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterialPostAction(), T4S::ECM::CUSTOM::MAPPING::TC_Object2SAP_ChangeMaster(), T4S::DIR::CUSTOM::MAPPING::TC_Object2SAP_DocumentInfoRecord(), T4S::EQUI::CUSTOM::MAPPING::TC_Object2SAP_Equipment(), T4S::FUNCLOC::CUSTOM::MAPPING::TC_Object2SAP_FuncLoc(), T4S::MM::CUSTOM::MAPPING::TC_Object2SAP_MaterialMaster(), T4S::VENDOR::CUSTOM::MAPPING::TC_Object2SAP_Vendor(), T4S::MM::CUSTOM::ITEM::IMPORT::updateTC_Object(), T4S::CONNECTION2SAP::validateAccess2SCSI_GET_SYSTEM_INFO(), T4S::DIR::CONFIG::writeDocumentInfoRecordKeyDefaults(), T4S::DIR::CONFIG::writeDocumentInfoRecordOriginalsConfig(), T4X::BATCHJOB::TOOLBOX::writeTcUser2LogIndex(), and T4X::BATCHJOB::IMPORT::writeTransactionLog().

◆ getTransactionLogChannel()

T4X::CORE::getTransactionLogChannel   args  

Returns the Log-channel information defined for the active transaction.

Parameters
none
Returns
Relative file name of the TransactionLogFile

Referenced by TPSAP::performSapCall(), and T4X::TC::MAPPING::storeReverseMapping2TcObject2().

◆ initStatusInfo()

T4X::CORE::initStatusInfo   args  

Initializes the global StatusInfo buffer array.

Parameters
none
Returns
none

Referenced by T4X::BATCHJOB::EXPORT::executeExportJob(), T4X::BATCHJOB::IMPORT::executeImportJob(), and T4X::TEST::WORKFLOW::executeTcWorkflowJob().

◆ matchStringWithRegExp()

T4X::CORE::matchStringWithRegExp   compareExpr matchString args  

References tpwrite().

◆ resetLastErrorMessage()

T4X::CORE::resetLastErrorMessage   args  

Initializes the global ErrorMessage buffer array.

Parameters
none
Returns
none

Referenced by T4X::BATCHJOB::EXPORT::executeExportJob(), T4X::BATCHJOB::IMPORT::executeImportJob(), and T4X::TEST::WORKFLOW::executeTcWorkflowJob().

◆ sendMail2BGS2()

T4X::CORE::sendMail2BGS2   addr from smtp port message org subject xmailer ttype prio args  

This function will send a mail via the BGSs and a smtp.

Parameters
addr: receiver mail address
from: sender mail address
smtp: <DNS|IP|HOST> address of the SMTP server
port: smpt server port (not yet supported, for future usage)
messageemail message text
org: Inhalt des ORG Flags
subjectsubject of the email
xmailer- dummy - (for future usage)
ttype: HTML | PLAIN
prio: "" | high | low
args: list of file attachments (please make sure that the files are copied to the BGS before the mail is send)
Returns
Status of the mail transfer

Sample code sequence

1 #
2 # sample for simple mail with high priority
3 #
4 set Smtp $::env(TPS_SMTP)
5 set From "T4S"
6 set Org "T4S-Server([info hostname])"
7 set Xmailer "TP-CM"
8 set Message "My mail text\n"
9 set Status [::T4X::CORE::sendMail2BGS2 "$MailAddr" "$From" "$Smtp" "0" "$Message" "$Org" "$Subject" "$Xmailer" PLAIN high]
10 #
11 # sample for html mail with low priority
12 #
13 set HtmlMessage "<strong>My html mail text<\strong>\n"
14 set Status [::T4X::CORE::sendMail2BGS2 "$MailAddr" "$From" "$Smtp" "0" "$HtmlMessage" "$Org" "$Subject" "$Xmailer" HTML low]

Referenced by sendMailWithErrorList().

◆ sendMailWithErrorList()

T4X::CORE::sendMailWithErrorList   FromMailAddr MailAddr Subject ErrorMessage ?Prio?  

Send an email via the BGS server to a specified receiver including all stored error messages.

Parameters
FromMailAddrsender mail address(e.g. i.am@.nosp@m.sour.nosp@m.ce.co.nosp@m.m)
MailAddrreceiver mail address(e.g. i.am@.nosp@m.xyz..nosp@m.com)
Subjectsubject string of the email
ErrorMessageprefix string for the message body
Prio: "" | high | low
Returns
Status of the mail transfer

Sample code sequence

1 #
2 # sample with high priority
3 #
4 set FromMailAddr "Teamcenter.Gateway@myDomain.org"
5 set MailAddr "Teamcenter.Administrator@myDomain.org"
6 set Subject "My Subject"
7 set Message "My mail text\n"
8 #
9 set Status [::T4X::CORE::sendMailWithErrorList $FromMailAddr $MailAddr $Subject $Message high]
10 #
11 # sample with low priority
12 #
13 set Status [::T4X::CORE::sendMailWithErrorList $FromMailAddr $MailAddr $Subject $Message low]

References sendMail2BGS2().

◆ setTransactionLogChannel()

T4X::CORE::setTransactionLogChannel   TransactionLogChannel  

Stores the name of the Transaction log-file into the internal buffer.

Parameters
TransactionLogChannel
Returns
none

Referenced by T4X::BATCHJOB::IMPORT::executeImportJob().

◆ storeMessage2()

T4X::CORE::storeMessage2   MessageSource Message ?Kind? ?Format?  

writes an entry to the internal error message buffer so so that the information can be displayed to the Teamcenter user

Parameters
MessageSourcedefines the origin system or module of the message
Messagemessages string default format is hex encoded
KindERROR | INFO | WARNING
FormatHEX|NOHEX defines if the message string is hex encoded or not default is NOHEX
Returns
none

References getSessionLogChannel(), tpco_formatHEX16(), tpco_getHostName(), and tpwrite().

Referenced by T4S::CONNECTION2SAP::checkConnection2SAP(), T4S::CONNECTION2SAP::checkConnection2SAP_legacy(), T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterial(), T4S::BOM::CUSTOM::MAPPING::TC_Object2SAP_BillOfMaterialPosition(), T4S::DIR::CUSTOM::MAPPING::TC_Object2SAP_DocumentInfoRecord(), T4S::FUNCLOC::CUSTOM::MAPPING::TC_Object2SAP_FuncLoc(), T4S::VENDOR::CUSTOM::MAPPING::TC_Object2SAP_Vendor(), T4X::TRANSLOG::writeBomLineMappingStatusLog(), T4X::TRANSLOG::writeCustomMappingStatusLog(), and T4X::TRANSLOG::writeCustomReverseMappingStatusLog().

◆ storeMessage2DatasetLogfile()

T4X::CORE::storeMessage2DatasetLogfile   MessageSource Message ?Kind? ?Format?  

writes an entry to the internal message buffer so that the information can written to the log-file dataset

Parameters
MessageSourcedefines the origin system or module of the message
Messagemessages string default format is hex encoded
KindERROR | INFO | WARNING
FormatHEX|NOHEX defines if the message string is hex encoded or not default is NOHEX
Returns
none

References getSessionLogChannel(), tpco_formatHEX16(), tpco_getHostName(), and tpwrite().

◆ storeUserMessage()

T4X::CORE::storeUserMessage   Severity MessageId ?S1? ?S2? ?S3? ?S4? ?S5?  

writes an user error entry to the internal error message buffer so that the information can be displayed to the Teamcenter user

Parameters
Severity- ERROR | INFO | WARNING - by unknown will be set to ERROR
MessageId- for UserError use the range 919000-919999
S1Character string being substituted into the internationalized message associated with this ifail code
S2Character string being substituted into the internationalized message associated with this ifail code
S3Character string being substituted into the internationalized message associated with this ifail code
S4Character string being substituted into the internationalized message associated with this ifail code
S5Character string being substituted into the internationalized message associated with this ifail code
Returns
none

References tpco_getHostName(), and tpwrite().

◆ tp_split()

T4X::CORE::tp_split   strInput strSplit ?blnTrim?  

Just like the TCL split, but with the possibility to use more than one character as split parameter.

Parameters
strInput- input string which should be split
strSplit- split string (more than one character possible)
blnTrim- OPTIONAL (FALSE) - If TRUE, the returned values will be trimmed

Referenced by T4X::USEREXIT::afterTransfer(), and T4X::USEREXIT::beforeTransfer().

◆ writeLogLineWithAttachment2BGS()

T4X::CORE::writeLogLineWithAttachment2BGS   strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strHost? ?strPort? args  

Creates an attachment on the given server and adds it to the specified log line.

Parameters
strLogChannel- Defines the log file in the log server
strLogLine- Message in the log file where the attachment will be added as a link
strLinkName- The name of the link
strAttachmentData- The content/payload of the attachment
strAttachmentMType- Mime type of the attachment (Optional - Default text/xml)
strMessageType- Message type (like INTERN, DEBUG, WARNING, ERROR) (Optional - Default INTERN)
strAttachmentName- The name of the attachment (Optional - Default Attachment_timestamp + valid file extension for text/plain (.txt) and text/xml (.xml))
strHost- this argument is ignored
strPort- this argument is ignored
strLogChannel- Defines the log file in the log server

References TPHAP::setAttaLink(), tpco_udpWriteRemoteAttachment2(), and tpwrite().

◆ writeVersionInfo2LogChannel()

T4X::CORE::writeVersionInfo2LogChannel   LogChannel args  

Writes the version info to a given log channel.

Parameters
LogChannelname used for the version version string output
argsnone
Returns
OK

References tpco_shmget(), and tpwrite().

Referenced by T4X::TEST::WORKFLOW::executeTcWorkflowJob().

Variable Documentation

◆ CtrlParam

CtrlParam
static

◆ LastError

LastError
static

◆ TransactionLogChannel

TransactionLogChannel
static