How to insert Method in ABAP code

Hi Gurus,
Plz tell me how to insert a METHOD in ABAP code as we do in the case of inserting function in ABAP code using PATTERN.Button
Rgds
rajesh

Hi,
Try this.
Click pattern tab ans select AABAP object patterns.
Select call method.
Then give the instance name , class/interface name and the method name.
Sharin.

Similar Messages

  • How to add breakpoint in abap code

    when use <i><b>java</b></i> call abap code ,
    how to add breakpoint in abap code?

    Hi,
    To start the ABAP debugger from your java client you have to set the JCO client to debug mode:
    e.g.
    yourJCOClient.setAbabDebugMode(true)
    (hope thats the right method name:-)).
    And don't forget to set also a break point of type "External" in the function module you call from your java client. For debuging, the user which calls the FM has to be a SAP User of type "<b>Dialog"</b> and has to be the rights to call RFCs, ...

  • How to send mail from ABAP code?

    Hi,
    I need to send e-mail from ABAP Code .
    e.g:  If sy-subrc ne 0.
         ( send e-mail to  "[email protected]" )
           endif.
    Please provide me any Function module for this or any code.
    Correct answear will be rewarded my maximum points.
    Thanks & Regards,
    Gaurav.

    Check this code sample
    * Send mail
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test Subject'.
      loop at htmllines.
        mailtxt = htmllines.
        append mailtxt.
      endloop.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_data              = maildata
                document_type              = 'HTM'
                put_in_outbox              = 'X'
           tables
                object_header              = mailtxt
                object_content             = mailtxt
                receivers                  = mailrec
           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  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Regards.

  • How to Insert and call custom Code in CaptivateMainTimeine.as?

    I have been trying to get my head around this, using various blog postings by Jim Leichliter as my guide. However, so far I have been defeated.
    This is what I attempted (in Captivate 5):
    1) I inserted the following code into CaptivateMaintimeline.as, just above the private function AddEICallbacks() section:
    public function helloWorld(){
      alert('hello world');
    2) Just above the EICallbacksAdded = true; line, I inserted
    ExternalInterface.addCallback("helloWorld", helloWorld);
    3) I created a one-slide Captivate 5 presentation with a button whose "On Success" action is set to "Execute Javascript".
    4) In the "Execute Javascript" Script_Window, I entered this code:
    Captivate.helloWorld();
    5) I published the presentation and viewed it in Chrome, Firefox and IE 9, which all reported an error, as follows:
    (Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
    (Firefox) "Captivate is not defined"
    (IE 9) "Object doesn't support property or method 'helloWorld'"
    6) I changed the script window code to
    document.Captivate.helloWorld();
    and published and viewded in Chrome in Firefox, with the following results:
    (Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
    (Firefox) "document.Captivate.helloWorld is not a function"
    7) I also tried
    document.getElementById('Captivate').helloWorld();
    and published and viewed in IE 9, getting the same error as previously,
    "Object doesn't support property or method 'helloWorld'"
    Can anyone see what I am missing here?

    Thanks, Jim. Your example got my "proof-of-concept" working.
    I had jumped to the unwarranted conclusion that core JavaScript functions were directly accessible from ActionScript. Investigating further as a result of your comment, I discovered the ExternalInterface.call technique for using JavaScript functions in ActionScript when I actually need to. (Ref. http://codingrecipes.com/calling-a-javascript-function-from-actionscript-3-flash and http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in- ActionScript-3/).
    Some background: I wrote my first program in Fortran in 1966 and having been coding ever since. For most of the last two decades, most of what I have written has been in the VB, VB.NET, and ASP.NET worlds, but now I am going through a steep Captivate + ActionScript + JavaScript learning curve as I use Captivate to create course materials for the learning institution where I work. It would be simpler if the materials were only ever going to be run from our web server, but as well as on-campus students we have distance students across the country. We provide the distance students with a computer preloaded with the materials, but not all students have an Internet connection, so I am trying to create materials that can be run stand-alone from the computer's file system or served from a web server with equal facility.
    Add in the complication that there are many keyboard shortcuts that Internet Explorer doesn't pass through to Flash, therefore hobbling some of the training and assessment simulations, and you can see that the Captivate presentations have to have sufficient logic built in to detect the environment in which they are running and adjust accordingly. As I will be calling upon this logic over and over again, I would like it to be in one place and access it by a simple JavaScript call from the opening slide of every presentation, thus populating a number of Captivate variables with the environmental information which can then be used to branch the presentation to alternative slides wherever necessary. Therefore, embedding the logic into a customized version of CaptivateMainTimeLine.as seemed the way to go, but if anyone can suggest a better strategy, I am open to all ideas!
    Trevor

  • If  I know authority object is 'S_OC_SEND', how to check it in ABAP code ?

    Can i find if people in other place check the authority 's_oc_send'.
    Best regards,

    Hi Blake,
    Check program RSUSR060
    Thanks
    Lakshman

  • How to create breakpoint with ABAP code?

    Hi all,
    I would like to create a breakpoint for my user id only.
    So far, the only way that I know is by:
    break <user_id>.
    e.g.
    break john.
    HOWEVER, my user id contain a "." (i.e. chris.p) , and this cause syntax error.
    Could anyone help me?
    Thank you.
    Best regards,
    Chris

    Hi chris.
    greetings
    try like this:-
    if sy-uname = 'CHRIS.P'.
    break-point.
    endif.
    if helpful, plz reward points.
    regards
    prashant

  • How to Debug a ABAP code running the background in Portal

    How can I debug a ABAP code running in the background while executing a transaction code through portal.
    e.g Presently I have to incorporate some checks in the portal. For that I know the function module where i need to put though checks. Now I want to know, how does the code during runtime. What values do we get in the function module. For this I need to get into the debugging mode while executing the portal.
    So how can we do that???

    Namit,
    it doesnot matter whether it is a standard funtion module or a custom one .check whether you are debugging for proper user(portal user and backend user are same) and check debugging is activated

  • Debug ABAP code in InfoPackage

    Hi friends,
    How i can debug a ABAP code from a variable selection in Infopackage?
    Thanks,
    EA

    I guess you would have figured it out - but for the use of people who might chance upon this post while searching ...
    to debug the ABAP code in an Infopackage - you need to run it in dialog mode ( Start Data Load Immediately ) and not in background. This is because background processes cannot be debugged.

  • How to translate std. ABAP report in german language to English in SAP

    Dear All,
    How to translate std. ABAP code in German language to English in SAP ?

    Hi,
    code does not need to be translated.
    Data elment descriptions, documentation, text elements, etc. can be translated in the transaction se63.
    Also you can translate almost each single object in the editor in the menue  goto-translation.
    Regards,
    Gianpietro

  • Move ABAP code from Z-namespace to other namespace

    Hello,
    I wonder how one can move custom ABAP code that was created in the Z-namespace to a NEW namespace, that was just created upon a confirmed "request namespace". The Z-namespace ABAP code is developed to work in SAP ERP.
    I have learned that you need the developer key of an SAP ERP installation to move ABAP code to the new namespace.
    Now, if a third party is performing this namespace move, what kind of developer key do they need? Can one give them the developer key of the created namespace or do they need THEIR OWN developer keys?

    Hello Rob,
    Thanks for the reply . I would not be deleting the objects from the sap namespace as I would need to do a double maintenance in both (customer as well as the sap namespace). However , if I have some code that gets generated and want  to have it in both my namespaces , would this(just copying it) be the best way ?
    Thanks,
    ~Vj

  • Compilation process of ABAP code.?

    Hai every one.
    Can any one tell me how a ackground process of ABAP code..How it is executed and How it is stored in database ( In which form )..!

    This is probably the strangest thread I've seen for a while.  First of all, why do you care?   Just abstract knowledge?
    ABAP is not a compiled language.  Therefore there is no compilation process.  ABAP is interpreted.  If you want to know what that means, then go read a dictionary or wikipedia or something similar.
    When you save an ABAP program it is stored in the database.  You do not put it into the database or retrieve it from the database directly, using any form of SQL.  Indeed, from ABAP, you can't.  You use the editor and the save function.  Programs are only "stored" in memory when you RUN them.  You can have many versions of a program as well as the active/inactive versions.  For information about that, search the help on version management and change and transport system (CTS) 
    Different programs are differentiated in the database by the name of the program.  How else would it be done?

  • ABAP Store ABAP code locally  on the disk

    Hello
       I have a question, how download the Web dynpro ABAP code from the SAP System.
    Could You give me a hint how to save code locally on the disk?
    Regards
    Wojtek

    I started from http://code.google.com/p/saplink/ .
    Then in http://code.google.com/p/saplink/wiki/pluginList I found the plug-in for ABAP Web Dynpro.
    It still in ALPHA status and to be honest I got trouble installing it (in fact there is the note:  But WDA plugin requires SAPlink 0.1.3 or greater).
    You should get it running because I can see the nugg file.
    Eventually ask navigate to the http://code.google.com/p/saplink/issues/list and the other pages of http://code.google.com/p/saplink.
    Sergio

  • How to insert a new line item in VA01/VA02 by using ABAP code?

    Hi Gurus
    i have a very tough requirement. the customer wants to insert a free goods after an item has been populated in VA01/VA02 automatically according to some certain rules. the input material may be a main material of a sales BOM.
    for example. let's suppose there is a material A who has two sub-material B and C which is maintained in a sales BOM via CS01/CS02. when the material A has been input in the line item in VA01/VA02, its quantity input and after the ENTER key has been clicked, another material D may be displayed in a new line as a gift if the condition met.  the condition relates to customer/material/quanity and these information are stored in a Z-table.
    on the other hand, if the material A is only a single material(not a BOM), the gift(material D) will also be filled automatically if the condition met.
    i have already enhance the FM cs_bom_explosion to filfill the requirment for BOM materials. whereas it is very hard to find the enhanment point for the single material.
    so my question is where is the correct place for me to insert the ABAP code, which decides whether the gift should be given or not and furthermore inserts the new line item into XVBAP. i tried to use MV45AFZZ, whereas the data is always inconsistant if a new line has been inserted. it is very strange that there is no temperary internal table storing line item data input in the table controal of VA01/VA02. system reads the line item data , line by line, via a system kernal function call.
    any hints are welcome. thanks

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

  • How to insert code in ABAP program ( Z program) by ABAP coding.

    Hello,
    In ABAP is there any way to insert some code lines into an existing ABAP program (Z*) , We will insert in masse some code lines into a liste of program automatically ?
    Thanks in advance

    Hi,
    This thing you can achieve by using the Code Template . If you are using New ABAP editor you can in the bottom right side after the scrolling bar. Click on that add the code you need to insert .
    Hope this might help you.
    With Regards,
    Sumodh.P

  • How to insert abap code in LSMW generated program?

    hi,
    i m working on LSMW for loading data in SAP
    i would like to insert abap code into the generated program....
    it's because i have 1 BKPF segment (header data), 2 BSEG segments, but i cannot define rules by customizing for the second BSEG segment(LSMW doesn't permitt).
    i already tried to insert code directly into the program, but obviously it disapears at each time i generate the program.
    i saw that apparently a code insertion has already be made into this program and the subject of this insertion is to define rules for the second BSEG (exactly what i want to do....) and this modification doesn't disapear at new prog generation.....
    Any idea ?

    Hi
    Why dont you use the FORM provided by LSMW
    To use this please do the following
    1.Goto option <b>Maintain Field Mapping and Conversion Rules</b>
    2.Goto menu <b>EXTRAS->LAYOUT->Form Routines</b>
      Here you will now get many options like
       Global Data
       Begin of Transaction
    Begin of Processing
    Begin of Record
      like wise the End of these also.
    Please put a breakpoint and check where you want to insert your code.
    Note:
    This is only for the Conversion Program and does not affect the main program used to update the Standard Tables
    Hi , I was reading your earlier post .. It seems that you have worked on EMIGALL. Consider a similar situation, it is like writing the code in the events till CALL01...
    Thanks
    DOminic
    Message was edited by: Dominic  Pappaly

Maybe you are looking for

  • Issue with Ravenna search

    Hi all, He have problem when using the search included in test portal in Site Studio (the Ravenna portal). After doing a search, we do not get any result, and Content Server logs file registers the following lines (see bellow) Details of our environm

  • Standard or Complex UDF's - Non java

    Hi Gurus I have been facing a lot of issues in learning the concepts of writing UDF's I am not a java developer but have to work now on interfaces involving both simple and complex UDF's in EDI's as well as IDOC scenarios I request you to send me som

  • Using Caching Server with Only Two Macs?

    I'm currently running OS X Mavericks (10.9.4) on both of my Macs (2008 MB and 2010 MBP).  We have a limited Internet download allotment, so I am trying to find ways to reduce the number OS X system update downloads.  Someone suggested that I take a l

  • IPhoto will not launch--what do I do?

    When I try to open iPhoto it gives me the "quit unexpectedly" message.  I cannot access any of my photos.  What do I do?

  • JAVA(JCO) and BW Connectivity

    Hi, I am using JCO to get data from R/3. At the same time I want to get data from BW server also. Is there any methods available for this activity. How make it possible, Please provide details. Thanks, Ask123