BPM Alerts Method/Function Module

Hi,
Which MTE Method sends SMS for BPM? I want to change the SMS content. If I can know the Method name, I can edit the function module. If any further infromation is required please let me know.
Points gauranteed.
Please help.
--Ragu

Hi,
check out this guides:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e7bc3a5a-0501-0010-1095-eb47159e169c
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0b4580be-0601-0010-d3ad-bd6ce51ae916
Dominic
Edited by: Dominic Ludolph on Feb 11, 2008 11:37 AM

Similar Messages

  • Create Alert with Function Modul

    Hello
    I want to creat a Alert in Z-program.
    Which Function Modul could I use to create an alert?
    I don't find the right Modul.
    Thanks Sven

    Hi Sven,
    Please try these function modules
    /SAPAPO/AMOS_CREATE_AMO_ALERT
    /SAPAPO/MSNP_TLB_CREATE_ALERTS
    /SAPAPO/VMI_PON_ALERT_CREATE
    /SAPAPO/ASTAND (Function group)
    Check the include /SAPAPO/LASTANDUXX in the function
    module
    Regards
    R. Senthil Mareeswaran.

  • How to access Business object type attribute from a method/function modul ?

    Hello,
    i have created a business object type object along with attributes and methods. Now inside the method i want to access the attributes. inside the method i am writing:
    data a type XXX.
    a = me->attribute
    this is creating a compilation error.
    Now the method is defined as a function module in some package, so can anyone inform me how to access object attributes from the function module ?
    pointes are awarded
    Regards

    Hello,
    thanks for your answer, but this too did not work, "=>" is for static attributes and the attributes i have are not static. Moreover, i tried it but it gave the same error :
    the abap error was when i was checking the code is :
    the type me=>documenttype is unknown
    as you know in SWO1 i created an object and when i create a method you link it to a function module and this is where you have the implementation of the method, so from this method how can i access the attributes on the main object that i created in SWO1
    regards

  • Need to flow/get rejection attachment into method(Function module).

    Hi Workflow experts,
    I need to get or flow rejection reason attachment into method from workflow.
    Pls suggest me how to capture the attachment in method and send it to through CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    I don't need to attach the rejection reason through sent mail activity as I know it works.
    Thanks & Regards
    Srimanta

    Hi,
    As you mentioned when he clicks on CREATE button and then he would be including his comments in the textbox, is enduser using a  webdynpro applicaiton of SAP GUI transaction?,
    and once he clicks on the reject button read the text what ever entered by the enduser into a internal table of type SOLI_TAB and pass this internal table to the function module which you want to use for sending the rejection comments as the mail body..
    Make sure you define the type of the mail as RAW.
    Regards
    Pavan

  • How to Measure Function Module Performance?

    Please can you tell me how I can measure the performance and trace the actions of a Function Module in R/3?
    The function module in R/3 is run when a user calls a WebDynpro action from a WebDynpro screen within the SAP Portal.
    I have tried running a trace on a user (ST05) but that only shows table actions (e.g. reads/fetch etc.). Also it does not appear in ST04 or ST03N. I would like to know how long the program actually takes to run.
    Thanks.
    Paul

    Hi,
    if I want to measure the runtime required to run some Abap, I use SE30. However i used it only for normal Dynpro application, not WebDynpro.
    The detail level of the created trace can be configured. The aggregation level should be set to "Full" or "By call" at the beginning. Disabling aggregation leads to huge trace files.
    You can select which statements should be traced. If you disable an option it's runtime is not lost but add to the traced action in the next level. If for example "Open SQL" is disabled, the time used by it is added into the net time of the method, function module of subroutine. Otherwise if "Open SQL" is enabled the net time of a function module does not include SQL time. SQL time is then listed separately.
    Greetings

  • How to use function module SALRT_CREATE_API to trigger alert in XI?

    Hi experts,
             I have read that alert can be triggered in BPM or through a FM SALRT_CREATE_API. Now how to use this FM?
    In what XI scenario I can use this FM and how?
    Any example will be really appreciated.
    Thanks
    Gopal

    Hi Gopal,
    I am not sure if any function module like SALRT_CREATE_API is used to create ALERTS.
    If you want to <b>create alerts</b>, just check this blog,
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    Next , after you have done this to <b>test your configuration</b>,
    go to T code - SE38.
    In the program , type RSALERTTEST and then click on EXECUTE button ( F8 ). In the next window, it will ask you for your ALERTCATEGORY. Just give the name of your ALERT CATEGORY and click EXECUTE.
    If you have configured your alerts correctly, you will receive a message that tells ALERT IS GENERATED and will give the ALERT ID.
    Now, go to your Run TIme workbench and then select ALERT INBOX and see if you have got the ALERT message in your ALERT INBOX.
    Finally if you are on <b>SP14 or above</b> , check this note <b>913858</b>
    and if <b>below SP14</b>, just check this blog,
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    And. to use this alerts in your BPM,
    /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
    Regards,
    Bhavesh
    Message was edited by: Bhavesh Kantilal

  • Getting values from a function module called in a WDA method

    Friends,
    I am trying to execute a function module from WDA.
    I have created a service call for the function module. The function module takes values from the user, looks up the corresponding values of another field and returns the values in an internal table.
    I am using the "Method Call in Used Controller" of WD Code wizard to call the function module.
    When the event handler method containing the call to the function module is executed, nothing happens.
    I am not sure how to pass values to the function module and to get the return values from the function module.
    I am new to using function modules from WDA. Please help me out.
    Thanks and Regards.

    Rashmi,
    Is the function module intended to collect input data from the UI and process it? - Yes
    If yes, then the input (importing parameter) to the Function Module is a table of values (which should be ideally from the context mapped to the Table UI Element). - The importing parameter is a single value NOT a table and is mapped to the view context.
    Now this table UI Element is bound to the view controller context , which in turn is mapped to the component controller context. And you are indeed being able to read the value of this internal table in the component controller method where the function module is being called by means of get_static_attributes_table (Is this right? - Yes, I am able to read the table of values that is passed from the component controller view to form view context by using get_static_attributes_table.
    Or are you being able to read it in the event handler method of the view controller and not being able to read it in the component controller method) -
    The function module takes a single value as import parameter and returns a table of values as return value.
    It works fine when no importing parameter is being used and returns the table of values that is getting passed from component controller context to form view context when i am able to read it using get_static_attributes_table.
    Now the question is: how to pass the import parameter value to the function module. I assumed since the importing parameter is a context node (like the return values are), i should set the value ( captured when the user enters the value in the form) to the importing parameter context attribute using set_attribute method. Since it is mapped to the component controller context, i assumed it will get passed and the method will take it as input parameter.
    Let me know if my assumptions are correct regarding passing the import parameters and what is missing here.
    Thanks and Regards.

  • How to write the custom Function Module to trigger the Alert.

    Hi all,
    I have developed a custom alert category in Tx - alrtcatdef. Now i want to trigger it from my custom function module. what should i do or what is the procedure to trigger the alert from my custom function module.
    Arul Jothi

    hi arul,
    try this program.
    RSALERTTEST.
    check out this link...
    <a href="/people/ginger.gatling/blog/2005/12/02/innovative-ways-to-use-alerts:///people/ginger.gatling/blog/2005/12/02/innovative-ways-to-use-alerts
    regs,
    jaga

  • How to Send Internal table to SAP Spool using Function Modules or Methods?

    Hi Experts,
    How to Send Internal table to SAP Spool using Function Modules or Methods?
    Thanks ,
    Kiran

    This is my code.
    I still get the no ABAP list data for the spool, even tho I can see it sp01?
    REPORT  Z_MAIL_PAYSLIP.
    * Declaration Part *
    tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
    infotypes: 0000, 0001, 0105, 0655.
    data: begin of ITAB occurs 0,
      MTEXT(25) type C,
      PERNR like PA0001-PERNR,
      ABKRS like PA0001-ABKRS,
      ENAME like PA0001-ENAME,
      USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
          P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
          MY_MONTH type T549Q-PABRP,
          STR_MY_MONTH(2) type C,
          MY_YEAR type T549Q-PABRJ,
          STR_MY_YEAR(4) type C,
          CRLF(2) type x value '0D0A'.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
          ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
            INDEX type I,
    end of P_INDEX.
    constants: begin of F__LTYPE, "type of line
       CMD like PC408-LTYPE value '/:',  "command
       TXT like PC408-LTYPE value 's',   "textline
    end of F__LTYPE.
    constants: begin of F__CMD, "commands
      NEWPAGE like PC408-LINDA value '',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    *data: OBJBIN like SOLISTI1 occurs 10 with header line,
    data: OBJBIN like  LVC_S_1022 occurs 10 with header line,
          DOCDATA like SODOCCHGI1,
          OBJTXT like SOLISTI1 occurs 10 with header line,
          OBJPACK like SOPCKLSTI1 occurs 1 with header line,
          RECLIST like SOMLRECI1 occurs 1 with header line,
          OBJHEAD like SOLISTI1 occurs 1 with header line,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_buffer type string,
          l_no_of_bytes TYPE i,
          l_pdf_spoolid LIKE tsp01-rqident,
          l_jobname     LIKE tbtcjob-jobname.
    data: file_length  type int4,
          spool_id     type rspoid,
          line_cnt     type i.
    *-------------------------------------------------------------------* * INITIALIZATION *
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    data: S_ABKRS like PV000-ABKRS.
    data: S_PABRP like T549Q-PABRP.
    data: S_PABRJ like T549Q-PABRJ.
    * SELECTION SCREEN                                                  *
    selection-screen begin of block BL1.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    START-OF-SELECTION.
      s_ABKRS = PNPXABKR.
      S_PABRP = PNPPABRP.
      s_pabrj = PNPPABRJ.
      w_begda = PN-BEGDA.
      w_endda = PN-ENDDA.
    get pernr.
    *                                 "Check active employees
      rp-provide-from-last p0000 space pn-begda  pn-endda.
      CHECK P0000-STAT2 IN PNPSTAT2.
    *                                 "Check Payslip Mail flag
      rp-provide-from-last p0655 space pn-begda  pn-endda.
      CHECK P0655-ESSONLY = 'X'.
      rp-provide-from-last p0001 space pn-begda  pn-endda.
    *                                 "Find email address
      RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
      if p0105-usrid_LONG ne ''.
        ITAB-PERNR      = P0001-PERNR.
        ITAB-ABKRS      = P0001-ABKRS.
        ITAB-ENAME      = P0001-ENAME.
        ITAB-USRID_LONG = P0105-USRID_LONG.
        append itab.
        clear itab.
      endif.
      "SY-UCOMM ='ONLI'
    END-OF-SELECTION.
    *------------------------------------------------------------------* start-of-selection.
      write : / 'Payroll Area        : ', S_ABKRS.
      write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
      write : / 'System Time         : ', SY-UZEIT.
      write : / 'User Name           : ', SY-UNAME.
      write : / SY-ULINE.
      sort ITAB by PERNR.
      loop at ITAB.
        clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
        refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
    *                                                  Retrieve Payroll results sequence number for this run
        select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
                                        and FPBEG ge W_BEGDA
                                        and FPEND le W_ENDDA
                                        and SRTZA eq 'A'.
    *                                                  Produce payslip for those payroll results
        if SY-SUBRC = 0.
          call function 'GET_PAYSLIP'
            EXPORTING
              EMPLOYEE_NUMBER = ITAB-PERNR
              SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
              PAYSLIP_VARIANT = PAY_VAR
            IMPORTING
              RETURN          = RETURN
              P_INFO          = P_INFO
            TABLES
              P_FORM          = P_FORM.
          check RETURN is initial.
    *                                                 remove linetype from generated payslip
          loop at p_form.
            objbin = p_form-linda.
            append objbin.
            line_cnt = line_cnt + 1.
          endloop.
          file_length = line_cnt * 1022.
    *                                                 create spool file of paylsip
          CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
            EXPORTING
              i_file_length = file_length
            IMPORTING
              e_spoolid     = spool_id
            TABLES
              it_textdata   = objbin.
          IF sy-subrc EQ 0.
            WRITE spool_id.
          ENDIF.
          DESCRIBE table objbin.
          DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
          CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = spool_id
              NO_DIALOG                      = ' '
              DST_DEVICE                     = 'MAIL'
    *      PDF_DESTINATION                =
    *    IMPORTING
    *      PDF_BYTECOUNT                  = l_no_of_bytes
    *      PDF_SPOOLID                    = l_pdf_spoolid
    *      LIST_PAGECOUNT                 =
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
            TABLES
              PDF                            = pdf
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
              OTHERS                         = 12
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *Download PDF file C Drive
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:\itab_to_pdf.pdf'
          filetype = 'BIN'
        TABLES
          data_tab = pdf.
    * Transfer the 132-long strings to 255-long strings
    *  LOOP AT pdf.
    *    TRANSLATE pdf USING ' ~'.
    *    CONCATENATE gd_buffer pdf INTO gd_buffer.
    *  ENDLOOP.
    *  TRANSLATE gd_buffer USING '~ '.
    *  DO.
    *    it_mess_att = gd_buffer.
    *    APPEND it_mess_att.
    *    SHIFT gd_buffer LEFT BY 255 PLACES.
    *    IF gd_buffer IS INITIAL.
    *      EXIT.
    *    ENDIF.
    *  ENDDO.
          OBJHEAD = 'Objhead'.
          append OBJHEAD.
    * preparing email subject
          concatenate W_ENDDA(6)
                    ' Payslip-'
                    ITAB-ENAME+0(28)
                    ITAB-PERNR+4(4) ')'
                 into DOCDATA-OBJ_DESCR.
          DOCDATA-OBJ_NAME = 'Pay Slip'.
          DOCDATA-OBJ_LANGU = SY-LANGU.
          OBJTXT = 'Pay Slip.'.
          append OBJTXT.
    *prepare email lines
          OBJTXT = DOCDATA-OBJ_DESCR.
          append OBJTXT.
          OBJTXT = 'Please find enclosed your current payslip.'.
          append OBJTXT.
    * Write Attachment(Main)
    * 3 has been fixed because OBJTXT has fix three lines
          read table OBJTXT index 3.
    *    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
          clear OBJPACK-TRANSF_BIN.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = 3.
          OBJPACK-DOC_TYPE = 'RAW'.
          append OBJPACK.
    * Create Message Attachment
          ATT_TYPE = 'PDF'.
          describe table OBJBIN lines TAB_LINES.
          read table OBJBIN index TAB_LINES.
    *    OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
          OBJPACK-TRANSF_BIN = 'X'.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = TAB_LINES.
          OBJPACK-DOC_TYPE = ATT_TYPE.
          OBJPACK-OBJ_NAME = 'ATTACHMENT'.
          OBJPACK-OBJ_DESCR = 'Payslip'.
          append OBJPACK.
    * Create receiver list refresh RECLIST.
          clear RECLIST.
          RECLIST-RECEIVER = itab-USRID_long.
          translate RECLIST-RECEIVER to lower case.
          RECLIST-REC_TYPE = 'U'.
          append RECLIST.
    * Send the document
    *SO_NEW_DOCUMENT_ATT_SEND_API1
          call function 'SO_DOCUMENT_SEND_API1'
            exporting
              DOCUMENT_DATA = DOCDATA
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK = 'X'
    * IMPORTING
    *   SENT_TO_ALL =
    *   NEW_OBJECT_ID =
            tables
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = pdf
              CONTENTS_TXT  = OBJTXT
    *   CONTENTS_HEX =
    *   OBJECT_PARA =
    *   OBJECT_PARB =
              RECEIVERS = RECLIST
            exceptions
              TOO_MANY_RECEIVERS = 1
              DOCUMENT_NOT_SENT = 2
              DOCUMENT_TYPE_NOT_EXIST = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR = 5
              X_ERROR = 6
              ENQUEUE_ERROR = 7
              others = 8.
          if SY-SUBRC NE 0.
            ITAB-MTEXT = 'Message Not Sent to : '.
          else.
            ITAB-MTEXT = 'Message Sent to : '.
          endif.
    *    else.
    *      ITAB-MTEXT = 'Message Not Sent to : '.
    *    endif.
        else.
          "SY-SUBRC Not = 0
          ITAB-MTEXT = 'Payroll data not found : '.
        endif.
        "end of SY-SUBRC = 0.
        modify ITAB.
      endloop. "end loop at ITAB
      sort ITAB by MTEXT PERNR.
      loop at ITAB.
        at new MTEXT.
          uline.
          write : / ITAB-MTEXT color 4 intensified on.
          write : / 'Emp. Code' color 2 intensified on,
                 12 'Emp. Name' color 2 intensified on,
                 54 'Email ID' color 2 intensified on.
        endat.
        write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
      endloop.

  • Hierarchy Function Modules (or Methods)?

    I am trying to retrieve all hierarchies, and their children nodes, below a main node. Is there a function module in SEM/BCS for doing this?
    Are there other function modules that come in handy with hierarchies?
          Thank-You.

    There isn't a single FM that I'm aware of.  You can piggy back the standard BCS functionality and acheive something similar.
    You need to know period, year, version and fiscal year variant. 
    Then...for this structure:
    CG1
    - CG2
    - CG3
    - - CG4
    you can pass CG1 as your "parent" and retreive CG2, CG3, and CG4 as selections (according to date-from date-to in your CG master data).
    I'll try to include the relevant section for this (it's from a number of methods in a class I created for an outbound interface)....I'm sure I don't have all the data declarations, and I might have a few unnecessary sections.
    global variables
      data DO_AREA type ref to IF_UC_AREA .
      data DO_MODEL type ref to IF_UC_MODEL .
      data DO_MD_FACTORY type ref to IF_UG_MD_FACTORY .
    initialize objects
    *** method for initialize objects
      DATA:
      lo_factory        TYPE REF TO if_ug_md_factory,
      lo_char           TYPE REF TO if_ug_md_char,
      lo_value          TYPE REF TO if_ug_md_char_value,
      lt_field_val      TYPE ugmd_ts_field_val,
      ls_field_val      TYPE ugmd_s_field_val.
    * Initialize master data factory
      CALL METHOD cl_uc_area=>if_uc_area~get_md_factory
        EXPORTING
          i_area        = c_cons_area
        IMPORTING
          eo_md_factory = lo_factory.
      do_md_factory = lo_factory.
    * get area object, if it's not set
      IF do_area IS NOT BOUND.
        lo_char = do_md_factory->get_char_instance(
            i_fieldname = uc00_cs_fld-area ).
        ls_field_val-fieldname = uc00_cs_fld-area.
        ls_field_val-value     = c_cons_area.
        INSERT ls_field_val INTO TABLE lt_field_val.
        lo_value = lo_char->get_value_instance(
           it_value = lt_field_val ).
        do_area   ?= lo_value.
    *   get data model
        IF do_model IS NOT BOUND.
          CALL METHOD do_area->get_model
            IMPORTING
              eo_model = do_model.
        ENDIF.
      ENDIF.
    determine lower level consolidation groups
    **Include lower level consolidation group nodes in cube selection.
      DATA:
      lo_context           TYPE REF TO if_uc_context,
      lt_value             TYPE uc0_ts_value,
      ls_value             TYPE uc0_s_value,
      ls_o_sel             TYPE uct_sx_sel,
      lt_sel               TYPE uc0_ts_sel,
      ls_sel               TYPE uc0_s_sel,
      ls_sid               TYPE ucd_s_sid,
      ls_sel_node          TYPE uc0_s_sel_node_sid,
      lt_sel_node          TYPE uc0_ts_sel_node_sid,
      lt_o_sel             TYPE uct_t_sel.
      CLEAR lt_value.
      ls_value-fieldname = c_cgcomp_fieldname. ' /1FB/SEM_CGCOMP
      ls_value-value = i_sem_cgcomp.           ' "parent" consolidation group
      APPEND ls_value TO lt_value.
      CALL METHOD do_model->do_sidmap->convert_value_to_sid
        EXPORTING
          i_fieldname = c_cgcomp_fieldname
          it_value    = lt_value
        IMPORTING
          es_sid      = ls_sid
        EXCEPTIONS
          not_found   = 1
          OTHERS      = 2.
      CLEAR lt_sel_node.
      ls_sel_node-fieldname =  c_cgcomp_fieldname.
      ls_sel_node-sign      = uc00_cs_ra-sign_i.
      ls_sel_node-s_node    = ls_sid.
      INSERT ls_sel_node INTO TABLE lt_sel_node.
      CLEAR lt_sel.
      CLEAR lt_value.
      CALL METHOD do_model->do_data_factory->create_sel
        EXPORTING
          it_node_sid = lt_sel_node
        RECEIVING
          eo_sel      = ls_o_sel-o_sel.
      APPEND ls_o_sel TO lt_o_sel.
      CLEAR ls_value.
      ls_value-fieldname = '/1FB/CS_VERSION'.     " CS Version
      ls_value-value = g_cs_version.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = '/BIC/BCS_VERS'.          " Custom Version
      ls_value-value = g_bcs_vers.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCPERIOD'.
      ls_value-value = g_fiscperiod.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCVARNT'.
      ls_value-value = g_fiscvarnt.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCYEAR'.
      ls_value-value = g_fiscyear.
      APPEND ls_value TO lt_value.
      CALL METHOD do_model->derive_context
        EXPORTING
          it_value     = lt_value
        IMPORTING
          eo_context   = lo_context
        EXCEPTIONS
          info_missing = 1
          OTHERS       = 2.
      CALL METHOD ls_o_sel-o_sel->set_context
        EXPORTING
          io_context = lo_context.
      CALL METHOD ls_o_sel-o_sel->get_sel
        IMPORTING
          et_sel = lt_sel.
    * lt_sel will contain the lower-level consolidation groups, beneath the "parent" consolidation group (i_sem_cgcomp)
    * Add cons groups to selection criteria
      DELETE gt_range WHERE chanm = c_objnm_cgcomp.   ' 0SEM_CGCOMP
      LOOP AT lt_sel INTO ls_sel.
        CLEAR  gs_range.
        gs_range-chanm  = c_objnm_cgcomp.   ' 0SEM_CGCOMP
        gs_range-sign   = ls_sel-sign.
        gs_range-compop = ls_sel-option.
        gs_range-low    = ls_sel-low.
        gs_range-high   = ls_sel-high.
        APPEND gs_range TO gt_range.
      ENDLOOP.
    Hope that helps...if not, you might be able to do a find for some of the sections of the code to find exactly how SAP is doing (I can only say that this functionality worked in my situation, not sure it works in all consolidation scenarios).  FYI - I was using this to read from the virtual cube in a custom task in order to outbound consolidated results.
    - Chris

  • Function Module to open a new session displaying a method of a class

    Hello All,
    I have a method A of class B.
    Now, in my current session, I have a button. When the user clicks on this button, what I expect is that a new session be opened and in the new session method A of class B be displayed.
    This is similar to the debugger, wherein, in the debugging mode, we can bring up the context menu in the Source Code (Edit Control) tool, and then select "Go To Source Code".
    So basically, I am looking for a Function Module which does the same.
    I came across Function Module CC_CALL_TRANSACTION_NEW_TASK, however, this will only create a new session.
    I could specify the transaction as SE24, but it then opens a new session with this transaction. That is it.
    My objective is to display the method of a class in a new session.
    Is there any Function Module in this case?
    Regards,
    Mithun
    Edited by: Mithun Kamath on Aug 9, 2011 5:35 PM

    Hello Sandra,
    Thank you very much. That was exactly what I was looking for.
    However, instead of calling EDITOR_PROGRAM directly, what I instea did was the following:
    1) Created a RFC enabled Function module.
    2) Inside this function module, I wrote the following code:
      SUBMIT tpda_editor_start AND RETURN
       WITH prgm  = is_alert_det-program_name
       WITH incl = is_alert_det-include_name
       WITH dynp = space
       WITH line = is_alert_det-line_no.
    The parameters above were similar to the one proposed by you.
    Borrowed the above from the class CL_TPDA_SERVICES_TOOLS, method NAVIGATE_TO_SOURCE.
    The above is basically called in the debugger, when we use the context menu in the editor tool and invoke the "Goto Source Code" functionality. This eventually calls the EDITOR_PROGRAM FM.
    The reason why I did this is because when I was testing the FM, it did not allow me to specify the include as CL_TEST=====CM01. I do not know why, probably I was doing it wrong. But it gave me a message saying that the object does not exist in table TADIR.
    Anyway, I did the above steps and it worked exactly as I wanted it to.
    I would like to thank you again.
    Best Regards,
    Mithun
    P.S. Forgot to add, I called the above RFC enabled FM as a new task.
    Edited by: Mithun Kamath on Aug 10, 2011 4:19 PM

  • A function module or class/method to look up repository objects?

    Hi,
    Does anyone know of a class/method or a function module that returns back objects of a namespace in the integration repository.
    For example, I would like to be able to retrieve all the message interfaces of a particular namespace.
    Thanks in advance,
    Duke

    Hi Duke,
    I am not sure about the function module. But you can look up all the objects with their IDs using transaction sxi_cache.
    Regards,
    Ramesh P

  • Error with quantity field:Datasource Creation Using Function Module method

    Problem with DATASOURCE Creation using Function Module method :
    I have created a datasource ZSTANDARD_COST_PRICE using Function Module method . The datasource creation is successfull when I remove the quantity field from the Z table . If I dont remove the quantity field from my Z table it gives an error as "Units Field WAERS for field STPRS of datasource ZSTANDARD_COST_PRICE is hidden". I am not able to remove this error . Please someone guide.
    Let me know if my explanation is not clear enough.
    Thanks in advance,
    Neha.
    Z table definition is as below :
    MATNR MATNR CHAR 18 0 Material Number
    BWKEY BWKEY CHAR 4 0 Valuation area
    LFGJA LFGJA NUMC 4 0 Fiscal Year of Current Period
    STPRS STPRS CURR 11 2 Standard Price   " Here the currency field is WAERS and table T001
    PEINH PEINH DEC 5 0 Price Unit
    VJSTP VJSTP CURR 11 2 Standard price in previous year
    VJPEI VJPEI DEC 5 0 Price unit of previous year.
    Edited by: Neha Rathi on Jan 30, 2009 3:03 PM

    Hi,
    You should add it as one of the main fields as you have added other fields and not as the currency fields...that is..it should be part of the data source and you should be able to see it in RSO2...
    Also if added as i said then it will come as new field in the data source...you can either let it be there...or hide it..
    also if you want to populate it then you will have to write the code for this fields as well.
    Thanks
    Ajeet

  • Error catch of a function module exception in a method

    Hello,
    how do you catch the error of a function module that is called from within a method. Presently the process terminates in case of an exceptions. Sy-subrc seems also not to work.
    E.G.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING
    client = sy-mandt
    date = SOURCE_FIELDS-xxx
    foreign_amount = SOURCE_FIELDS-xxx
    foreign_currency = SOURCE_FIELDS-xxx
    local_currency = SOURCE_FIELDS-xxx
    IMPORTING
    local_amount = RESULT
    EXCEPTIONS
    NO_RATE_FOUND = 1
    OVERFLOW = 2
    NO_FACTORS_FOUND = 3
    NO_SPREAD_FOUND = 4
    DERIVED_2_TIMES = 5
    OTHERS = 6.

    HI,
    use 'EXCEPTIONS' to catch the error happens in FM.
    uncomment all your exceptions when calling FM.
    and you will get the exception number in sy-subrc.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING
    client = sy-mandt
    date = SOURCE_FIELDS-xxx
    foreign_amount = SOURCE_FIELDS-xxx
    foreign_currency = SOURCE_FIELDS-xxx
    local_currency = SOURCE_FIELDS-xxx
    IMPORTING
    local_amount = RESULT
    EXCEPTIONS
    NO_RATE_FOUND = 1
    OVERFLOW = 2
    NO_FACTORS_FOUND = 3
    NO_SPREAD_FOUND = 4
    DERIVED_2_TIMES = 5
    OTHERS = 6.
    if sy-subrc = 2.
    message e000(su) 'overflow.
    endif.
    Regards,

  • Function Module / method to read interface of a function module

    Hi all,
    Does anyone know a function module or a method of a class which reads the parameters and types of these parameters of a function module. Thanks in advance.
    Kind Regards,
    Sükrü

    Hi Suekrue,
    You marked the question as answered, so please assign contributor points too. I did this time, but you can change them.
    See: /people/mark.finnern/blog/2004/08/10/spread-the-love for directions.
    Click on the yellow Star icon per reply. You can give:
    1 - 10 pts (Which marks the question as answered)
    2 - 6 pts (Very helpful)
    Lots of 2 pts (Helpful)
    It's just a little thank you for the responses.
    Thanks!
    Joan (and Mark Finnern)

Maybe you are looking for