cancel
Showing results for 
Search instead for 
Did you mean: 

Response did not contain a valid OData result200,OK,%PDF-1.3 Error on SAPUI5 odata.read method

Former Member
2,749

Hi Experts,

I am facing an issue in SAPUI5 development to disaply/download pdf using GET_STREAM method.

When I call ODATA.READ( key: value)/$value I am getting error on UI5 "The following problem occurred: Response did not contain a valid OData result200,OK,%PDF-1.3".

I am able to generate the PDF in gateway using the same URL which I am calling from SAPUI5.

Thanks

Pradeep

View Entire Topic
CristianBabei
Contributor

To call a media type entity, you don't have to use the oModel.read, you should open is as window, an example can be :

var isProxy = "";
if (window.document.domain == "localhost") {
	isProxy = "proxy";
}
var w = window.open(isProxy + "/sap/opu/odata/sap/ZCD_TEST_SRV/TestSet("11111")/$value", '_blank');
if (w == null) {
	MessageBox.warning(oBundle.getText("Error.PopUpBloqued"));
}

Regards

pablos81
Explorer
0 Kudos
 

 

window.open(window.location.origin + "/sap/opu/odata/sap/TestSet("11111")/$value )

 

This worked for me