Call RFC SAP Erp to display Vietnamese UTF-8

To connecting to ERP SAP with Php Programming, we can use saprfc / sapclass Download here .

When data contain Vietnamese languange, the display is unreadable. Cause a HTML tag needs charset UTF-8.

To call SAP RFC using saprfc with UTF-8, you can add a function SetCodePage($codepage)

example file php connect SAP ERP with sapclasses

$sap = new SAPConnection(); 
//Change Unicode to UTF-8

		if ($sap->GetStatus() == SAPRFC_OK ){
			$sap->Open ();
			echo "Failed to connect SAP";
		$fce = $sap->NewFunction ("Z_ZCSD_SHIPTO");
		if ($fce == false ) {

		//Header Entry		
		$fce->ZKTOKD1 = "ZTL1"; 
		$fce->ZKTOKD2 = "ZTL2"; 
		$fce->ZKUNNR = "0000060004";

		if ($fce->GetStatus() == SAPRFC_OK ) {		
			while ( $fce->RETURN_DATA->Next() ){
				echo "";
}else $fce->PrintStatus();



in simple Php programming without call RFC SAP, you can use :


header(‘Content-Type: text/html; charset=utf-8’);


Example Vietnamese sentence :

WordPress là một phần mềm mở và miễn phí để làm blog cá nhân, trang web cá nhân nổi tiếng. WordPress được xây dựng trên sự tiện dụng, cùng với các định dạng chuẩn của web. WordPress sẽ luôn miễn phí và vô giá!

Needs TTF Font? download here

Hope this helpfull 😀



About blackphp

All about programming php, ajax, jquery, mysql, etc, tips n trick. Now, i'm concern in php programming with codeigniter framework n also training my design skill with photoshop or corel... wish me luck! ('o')

Posted on June 20, 2013, in ABAP, PHP, SAP and tagged , , , , , , , , , , , , , , , , , . Bookmark the permalink. 1 Comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: