cancel
Showing results for 
Search instead for 
Did you mean: 

call transaction in abap server proxy

Former Member
0 Kudos

Hallo

We have a problem with one of our server proxys.

Scenario: SAP - backend system

The functionality implemented is the creation of a service notification

(IW51). The creation is made using batch input/call transaction and is

capsuled in an function module. In case of error by creation, the

message table will be read and a application error will be raise.

In the implementation of the proxy class the function module will be called

and the exceptions will be read and put in the response.

In case of success by the creation of the notification, everything is working ok.

In case of error in the call transaction, we will receive a "server

error" in XI, even if the error is catched and treated. In the trace we can see the error message from the call transaction, even if we do not send these messages in our response anymore.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Call Adapter

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>

<SAP:P1>500</SAP:P1>

<SAP:P2>Internal Server Error</SAP:P2>

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText><html> <body> <H1> 500 SAP Internal Server Error </H1> <B> Error message: </B> Counter reading smaller than in previous document 10000009340 ( <B> type of termination: </B> ERROR_MESSAGE_STATE ) <BR /> </body> </html></SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>HTTP response contains status code 500 with the description Internal Server Error XML element Envelope missing in SOAP message header (SAP XI Extension)</SAP:Stack>

<SAP:Retry>N</SAP:Retry>

</SAP:Error>

Ex: if by call transaction we have at the end 2 messages ( first W and second E) , we will see in the tracing in XI the second message ( so the error one ).

In the backend system (SAP), under sxmb_moni the message in question has the status : "green flag".

We used the same way of implemenation for all our interfaces. The only difference is that we are now using a batch and not a bapi or SAP function module for objects creation.

Has someone any idea? . Any suggestion will be really helpful.

Thanks.

Anca

Accepted Solutions (0)

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi Anca,

what is your problem?

Which error do want to have in which case?

What is not working like you expect?

Regards,

Udo

Former Member
0 Kudos

Hi Udo

My response has the following structure:

notification nr

+ 3 fields: message type (E,W,I,S,A)

message nr

message text

In case of error I should receive this filled structure and not a internal service error.

When I am testing the class in SAP is working very good.

Proxy Class implementation:

CALL FUNCTION 'Z_B2_CREATENOTIFICATION1'

EXPORTING

P_SERNR = i_sernr

P_MATNR = i_matnr

P_CDGRP = i_cdgrp

P_CODE = i_code

P_KUNAG = i_kunag

P_DATE = i_data

P_COUNT = i_counter

  • P_NTYPE = 'Z7'

  • P_VKORG = '2730'

  • P_VTWEG = '20'

  • P_SPART = '10'

  • P_PARVW = 'AG'

  • P_NAME =

P_EMAIL = i_email

IMPORTING

E_QMNUM = e_qmnum

e_return = e_error

TABLES

T_SPARES = t_spares

EXCEPTIONS

EQUI_NOT_FOUND = 1

ERROR_EMAIL = 2

MEAS_POINT = 3

ERROR_NOTIF = 4

OTHERS = 5

.

output-MT_CREATE_NOTIFICATION1RESPON-returncode = sy-subrc.

case SY-SUBRC.

when 1.

output-MT_CREATE_NOTIFICATION1RESPON-rctxt = 'equi'.

when 2.

output-MT_CREATE_NOTIFICATION1RESPON-rctxt = 'error email'.

when 3.

output-MT_CREATE_NOTIFICATION1RESPON-rctxt = 'meas point'.

when 4.

output-MT_CREATE_NOTIFICATION1RESPON-rctxt = 'notification'.

when 5.

data mess type ZB2_EXCHANGE_FAULT_DATA22.

mess-fault_text = 'others'.

raise exception type ZB2_CX_FM_CREATE_NOTIFICATION1

exporting standard = mess.

endcase.

output-MT_CREATE_NOTIFICATION1RESPON-qmnum = e_qmnum.

data out_return type ZB2_DT_RETURN2.

IF e_error-type is not initial.

out_return-type = e_error-type.

out_return-number = e_error-number.

out_return-message = e_error-message.

append out_return to output-MT_CREATE_NOTIFICATION1RESPON-DT_RETURNS.

endif.

Regards,

Anca

udo_martens
Active Contributor
0 Kudos

Hi Anca,

may be you should define a fault message type (with additional data) for your inbound interface and regenerate your proxy, which has now an exception. In your source code you can throw the exception with

RAISE EXCEPTION TYPE myException

EXPORTING

standard = ...

addition = ... (use butten "pattern").

You need a new mapping programm for that exception which you put to your interface mapping.

Now you get an answer to your request AND you see in the monitoring the exception icon which is showing you, that something in your server proxy went wrong.

Regards,

Udo

Former Member
0 Kudos

Hello Anca,

We are also facing similar kind of problem. As Udo suggested, we have created fault message types to capture the exception, however we could not able to succeed. can you please let us know if you have solved this problem.

What the problem which we are facing is, We are doing an interface from Sender through SOAP adapter to R/3 using Proxy (Synchronous Interface). If the Function module executed properly then we are getting Success message back to the sender. But when we get an error message then it is not passing that exception back to the sender, instead we are getting HTTP_RESP_STATUS_CODE_NOT_OK error 500.

Best Regards

Sekhar

Former Member
0 Kudos

Hi Udo, Sekhar

I've implemented the fault messages but still the same problem.

Sekhar, we have the same scenario: sender SOAP Adapter, synhchronous interface.

What really bothers me, is that is not the first interface from this project. We have also a interface for creating purchase orders. The implementation steps are the same. The only difference is that we are using a BAPI to create the PO.The RETURN table from the bapi we are sending as response. So even if we have an error by creation, the client is receiving the response with details (the error messages).

I am still trying to find a solution. Some other ideas/suggestions will of course help a lot.

Regards,

Anca

Former Member
0 Kudos

Hi everyone

I have no solution but at least now I know what is happening.

I've debugged our synchrone interface and by the first error message the execution will be interrupted and I receive in XI "internal server error".

Wenn I am testing in SAP, the execution will continue after the "call transaction".

I do not have very much experience with interfaces.

Maybe can someone explain to me what can I do?

I can not believe that in a proxy you can use only BAPIs or SAP functions to create objects ( notifications, orders ). And for what I need to do, I havent found any function. Without the "call transaction", which possibilities to I have???

Thanks a lot for any further helping mind.

Regards

Anca