How in ABAP do you develop a class to publish an event externally

Hi all,
I am trying to publish equipment information to multiple systems using ECC 6.0 and PI 7.1
Here are two articles which I have read which were very useful
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/800e2826-718c-2a10-f680-d6b29f0dce18
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0334534-aa28-2b10-a3a2-9ed4135727ed
High level overview of what I've done is as follows.
PI
- I developed a generic Service Interface called Asset_Sync and mapped this to a non SAP backend system to persist the equipment information (this all works fine).
- I also published the Sender Agreement for Asset_Sync to ESR
ECC 6.0
- I generated a client proxy ZEFI_CO_ASSET_SYNC from the ESR entry for Asset_Sync
- I used transaction SWF_BAM and have created an event linkage for object type EQUI event Changed
Here is where I am stuck
I now need to define the Proxy object to publish the equipment information to PI.
I am not sure if I have to extend the object EQUI to ZZEQUI and whether I need to create a method execute-synchronous.
I am really looking for some sample code of how to create the Proxy object and link it to the event.
Regards,
John
P.S.
I have coded a test program which calls the proxy and sends the information to PI and then to the third party system it looks as follows and works fine, it is just a shell right now once I have finished linking it to the event I will enhance the message interface and pass real values (for now my mapping in PI just hardcodes enough data so the publish to the back end system works). Basically althugh this works I need to execute this automatically from the event being triggered and hence need to move this into a proxy with event linkage.
FORM CREATE_ENTITLEMENT .
  DATA: lv_assset_sync_req TYPE ZEFI_ASSET_SYNC_REQUEST,
        lv_assset_sync_resp TYPE ZEFI_WSRESPONSE1.
  CREATE OBJECT lv_asset_sync_proxy
    EXPORTING
      LOGICAL_PORT_NAME = 'ASSET_SYNC_DX3'.
*TRY.
*TRY.
CALL METHOD LV_ASSET_SYNC_PROXY->ASSET_SYNC
  EXPORTING
    OUTPUT = lv_assset_sync_req
  IMPORTING
    INPUT  = lv_assset_sync_resp.
  Write :/ 'Status : ', lv_assset_sync_resp-WSRESPONSE-STATUS.
  WRite :/ 'Code : ', lv_assset_sync_resp-WSRESPONSE-CODE.

Hi all,
I thought I'd give an update.
After reading a number of articles and documentation (see below).
It appears it may be easier to create a new class using SE24 rather than extending the Business Object in SWO1.
I've done the following which works via a user-exit.
a.     Create Class ZZEQUI
b.     Create an Instance Dependent Object to Publish the Entitlement
c.     Leverage User Exit MV50AFZ1 - FORM USEREXIT_SAVE_DOCUMENT_PREPARE
d.     Created Include ZSDI_DELIVERY_PUBLISH
i.     Loops through serial numbers
ii.     Create Object LV_ASSET EXPORTING EQUNR = LV_EQUNR
iii.     CALL LV_ASSET->Publish.
If I add the Interface IF_WORKFLOW to my class then I may be able to be trigger it from SWF_BAM.
The solution I have is working, if I decide to go with BAM and have additional questions I'll raise this in either the workflow or ABAP Objects forums.
Regards,
John
Addtional articles and documentation
i.     Business Object Macros http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4ad23453d11d189430000e829fbbd/frameset.htm
ii.     Integrating Abap Objects with Workflow http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0409e6c-d213-2d10-3cb6-c12d417626c1
iii.     Why Use ABAP OO with workflow /people/jocelyn.dart/blog/2006/06/19/why-use-abap-oo-with-workflow
iv.     ABAPOO for WUG http://wiki.sdn.sap.com/wiki/display/HOME/2.Designand+Development#2.DesignandDevelopment-HowcanIuseABAPOOClassesinWorkflow%3F

