Include in ABAP class for Workflow

Hi,
In order to use BOR macros inside ABAP class, (From SAP help) came to know that we need to use include <cntn02> .
How to add this include to ABAP class for workflow?
Regds,
Akshay

Hi Akshay,
Slight difference, I said "keeping the class clean of BOR <i>code</i>". By all means use BO's in the class: basically create a ZCL_MATERIAL, and use BUS1001 as an attribute (I use a naming convention BO_* for these). As long as it's the right type (SIBFLPORB I think - no system handy right now), and the key values are populated correctly the system will instantiate it as necessary. So in WF I can refer to ZCL_MATERIAL.BO_MATERIAL whenever I need any of the BO's functionality.
You are correct though, creating a proper business class which you can instantiate such as material does involve a fair bit of effort and coding to set up. e.g. my last project I ended up creating one ZBOR subtype because all I needed was one new attribute - definitely not worthwhile creating a new class for. (USR01.zEmailAddress for what it's worth).
I've said before somewhere, it's not without pain, so if you're under time pressure etc, then it may be better to do whatever's quickest. There's nothing wrong with using BOR macros, it will still work for quite a few versions. I just meant to say that pure class(y) code is a preferred way to go if it makes sense to do so. This is not always the case.
Hope that helps,
Mike

Similar Messages

  • ABAP Classes in Workflow

    I am planning to use ABAP classes instead of BOR Objects in Workflow and would appreciate
    1) any elaborate documentation on the use of ABAP classes in workflow (SAP help has very limited documentation)
    2) comparision of using either approach with advantages of using ABAP classes over the use of BOR Objects and limitations of using ABAP classes,if any.
    3) any examples of ABAP classes used in Projects
    Thanks for your help.
    Saurabh

    Hi,
    check the wiki, in the design and development part are listed all of Jocelyn darts blogs about OO in workflow:
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/2.DesignandDevelopment&">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/2.DesignandDevelopment&</a>
    regards, Rob Dielemans

  • BOR or ABAP Class for MM41

    Hi all.
    I am wondering whether anyone ever use workflow in transaction MM41.
    Does SAP provide standard BOR or ABAP Class for transaction MM41.
    I  know there is BUS1001006 but this only get triggers from MM01.
    Does user exit or BADI is the only way to trigger workflow from MM41?
    Thanks

    Hello,
    It might help if you said what MM41 was.
    As usual, turn on the event trace (SWELS), create and save something in your chosen transaction and then check the event trace (SWEL) for any events.
    regards
    Rick Bakker
    hanabi technology

  • Include in ABAP class

    Hi all,
    Would like to know how to use a INCLUDE in ABAP class.
    Regrdas,
    Akshay

    Like any other INCLUDE.   See below:
    CLASS lcl_event_receiver_g1 DEFINITION.
      PUBLIC SECTION.
        include zr_snax_class_defs.
      PRIVATE SECTION.
    ENDCLASS.
    CLASS lcl_event_receiver_g1 IMPLEMENTATION.
      METHOD handle_toolbar.
        include zr_snax_class_info2.
      ENDMETHOD.
      METHOD handle_user_command.
        DATA: lt_rows TYPE lvc_t_row.
        data: Proceed.
        data: l_cnt type i.
        Perform Clear_Refr_Variables .
    get selected row
        CALL METHOD grid1->get_selected_rows
                 IMPORTING et_index_rows = lt_rows.
        CALL METHOD cl_gui_cfw=>flush.
        assign P1[] to <TheGrid>.
        Refresh_G1 = 'Y'.
        include zr_snax_class_info3.
        unassign <TheGrid>.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.

  • Error handling in Abap Class for SAP Workflow

    Hi Experts,
    I would like to know if we have an option in abap classes used in workflows to send errors to the workflow log. We can achieve this in BOR Object methods by using the EXIT_RETURN <CODE> var 1 var 2 to send the errors back to the workflow, but how is this achieved through methods from classes  used in workflows.
    Appreciate your quick responses,
    Chaitanya

    Just raise exceptions in the normal OO way. Any exception that is a subclass of CX_BO_ERROR should be automatically available in workflow. Use subclasses of CX_BO_TEMPORARY for temporary errors.

  • Calling a custom tcode using abap class from workflow

    Hi Experts,
    I have a requirement of calling a custom tcode from my workflow.
    For this i have created a class zcl_test ( has if_workflow ) .
    I created a method ztest which will call the tcode.
    CALL TRANSACTION 'ZTX'.  ( My tcode just has 1 input field, for testing purpose )
    Then i created a task in whichi hv used this abap class and method.
    But the tcode does not run when i execute the workflow.
    Please help.
    Thank You,
    Radhika Vadher.

    Radhika Vadher 
    use the sample code to get the data from the task container into the ABAP class
    DATA :
             w_ref        TYPE  REF TO      if_swf_run_wim_internal,
             w_ref_cnt  TYPE  REF TO      if_wapi_workitem_context,
              w_wi_ref   TYPE  REF TO      if_swf_ifs_parameter_container.
    TRY.
        CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
          EXPORTING
            im_wiid     = w_wiid
          RECEIVING
            re_instance = w_ref.
      CATCH cx_swf_run_wim_enq_failed .
      CATCH cx_swf_run_wim_read_failed .
      CATCH cx_swf_run_wim .
    ENDTRY.
    CALL METHOD w_ref->get_workitem_context
      RECEIVING
        re_ctx = w_ref_cnt.
    CALL METHOD w_ref_cnt->get_wi_container
      RECEIVING
        re_container = w_wi_ref.
    and the w_wi_ref is having a method GET use that method to get the values of the task container into the ABAP class.

  • ABAP classes for WebTemplate development

    Hi experts,
    I am manipulating a report via ABAP classes.  I need to hide an entire column including the header.  Currently I have done this under the DATA_CELL method and have only been able to hide the KF area.  If I need to hide the Header in the column (built under a structure) as well must I move all my code under the CAPTION_CELL method instead?
    Secondly, I also need to search for a row by the text "Overall Results."  Is there a quick way to search the Y axis for this particular row using the text "Overall Results?
    mark

    hi Mark,
    you can try in
    method CAPTION_CELL
    if i_iobjnm_row = 'your charateristic to be hidden'.
    C_CELL_TD_EXTEND = 'style="display:none;"'.
    endif.
    and ...
    method CHARACTERISTIC_CELL
    if I_IOBJNM = 'your charateristic to be hidden'.
      C_CELL_TD_EXTEND = 'style="display:none;"'.
    endif.
    and I_IS_SUM <> 'X' if result not hide       
    to search 'Overall Result' (if you didnt get yet), can try
    method CHARACTERISTIC_CELL
    I_TEXT
    not sure what's your requirement, to hide a characteristic you can set it bex query designer, characteristic's property 'display' = no display.
    hope this helps.

  • Abap Class for Enterprise Service

    Hi guys.
    I've published as webservice in SAP ECC as enterprise service get it in Enterprise Service Workplace.
    I have two questions:
    1- How can I know the abap class associated to this enterprise service.
    2- Could I extend the functionality of this enterprise service? For instance I'd like to response with one more field. Is that possible or I have to create a new one?
    Thaks a lot.
    Regards.
    Edited by: Christian  Abad Chico on Feb 20, 2012 4:03 PM

    Hi
    May be the below link helps you,
    [http://wiki.sdn.sap.com/wiki/display/EmTech/PublishWeberviceinABAP,ConsumeWebserviceinABAPandAdobeFlex.]
    Regards,
    Vijay V

  • ABAP Classes for date & day computation

    <<Date questions have been asked so many times that they are not permitted in the ABAP forums>>
    Hello, I have a requirement to get the date of last 2 thursdays. Can somebody please help with the class I should use for the purpose?
    Thanks!
    Edited by: Matt on Aug 16, 2011 11:50 AM

    Hey,
    DATE_COMPUTE_DAY will give you DAY number for any date, with day number 1 as Monday .....4 as Thursday....and 7 as Sunday.
    SO, you can use ..
    data: lv_day type SCAL-INDICATOR,
          lv_diff type i,
          lv_thurs1 type sy-datum,
          lv_thurs2 type sy-datum.
    PARAMETERS: p_date type datum DEFAULT sy-datum.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
      EXPORTING
        date          = p_date
      IMPORTING
        DAY           = lv_day
    lv_diff = lv_day - 4.         "since Thursday is 4
    if lv_diff GT 0.
      lv_thurs1 = p_date - lv_diff.
    else.
      lv_thurs1 = p_date - 7 - lv_diff.
    endif.
      lv_thurs2 = lv_thurs1 - 7.
      write:/ lv_thurs1, lv_thurs2.
    I have not included today's date if it is Thursday, if you want to include it, change 'GT' to 'GE'.
    BR,
    Diwakar
    Edited by: Diwakar Aggarwal on Aug 16, 2011 10:49 AM

  • ABAP Class for BOR IMAGE

    Is there an ABAP Object class which wraps or implements the BOR IMAGE?
    ( In particiluar, I wan't to be able to use the display method. )
    Thanks...
    ,..Mike

    closed

  • How to use ABAP Class to modify Web Query Result ??

    Hi all !
    We are using Web Templates to display our Query.
    What I would like to do ( and seems a really important issue for our users! ) is to have a "PAGE BREAK" everytime the value of a charateristics change in the report
    For Example :
    -Page 1-
    Division     Project
       A               1
                        2
                        3
    -Page 2-
    Division     Project
       B               1
                        2
                        3
    and so on....
    I read threads about using ABAP CLASS but no example what so ever...
    We are presently under BW 3.1 but are considering upgrading to 7.0 by the end of the year so if there is a solution to my problem on either version i'd like to know.
    If anyone has any information about how I can do this it would be most appreciated
    Thx
    JB.

    Hi Yong,
    Ravi is right, first check the blogs by Jocelyn, and if you still have specific questions you can ask them. I have used ABAP classes in workflow and I know Mike Pokraka tries to use classes exclusively.
    Regards,
    Martin

  • ASUG Presentation - April 2007 - Do you have the ABAP Classes presentation?

    Hi all,
    does anyone have a copy of the ASUG presentation that supported the session:
    "Classy Workflows: Moving from Business Objects to ABAP Classes - practical examples, and case studies, for using ABAP Classes in Workflow applications".
    Can you please send it to [email protected]
    Much thanks and regards,
    Cristiana

    Hi there
    In Captivate, try opening the preferences by pressing Shift+F8 and navigating to the Project > Start and End and clearing the Auto Play option. Re-publish and re-insert into the PowerPoint and see if that helps.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • ABAP CLASS in work flow

    Hi all.
         Can you pls let me know what is the use of ABAP CLASS in workflow with one sample scenario.
    How it differs from  BOR. Thanks in advance.
    Kind Regards,
    sami.

    Hi Sami,
    ABAP classes are pure representation of OOPS. They provide additional functionality that is not provided by business objects.
    If you search SDN you would find ample information on the same, you can refer the following blogs to start with:
    /people/jocelyn.dart/blog/2006/06/19/why-use-abap-oo-with-workflow
    /people/jocelyn.dart/blog/2006/07/27/raising-abap-oo-events-for-workflow
    Hope this helps!
    Regards,
    Saumya

  • File to Proxy Scenario using ABAP Class and DB Multi Connect

    Hello Friends,
    I have a scenario below and a proposed solution. I would like some input as to whether i am headed the right way.
    Scenario: Thousands of records come in from the legacy accounting system. The fields of these records need to be mapped to SAP fields using cross-reference tables stored in DB2. Finally, summarize the records by deleting a few fields and feed to R/3.
    Solution i proposed:
    (1) File Adapter is used to send the file
    (2) Although JDBC adapter comes first to mind but since i need to access the DB2 tables multiple times for each record i propose to use an ABAP class for the mapping. Within the ABAP class the intent is to open an database connection to DB2, read the relevant cross tables using native SQL and finally generate the output XML.
    (3) Reciever is Proxy which feeds this generated XML to SAP for creating posting via BAPI_ACC_DOCUMENT_POST
    Question: Is the above solution correct or is there a better method to implement this scenario?
    Please let me know.
    Thanks,
    Minhaj.

    Looks fine. Few observations -
    1. Whether it is ABAP class or Mapping in RFC lookup, you are making multiple trips to the database.
    2. It looks like PI is being used only for reading the file and converting it to XML.
    3. If using PI is not mandatory, then a complete ABAP class on ECC it self would be faster than swtching between PI Java, PI ABAP then round trips to DB2 finally data push to ECC.
    If you could look at something like fetching all the required RFC look up data in one go and then map the fields according, might save u on processor and network resources.
    VJ

  • Include rt.jar class files in my own jar file to run 1.2+ applets on MS JVM

    My problem is this. I'm writing an applet (which includes 1.2 classes) for my organization (over 2000 NT workstations) in which no one has administrative privelages to install Sun's JRE 1.2 or greater. The target browser is IE 5. Our NT admins are having problems pushing the JRE out so my only two options are to rewrite everything as 1.1 or somehow include the missing class files from rt.jar.
    I really do not want to rewrite it all!
    I was able to extract the missing class files (i.e. /java/util/HashMap.class) but I cannot figure out how to get the IE JVM to use them. Things I have tried:
    1. jarred up all my class files along with the missing classes from rt.jar.
    $ jar cvf test.jar *.class java
    added manifest
    adding: ArrayObj.class(in = 731) (out= 448)(deflated 38%)
    adding: DivMonGrid.class(in = 1509) (out= 812)(deflated 46%)
    adding: GridLayout2.class(in = 2720) (out= 1514)(deflated 44%)
    adding: Item.class(in = 317) (out= 232)(deflated 26%)
    adding: Row.class(in = 588) (out= 365)(deflated 37%)
    adding: Screen.class(in = 672) (out= 416)(deflated 38%)
    adding: Site.class(in = 545) (out= 360)(deflated 33%)
    adding: divmonDash.class(in = 12506) (out= 6892)(deflated 44%)
    adding: java/(in = 0) (out= 0)(stored 0%)
    adding: java/util/(in = 0) (out= 0)(stored 0%)
    adding: java/util/HashMap.class(in = 6668) (out= 3461)(deflated 48%)
    adding: java/util/HashMap$1.class(in = 931) (out= 513)(deflated 44%)
    adding: java/util/HashMap$2.class(in = 800) (out= 454)(deflated 43%)
    adding: java/util/HashMap$3.class(in = 1608) (out= 904)(deflated 43%)
    adding: java/util/HashMap$EmptyHashIterator.class(in = 592) (out= 358)(deflated 39%)
    adding: java/util/HashMap$Entry.class(in = 1505) (out= 775)(deflated 48%)
    adding: java/util/HashMap$HashIterator.class(in = 1814) (out= 1096)(deflated 39%)
    $ jar -tf test.jar
    META-INF/
    META-INF/MANIFEST.MF
    ArrayObj.class
    DivMonGrid.class
    GridLayout2.class
    Item.class
    Row.class
    Screen.class
    Site.class
    divmonDash.class
    java/
    java/util/
    java/util/HashMap.class
    java/util/HashMap$1.class
    java/util/HashMap$2.class
    java/util/HashMap$3.class
    java/util/HashMap$EmptyHashIterator.class
    java/util/HashMap$Entry.class
    java/util/HashMap$HashIterator.class
    RESULT: IE JVM complains classnotfoundexception (its complaining about not finding HashMap.class)
    2. Tried to just place missing *.class files in same directory as my class files
    RESULT: Compiler error (complaining about file not be in correct path package) I understand this because when it was created the package statement has the class file in java/util/.
    If anyone has done this before or knows how to do it, please help me out.
    Thanks!

    When the collection classes first came out, I think they were available in a separate jar (although the package name may be slightly different). If it's just collection classes, that might be worthwhile looking at.
    The MS JVM may be spewing because the class format is too new; you may try with rt.jar classes from an older JVM (such as JDK 1.2), or try to recompile them from source using -target 1.1.

Maybe you are looking for

  • Airport.  Extreme and Mybook Studio Edition - what cable do I need.

    I haven't had my Mybook external harddrive attached to our home network for over a year and now I can't remember how I did it. In fact, I can't even find a cable that would work! Is it possible to run a cable from the Airport extreme to the MyBook? O

  • CProjects rescheduling:: Role-task assignment adjustment

    All, We create a project with phase and task & role with staffing. We assign role-resource to task. After sometime, we reschedule the project. Dates of project, phase, and task are changed. But the role validity, the role staffing duration, role-reso

  • Can you affect the exported pdf-version???

    Hi, you can influence the version of the created pdf doc witin the EXPORT OR EXPORTTODISK function? which Pdf version is produced by which CR version?? Background: I have an ocx (which I cannot change), that shows only version 5.1 of PDF documents wi

  • Hosting Plans -- Large Bandwidth needed!

    I started my podcast back in late February, and I've switched servers a couple times, starting with my school's personal web server (however I recently graduated) and then moving to GoDaddy's biggest plan, which has 2,000GB of bandwidth monthly. Howe

  • Binary threshold - U16 Image

    I have a simple example which I have attached (Vision 2013 but can save for previous if need be) in which I would like to apply binary thresholding to a range of values (minimum --> mean) in a U16 image.  This example is based on the particle analysi