Passing SAP messages from Bapi
Hi all.
I have created a BAPI. In this, There are some messages which are type I and some which are type E. Now this bapi has to integrate with EP. Will these messages be passed on to EP as it is or do I have to do something special about it. Please help
Thanks
Here is a part of the code which I did in my bapi to pop up the message:
loop at T_BAPI_ENTERTAINMENT_IMPORT2.
if T_BAPI_ENTERTAINMENT_IMPORT2-amount > T_BAPI_ENTERTAINMENT_EXPORT-BET01.
message 'Amount cannot be greater than basic salary' type 'E'.<<<<<<<<<<
else.
ITAB_zentertainment-persno = BAPI_PERSNO.
ITAB_zentertainment-ZMONTH = t_BAPI_ENTERTAINMENT_IMPORT2-ZMONTH.
ITAB_zentertainment-ZYEAR = T_BAPI_ENTERTAINMENT_IMPORT2-ZYEAR.
ITAB_zentertainment-AMOUNT = t_BAPI_ENTERTAINMENT_IMPORT2-AMOUNT.
ITAB_zentertainment-CURRENCY = t_BAPI_ENTERTAINMENT_IMPORT2-CURRENCY.
INSERT INTO ZENTERTAINMENT VALUES ITAB_ZENTERTAINMENT.
concatenate 'Claim for the month ' t_BAPI_ENTERTAINMENT_IMPORT2-ZMONTH space space 'Inserted' into var separated by space.
message var type 'I' . "with 'Claim for the month Inserted'. <<<<<<<<<<
endif.
endloop.
Please let me know what to do with respect to the code above.
Thanks
Similar Messages
-
Passing Error message to BAPI Structure in RFC
Hi Experts,
I would like to know how we pass error message to BAPI structurre in RFC?
Plz some one give the details about how we handle the errors.
Thanks in advance.Like already mentioned before, every Standard SAP BAPI, has an export or tables parameter which is called something like RETURN with structure BAPIRET2. In here, you can store all the messages that are generated during the BAPI Call.
However, if you also want to catch errors like system exceptions and communication errors, you will have to add these exceptions manually:
EXCEPTIONS
SYSTEM_FAILURE = 1 MESSAGE RFC_MESS
COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
However, not sure if this addition works when calling BAPI from NON-sap application.
Declaration:
DATA: RFC_MESS(128). -
JMS: can I access SAP messages from extenal Java
- Can I access SAP Messages from an external (non-SAP) java program?
- Do I use JNDI or can I call using a jar file from my java invocation?
- Do I have to define a queue (or does SAP JMS have queues)
- What port do I use?
ThanksHi John,
> - Can I access SAP Messages from an external
> (non-SAP) java program?
>
Yes, you can use the JMS provider on the Web AS from a standalone java program.
> - Do I use JNDI or can I call using a jar file from
> my java invocation?
You connect your remote java client to the server by getting an InitialContext. The you lookup the JMS resources (such as Topic- or Queue ConnectionFactory, etc.) from the JNDI. You can have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/25/bf8f44540c469abc19fb6ac3ac7885/frameset.htm">this</a> page for more info.
>
> - Do I have to define a queue (or does SAP JMS have
> queues)
>
The JMS Provider on the Web AS provides default connection factories that you can use to create a topic ot queue. The lookup strings you have to use are
jmsfactory/default/TopicConnectionFactory
for topics and
jmsfactory/default/QueueConnectionFactory
for queues.
> - What port do I use?
>
You use the P4 port (50004 by default for instance number 00) when obtaining the InitialContext with this code:
java.util.Properties properties = new Properties();
// set the properties of the connection
properties.put("Context.INITIAL_CONTEXT_FACTORY", "com.sap.engine.services.jndi.InitialContextFactoryImpl");
properties.put(Context.PROVIDER_URL, "<Server_Host>:<p4_port>");
properties.put("Context.SECURITY_PRINCIPAL", "Administrator");
properties.put("Context SECURITY_CREDENTIALS", "admin_password");
// start initial context with the properties specified
InitialContext context = new InitialContext(properties);
Hope that helps! -
Hi....
How to read the messages from BAPI returned table.
Regards,
SPHi,
data: it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = HEADER
POHEADERX = HEADERX
POADDRVENDOR =
TESTRUN =
IMPORTING
EXPPURCHASEORDER =
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN = IT_RETURN
POITEM = ITEM
POITEMX = ITEMX.
*Output the messages returned from BAPI call
LOOP AT it_return.
WRITE:/ it_return-type, it_return-id, it_return-number,
it_return-message.
ENDLOOP
thanx.
Edited by: Dhanashri Pawar on Oct 15, 2008 12:31 PM -
What ESB adapter can pass a message from JMS service to outside service?
1. we are running ESB from SOA 10.1.3.1 on linux
2. we have XML message passed to JMS deployed at the local OC4J
3. we need this XML message passed to an outside service.
What will be the adapter to use as outbound from JMS?
TIAWhat is this outside service, if it is a web service then you can use SOAP adapter. just put in the WSDL and away you go.
Use the JMS adapter for reading the queue and the SOAP adapter for writing to outside service.
cheers
James -
Suppress an error message from BAPI
Dear all,
One of the BAPIs we are using issues messages like type I or E during background processing.
I want these messages suppressed. I heard this can be customized in some where.
Does anybody know how to do it?
Regards,
KazuyaHI
GOOD
GO THROUGH THE FOLLOWING LINKS,I HOPE THIS WILL HELP YOU TO SOLVE YOUR PROBLEM.
http://www.realtech.com/wDeutsch/software/application_manager/Applications/SAP/APO_DC_WP_EN.pdf
THANKS
MRUTYUN -
Passing error message from login module to login page
Hello,
we have a custom login module to authenticate user in ldap and to grant application roles stored in db.
Is it possible to pass error catched in login module to the user (display the error message on login screen)? We think it is helpful to see correct reason why the user couln't be logged in.
Notes:
Jdev version is 10.1.3.1. Custom login module was written using Frank Nimphius guidelines and examples.
RadoHi,
if you followed this example then it is configured for container managed authentication, in which case the error message cannot be propagated to the view.
There was a similar discussion on the J2EE forum and the answer was that the OC4J team will put this on a list of enahncements they track. The technical reason appears to be that the J2EE spec does not foresee to tell users about the "why" authentication fails - which clearly is a limitation of the Spec.
Frank -
How ro send error message from BADI to BAPI
i have a BADI which is triggered from a BAPI.This BADI has only importing and changing parameters.How can i send error message to BAPI.Please reply at the earliest.
High points can be expected.Hi Arshi,
Please check whether the following link is of any use to you,
how to capture the error message from bapi
Best Regards.
Reward points if it is helpful. -
Hi,
I am new to BSP. I have to call SAP Screen on button click event on BSP and also need to pass data at runtime.
I searched this forum but didn't find the right solution. I tried to call SAP screen from BAPI and through URL but no success.
Anyone knows how it can be done?
Regards,
Usman MalikThanks for your reply,
Actually I am very new to BSP. I don't understand where to put this code?
[System]
Name=DEV
Description=DEV [Development]
Client=123
[User]
Name=RAJA
Language=EN
[Function]
Title=
Command=*SU01 USR02-BNAME=raja;
Type=Transaction
[Configuration]
WorkDir=d:xxxxxxSapWorkDir
[Options]
Reuse=1
Second thing is about shortcut. Do I have to place this shortcut on server?
Thanks,
Usman Malik -
Error getting application exception message from client EJB 3
Hi, somebody nkow what is the error?
I have this simple session bean deploy in a jboss 4.0.5 GA application server
My interface:
package server.ejb.usuarios;
import javax.ejb.Remote;
@Remote
public interface Prueba {
public void getError() throws Exception;
}My Session bean implementation:
package server.ejb.usuarios;
import javax.ejb.Stateless;
import server.ejb.usuarios.Prueba;
public @Stateless class PruebaBean implements Prueba {
public void getError() throws Exception {
throw new Exception("Mensaje de error");
}Simple, i can deploy this bean on my application server, now i have this client code:
package clientold;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import server.ejb.usuarios.Prueba;
public class MainPruebaError {
* @param args
public static void main(String[] args) {
Context ctx;
try {
ctx = getInitialContext();
Prueba pruebaSession = (Prueba) ctx.lookup("PruebaBean/remote");
pruebaSession.getError();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch(Exception e){
System.out.println("Get error from server: " + e.getMessage());
e.printStackTrace();
private static Context getInitialContext() throws NamingException {
Properties prop = new Properties();
prop.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
prop.setProperty("java.naming.provider.url", "127.0.0.1:1099");
prop.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
return (new InitialContext(prop));
}and my client catch the exception but i can�t get the correct exception message. I need pass custom message from my server to my clients and wrap it in a exception, but when i run this example got the next output:
Get error from server: [Ljava.lang.StackTraceElement;
java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
at org.jboss.remoting.Client.invoke(Client.java:525)
at org.jboss.remoting.Client.invoke(Client.java:488)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
at $Proxy0.getError(Unknown Source)
at clientold.MainPruebaError.main(MainPruebaError.java:21)What is the problem??, i must see on the output
Get error from server: Mensaje de errorbut i have :
Get error from server: [Ljava.lang.StackTraceElement;why???, is only a simple application exception and don,t work, somebody can help me??
i have tried to use an interceptor class for get the exceptions and work, but without interceptor, dont work
thanksI can resolve this problem change the JDK version used to develop my clint application and to run the jboss application server.
Current, in JBoss 4.0.5, the JDK requirement is JDK 5, and i was using JDK 6. -
Re: send message from the database trigger(URGENT)
Hi,
I am using forms 6.0 and oracle 8.0. My question is I am calling a stored procedure in the BEFORE UPDATE TRIGGER on database. This trigger will be fired and update another table(table B) when user update any record in the forms based on different table (table A).
I want to pass the message to the forms from the database trigger when records gets updated in the database e.g. (10 records are updated). Since I am not calling my database procedure from the forms, rather it is being called from the database trigger, How can i display message to the forms.
Thanks all your help in advance.Thanks Parker for ur reply but that subprogram raise_application_error only works if there is an error in the store procedure. But in my case there is no error, I just need to pass a message saying that e.g. "12 rows updated". How can I pass this message from the database trigger to the forms application.
Thanks -
Passing a message while running in background between two different program
Hi all,
I am calling a report program(say Y) from another program (say X).
I want to pass a message from Y to X and i want to print that meesage in program X in the screen ,if X runs in foreground and if the program X runs in background i want to print that message in spool .
i tried by using a subroutine ie by passing the message to the calling program ..<b>PERFORM f_print_msg in program ZCTE0012_CR_MARK_RELEASE USING lv_msg</b> but how will i catch there.since this is a job i am getting some job related error too'....please help in solving this issueHi Hemavathi,
the only think that I can think of now is inserting that message in a database table, and then read it from the another program.
I hope it helps. Best regards,
Alvaro -
Hi All,
Can you please suggest to choose the best ways (for best performance) in MII (12.2 on NW 7.3), to process the incoming process messages from shop floor systems to SAP ECC 6.0 and vice versa?
ThanksHi Surya,
Best practices for flow of data from ECC --> SAP MII --> Shop floor & Vice verse:
1. Send ECC data through IDOC's/RFC's as messages to SAP MII message listener and BSL transaction process data and update directly on shop floor database as if you configured in Data services or later send those data by web service to shop floor system (i.e. depends on Shop floor machines).
From Shop floor:
shop floor --> SAP MII --> ECC
1. Use either Web service or fetch data from DB and pass data to BAPI's for sending to ECC through BLS transaction.
Regards,
Praveen Reddy -
Extraction of data from SAP R/3 Bapi into SAP BW
hi,
i am extracting data from sap r/3 bapi into sap bw. can u please send me the link and documents of how to extract the data from bapi to sap bw.
Answers will be rewarded
Thanks
sd shahidHi Swapnali,
In your case you have to send process order to XI and you have a bapi that satisfies your requirement.
Here the solution depends what is the triggerring point of the Interface.
If you want that from SAP side Interface should be triggered, then Use ABAP proxy program
You have to craete a Abap proxy class using outbound message interafce defined in IR of XI.This can be done by transaction SPROXY.
Then create a program that call sync/async method that is created by Sproxy t.code.
In this way , when u will execute the proxy program in R/3 , then call will be made to BAPI in Sap from XI server and u will get output back to your proxy program.
If your requirement is to not to trigger from SAP then nothing is required in R/3 side.
In XI , Bapi will be added in imported objects in Integration repository and bapi will be called.
Hope this will help u.
Please revert in case of queries.
Regards,
Monica -
How to pass the values from the Wb Dynpro Application to the SAP Backend ?
Hi All,
Good morning..,
I have scenario like:
I want to pass the values from the web dynpro appication to the SAP Back end R/3 Table. IN backend the RFC is writtn to accept the structure input from the Webdynpro.
Upto know I imported the corresponding RFC and maaped to the View.
How to proceed with the coding to save the data...
PLease suggest...
Regards and Thanks in Advance,
CSPHi Pradeep
Steps:
1. First create an instance for bapi and bind the instance to the bapi node.
Z<bapi name> zb=new Z<bapi name>();
wdContext.nodeZ<bapi name>. bind(zb);
2. Then if u have the import parameter u have to set them by using
The instance of the above bapi.
Zb.set<import parameters>;
3. If the bapi has a table parameters then the structure for the table parameters will also be imported
In the model class.
4. Set the table parameters by creating the instance for that structure and using this instance set it.
Z<Struct>itm tab=new Z<Struct>();
Tab.set<table parameters>
5. Then add the structure instance to the bapi instance.
Zb.add(Tab);
6. Then Execute the bapi after setting the import parameters.
7. If there is any export parameters, then get the values after execution.
Look at this thread for codes
Re: RFC call on click of button
Regards,
Arun
Maybe you are looking for
-
How to create a back-up version of your helpsystem
My institution is going through a conversion of our core systems in September of this year and I need to develop a process for updating the 700 helpfiles I have within my helpsystem. Is there a way to create a mirror image of my helpsystem so that I
-
Can not access OAF pages on R12.2
Hi All, We installed R12.2 with the beta patch for doing some investigation before it is formal released. After we patched add-on products successfully, we found we can not use all OAF pages of those products on R12.2 by following error message: ~~~~
-
hi, I developed a web dynpro on the base of the WDT_TREE structure. Itu2019s important to underline that each node can contain different type of sons: ITEM and NODE as you can see in the structure below For example: ROOT NODE1 Item 1 -> N
-
Printing envelopes with specific fields from contacts
I want to choose certain fields to print envelopes - from a group I have in contacts. Is this possible? Thanks
-
Hi, I've read about CRM Middleware, ALE/EDI and the usage of IDOCs for communication between SAP CRM and Non SAP System. I need to see the existing IDOCs that can be used for CRM. For example I need an IDOC for a Service Order... this is just an exam