Similar Messages

  • How the heck to you run a class more than once?

    Hello,
    I'm new to Java and have spent many frustrating hours on this program, (yeah I know, pathetic), but I can't get this program to run. I think that the problem lies in calling more than one object. The compiler says that the object has already been defined, by when I change it gives me the same message. Here is the message-
    java:35: data is already defined in main(java.lang.String[])
              C24001_PersonalInformation data = new C24001_PersonalInformation();
    java:41: cannot resolve symbol
    symbol : variable setAddress
    location: class C24001_PersonalInformation
    data.setAddress = ("149 East Bay Street");
    java:42: cannot resolve symbol
    symbol : variable setPhone
    location: class C24001_PersonalInformation
    data.setPhone = ("(555)555-5678");
    Here is the Demo followed by the class
    public class C24001_PersonalInformationDriver
    public static void main(String [] args)
              String name;
              int age;
              String address;
              String phone;
    C24001_PersonalInformation data = new C24001_PersonalInformation();
              //Set information and calls from method, Me
    data.setName("Joe Mahoney");
    data.setAge(27);
    data.setAddress("724 22nd Street");
    data.setPhone("(555)555-1234");
    System.out.println("\nMy information: ");
    System.out.println("Name: "+data.getName() );
    System.out.println("Age: "+data.getAge() );
    System.out.println("Address: "+data.getAddress() );
    System.out.println("Phone: "+data.getPhone() );
              C24001_PersonalInformation data = new C24001_PersonalInformation();
              //Set information and calls from method, Friend 1
    data.setName("Geri Rose");
    data.setAge(24);
    data.setAddress = ("149 East Bay Street");
    data.setPhone = ("(555)555-5678");
    System.out.println("\nFriend #1 Information: ");
              System.out.println("Name: "+data.getName() );
              System.out.println("Age: "+data.getAge() );
              System.out.println("Address: "+data.getAddress() );
    System.out.println("Phone: "+data.getPhone() );
              //C24001_PersonalInformation data2 = new C24001_PersonalInformation();
    //Set information and calls from method, Friend 2
    //data2.setName = ("John Carbonni");
    //data2.setAge =(28);
    //data2.setAddress = ("22 King Street");
    //data2.setPhone = ("(555)555-0123");
    //System.out.println("\nFriend #2 Information: ");
    //System.out.println("Name: "+data2.getName() );
              //System.out.println("Age: "+data2.getAge() );
              //System.out.println("Address: "+data2.getAddress() );
    //System.out.println("Phone: "+data2.getPhone() );
    public class C24001_PersonalInformation
    private String name;
    private int age;
    private String address;
    private String phone;
         // The constructor is a default               *
         public C24001_PersonalInformation()
              //System.out.println("Default Constructor Personal Info Class.");
    // The setName method accepts an argument *
    // which is stored in the name field. *
    public void setName(String n)
    name = n;
         // The setAge method accepts an argument *
         // which is stored in the age field. *
    public void setAge(int a)
    age = a;
         // The setAddress method accepts an argument *
         // which is stored in the adress field. *
    public void setAddress(String d)
    address = d;
         // The setPhone method accepts an argument *
         // which is stored in the phone field. *
         public void setPhone(String p)
         phone = p;
    public void set(String n, int a, String d, String p)
         name = n;
         age= a;
         address = d;
         phone = p;
    // The getName method returns the name field. *
    public String getName()
    return name;
         // The getAge method returns the age field. *
    public int getAge()
    return age;
         // The getAddress method returns the address field. *
    public String getAddress()
    return address;
    // The getPhone method returns the phone field.*
    public String getPhone()
    return phone;
    If anyone could help with this I would really appreciate it! Thank you!

    The other two error are because of syntax errors on your part. You're defining methods, but not invoking them correctly. For example:
    data.setPhone = ("(555)555-5678");What you're doing, syntactically speaking, is setting a value to the "setPhone" field, which of course doesn't exist. What you meant to do is invoke the setPhone method. So change the above to this:
    data.setPhone("(555)555-5678");(remove that equals sign).
    BTW, a couple of forum-consideration points:
    When you post code, please wrap it in [code][/code] tags. It makes it easier to read, and people are more likely to help you.
    This really isn't a question about compiling, even though it showed up during compilation. Probably a better forum would have been the New to Java forum.

  • Can you use ABAP for B1 Development

    Hi
    I have been lookng for answer for the following 2 questons.
    1.  Is is it possible to use ABAP for B1 Development to create Add-ons.
    2. In the standard forms/reports there is no figure to words conversion. Please high light on how to do this.
    Ramesh Shankaran

    Short answer: no you cannot.
    Longer answer: B1 gives you access to its objects and GUI
    with COM-based libraries. Any language that supports COM
    can be used, included VB, VB.NET, C#, C and C++. A wrapper
    for Java is also provided to access B1 objects.

  • How can you develop photo galleries with multiple pages using the web module?

    Going through the web module I can see there are many options for developing a web page with a single collection of photos.  How can you develop a web site with multiple pages containing different categories of photos using the Lightroom web module?

    This thread will give you several ideas.
    Re: How do you embed a gallery into an existing website?

  • How to access the objects from  multiple classes in  ABAP Objects

    <b> Give me The scenario and solution to the above problem </b>

    In abap OO you can have only one super class.
    multiple inheritence can be acheived by inheriting multiple interfaces.
    abap OO is similler to that of JAVA in inheritence.
    so you can not have classes a and b both as super at same time for a class.
    however if still you want to acheive your perpose then you can do it using heirarchical inheritance where b inherits a and c inhrites b. so this way public methods will be accesible in c
    do revert back if any other doubt.
    check this link for more clear picture:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/frameset.htm
    regards.
    kindly close the thread if problem by awarding points on left side.
    Message was edited by: Hemendra Singh Manral

  • How do you know what classes to use ?

    Hello,
    This may sound daft - but how do you know what classes to use to do a particular task ? For example to do password-related stuff - how would I know which classes are all relevant to that ? Am I supposed to buy a book on the classes as the API documentation doesn't really tell you WHEN to use which classes.

    If you're using JSP, then your password field is likely going to be implemented in HTML. So that's nothing to do with Java. (And you can't use a JPassword field in a JSP page.) But when that field comes back to your server, you may be using Java to authenticate it. Even there, the question is not yet what Java method you are going to use, but what methodology. You could have a database to authenticate against, or an LDAP directory. Or you could have the web server use its built-in authentication, which means you don't have to do any Java coding at all. And there are other ways.
    So the question before yours is, how do you know what methodology to use? Again, that comes down to experience.

  • Need to know how to find the name of the classes for ABAP Objects

    Hi Experts,
    I am new in ABAP Objects. I do not now the best way to find the class which I want to use. Shall I search it using F4 search help, but many of the classes does not have a description with them.
    I want to create a text field on my splitter container. Can anybody please tell me the class-name for the text field.
    Regards,
    Saurabh A. Buksh

    Hi,
    Thank you for the helping me. But, I actually want something which we call a Text Box. I do not require a Text Edit Control.
    Please tell me if you know any classes related to it and the parameters that I need to pass into it.
    Thanks & Regards,
    Saurabh A. Buksh

  • Content Holder How do you get css class to appear in the wysiwyg editor? The only option is "clear class".

    Need an answer to my question: How do you get css class to appear in the wysiwyg editor? The only option is "clear class".

    Liam,
    If it's not supported there, then where can I access the css and do you have any recommendations for a simple app to change the css style?

  • How do you compile multiple class files in a unix cmd prompt?

    I have been using Java for a few years now, but for some reason I have a course that requires us to compile/run and hand-in our java assignments using Unix...
    I know how to compile a simple program on unix with a single source file, but how the heck do you compile and run a program with say... 2 or more sources files linked together?
    I really doubt the answer is just type
    javac java1.java
    javac java2.java
    javac java3.java
    and then running the source file with the main in it.
    Hopefully someone here can help me.
    Thanks
    Roger

    okay, well I took some time to read up online how to do this and I guess i'll answer my own post just in case someone else wants to know the answer.
    2 ways I found were:
    1)For example, you can list all of the source file names in a file named sourcefiles. This file might look like:
    MyClass1.java
    MyClass2.java
    MyClass3.java
    You could then run the compiler with:
    % javac @sourcefiles
    2)Or if all the files are in the same directory you can do this:
    This example compiles all the source files in the package greetings.
    % ls
    greetings/
    % ls greetings
    Aloha.java GutenTag.java Hello.java Hi.java
    % javac greetings/*.java
    If that is confusing to read I found all the answers from this webpage:
    http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html

  • Abap 00 and HR SAP classes

    Hi,
    I am developer and beginner in HR
    I found many classes for HR in the repository. I think, the most interesting class for me is
    CL_HRBAS_PLAIN_INFOTYPE_ACCESS
    because I need to read single infotypes and not all records. The problem is: I found no examples for this class.
    Can someone help me further?
    Thank you!
    Have a nice time!
    Patrizia

    Hi Patrizia,
    I know this is a bit late but hopefully it still helps.
    In short you would be better to use one of the available function modules (e.g. HR_READ_INFOTYPE, HR_INFOTYPE_OPERATION) or to use the PNP logical database statements (GET PERNR, RP_PROVIDE) as Jamie alluded to.
    For detailed info on how the HR Infotypes have been implemented using ABAP Objects  you can refer to this SAP Library content which explains the decoupled infotype framework
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/43/a503b963161bbfe10000000a1553f7/frameset.htm">Decoupling Infotypes</a>
    For understanding why the HR Infotypes were decoupled you can refer to this SAP Library content introducing concurrent employment:
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/16/08c73c52aacf5be10000000a114084/frameset.htm">Infotype Framework for Concurrent Employment</a>
    If you still really want to use ABAP Objects to perform this action then please ignore class CL_HRBAS_PLAIN_INFOTYPE_ACCESS since that is used for PD infotypes only. You can refer to the example code I'm pasting below for reading a PA infotype:
    *& Report  zptest0002
    *& Test program to use the ITF to read infotype 0002 for a person
    REPORT  zptest0002.
    * data declarations
    DATA: prelp_tab       TYPE hrpad_prelp_tab.
    DATA: a_read_infotype TYPE REF TO if_hrpa_read_infotype.
    DATA: data_exists     TYPE boole_d.
    DATA: i_pa0002      TYPE TABLE OF p0002,
          wa_pa0002 LIKE p0002.
    DATA t_pernr TYPE pernr-pernr.
    * supply existing pernr for testing or implement a parameter
    t_pernr = 2.
    * initiate the infotype framework
    CALL METHOD cl_hrpa_masterdata_factory=>get_read_infotype
      IMPORTING
        read_infotype = a_read_infotype.
    CLEAR i_pa0002.
    REFRESH i_pa0002.
    * perform the read operation
    CALL METHOD a_read_infotype->read
      EXPORTING
        tclas         = 'A'
        pernr         = t_pernr
        infty         = '0002'
        subty         = space
        objps         = space
        sprps         = if_hrpa_read_infotype=>unlocked
        begda         = if_hrpa_read_infotype=>low_date
        endda         = if_hrpa_read_infotype=>high_date
        no_auth_check = 'X'
      IMPORTING
        infotype_tab  = prelp_tab
        data_exists   = data_exists.
    * cast prelp return value into infotype structure
    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn_tab
      EXPORTING
        prelp_tab = prelp_tab
      IMPORTING
        pnnnn_tab = i_pa0002.
    * loop to process or get first record
    CLEAR wa_pa0002.
    READ TABLE i_pa0002 INDEX 1 INTO wa_pa0002.
    * write to the screen or perform other operations
    WRITE: / 'First name: ', wa_pa0002-vorna.
    WRITE: / 'Last name: ' , wa_pa0002-nachn.
    Please reward points if you found this helped. ***
    regards,
    Paul

  • V.Important: How to use se24 to build a class step by step:  Points assured

    hi all
    I am new to OO based abap programming.  I want to build a class using SE24 but i dont know where to put the various pieces of code in SE24.
    Can anyone please provide a step by step procedure (including screenshots) on how to use SE24 to build a class using most of the features like constructor, attributes , interface , friend etc.
    Documents would be more helpful as compared to links.
    Points will be awarded
    thanks in advance

    Hi,
    Just follow the below givenlink. Using this you can create a class in SE24.
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/f4b1406fecef0fe10000000a1550b0/content.htm
    I think the below document would be
    a very good introduction
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0a33479c-0b01-0010-7485-dc8c09d6bc69
    See the Following Dem Program:
    DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
    DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
    DEMO_ABAP_OBJECTS_DIALOG_BOX Splitter Control for Screen with Dialog Box
    DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
    DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
    DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
    DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
    Regards,
    Padmam.

  • How OO ABAP  & ABAP WEBDYNPROS  are Related??

    HI,
    i am new to WEBDYNPRO and shifting myself from OO ABAP  to  WEBDYNPRO IN ABAP.
    Kindly let me know how OO ABAP and webdynpro ARE INTERRELATED.(in terms of coding or in terms of environment)
    Regards,
    Dev

    Hi Dev,
    Welcome to ABAP Dynpro!
    Now I am 10 months old to ABAP Dynpro.I have explored a lot.Now you were asking about how much ABAP/OOPS one should know and topics one should know.
    In my view you should be aware with fundamental of OOABAP like
    class , methods , interfaces and static attribute.Being WD ABAP Dynpro guy you should be in position to use ABAP classes and methods in it.
    Just take case if you want to access element from node in context ...such code by wizard Appears ....
    DATA:
    zobj_bbp_ior_util TYPE REF TO zcl_bbp_ior_util,
    node_ztiornode TYPE REF TO if_wd_context_node,
    elem_ztiornode TYPE REF TO if_wd_context_element,
    stru_ztiornode TYPE zsior.
    navigate from <CONTEXT> to <ZTIORNODE> via lead selection
    node_ztiornode = wd_context->get_child_node( name = if_request_ior=>wdctx_ztiornode ).
    get element via lead selection
    elem_ztiornode = node_ztiornode->get_element( 1 ).
    now you should be in position to understand and make use of classes like
    ' wd_context' etc. .You should know what it does then you will use it method
    like get_child_no.
    Hope I have cleared you doubt.
    Cheers,
    Darshna.

  • Finding files when you develop web program

    Hi. I develop web app. I deploy application on GlassFish. I have stateless session bean. There code reads data from file and checks retrieved value. File f= new File("category.properties"); suppose to locate the file category.properties in Project's directory. But the program can't find it there. The file exist in that directory.
    Somehow that file was found before in Project's directory and deployed to GlassFish. So I noticed that the program checks just if the file exist on GlassFish, but does not check if the file is in Project's directory. As well the program updates data in file which is inside GlassFish but leaves alone same file in Project's directory.
    If you run that class which reads file from Project's directory using separate main method which runs just that class, then the program sees the file in Project's directory and updates it.
    How to force the web program to read/find file in Project's directory and if you make updates show those updates in Project's directory file.
    Cheers
    Edited by: 814861 on 23-Feb-2011 06:26

    A deployed application has no relation at all to a 'project'. What you want is the application to find a file in a specific directory.
    In your case you will probably only want to read from the file, so your best bet is to put the file on the classpath (for example, put it in the 'classes' subdirectory of your war) and load it using getClass().getClassLoader().getResourceAsStream(). In other words, make the properties file part of your project resources.

  • How much ABAP is used in your entourage

    Hi All,
    I want to have a rough estimation of how much ABAP is used outside SAP.
    As an ABAP community member, you may have answers for the following questions.
    Which companies use ABAP ?
    How many projects are developed or in development ?
    What are the sizes of theses projects ? (no need for the precise size. Just say if the size is
    many hundreds, thousands or tens of thousands, u2026)
    Thank you very much for your help.
    A.
    PS. Links for any document which contains information related to the questions above, should be very helpful.
    (I m asking for non-confidential information or already published)

    3rd - SAP is the 3rd largest software company in the world
    There are over 10,000 companies using SAP. There are millions of people using SAP.  ABAP is a central programming language for SAP so each of those companies employs people who can code in ABAP.
    I am a Senior ABAP Developer.  I do a lot of ABAP and have created some very complex systems with it.  Usually you are talking anywhere from 10 lines of code to a couple of thousand.  Not tens of thousands.

  • How to load a specific set of classes at runtime.

    Howdy!
    I want to load all the classes in a directory that implement a specific Interface, at runtime. Of course i can load all the classes if i know the String name.
    Class t = Class.forName(ruleClass);
         cnst = t.getConstructor( new Class[] { Session.class } );
         try {
             Object obj = cnst.newInstance(new Object[] {            
                                              m_fwkSession });
             IRules rule = (IRules)obj;
                ...................where IRule is an interface.
    How do i get all the files in that directory and find the classes implementing that interfaces ?

    You can either load all the classes and then test if they are assignable from IRule.class (isAssignableFrom())
    (you could use a custom classloader if you wanted these classes to be garbage collected)
    or
    Open the class files and scan them to see if they contain
    "myPackage/IRule"
    (maybe you would have to parse the .class file, but just scanning it might be good enough)

Maybe you are looking for

  • PO Print for Asset

    Hi All We need to buy 50 computers, so have to assign 50 asset codes for 50 pc. when we generate the PO have to enter 50 line Items. when it print also , it is a long print out, is any way to put 50 Asset codes in one line item in PO. Rgds PP

  • ACE30 Load balancing based on IP and using x-forward-for header

    Hi Guys, We currently have a load balancing policy setup to direct traffic to say FARM-A based on a particular range of source (client) IP addresses, and the default FARM-B for all the other traffic. We are now looking to introduce a web application

  • Urgent Pls - Using BC4J Intermedia tags

    Hi, I am using BC4J Intermedia tag EmbedImage to display images stored in Databases. When I try to display I get only a blank picture equivalent to the size of the image and not the image itself. The type of the image is JPG. The Image datatype in th

  • Lightroom 4.4 doesn't open

    I downloaded the LR 4.4 update and get an error message "lightroom quit unexpectedly".  Does this with CS6 download as well.  Updates from other software providers work fine.  Only Adobe software has this issue.  Running OS 10.8.3 on a MacPro 6 core.

  • Lost internet connection when computer moved only 5ft!

    I wonder if someone can help me with this odd problem I've been having. I have a Mac Book Pro that is wirelessly connected to the internet via Airport Extreme. I also have a Roadrunner cable modem hooked up to my TV (in the Living room) and to Vonage