Calling a class/function in a view

Hi ,
I want to instantiate a external class in a view, how to achieve that ?...
For say ...
Need to call/instantiate function /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS (public)
of class /SAPSRM/CL_PDO_BO_SC in the view of Webdynpro component  /SAPSRM/WDC_DODC_SC_I_DES in SRM 7.0
Any help will be highly appreciated.
Thanks.

CALL FUNCTION to call Function Module.
CREATE OBJECT to instantiate class.
CALL METHOD to call method of a class.
/SAPSRM/WDC_DODC_SC_I_DES  is a standard SRM web dynpro component, use Modification free enhancement to call a method in view controller.
http://help.sap.com/saphelp_nw70/helpdata/EN/c5/f4b9422e0fb911e10000000a1550b0/frameset.htm

Similar Messages

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • How to call another class function in SharePoint?

    Facing 'ConvertViewToHtml' does not exit in current context. Here is my code:
    namespace ChangeControl3_Nov
    class eGA_Utility
    public static void SendmailwithTwo(string To, string subject, string Body, string frommail, byte[] docFile, byte[] docFile1, string fileName1, string fileName3)
    string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;
    string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;
    string smtpReplyTo = SPAdministrationWebApplication.Local.OutboundMailReplyToAddress;
    MailMessage mailMessage = new MailMessage();
    System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress(frommail, "Quality Management");
    mailMessage.From = from;
    mailMessage.To.Add(new MailAddress(To));
    mailMessage.Subject = subject;
    mailMessage.IsBodyHtml = true;
    mailMessage.Priority = MailPriority.High;
    mailMessage.Body = ConvertViewToHtml();
    MemoryStream stream = new MemoryStream(docFile);
    string fileName2 = fileName1;
    Attachment attachment = new Attachment(stream, fileName2);
    mailMessage.Attachments.Add(attachment);
    MemoryStream stream1 = new MemoryStream(docFile1);
    string fileName4 = fileName3;
    Attachment attachment1 = new Attachment(stream1, fileName4);
    mailMessage.Attachments.Add(attachment1);
    SmtpClient smtpClient = new SmtpClient(smtpServer);
    NetworkCredential oCredential = new NetworkCredential("", "");
    try
    smtpClient.UseDefaultCredentials = false;
    smtpClient.Credentials = oCredential;
    smtpClient.Send(mailMessage);
    catch (Exception)
    I would like to call "ConvertViewToHtml()" from FormCode.cs in this line: 
    mailMessage.Body = ConvertViewToHtml();
    namespace ChangeControl3_Nov
    public partial class FormCode
    public string ConvertViewToHtml()
    try
    byte[] sourceFile = null;
    XPathNavigator root = MainDataSource.CreateNavigator();
    string myViewName = this.CurrentView.ViewInfo.Name.Replace(" ", string.Empty);
    string myViewXslFile = myViewName + ".xsl";
    // Create the xsl transformer
    XslCompiledTransform transform = new XslCompiledTransform();
    transform.Load(ExtractFromPackage(myViewXslFile));
    // Generate a temporary HTML file
    string fileName = Guid.NewGuid().ToString() + ".htm";
    string filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), fileName);
    using (XmlWriter writer = XmlWriter.Create(filePath))
    // Convert the XML to HTML
    transform.Transform(root, writer);
    writer.Close();
    // Return the HTML as a string
    sourceFile = File.ReadAllBytes(filePath);
    return System.Text.Encoding.UTF8.GetString(sourceFile);
    catch (Exception ex)
    return "<html><body>Unable to convert the view to HTML <p>" + ex.Message + "</p></body></html>";
    How to do this? Thanks in advance!

    Hi Sam,
    According to your description, you might want to call a function from other class.
    Before calling this function, it will require to initialize a FormCode object and then we can call the functions of the FormCode class.
    You can take a look at the code snippet provided by tompsonn in this similar thread:
    http://www.overclock.net/t/1411342/calling-a-function-from-another-form-c
    More information about working with Partial Classes and Methods:
    http://msdn.microsoft.com/en-us/library/wa80x488.aspx
    Thanks 

  • Call a PAL function within a view in HANA?

    Hi community!
    Does anyone know how you can integrate the call of a PAL function (e.g tripple exponential smoothing) into a HANA view?  I guess this must be achievable in a CE Script?
    Business scenario: we would like to show a time series based prediction on a Design Studio dashboard. Because the datasource is near-realtime and rapidly changing, we would like to calculate the PAL function on applications request. how can this be achieved?
    Furthermore I was not able to integrate ordinary db views in an analytical-view (it seems to only support tables? does anyone know the reason why?)
    thanks a lot!
    matthias

    Hi Mohler,
    PAL is ultimately some set of database procedures . If you want to use it as HANA View, you may need to right scripted views and consume the same.
    Analytic views are typically defined on at least one fact table that contains transactional data. Using analytic views you can create a selection of measures—sometimes referred to as key figures—, add attributes and join attribute views. Analytic views leverage the computing power of SAP HANA to calculate aggregate data, e. g., the number of cars sold per country, or the maximum power consumed per day.
    Ref : https://cookbook.experiencesaphana.com/bw/modeling-data/modeling-concepts/views/
    Sreehari

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

  • Calling a class in the planning function

    HI All,
        I have to create a a button in WAD for IP which calls a class (I believe there is no standard exit planning function in IP) , I believe the best way to do this is using a planning function formula which calls this class and automate using a planning sequence, so that I can use this sequence to the button. My problem is I am not much familiar with Fox formula...can somebody give some sample code to call the calss.
                 call 'clss' I hope will work.....Do i Need to declare any variables if you could give full code it would be helpful. Would it be required that I need to create a function module and call the class in it.
    thanks
    kasi
    Edited by: Kasi Viswanath Aurangabad on Apr 18, 2011 1:57 PM

    To run a planning sequence by clicking a button you have to write a code like this to link the button to planning sequence  :
    <bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_4" designheight="23" designwidth="300" >
                                        <bi:BUTTON_LIST type="ORDEREDLIST" >
                                            <bi:BUTTON type="COMPOSITE" index="1" >
                                                <bi:CAPTION value="<write button name here>" />
                                                <bi:ACTION type="CHOICE" value="INSTRUCTION" >
                                                    <bi:INSTRUCTION >
                                                        <bi:EXEC_PLANNING_SEQUENCE_SIMPLE >
                                                            <bi:PLANNING_SEQUENCE value="<Planning sequence technical name" text="Planning Sequence description" />
    </bi:EXEC_PLANNING_SEQUENCE_SIMPLE>
                                                    </bi:INSTRUCTION>
                                                </bi:ACTION>
                                            </bi:BUTTON>
                                        </bi:BUTTON_LIST>
                                    </bi:BUTTON_GROUP_ITEM>
    Also, in the planning function , you can call a function module using the following statements :
    Call function module
    importing
    exporting
    I am not sure about calling a class .

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Calling a private function when inside another class?

    Can't help it but im curious how classes seem to be able to
    call private functions inside other classes. I'm mainly thinking
    about the addEventListener() here. When adding a listening function
    to a class, that function can be private, and yet it seems to be
    called magically somehow. Or maybe its all internal? I dunno.
    Anyone? :D

    Hi Kenchu1,
    You can grab a copy of the open source API here:
    http://www.baynewmedia.com/download/BNMAPI10.zip
    (feel free to drop by
    the main site for documentation as well :) ). The main class
    is the
    Events class, "broadcast" method. This method broadcasts
    events in a
    decoupled fashion, meaning that listeners can listen to
    messages that
    aren't bound to a specific sender. The AS3 version works in
    much the
    same way except that I still haven't fully fleshed out the
    cross-SWF
    communication that this version can do (broadcast across all
    movies on
    the same computer using LocalConnection).
    Basically, the broadcaster works like this:
    1. Add event listener and bind to function A (called from
    within the
    class so the reference is available)
    2. Event listener pushes this into the listener array. It was
    provided
    by the class so the reference is valid and is now a part of
    the events
    class as well.
    3. Broadcast runs through all associated events when it comes
    time to
    broadcast and calls the function by using the array
    reference:
    this.listeners[message].call(classInstance,someParameter);
    In other words, the class that adds the listener "allows"
    the event
    broadcaster to use the reference because it passes it out.
    You can do
    the same thing by calling:
    someOtherclass.functionRef=this.privateFunction
    someOtherClass is the class that will store the private
    reference,
    functionRef is some variable to hold the reference, and
    privateFunction
    is the private function. Then, in someOtherClass, you can
    call:
    this.fuctionRef(someParameter);
    Hope this helps.
    Patrick
    Kenchu1 wrote:
    > Patrick B,
    > exactly! Something like that is what im looking for. I
    have my own rather
    > simple system right now with listeners and classes
    calling these, but since i
    > dont know how to call a private function, i had to make
    all the listening
    > classes functions public - something id rather avoid.
    Exactly how did your
    > event broadcasting system work? Oh, and we're talking
    AS3 btw.
    >
    > How do i call a function via a reference? (to the
    function? To what?)
    >
    http://www.baynewmedia.com
    Faster, easier, better...ActionScript development taken to
    new heights.
    Download the BNMAPI today. You'll wonder how you ever did
    without it!
    Available for ActionScript 2.0/3.0.

  • Call Class Function from FLA

    This maybe simple but I have two as files and I want to call a function inside a class and I am not sure how to do this. EX I want to call the function Main() after I import the packages.  Can anyone help?
    Package CODE:
    package code
              import flash.display.Sprite;
              import flash.display.MovieClip;
              public class allActivities extends flash.display.Sprite
                        public static var testGlobal:String = "testValue";
                        private function Main():void
                                  trace("Initilize Global Variables");
    package code
              public class activityone
                        private function Maintwo():void
                                  trace("testGlobal " + allActivities.testGlobal);
    FLA CODE
    import code.*;

    If you want to be able to call the Main function from the fla you need to make it a public function.  Making it private means access to it is restricted to within the class. 
    After you straighten that out, in your fla file try creating an instance of the class and use that to call on the Main function...
    var aa:allActivities = new allActivities();
    aa.Main();

  • How can I call the Class and have a PDF appear in seperate window?.

    I would like to call the class/interface ZCL_UIU_PRN_ACCOUNT2, method Collect_data and have a Smartform executed to produce a PDF document in a Seperate window.
    Where I have an issue is in opening another window to display the PDF.
    I know the Standard PDF Facsheet does exactly this, but that is triggered via the Web browser and calls a Java script, avoiding and events and round-server trip processing. I would have changed the button values so that when pressed it does process the various events and eventually ends up at EH_ONPREVIEW for the BP_HEAD/Overview. I know just need to open a new window and call the process to create the PDF via Smartform.
    Any suggestions would be more than welcome. I have spent so much time on this, and have gained no real ground, so far.
    Jason

    Hi,
    in the method
    data: zcontrol TYPE SSFCTRLOP.
    zcontrol-device = 'PRINTER'.
    zcontrol-langu = sy-langu.
    zcontrol-no_dialog = 'X'.
    zcontrol-getotf = 'X'.
    data: job type SSFCRESCL.
    data: devtype type RSPOPTYPE.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = sy-langu
    IMPORTING
    e_devtype = devtype
    EXCEPTIONS
    no_language = 1
    language_not_installed = 2
    no_devtype_found = 3
    system_error = 4
    OTHERS = 5.
    data: output_options type SSFCOMPOP.
    output_options-tdprinter = devtype.
    call function FM_NAME
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = zcontrol
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = output_options
    *   USER_SETTINGS              = 'X'
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = job
    *   JOB_OUTPUT_OPTIONS         =
      TABLES
        t_texto                    = t_texto
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5.
    if sy-subrc <> 0.
    endif.
    data: DOCTAB_ARCHIVE type TABLE OF DOCS,
    LINES type TABLE OF TLINE.
    *CALL FUNCTION 'CONVERT_OTF_2_PDF'
    ** EXPORTING
    **   USE_OTF_MC_CMD               = 'X'
    **   ARCHIVE_INDEX                =
    ** IMPORTING
    **   BIN_FILESIZE                 =
    *  TABLES
    *    otf                          = job-otfdata
    *    doctab_archive               = doctab_archive
    *    lines                        = lines
    * EXCEPTIONS
    *   ERR_CONV_NOT_POSSIBLE        = 1
    *   ERR_OTF_MC_NOENDMARKER       = 2
    *   OTHERS                       = 3
    data:  l_pdf_len type i,
    l_pdf_xstring type XSTRING.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    IMPORTING
    bin_filesize = l_pdf_len
    bin_file = l_pdf_xstring
    TABLES
    otf = job-otfdata
    lines = lines
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5.
    IF sy-subrc is initial.
    DATA: cached_response TYPE REF TO cl_http_response.
    CREATE OBJECT cached_response
    EXPORTING add_c_msg = 1.
    l_pdf_len = XSTRLEN( l_pdf_xstring ).
    cached_response->set_data( data = l_pdf_xstring
    length = l_pdf_len ).
    cached_response->set_header_field(
    name = if_http_header_fields=>content_type
    value = 'application/pdf' ).
    cached_response->if_http_response~set_status( code = 200
    reason = 'OK' ).
    cached_response->if_http_response~server_cache_expire_rel(
    expires_rel = 180 ).
    data guid type GUID_32.
    CALL FUNCTION 'GUID_CREATE'
    IMPORTING
    ev_guid_32 = guid.
    data display_url type string.
    CONCATENATE url '/' guid '.pdf' INTO
    display_url.
    cl_http_server=>server_cache_upload( url = display_url
    response = cached_response ).
    *GV_DISPLAY_URL & GV_PRINTON are class attributes
    CLEAR: gv_display_url, gv_printon.
    MOVE display_url TO gv_display_url.
    gv_printon = 'X'.
    ENDIF.
    Send me you e-mail i cannot post the code that is used in the view.htm.
    Best Regards,
    Caíque Escaler
    Edited by: Caíque Escaler on Nov 26, 2010 5:00 PM

  • Procedure and Functions from ADF View Layer

    Hi,
    Before i ask my question ,I would like to mention that I have done lot of googling on this topic before asking this question.
    http://adfhowto.blogspot.in/2010/11/call-db-procedure-or-function-from-adf.html
    http://adf-tools.blogspot.ca/2010/03/adf-plsql-procedure-or-function-call.html
    Lot of threads on otn forum too on this topic.
    I m pretty new to ADf too.
    Now most of our logic is in procedures and functions ,so on various events on form(view layer) I need to call procedure and function and then return values back to value layer too.
    Now the approach mentioned in the link above is good whats best approach to return out parameters to view layer considering i will be using either the DbCall class for all calls to procedures and functions
    I am thinking of this approach to Create a view with static fields,and in Model layer set values for these fields and access them in view layer or binding view controls to these fields.
    From View layer i will call the methods in AppmodImpl which will be calling procedure( methods will be exposed as Client Interface)
    Also in few articles i came across generic CallStoredProcedure and CallStoredFunctions.
    But my main concern is how to share out parameters with view layer....can anyone give link of showing application of it on view layer.
    Regards,

    From your subject. am stating that, dont do all those stuff in backing bean. backing bean is 1:1 mapping with your .jpsx or .jsff .
    best approach would be call those things your Application Module(model layer) exposed it. access the method over your pagedef. well said by ram.

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • How to run a class function on the click event ?

    Hi Tecs,
    i want tht when someone click on some paricular location on the form, then the class function must be called with some parameter, when someone click on some other location, the function should be called with different parameters.
    How this can be done , plz help.
    Thnx in advance.

    Almost every tag supports onclick .. For example h:panelGrid and even h:form.
    JSF<h:panelGrid onclick="document.getElementById('formId:hiddenActionId').click(); return false;">
        <h:form id="formId">
            <h:commandButton id="hiddenActionId" value="action" actionListener="#{myBean.action}" style="display: none;">
                <f:attribute name="param1" value="value1" />
                <f:attribute name="param2" value="value2" />
            </h:commandButton>
        </h:form>
    </h:panelGrid>MyBeanpublic void action(ActionEvent event) {
        String param1 = (String) event.getComponent().getAttributes().get("param1"); // returns "value1"
        String param2 = (String) event.getComponent().getAttributes().get("param2"); // returns "value2"
        // do your thing
    }[EDIT]You really cannot avoid JavaScript. Heck, JSF itself also generates a heap of JavaScript ;)
    Message was edited by:
    BalusC

  • Calling a class method from another class

    how can i call a method / function of one class without extending that class in another class.
    and one thing more i want want o check wether any Swing gui is open or closed.

    how can i call a method / function of one class without extending that class in another class.What?... Umm... You just call it... as in Foo.bar("doe ray me");
    i want want to check if any Swing gui is open or closed.Ummm, what? I don't understand the question. Do you mean find out if a particular java programming is allready running, of do you mean is the JPanel visible, or something else?

  • XSLT mapping calls Java class, with hardcoded values-problem at Transport

    Hi All,
    I know the subject may be  misguiding, but i need some suggestions how to handle the following scenario.
    From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
    The problem is, i have hardcoded the Connection parameters....
    and now that we transport these objects to production, the connection parameters will change.
    I thought of two solutions
    1) i create a new java class for Production system
    2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
    But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
    What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
    XI Gurus, please suggest me the correct way to handle.....
    Thanks a lot.
    Mona

    Mona,
    This is what i do..
    1) Parametrize ur current calling class,
    2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
    The call from your current class will be just like
    dbConnect.Runsql("sql as a string");
    the runSql can then internally call
    dbConnect().connect(); //that should do the connection opening.
    then create a prepared statement from your string input and call the db.......
    this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
    Regards
    Ravi

Maybe you are looking for