on 02-09-2006 8:41 AM
Hi all,
How JAVA environment can trap an error returned from abap code?
E.g.:
From a BAPI wrapper written like this:
"function zpm_gi_create .
*"----
""Interfaccia locale:
*" IMPORTING
*" VALUE(ZBAPIGOODSMVT) TYPE ZBAPIGOODSMVT
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" VALUE(PO_NUMBER_ES) TYPE ZBAPIEKKO-PO_NUMBER
*" TABLES
*" GOODSMVT_ITEM STRUCTURE ZGOODSMVT_ITEM
*"----
data: goodsmvt_header type bapi2017_gm_head_01,
return2 type bapiret2 occurs 0 with header line,
....
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = goodsmvt_header
goodsmvt_code = zbapigoodsmvt-gm_code
testrun = 'X'
importing
GOODSMVT_HEADRET GM =
materialdocument = matdoc
matdocumentyear = matyear
tables
goodsmvt_item = gm_item
GOODSMVT_SERIALNUMBER =
return = return2.
...
Our return (for istance is):
"EBM 312The (internal) unit xx has not been maintained in
the unit table"
How JAVA environment can trap this error or interpret the BAPIRET2 structure?
Is there something to do in the corresponding syncBO?
regards,
eliana
hello elaina,
i'll assume that you are using SmartSync framework and want
to "trap" or get the BAPIRET2 result in the client.
for technical errors and BAPI exceptions, you can use the
<a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/me/com/sap/ip/me/api/smartsync/MessageReply.html">MessageReply</a> API which can be monitored thru a MessageReplyObserver.
for other results like "successfully updated", you can use
<a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/me/com/sap/ip/me/api/smartsync/SyncReply.html">SyncReply</a> and its corresponding SyncReplyObserver to get that info.
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks jo,
problem solved:
steps:
0: abap EXPORTING VALUE(RETURN) TYPE BAPIRET2
1: my class implements SyncBoInDeltaObserver
2: my class has registered observer : SmartSyncRuntime.getInstance().getInboxNotifier().registerSyncBoInDeltaObserver(this);
3: method receivedSyncBoInDelta() print the msg returned from abap function:
syncBoInDelta.getSyncReply().getText()
eliana
Hi elina ,
these topic is already discussed in forum.
Jo has replied to this doubt in these links.
just note this..
have to change like this , when u follow the help.
if (messageReply.getType() == MessageReplyType.SYNC_BEGIN) {
}
if (messageReply.getType() == MessageReplyType.SYNC_END) {
}
Regards
Kishor Gopinathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.