In update task option with class methods ??

Hi,
In my case, I have written a BADI and in it's method I will be updating a custom table. In the earlier approach I was updating the custom table in a function module which was invoked in update task as
CALL FUNCTION 'Z_XXX'
      IN UPDATE TASK
     EXPORTING
Do we have a similar update task concept w.r.t class methods ? So that whatever i have written in the FM I will copy into the method but that code must execute in update task !!
thks

Thanks Krishna, I too thought of the same initially but this looks like too many layers involved...
BTW, I came across a document in SAP help,
http://help.sap.com/saphelp_nw04/helpdata/EN/fa/f23c15330411d5992100508b6b8b11/content.htm
Any idea on this ? Will this be of any help ?
thks

Similar Messages

  • IN UPDATE TASK  problem with CRM_ORDER_SAVE

    Hello,
    I'm trying to write a program to update one field on CRM order documents,
    but i need to run it in background with update task.
    - I created a function module and called CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE functions
    in this function module consequently,
    - I set the tick "Update Module" and "Start.immed." in attributes of this function module,
    - I called the function module with IN UPDATE TASK additon in a program
    - I used COMMIT WORK command after calling this function module.
    if I use IN UPDATE TASK addition ,
    function is not working and not updating table VBLOG
    and no return message in my workplace.
    But same coding is working perfectly if I don't use IN UPDATE TASK.
    Is there way to understand what's wrong, or a trace possibility?
    Thanks in advance.
    Bulent

    Hello Bulent,
    The entry in VBLOG is retained if the there is any error during the update work process otherwise it is removed from VBLOG.
    Why don't you check the behavior of your FM in "update debugging"? That should throw more light on how the FM works in update work process.
    @Ravi:
    You can check with SO01 transaction if any error occurs
    If there is an error during the update the record in VBLOG updated again. Check the online documentation on [UPDATE TASK|http://help.sap.com/abapdocu_702/en/abapcall_function_update.htm].
    BR,
    Suhas

  • Best Practice for Updating Infotype HRP1001 via Class / Methods

    I want to update an existing (custom) relationship between two positions.
    For example I want
    Position 1 S  = '50007200'
    Position 2 S =  '50007202'
    Relationship = 'AZCR'
    effective today through 99991231
    Is there a best practice or generally accepted way for doing this using classes/methods rather than RH_INSERT_INFTY ?
    If so, please supply an example.
    Thanks...
    ....Mike

    Hi Scott
    You can use a BAPI to do that.
    Check the following thread:
    BAPI to update characteristics in Material master?
    BR
    Caetano

  • Passing select-options to class methods

    Hi,
    I want to pass a select-option filled in the selection screen by the user to a method of my class. Since select-options are hold as an internal table with fields sign option low high, and passing internal tables to methods require typing, what should I write as the name of this internal table type?
    For example;
    select-options: so_carid for spfli-carrid.
    I want to pass the contents of so_carid to my method defined in a class

    hI
    Triggering and Handling events
    At the moment of implementation, a class defines its:
             Instance events (using the EVENTS statement)
            Static events (using the CLASS-EVENTS statement)
    Classes or their instances that receive a message when an event is triggered at runtime and want to react to this event define event handler methods. Statement: METHODS
    CLASS IC1_VEICHLE DEFINATION.
    PUBLIC SECTION.
    METHOD CONSTRUCTOR IMPORTING
    EVENTS VEICHEL_CREATION.
    ENDCLASS
    CLASS LC1_VEICHLE IMPLIMENTATION.
    METHOD CONSTRUCTOR
    RAISE EVENT VEICHLE_CREATION.
    REWARD IF USEFULL

  • Need help with using ArrayLists with class methods

    **********************MAIN***************************
    import java.util.ArrayList;
    public class temp {
         public static void main (String[] args) {
              ArrayList <Shape> list = new ArrayList<Shape>();
              Point p = new Point(0,0);
              Circle c = new Circle(p, 3);
              list.add(c);
              list.add(p);
              for(int i = 1; i<=list.size(); i++){
                   list.get(i).toString(); //Exception in thread "main" java.lang.IndexOutOfBoundsException:
    //Why does this error message occur?
    //Shouldn't list.get(i) return a Shape object?
    **********************POINT CLASS*****************************
    public class Point extends Shape{
         private double X, Y;
         Point(){
              X = Y = 0;
         Point(double x, double y){
              X = x;
              Y = y;
         public String toString(){
              String temp;
              temp = "(" + this.X + ", " + this.Y + ")";
              return temp;
    **********************CIRCLE CLASS***************************
    public class Circle extends Shape{
         Point center;
         double radius;
         Circle(){};
         Circle(Point p, double r){
              center = p;
              radius = r;
         public String toString(){
              String temp;
              temp = "C:( (" center.getPointX() ", " + center.getPointY() + "), " + this.radius + ")";
              return temp;
    Where am I going wrong here??

    arrays run from 0 to n-1 in Java.

  • Need class method example for updating infoype15

    Hi All,
    I need to update infotype 15 without using BDC and HR_INFOTYPE_OPERATION function module, i have suggexted to use Class methods please can any one help in this regards with sample code of updation of infotype with class methods,
    Regards,
    Reddy

    Hi
    You can use the following interface:
    IF_HRPA_PLAIN_INFOTYPE_ACCESS - HR: Writing Infotype Records
    Interface for Writing Infotypes
    This interface permits simplified write accesses for infotypes. In particular, such accesses function for "simple" infotypes only. By definition, all infotypes that use CL_HRPA_INFOTYPE_CONTAINER as container class are simple. All other infotypes cannot be processed or can only be processed in a basic way using this interface.
    Regards

  • Enhanced SAP class with new methods - Not showing these from standard task

    Dear Gurus,
    I have enhanced SAP standard class with new methods. After I have activated my new methods and would like to create a workflow task using these new methods. when I create a task and input object category as "ABAP Class" and object type is SAP enhanced class. When I try to drop down for methods SAP is not showing my new methods. I do not know why. Am I missing any? Any help would be appreciated.
    Note: Remember I am trying to use SAP ABAP class custom methods.
    Thanks,
    GSM

    Hi,
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Kind regards,
    Siobhan

  • In which case we need a class with all methods defined as abstract ?

    In which case we need : A class with all methods defined as abstract (or should we go for Interface always in this case)

    The concept of interface and abstract class overlaps sometime, but we can have the following thumb rule to use them for our specific need:
    1) Interface: This should be use for code structuring. They standardize your application by providing a specific contract within and outside. If you think abstract class also provide structure, then reconsider as it limits the structure re-usability when there are many super-classes to inherit from. Java allow multiple inheritance by interface and not by Abstract class.
    2) Abstract Class: This should be use for code-reusability. Interface doesn't have any code so can't be used for code-reusability.
    Actually we can use both to provide the best.Taking a refernce to J2EE framework, the "Servlet" is an interface. It laids down the contract/structure for any code to be a servlet.
    But the "GenericServlet" class is an abstract class which provides implementation of some of the methods defined in the "Servlet" interface and leave some method abstract.
    Thus we see that the "Servlet" interface standardise the structure and the "GenericServlet" abstract class gives code re-usability.
    Original Question:
    In which case we need a class with all methods defined as abstract ?To this question, as all methods are abstarct we don't have option for code-reusability. so why not add standard structure concept to your application. So if there is not any restriction on making the field variable(if any) as final, we should go with the interface concept.

  • How to use task flow's transaction options with session's user data

    Hi.
    I have custom extension of ApplicationModuleImpl class:
    package test.model
    imports...
    public class CustomAppModuleImpl extends ApplicationModuleImpl {
        public static final String SESSION_VAR = "MySessionVar";
        public CustomAppModuleImpl() {
            super();
        @Override
        protected void prepareSession(Session session) {
            super.prepareSession(session);
            System.out.println("######## " + this.getClass().getName() + ".prepareSession() called.  AM isRoot() = " + isRoot());
            Hashtable userData = session.getUserData();
            if (userData == null) {
                userData = new Hashtable();
            userData.put(SESSION_VAR, "Useless");
        @Override
        protected void create() {
            super.create();
            System.out.println("######## " + this.getClass().getName() + ".prepareSession() called.  AM isRoot() = " + isRoot());
    }Inside userData I store some useful session-based values (here is just an example ;) ).
    Within Model.jpr I defined that every Application Module I create must extends this CustomAppModuleImpl :
       <value n="oracle.jbo.extends.appModule" v="test.model.CustomAppModuleImpl"/>
    ...I have one AM with one view:
    package test.model;
    import oracle.jbo.server.ViewObjectImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Mar 07 20:22:11 CET 2012
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class AppModule1Impl extends CustomAppModuleImpl {
         * This is the default constructor (do not remove).
        public AppModule1Impl() {
         * Container's getter for EmployeesView1.
         * @return EmployeesView1
        public ViewObjectImpl getEmployeesView1() {
            return (ViewObjectImpl)findViewObject("EmployeesView1");
    }Now I have BTF (bounded task flow, with default properties) and I call that task flow on a button press. With default properties ( Transaction: <No Controller Transaction> ) I get preferred values from session's userData within Entity Object.
    Code snippet inside that entity implementation looks like:
            DBTransaction dbt = getDBTransaction();
            System.out.println(getClass().getName() + " entity lives AM: " + dbt.getRootApplicationModule().getClass().getName());
            if (dbt.getSession().getUserData() == null) {
                System.out.println(CustomAppModuleImpl.SESSION_VAR + " -> NULL");
            } else {
                System.out.println(CustomAppModuleImpl.SESSION_VAR + " -> " + dbt.getSession().getUserData().get(CustomAppModuleImpl.SESSION_VAR));
    ...And as I mentioned output is correct:
    test.model.EmployeesImpl entity lives AM: test.model.AppModule1Impl
    MySessionVar -> UselessNow the trickiest part. As soon as I change property of called task flow Transaction to something else that +<No Controller Transaction>+, e.g. Always Begin New Transaction, code snippet from task-flow.xml :
        <transaction>
          <new-transaction/>
        </transaction>
    ..This session stuff begin to act unpredictably. Session's userData is now null. And Output looks like:
    test.model.EmployeesImpl entity lives AM: oracle.jbo.server.ApplicationModuleImpl
    MySessionVar -> NULLWhy in the world ADF uses oracle.jbo.server.ApplicationModuleImpl instead of test.model.AppModule1Impl or at least my defined test.model.CustomAppModuleImpl ?!?
    Is this a bug? Or maybe a feature?
    10x
    Regards

    Hi,
    Why in the world ADF uses oracle.jbo.server.ApplicationModuleImpl instead of test.model.AppModule1Impl or at least my defined test.model.CustomAppModuleImpl ?!?
    Is this a bug? Or maybe a feature?
    ADF BC alwyas has a transaction opened even if the ADFc setting is No Transaction. So if you explicitly ask for a new transaction I assume that the ADF BC data control creates a new transaction without re-executing your AM initialization codes. Looks as if it uses an internal AM instance for this just to hold the transaction. However, worth filing this as a bug - assuming you reproduced this with a later version of either JDeveloper 11g R1 or R2
    Frank

  • Custom User Decision for Class Method in Task

    Hi Expert,
    I have a screen for user decision(Approve/Reject with some comments field). When i execute the process it works fine for all cases, but when i don't click any decision and come back from the screen, then also this task gets completed and workflow starts executing next step. Here in this case, i want workitem to remain in inbox same as what happen in case of user decision step.
    Do i need to put this task in loop till i get a decision or some other way i can solve it? I have tried putting this method as Synchronous and non-Synchronous method. I am not sure if this issue is, because i am using Class method. Please help.
    Regards,
    Pritam
    Edited by: Pritam Kunal on Feb 11, 2011 4:28 PM

    Hi Mike,
    I have got a solution for this. If we make the task as Asynchronous task with a terminating event. Till the time event is not triggered process workitem will remain in inbox. This event can we triggered at any user decision only.
    Is there any flow in this logic? I have tried it for few cases and it worked, but not sure if there will be any case where it will not work? any suggestion?
    Regards,
    Pritam

  • Passing select-options table to a class method

    Hi,
    I have to pass a table which contains a select-options to a class method as a param...
    How I do this??
    DATA s_mail TYPE  z_mail_rng.
    o_mail->add_receiver( ? ).
    (add_receiver's formal param is TYPE ANY)
    Plese give me help.
    Thanks.

    Hi,
    I send coding for  how to use select-options in class.
    May it is useful for u
    tables:marc.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_matnr for marc-matnr.
    selection-screen end of block b1.
    class c3 definition.
    public section.
    types: begin of ty_marc,
    matnr type marc-matnr,
    werks type marc-werks,
    end of ty_marc.
    data: wa_itab type ty_marc.
    data: itab type table of ty_marc .
    data: wa_matnr type r_matnr.
    methods: add.
    private section.
    *methods: sub.
    endclass.
    class c3 implementation.
    method add .
    select matnr
    werks
    from marc into table itab where matnr IN s_matnr.
    write:/ 'material no', 20 'plant'.
    loop at itab into wa_itab.
    write:/ wa_itab-matnr,
    wa_itab-werks.
    endloop.
    endmethod .
    endclass.
    start-of-selection.
    data b1 type ref to c3.
    create object b1 .
    call method b1->add.

  • ABAP class method with dialogue

    Hi all,
    I want to use a ABAP class method within a Workflow definition with user interaction. The SAP help says, that is possible, but I couldn't find a way, to mark the method as "with dialogue".
    For BOR-objects there is a checkbox in the details for the method definition. Can anybody tell me, how it can be done?
    Thanks in advance
    Nick

    Hi Nicolas,
      When you create the Task with the ABAP OO Method, you can select it as "Background Processing" else it will be a "Dialog Process".
    If you notice here, "Background Processing" checkbox will be editable if ABAP OO Method is used, whereas in case of Business Objects it directly comes from method definition.
    Reward points if useful.

  • How to use the class CL_CTMENU with the method DISABLE_FUNCTIONS

    Hi Friends,
    How to de-activate some functions in the Menu bar?
    Eg: - Sales document
                 Create
                 Change
                 Display
    I want to de-activate "Change"
    In other words: - How to use the class CL_CTMENU with the method DISABLE_FUNCTIONS in my program.
    Regards,
    Hari
    Edited by: Bhatlapenumarthy Hari Krishna on Jun 9, 2008 5:22 PM

    Krishna,
    It is not possible to deactivate the CHANGE option in themenu bar using the method disable_functions of cass CL_CTMENU. This method allows you to deactivate only the function codes of the CONTEXT MENU, which is available only when u press the left mouse button.
    U can use the SET PF-STATUS 'XXX' EXCLUDING fcodes option to disable the CHANGE.
    *****Reward points if useful
    Regards,
    Kiran Bobbala

  • Update infotype using class method

    Hi All,
    I need to update an infotype using a Class method. I need to pass a file as input to the Class Structure.
    How can we pas a file as input to the Class structure.
    Any pointers on this would be really helpful.
    Thanks,
    Saher

    Hello,
    You can update/insert records in Info type thru below code using FM: HR_INFOTYPE_OPERATION, but you need to get the data from the file to internal table for the same.
      LOOP AT t_insert INTO w_insert.
        w_pernr = w_insert-ownnum.
        CALL FUNCTION 'HR_READ_INFOTYPE'
          EXPORTING
            pernr           = w_pernr
            infty           = c_infty                           "'0105'
          TABLES
            infty_tab       = t_0105
          EXCEPTIONS
            infty_not_found = 1
            OTHERS          = 2.
        READ TABLE t_0105 INTO w_0105 WITH KEY pernr = w_insert-ownnum"#EC *
                                                       subty = c_subu.
        IF sy-subrc = 0.
          MOVE w_0105 TO w_p0105.
          w_p0105-usrid = w_insert-lanid.
          CLEAR w_0105.
        ELSE.
          w_p0105-pernr = w_pernr.
          w_p0105-usrid = w_insert-lanid.
          w_p0105-begda = sy-datum.
          w_fnr = 'X'.
        ENDIF.
        CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
          EXPORTING
            number = w_pernr.
        w_p0105-pernr = w_pernr.
        IF w_fnr = 'X'.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = c_infty                           "'0105'
              number        = w_p0105-pernr
              subtype       = c_subu                            "'0001'
              validityend   = w_p0105-endda
              validitybegin = w_p0105-begda
              record        = w_p0105
              operation     = c_oprn  "'INS'
              tclas         = 'A'
              dialog_mode   = '0'
            IMPORTING
              return        = w_return.
        ELSE.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = c_infty                           "'0105'
              number        = w_p0105-pernr
              subtype       = c_subu                            "'0001'
              validityend   = w_p0105-endda
              validitybegin = w_p0105-begda
              record        = w_p0105
              operation     = 'MOD'  "'MOD'
              tclas         = 'A'
              dialog_mode   = '0'
            IMPORTING
              return        = w_return.
        ENDIF.
        CLEAR w_fnr.
        CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
          EXPORTING
            number = w_pernr.
    endloop.
    Hope it helps.
    Thanks,
    Jayant

  • Update jar file with modified class files

    hi all,
    I'm developing a jar utility for updating a jar file with modified class files as of now i have reached a point where in i can browse files and set it to required location
    i.e i have developed a swings GUI application using JfileChooser and browse the files ..now my requirement is to update the jar files with modified class file
    GUI looks like below
    ....enter the modified class file ----> d:\c.class
    ....enter the jar file path ---> d:\a.jar
                                                          update button now i have the requirement as
    1> when i click on the update button ,my jar file (a.jar) should get updated with the latest class file (c.class)
    can u help me to achieve this requirement.???
    im stuck with this,,,if u can provide me wit the code for updating jar file with latest class file...it will really be helpful
    if u can help me with the code on click on update button it will be really helpful
    Thanks and expecting a faster response from u all java experts....

    Please find my query in bolds...i have written the partial code now,i need some help now
    hope u guys can help me out...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    public class FileExplorer extends JDialog implements ActionListener
         JTextField txtLocation_class;
         JButton btnBrowse_class;
         JLabel label_class;
         JTextField txtLocation_jar;
         JButton btnBrowse_jar;
         JLabel label_jar;
         JButton updatebutton;
         public FileExplorer()
                   setSize(600,300);
                   //for class files
                   label_class = new JLabel("Please select Modified Class File");
                   txtLocation_class= new JTextField(20);
                   btnBrowse_class = new JButton("Browse");
                   btnBrowse_class.addActionListener(this);
                   //for jar files               
                   label_jar = new JLabel(" Please select the Jar file");
                   txtLocation_jar= new JTextField(20);
                   btnBrowse_jar = new JButton("Browse");
                   btnBrowse_jar.addActionListener(this);
                   ActionListener updateListener = new ActionListener(){
                    public void actionPerformed(ActionEvent ae){
                     if(ae.getActionCommand().equalsIgnoreCase("Update")){               
                      System.out.println("ae.getActionCommand() :: "+ae.getActionCommand());
                      System.out.println("Update Button is pressed");               
                    *//Query :how do i access FilePath and FilePath1 here which*
    *                // has been set in public void actionPerformed(ActionEvent ae)*
    *                //method below*
    *                // FilePath  ---??*
    *                // FilePath1  ---??*
    *                // how do i access the above 2 parameters*
    *                //Query :on click of update button i have to pass*
    *                //two parameters FilePath and FilePath1 to*
    *                //perform some functionality. please help me*
    *                //to achieve this..how do i access Filepath and Filepath1*
    *                //here which has been set below.*
                     } // end of if               
                   } // end of actionPerformed
                };// end of ActionListener
                  updatebutton = new JButton("Update");
                  updatebutton.addActionListener(updateListener);
                   //adding to the panel               
                   JPanel pnl = new JPanel();
                   pnl.add(label_class);
                   pnl.add(txtLocation_class);
                   pnl.add(btnBrowse_class);
                   pnl.add(label_jar);
                   pnl.add(txtLocation_jar);
                   pnl.add(btnBrowse_jar);
                  pnl.add(updatebutton);
                   getContentPane().add(pnl);                         
         public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              if(obj==btnBrowse_class)
                   final JFileChooser fcstudent = new JFileChooser();
                   int rtrnval = fcstudent.showOpenDialog(this);
                   if(rtrnval==JFileChooser.APPROVE_OPTION)
                        try
                             File file=fcstudent.getSelectedFile();                         
                             String path = file.getPath();
                             System.out.println("This is Path:"+path);
                             txtLocation_class.setText(""+path);
                             String FilePath=txtLocation_class.getText();
                             System.out.println("FilePath is ::"+FilePath);                                        
                        catch(Exception ex)               
                             ex.printStackTrace();
              }else if(obj==btnBrowse_jar){
                             final JFileChooser fcstudent = new JFileChooser();
                             int rtrnval = fcstudent.showOpenDialog(this);
                             if(rtrnval==JFileChooser.APPROVE_OPTION)
                                  try
                                       File file=fcstudent.getSelectedFile();                         
                                       String path1 = file.getPath();
                                       System.out.println("This is Path:"+path1);
                                       txtLocation_jar.setText(""+path1);
                                       String FilePath1=txtLocation_jar.getText();
                                       System.out.println("FilePath is ::"+FilePath1);                                        
                                  catch(Exception ex)               
                                       ex.printStackTrace();
         public static void main(String arg[]){
                   FileExplorer Exm= new FileExplorer();
                   Exm.setVisible(true);
    }

Maybe you are looking for

  • DVI Signal Not Working Properly in Hp 2010i Monitor

    Hi Team,  My Name is Rubhan and i Purchased a Hp2010i 20" LCD Monitor 3 weeks back. I just installed an ATI Radeon 4670 HD Graphics Card in my System which comes with a DVI Port(Default), Since there was no DVI Cables Supplied by the Manufacturer, i

  • Using functions/sql in report columns

    Hi, New at CRM OD so struggling with reports... So the problem is : Have an Account Record and an associated "Parent Account" with it (Type: Account) Now the report must show the Account Name, Parent Account(if any), ID of the Parent Account. Not sur

  • My Clipping Path isn't working? Please help...

    I am working in Photoshop CS4 on Mac. I have followed the steps below to create a clipping path: * Opened image that I want to add a clipping path to * Selected the part of the image that I wanted to clip (with the eliptical marquee tool) * On the Pa

  • Photoshop won't open any files!

    application opens fine, but won't open any pics(jpg,tiff,psd,etc.) It won't even open a new file image. Please help!!!! This is a school emergency

  • Two Data Controls, One UI

    JDev 11.1.1.6.0 BPM andrejusb.blogspot.com/2012_08_01_archive.html In the above link, andrejus has explained how to use a single UI for two human tasks. I have a similar use case with slightly different. I have to use the same UI with either of the t