function STFC_WRITE_TO_TCPIC ($fce) { global $rfc_handle, $data_file; $tbuf = sprintf("\n\nStart Function %s", "STFC_WRITE_TO_TCPIC"); TRFC_trace($tbuf); $tbuf = "\n<== RfcGetAttributes rc = "; TRFC_trace($tbuf); $rfc_attributes = saprfc_attributes ($rfc_handle); $tbuf = sprintf("%d", 0); TRFC_trace($tbuf); if ($rfc_attributes == false) rfc_error("RfcGetAttributes"); $tbuf = "\n\nAttributes of this RFC connection"; $tbuf .= "\n---------------------------------"; $tbuf .= sprintf ("\nDestination : %s", $rfc_attributes[dest]); $tbuf .= sprintf ("\nMy Host : %s", $rfc_attributes[own_host]); if ($rfc_attributes[rfc_role] == RFC_ROLE_CLIENT) { if ($rfc_attributes[partner_type] == RFC_SERVER_EXT) $tbuf .= sprintf("\nServer Program Name : %s", $rfc_attributes[partner_host]); elseif ($rfc_attributes[partner_type] == RFC_SERVER_EXT_REG) $tbuf .= sprintf("\nServer Program ID : %s", $rfc_attributes[partner_host]); else $tbuf .= sprintf("\nPartner Host : %s", $rfc_attributes[partner_host]); } else $tbuf.= sprintf("\nPartner Host : %s", $rfc_attributes[partner_host]); $tbuf.= sprintf("\nSystem No. : %s", $rfc_attributes[systnr]); $tbuf.= sprintf("\nSystem Name : %s", $rfc_attributes[sysid]); $tbuf.= sprintf("\nClient : %s", $rfc_attributes[client]); $tbuf.= sprintf("\nUser : %s", $rfc_attributes[user]); $tbuf.= sprintf("\nLanguage : %s", $rfc_attributes[language]); $tbuf.= sprintf("\nISO-Language : %s", $rfc_attributes[ISO_language]); if ($rfc_attributes[trace] == 'X') $tbuf .= sprintf("\nRFC Trace : ON"); else $tbuf .= sprintf("\nRFC Trace : OFF"); $tbuf .= sprintf("\nMy Codepage : %s", $rfc_attributes[own_codepage]); $tbuf .= sprintf("\nPartner Codepage : %s", $rfc_attributes[partner_codepage]); if ($rfc_attributes[rfc_role] == RFC_ROLE_CLIENT) $tbuf .= sprintf("\nRFC Role : External RFC Client"); else if ($rfc_attributes[own_type] == RFC_SERVER_EXT) $tbuf .= sprintf("\nRFC Role : External RFC Server, started by SAP gateway"); else $tbuf .= sprintf("\nRFC Role : External RFC Server, registered at SAP gateway"); $tbuf .= sprintf("\nRFC Library Release : %s", $rfc_attributes[own_rel]); if ($rfc_attributes[partner_type] == RFC_SERVER_R3) $tbuf .= sprintf("\nRFC Partner : SAP R/3"); elseif ($rfc_attributes[partner_type] == RFC_SERVER_R2) $tbuf .= sprintf("\nRFC Partner : SAP R/2"); elseif ($rfc_attributes[rfc_role] == RFC_ROLE_CLIENT) { if ($rfc_attributes[partner_type] == RFC_SERVER_EXT) $tbuf .= sprintf("\nRFC Partner : External RFC Server, started by SAP gateway"); else $tbuf .= sprintf("\nRFC Partner : External RFC Server, registered at SAP gateway"); } else $tbuf .= sprintf("\nRFC Partner : External RFC Client"); $tbuf .= sprintf("\nPartner System Release : %s", $rfc_attributes[partner_rel]); $tbuf .= sprintf("\nR/3 Kernel Release : %s", $rfc_attributes[kernel_rel]); $tbuf .= sprintf("\nCPI-C Conversation ID : %s\n", $rfc_attributes[CPIC_convid]); TRFC_trace($tbuf); /* Put the name of data file in trace file */ $tbuf = sprintf("\nDATA FILE: '%s'", $data_file); TRFC_trace($tbuf); $rc = write_itab_to_file($fce, $data_file, "TCPICDAT"); if ($rc) { return ("CANNOT_WRITE_DATA"); } return true; }
/** * Get Attributes (see saprfc_attributes) * */ function GetAttributes() { if ($this->rfc) { return @saprfc_attributes($this->rfc); } else { return array(); } }