четверг, 8 октября 2015 г.

Logging and Tracing Web Service Call on SAP NetWeaver Portal

You want to see request trace whan web service was called.

You should:

  • Go to /NWA -> Log Configuration
  • Switch to Tracing Locations view
  • go to locations:

com.sap.engine.services.httpserver.HttpTraceRequest.traceHeaders
com.sap.engine.services.httpserver.HttpTraceRequest.traceRaw
com.sap.engine.services.httpserver.HttpTraceResponse.traceHeaders
com.sap.engine.services.httpserver.HttpTraceResponse.traceRaw
  • Set debug mode to all of them

пятница, 21 августа 2015 г.

How to hide in SAP Portal Header menu Back, Forward, History, Favorites, Personalize, View, Help, New Session, SAP Store, Search

Hello!

Problem:
To hide in SAP Portal Header (version 7.3) menu Back, Forward, History, Favorites, Personalize, View, Help, New Session, SAP Store, Search do this:

Solution:
Go to "Content Administration", then go and open this object:
portal_content/every_user/general/defaultAjaxframeworkContent/com.sap.portal.AFPpage

Open object AFP Masthead properties:
SAP Store - uncheck property Show Link in Masthead: Enterprise Store
New Session - uncheck property Show Link in Masthead: New Session
Search in porta header - uncheck property Enable Quick Launch

Open object AFP Widgets properties and search properties which starts with "Show" and there uncheck what you need. There will be properties: Back, Forwrard, History, Favorites, Personalize, View, Help.

понедельник, 27 июля 2015 г.

понедельник, 30 марта 2015 г.

How to call PI Web Service or SOAPFaultException: Server Error

Problem:
You are trying to call SAP PI - Process Integration or XI -  Exchange Infrastructure or PO - process Orchestration.

You made proxy Java Class using WSDL and NWDS, and you are trying to call it and you have error:
com.sap.engine.services.webservices.espbase.client.bindings.exceptions.SOAPFaultException: Server Error

Solution:
1. You should ask your PI developer for URL for WSDL for Web Service which you want to use. I have it like this: http://<server>:<port>/dir/wsdl?p=ic/<some id>
2. You should import WSDL in NWDS in your project using this URL.
3. Then you should generate proxy Java Classes using that WSDL.
4. It should work.

I've described how to generate proxy java classes here call Web Service Java Client (Proxy) Example.

четверг, 26 марта 2015 г.

среда, 4 марта 2015 г.

How to search checked out record in SAP MDM via MDM JAVA API

You can search, find or retrieve checked out record with MDM JAVA API in SAP MDM using property "setCheckoutSearchType()" of "Search" object. Here code example:

Code example:
    Search search = new Search;
    search.setCheckoutSearchType(Search.CheckOutSearchType.STANDARD);
    RetrieveLimitedRecordsCommand cmd = new RetrieveLimitedRecordsCommand(
    cmd.setSearch(search);
    cmd.execute();

You set search type. It can be one of the three:

Search.CheckOutSearchType.STANDARD - you will find record which was checked out as new, and you will find record which existed in MDM and which has protected version and checked out version. You will find checked out version.

Search.CheckOutSearchType.ORIGINAL - you will find original record which is not checked out. If you are searching record which checked out as new, you will not find anything, but if you are searching record which existed in MDM and it checked out, and it has protected version and checked out version, you will find protected version - it is original record.

Search.CheckOutSearchType.ALL - if you are searching record which checked out as new, then you will find it. If you are searching record which existed in MDM and it checked out and it has two versions - protected(original) and checked out version (user can change it), you will find protected version (original).

вторник, 3 марта 2015 г.

MDM Record - Checkout Status

MDM Record can be in that checkout Statuses:

Record.CheckoutStatus.UNDEFINED: -1

Record.CheckoutStatus.NONE: 0 - record is not checked out

Record.CheckoutStatus.ORIGINAL: 1 - you found original record, that means record is checked out and you found protected version of record.

Record.CheckoutStatus.MEMBER: 2 - record is checked out and you joined to checkout and you found record which is checked out, not protected version.

Record.CheckoutStatus.OWNER: 3 - record is checked out and you owner of the chekced out version, and you found checked out version, not protected version.

Record.CheckoutStatus.NON_MEMBER: 4 - record is checked out and you did not join, and you found checked out version, not protected version.

суббота, 17 января 2015 г.

Работа с JScrollPane

Для инициализации необходимы скрипты:

<script type="text/javascript" src="jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="jquery.mousewheel.js"></script>

и стили:

<link href="jquery.jscrollpane.css" rel="stylesheet"/>

Вы создаете div, указываете ему класс, задаете данному классу или div ширину и высоту и потом вызываете:

$('.myTestClass').jScrollPane();

Скроллы появятся в указанном объекте. Данный плагин ни как не влияет на высоту и ширину объекта помещаемого в него, если хотите что бы div со скроллами стал больше или меньше, изменяете с помощью скриптов ширину и высоту и вызываете снова инициализацию плагина.

среда, 14 января 2015 г.

Вызов веб сервиса с десктопа

1. Из ws навигатора вытаскиваем xml для вызова

2. Формируем xml вида:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header />
<SOAP-ENV:Body>
<ns1:<"имя функции"> xmlns:ns1="нэймспэйс">
<сюда вставляем xml из ws navigator>
</ns1:start>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

3. Либо вставляем нужные параметры в файле xml, либо вписываем метки, что бы потом считать в строку данную xml и вставить данные вместо меток, либо зашиваем в код данныю xml и уже не нужно ее читать.

4. В коде получаем xml в виде строки как указано в пункте 3
5. Вставляем нужные параметры вместо меток, если нужно.
6. Формируем SOAP Message:

MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();

SOAPPart soappart = msg.getSOAPPart();

//создаем сообщение из string переменной xml
StreamSource preppedMsg = new StreamSource(new ByteArrayInputStream(xml.getBytes()));
soappart.setContent(preppedMsg);

// Аутентификация сообщения.
MimeHeaders headers = msg.getMimeHeaders();
String upas = _user + ":" + _pass;
String auth = "Basic " + new String(javax.xml.bind.DatatypeConverter.printBase64Binary(upas.getBytes()));
headers.addHeader("Authorization", new String(auth.getBytes()));
msg.saveChanges();