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.

Similar Messages

  • 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

  • TYPES statement in abap class to include structure

    hi ,
    i have declared following in a abap class...
    TYPES:
          zts_alv_line TYPE zmat_pr_costest_alv.
         TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
         TYPES: tt_alv_data TYPE STANDARD TABLE OF ts_alv_line WITH DEFAULT KEY.
         DATA:
          alv_data TYPE tt_alv_data.
    now while refering to alv_data-matnr the sap is giving error that this component does not have matnr.
    please help.
    Edited by: Suhas Saha on Feb 3, 2012 1:11 PM

    TYPES: zts_alv_line TYPE zmat_pr_costest_alv.
    TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
    Actually by defining this you've defined include as field of ts_alv_line. Actually ts_alv_line is a nested structure.
    I think you need to re-define the structure definition as:
    TYPES:BEGIN OF ts_alv_line.
          INCLUDE TYPE zts_alv_line.
    TYPES: matkl TYPE mara-matkl,
           t023t TYPE t023t-wgbez,
           lvorm TYPE mara-lvorm.
    TYPES: END OF ts_alv_line.
    BR,
    Suhas

  • Create Attachment in workflow through ABAP Class in ECC 5.0

    Hi,
    Wr are using SAP ECC 5.0 and i am trying to create attachment through ABAP class.
    Here in ECC 5.0, macro INCLUDE cntn01_swc is not available.
    I am getting an error in declaration of SOFM object, because again SWC0_OBJECT is not available.
    I've tried creating the parameter as type SOFM and of type table of SOFM but it also not working.
    Can anybody help me how i can create SOFM instance in ABAP class in ECC 5.0?
    Regards,
    Smit

    Hi
    I am not very much sure about ECC 5.0 environment. Firstly are you looking to create a SOFM object inside any class or program or Function module , If yes then you need to include a include INCLUDE CNTN01_SWC (No arrow brackets) if this include is not available then use INCLUDE<CNTN01>  then declare a variable of type SWC0_OBJECT if you are using first include or declare of type SWC_OBJECT.
    Once you include any of the includes then by making use of SWC macros you can create a object
    SWC0_CREATE_OBJECT <VARAIBLE> <BOR NAME> <BORKEY> for first include.
    SWC_CREATE_OBJECT <VARAIBLE> <BOR NAME> <BORKEY> for second include.
    Regards
    Pavan

  • ABAP Class reference in persistent container

    Hi all,
    Has anyone ever tried to read an abap class reference from a rule container in the rule's function module?
    This doesn't seem to work, unless I am doing something wrong...
    Here is the scenario:
    I have an abap class ZCL_CLASS instantiated in my workflow container. In one of my workflow steps I pass that class object reference to a rule (Function Module based). In the rule function module I use macro swc_get_element to try to get the class object reference. And there it is not getting anything.
    I have already tried the following:
    - Try to run macro swc_container_to_runtime on the rule container before retrieving the object reference -> doesn't work. The internal table ac_container doesn't even look different before and after having run this macro.
    - Try to replace the declaration of include <CNTN01> by <CNTN02> + <CNTN03>. Doesn't change anything either.
    When I look at ac_container in debugging it seems my object reference is there but looks a bit strange:
    ELEMENT | TAB_INDEX | ELEMLENGTH | TYPE | VALUE
    WFIBF_PORTAB | 000011 | 004 | u | SWFTSTRUCT
    WFIBF_PORTAB | 000012 | 032 | C | STEP
    WFIBF_PORTAB | 000014 | 032 | C | 1CCC1000C
    WFIBF_PORTAB | 000015 | 104 | C | <object key>    <class>    CL
    Any idea of how I should proceed to retrieve my object reference?
    For the moment the workaround I found is to pass the object key to the rule and to reinstantiate the class in the rule function module. Not a very elegant solution...
    Thanks in advance and kind regards,
    Patrick

    Hi Mike,
    I understand what you're saying. But the problem is that the swc_get_element macro does not even get me the LPOR value, and therefore I can't call the FIND_BY_LPOR method.
    That means I have two solutions:
    - Passing the LPOR instead of the object reference to the rule container => Not a very nice solution, for many different reasons.
    - Find an alternative to swc_get_element to get the LPOR value.
    I had a look at class cl_swf_cnt_container, and it seems it can do the trick for me.
    So what I will finally do is:
    1. Convert the BOR container into an instance of cl_swf_cnt_container.
      DATA: lo_cnt    TYPE REF TO if_swf_cnt_container,
                 lt_container TYPE swconttab.
      lt_container[] = ac_container[].
      TRY.
          CALL METHOD cl_swf_cnt_container=>if_swf_cnt_conversion~create_from_bor_container
            EXPORTING
              values                = lt_container
            RECEIVING
              container           = lo_cnt.
        CATCH cx_swf_utl_obj_create_failed.
      ENDTRY.
    2. Get my container element.
    DATA: lo_myobj TYPE REF TO zcl_class.
    CALL METHOD lo_cnt->if_swf_ifs_parameter_container~get
      EXPORTING
        name       = 'MyContainerElement'
      IMPORTING
        value      = lo_myobj
    I didn't take the time to debug that deep in the standard SAP code, but I assume the if_swf_ifs_parameter_container~get re-instantiates my class for me.
    Please feel free to comment.
    Kind regards,
    Patrick

  • Macro swc_set_objectkey in ABAP Class

    Hello,
    I want to use macro swc_set_objectkey in ABAP class.  macro swc_set_objectkey is present in include <object>. I can not include <object> in ABAP class because it gives syntax error "You may only define classes, interfaces, or types in a CLASS-POOL". Can you please let me know what should be done in this case ?
    Edited by: Ashwin Sonkusare on Apr 6, 2011 1:55 PM

    Hi Rick,
    Is possible to use macros in abap classes ,
    review link
    http://help.sap.com/saphelp_nw70/helpdata/en/c5/e4b130453d11d189430000e829fbbd/frameset.htm
    Regards.
    maopacheco.

  • Function module equivalent to SWE_EVENT_CREATE while using ABAP classes

    Hi there,
    I used to use SWE_CREATE_EVENT to fire the events linked to my BOR objects, in order to start certain workflows.
    Now I am using ABAP classes within the WorkFlows, and the name of the classes MUST (in my case) be longer than 10 characters, and SWE_EVENT_CREATE is cutting the name so it does not work
    Do you know any FM equivalent to start an event from a ABAP class (SE24) object?
    I have tried to use SAP_WAPI_START_WORKFLOW, but I cannot find the way to include my object in the container. Any ideas on this point would be welcome as well
    Thanks so much,
    Miguel

    Thanks for such a quick reply,
    You were right. I actually did follow Jocelyn's blogs, but somehow I skipped the raising event section.
    Just for information, the URL with the solution to this problem is:
    /people/jocelyn.dart/blog/2006/07/27/raising-abap-oo-events-for-workflow
    Have a good one

  • Capturing ABAP Class in Transport Request

    Hi ,
    Can anyone please tell me how to capture ana ABAP Class in transport request . IT first gave me an error saying :
    'ZCL_PHX_MANUAL_SAVE===========CO  missing then after capturing that , now it is giving me an error message saying
    'ZCL_PHX_MANUAL_SAVE===========CI missing.
    Can someone suggest me the correct method by which i can captur my class in request and transport it to Production.
    Thanks and Regards,
    Vijay Sanklecha.

    Hello Vijay,
    If your class name is ZCL_PHX_MANUAL_SAVE. Then SAP genereates its own includes for private,public and protected sections . Those are the includes that you have mentioned here.
    Right mehtod for including the class in a request is
    Go to Se80
              Give your class name anf right click
              Choose other functions-> write transport entry
    Regards
    Arshad

  • Binding ABAP Class Attribute with BUS2038 in a Standard WF task

    Hi,
    I need help as mentioned in the subject line.
    In my standard task I am capturing event for BUS2038. In the General tab I have a ABAP class which has implemented IF_WORKFLOW. From BUS2038 I just need notification number.
    Since my source is a BO and my target is a class. How do I make this conversion and pass the data to my class?
    I know there are several solution but none have solved my concern.
    Thanks,
    Sridhar Karra.

    Hi,
    If you want to access teh attributes of the BOR inside a class emthod then you have to make use of teh MACROS.
    1. include INCLUDE CNTN01_SWC  in the class local macros section. and in the type groupsof the class include SWC0.
    2. Now if you know the key of the BOR instance then create a BOR object inside the class method as below
    DATA lo_object   TYPE SWC0_OBJECT.
    SWC0_CREATE_OBJECT lo_object '<BUSXXXX>' '<Key of the BOR>.
    the above line will create the instance of the bor inside the class method
    now inorder to access the attributes of the BOR  use the below code
    DATA lv_notif_no   TYPE  <type of the notification>.
    SWC0_GET_PROPERTY lo_object '<ATTRIBUTE NAME> lv_notif
    In this way you can access the BOR attributes inside a class method.
    Regards
    Pavan
    Edited by: Pavan Bhamidipati on Dec 15, 2011 11:01 PM

  • ABAP Classes & Macros ( CNTN02 & CNTN03 )

    Good day
    Background:
    Inside a Workflow BADI (def BBP_WFL_APPROV_BADI ) implementation. I need get approval agents by to evaluating Rule (eg: AC9000001).
    I found SAP Help (link below) which says I can use <CNTN02> & <CNTN03> "To use the macros in ABAP classes, the include files <CNTN02> and <CNTN03> must be included. In the Class Builder, include the include file <CNTN02> by choosing Goto >> Class Local Types >> Macros. Include the include file <CNTN03> by choosing Goto >> Class Local Types >> Local Class Definitions/Types."
    [SAP Help -- To use the macros in ABAP classes|http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4b130453d11d189430000e829fbbd/frameset.htm]
    Problem:
    The option Goto >> Class Local Types >> Macros  is greyed out. Means I cannot include <CNTN02>
    The option Goto >> Class Local Types >> Local Class Definitions/Types is available and I can enter <CNTN03> as per SAP Help
    Question:
    Has anyone come across this problem? How did you get past it?
    System:
    SAP_ABA      640 level 18
    SAP_BASIS   640 level 18

    Hi,
    This is still the approved method so stick with this.
    It works perfectly ok so there is no view to changing it.
    Cheers
    Colin

  • 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.

  • Download ABAP Class in 46C?

    Hi,
    Anyone know a tool for downloading ABAP class method codes/ attribute definitions to a local PC file for release 46C?
    I know Direct Download, but for 46C version it's not possible to download Classes:-(
    I know that via menu Goto-> Protected/Private/Public section I can dowload the generated class, but it's not really easy for several class.
    Thanks in advance,
    Peter

    Hi,
    Got from a link
    Downloading ABAP code to your local PC
    Creating Z* test programs is a popular method for conducting tests. However, when an environment is about to get shut down, keeping your test programs becomes tricky. You have to launch se38/37/24/80, select your programs one by one, and choose system -> list -> save -> local file, or use function module WS_DOWNLOAD. This is a lengthy procedure that does not even enable you to save screens, tables, or structures.
    An ABAP program available for free download at http://www.dalestech.com/ can help you save your test programs.
    Choose home -> R/3 entreprise -> direct download entreprise 1.2
    download the .ZIP file,
    Unzip
    Cut and paste in an ABAP program
    Compile and run
    All your projects (including multiple classes, programs, function groups, screens and tables) can be saved in less than one minute.
    If you want to backup your work in order to keep a certain stable version while you are programming, it might be preferable use a tool that is already embedded in the Workbench: in se38/37/24/80, choose utilities -> versions -> generate version
    Thanks & Regards,
    Judith.

  • ABAP class mapping in PI (7.0)

    I just switched from XI (3.0) to PI (7.0).
    I tried to move one of my interfaces, but in Interface Mapping there is no "ABAP-class" option. How to use ABAP mapping in PI?

    Hi Mariuszu
    you need to enable it as described here
    in the exchange profile
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    or you can ask us directly via mail
    Regards,
    michal

  • Shooping cart creation in SRM 7.0 using web dynpro ABAP classes.

    Hi,
    We have recently upgraded to SRM 7.0 from SRM 4.0. We are using customized portal application for the creation of the shopping cart.I am planning to create custom FM which will use the standard Web dynpro ABAP classes to create the shopping cart.
    Could you please guide with the classes that are need to be implemented and the sequence of the classes used in the shopping cart creation.
    I think these are the classes that are used in the standard web dynpro ABAP component.
    CL_FPM_EVENT ->                  Creates an instance of this class based on an event ID.
    CL_BADI_FLT_DATA_TRANS_AND_DB -> Data Handling: Transport and Database.
    CL_EXITHANDLER ->               Class for Ext. Services Within Framework of Exit Technique.
    CL_EX_BBP_DOC_CHANGE_BADI ->     BAdI Class CL_EX_BBP_DOC_CHANGE_BADI.
    CL_BBP_OBJECTS_ACCESS ->         Access Functions for Object Types.
    /SAPSRM/CL_PDO_BO_SC ->          Shopping Cart BO.
    Your expert comments will be appreciated...
    Regards,
    Naresh

    Dear Poster,
    As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
    Best Regards,
    SDN SRM Moderation Team

  • 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

Maybe you are looking for

  • Elements Organizer

    Is there any way to sort videos in the organizer? The only options (that I see) are Date ascending and descending. I have a gopro and when you switch batteries the date resets to jaunuary third of 2009. So is it possible to sort by file name instead?

  • Improve the response time of logical database

    hi all, to improve the response time( time to access data ) in logical database how can we achive this

  • Crystal Reports XI R2 Service Pack 3 Install Issues

    Post Author: iamtgo3 CA Forum: Crystal Reports Crystal Reports XI R2 check automatically for updates when I open it. It finds an update Crystal Reports XI R2 Service Pack 3. Now when you go to install it I get this error. "Crystal Reports XI R2 Servi

  • ORA-01017 (invalid username/password) using globally authenticated account

    Kris and team, Having a hard time believing no one else has encountered this already. But searching on 1017 and "globally" and "identified" in the forum yields nothing useful. New corporate policy has all our DBAs, developers and QA logging into glob

  • Color Settings Error Message

    I got an error message that a pse7 file, color settings.csf was corrupted. I am running windows xp. What do I do?