ABAP Methods _ 50 lines of code or less recommendation

Hi,
I'm looking for a document that I recall seeing that recommends that an ABAP method should have only around 50 lines of code. Can anyone recall this document and where to get it? Not sure if it was a blog or pdf paper by someone.
Thanks,
Ken Murray

Hi,
Please refer link and page number 8.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fbafc9e-0e01-0010-dea9-9d23d1b269fb
Generally, limited lines are useful for effective modularisation and easier maintanance.
Thanks,
Chetan Shah

Similar Messages

  • No of classes, Methods, Lines of codes, DLL's used and Third Party Libraries details identifying tools

    We have started a project to migrate 100+ Web Applications developed using legacy Microsoft technologies to latest .Net 4.5 Framework.
    The following are the planned migration approach
    Classic Asp à                                                   
    Asp.Net 1.1 Framework à Asp.Net 4.5 Framework
    Asp.Net 2.0, 3.5, 4.0 Framework à         Asp.Net 4.5 Framework (Direct Migration)
    Asp.Net 2.0, 3.5, 4.0 Framework à         Asp.Net 4.5 Framework (Application Rewrite
    using MVC/Entity Framework)
    VB 6 (COM/DCOM) à                                  
    C# .Net 4.5 (Web Services)
    We have to analyze 100+ applications to categorize them as Simple/Medium/Complex conversions for planning the timeline for completing the migration activities.
    Analysis includes identifying the following details - No of classes, Methods, Lines of codes, DLL’s used and Third Party Libraries  details
    for 100+ Microsoft applications.
    Could you please let me know do we have any effective tool to identify above mentioned details?

    This forum is for Microsoft Project Server, an EPM tool. You will need to find a more suitable forum for your question.
    Good Luck with the conversion!
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Calling abap method in xslt mapping?

    Hi
    I need to call abap method in my xslt mapping , i tried with
    <sap:external-call >and <sap:external-function> .
    But it is giving short dump error.
    Can anybody give me proper syntax..
    thanks
    Prasad

    Hello,
    Please see the code below.
    This is how u call
      <sap:external-function class="ZTEST_CLASS" kind="class" method="GETRECORDCOUNT" name="ns0:GetRecordCount">
        <sap:argument param="XXXX" type="string"/>
        <sap:argument param="YYYY" type="string"/>
        <sap:result param="ZZZZ" type="string"/>
      </sap:external-function>
      <xsl:template match="/">
        <xsl:param name="Counter">
    *And this is how u call below...
    <xsl:value-of select="ns0:GetRecordCount(A,B)"/>
    </xsl:template>
    </xsl:transform>
    Regards,

  • Calling a abap method in a javascript

    Hi all,
    I've been browsing a bit through this forum, but there has no answer been completely covering my problem...
    I would like to call an abap method in the javascript in order to check some values...
    This is what I have done:
    <script language="JavaScript" defer="defer">
        function do_checks(htmlbevent)
            try
                  var doubles = "<%= controller->check_doubles( )%>";
                  if(doubles == true){
                      var Check = confirm("Test??");
                      if(Check == false){
                        htmlbevent.cancelSubmit = true;
            catch(e)
      </script>
    The method has the following code:
    mehod check_doubles. " returning parameter = rv_double of type flag
      rv_double = abap_true.
    endmethod.
    the button is defined like this...
    <htmlb:button
                              id      = "Save"
                              onClick = "save"
                              onClientClick = "do_checks(htmlbevent);"
                              text    = "<%= otr(crm_ic_appl/Save) %>"
                              />
    The funny thing is, that the controller->check_doubles( ). is already processed at load of the page (although there is no on_load used somewhere...
    If I leave out the " if(doubles == true){ } ", the javascript reacts as foreseen..., but when I keep the " if(doubles == true){ } ", the javascript doesn't go through the method anymore...
    Can anybody help me out here???
    Thanks!!
    Micha

    Hi,
    You can call them FM inside the javascript something like below...
    <script language="JavaScript">
    function yourFM()
    <%
       DATA: guid TYPE GUID_32.
       CALL FUNCTION 'GUID_CREATE' IMPORTING ev_guid_32 = guid.
    %>
    </script>
    <b>To call the class & method:</b>
    <script language="JavaScript">
        function yourFM()
          <% CLASS cl_bsp_login_application DEFINITION LOAD. %>
          var EXIT_URL  = "<%= CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page ) %>";
      </script>
    But i am not clear what do you want to achieve. I didnt understand what you are trying to do with you code. Could you give more detail?
    <i>* Reward each useful answer</i>
    Raja T
    Message was edited by:
            Raja Thangamani

  • Change the depreciati calc methods from straght line to Decline bal methods

    Hi,
    We have  company codes in india and Sigapore.In singapore we are following the Depreciaiton calculation methods is straight line method,but india we want to use the decline balance methods.
    Please tell me how to change  in order to set the deline balance methods in india company code and please tell me is there any problem  for singapore comapny codes if i change the depreciation calcuation methods in india .
    This is urgent issue.
    Thanks,
    Hani

    Hi,
    India & Singapore Comp codes diffrent:
    1 - Change depreciation key in Asset Master.
    If comp code one and asset diffrent:
    1 - Identify Asset masters
    2 - Change Dep Key in Asset master data through Substitution (Mass Change) /  LSMW.
    the above 2 scenarios system will calculate dep automatically.
    Ex:
    Ind Comp Till date using 10% dep kay (SLM) now change dep key (8%) WDV.
    This changes are effect from current fiscal year bigining period onwards.
    the adjustment amount calculate & post in next dep execution perion (Catch -up method)
    the adjustment amount equally distribute to next available periods (Smoothing Method)
    Regards
    Viswa

  • Total number of lines of code in a class.

    Dear Experts,
    Given a class, I want to find out the total number of lines of code in all of its methods.  Following sub-parts are derived.
    1.  Find out all the methods of the class
    2.  Find out the number of lines for each of these methods and finally add the total number.
    Can you kindly let me know how I can do this?  Thanks a lot !
    Best Regards, Vikram

    Be aware that a 2D array is an array of arrays, which don't necessarily have to be the same length. e.g.int[][] a = new int[2][];
    a[0] = new int[10];
    a[1] = new int[20];
    /* a.length == 2
       a[0].length == 10
       a[1].length == 20*/

  • Is it too much lines of code inside a class file?

    Hi,
    I was wondering about how many lines can be considered too much in a java class file. I saw some class files with more the two thousand lines of code and even more than three thousand lines. When we have so many lines in the code I've realized that the file becomes slow for edition and it's not readable as it should be. So, as a best practice, or even due to technical issues, in average how many lines of code we'd write in order to keep the readability and avoid compile and build issues? How many lines a class should have without putting our code and performance at risk ?
    thanks a lot

    My general rule of thumb--in a class everything shold be very consistent, that is to say: you should be focusing on 1 idea in your class. IMO: If you have a class for users, you need to consistent in just what that class does. When the class becomes large, then look for related themes that run through methods of that class, and if here are many, you should make a "related class" that does satelite functions of the "core" offered in the main user class.
    Thousands of lines do not a good class make, I break in to related categories of classes long before then, and as a rule I keep under 500 lines in a class--usually under 300. In any case, no more lines of code need go into a class than that to implement the core features in the main idea for that class--and no less lines of code than is needed too, don't religate a method to another class just becasue you feel it would make the class it belongs too big.
    Along the idea of the user class:
    Storage for the user data
    Home information
    Work information
    physical information
    tastes and preferences
    family
    and etc
    all of these could be a class in and of themselves, but definetely are closely related to the user class.

  • What is this line of code means???

    Hi have a general question, I am not sure if it right place to ask. But I will be grateful if some body could help on this one. I could not figure out what is that line of code (**) is doing or what does it mean. I gave sample implementation here.
    Public class Decoder{
    InputStream in
    Public Decoder(InputStream in){
    This.in = in;
    String st = somefunction(in)
    public static Xval decode(InputStream in){
    return new Decoder(in).decode(); **
    What I don�t understand that what is line of Code do �return new Decoder(in).decode(); � I have never seen this kind of implementation. The return type is Xval but the function is retrunin t object of this (Decoder) type. And what is Decoder(in).decode() when function decode() is doing nothing except returning a object???
    Thank you

    Apparently, the Decoder class has a method called decode() that returns a Xval object. The line is equivalent toDecoder d =  new Decoder(in);
    Xval xv = d.decode();
    return xv;

  • How would I go about adding multiple rectangles using the same lines of code?

    How would I go about adding multiple rectangles using the same lines of code? I would prefer to just run through a set of code every time I need a polygon. If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.

    >>How would I go about adding multiple rectangles using the same lines of code?
    You could create a method that creates and returns x number of Rectangle elements:
    public IEnumerable<Rectangle> CreateRectangles(int numberOfRectsToCreate)
    for (int i = 0; i < numberOfRectsToCreate; ++i)
    Rectangle rect = new Rectangle();
    rect.Fill = Brushes.Blue;
    rect.Width = 100;
    rect.Height = 100;
    yield return rect;
    ..and then call this method from anywhere in your code:
    IEnumerable<Rectangle> rects = CreateRectangles(5);
    foreach (Rectangle rect in rects)
    //add to StackPanel or do whatever with the Rectangle elements:
    yourStackPanel.Children.Add(rect);
    >>If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.
    When adding Point objects to a Polygon you can only add one per call to the Add method but you could call the Add method inside a loop, e.g:
    for(int i = 0; i < 10; ++i)
    //add to StackPanel or do whatever with the Rectangle elements:
    Polygon p = new Polygon();
    p.Points.Add(new Point());
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • Count lines of code in WDA component

    Is there a way to count the lines of own code (or otherwise measure the "size") in a WDA component on a 7.01 system? Please don't make me go through every single method one by one

    If you load the Web Dynpro Component in SE80 and then choose Web Dynpro Component->Check->Generation Limits, this will give you the load size in bytes of the WD Component. It also has some breakdown liek the number of variables declared.  However nothing that gives you the exact lines of code.
    The source code of all WD methods is stored in table WDY_CTLR_COMPO, so I supposed if if you really needed to you could write a small program to count the number of lines of code or the number of characters.

  • I pasted a line of code in my muse site google9cd204871dd4e782.html, is there any way to see the code so i can remove it?

    Hi, I pasted a line of code in my muse site, Is there any way to look at the code on my home page so i can remove this code? It is visible on my page when i view my site in browser, but i can't see it in muse.

    How did you paste the code? Did you insert HTML elerment? Or just paste it on the page? What's the site address?
    By the way. The code you have tried to add for Google webmaster tools should of been saved as a separate HTML file and upload it to your server to be verified, not put on the page, I think there are other methods that you put in the code to get  verified.
    thanks
    jason

  • How to break down long lines of code

    Is there a way to break a long line of code so that it will fit on an A4 sheet?

    You can break on most dots between variable name and method name, between spaces in operators, after a comma that separates parameter names, etc. Just about the only thing you can't break is a long literal String--though you could type it on multiple lines by breaking it into pieces and putting a + in between the pieces.

  • ERROR - the ProtectKeyWithTPMAndPIN Method failed with the exit code: 8031005B

    Hello
    I am using the EnableBitlocker.vbs script to automatically assign the TPM and start the encryption. I am running it from an elevated command prompt. Here is are the arguments I am running with
    cscript EnableBitLocker.vbs /on:tp
    /l:c:\bitlockerlog.log /promptuser /ro:"MBAM" on
    All is well and it prompts the user for a PIN but then it fails.
    Here is the full log file. I haven't been able to find any info on the error code in the subject.
    Script processing started  02/07/2014       14:43:27
    Proper number of command line arguments passed to the script
    ---------------Executing with the following arguments------------------
    Enable parameters: tp
    Logging location: c:\bitlockerlog.log
    Create recovery key: No recovery key use specified
    Encryption method: 3
    Create SMS status MIF's: No SMS status MIF's will be created
    Reset TPM ownership: 1
    User prompting: 1
    Connection succeeded to MicrosoftTPM
    Successfully retrieved a TPM instance from the Win32_TPM provider class
    TPM found in the following state:
    Enabled - True
    Activated - True
    Owned - True
    Connection succeeded to MicrosoftVolumeEncryption
    TPM is in a ready state to enable BitLocker.
    Change TPM owner password specified on the command line.
    Random TPM owner password is: ;&K:)BU65|c7_v2n
    Completed converting old owner password to owner authorization:  0
    Completed converting owner password to owner authorization:  0
    Starting to change owner authorization process on the TPM
    ERROR - Failed to change owner authorization on the TPM with the following exit code:  80280001
    Successfully connected to WMI StdRegProv
    Checking if Group Policy encryption method is set...
    Found EncryptionMethod with value: 4
    Found EncryptionMethod policy registry key ignoring any /em options on command line
    Found ActiveDirectoryBackup with value: 1
    Found RequireActiveDirectoryBackup with value: 1
    Determined client Group Policy configured to require AD escrow of recovery password
    EncryptableVolumes count is: 1
    The EncryptableVolume(s) found: \\?\Volume{ad6db324-01dd-11e4-8272-806e6f6e6963}\
    EncryptableVolume used for encryption is: C:
    The volume has a protection status of: 0
    BitLocker Protection is Off
    Get conversion status is: 0
    The volume has a status of fully decrypted
    The following user is logged on: MGMT\80151318-sys
    Attempting to enable BitLocker TPM + Pin
    ERROR - the ProtectKeyWithTPMAndPIN Method failed with the exit code:  8031005B
    Script ended  02/07/2014       14:43:51
    Any and all help would be appreciated. This has worked before on a different laptop.
    Thanks

    Hi,
    This error indicates that the group policy isn't set correctly, when configure the group policy at teh server side, you should notice that only one of the additional authentication can be required at start up , otherwise a policy occurs, the notice can be
    found just like below:
    and after test, the error indeed occurs, just like the screen below:
    So, I suggest to check the group policy for bitlocker settings, you can only choose one start up authentication method.
    Regards
    Wade Liu
    TechNet Community Support

  • Use abap report program to print bar code instead of smartforms

    Do anyone know how to use abap report program to print bar code?

    Hi Celina,
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci839063,00.html
    I hope this will help, also it depends on the barcode type like ARTNR-code 128...
    Regards,
    Sudhi

  • Starting new SAP LUW inside ABAP method

    I am calling a ABAP method and in that I want to start a new SAP LUW and do commit when leaving the method.
    The requirement is that all update function modules called inside the method should only be committed and no other prior update FMu2019s(before calling the method) should not be committed.
    Any idea if itu2019s possible to do that in ABAP OO and how do we do it.
    Thanks & Regards,
    Anand.

    HI ,
    Thanks for the quick replies. I tried using SET UPDATE TASK LOCAL but it was also committing all the prior update FM's before calling this method.
    I also tried using the RFM -    CALL FUNCTION 'ABC' IN BACKGROUND TASK   DESTINATION 'NONE' . and then
    COMMIT WORK AND WAIT.
    Now when i do commit work it commits all the previous update tasks also.
    And if i do not call COMMIT WORK right after the call to RFM, then the object that i am trying to create inside the RFM will not be committed.And then if i proceede some validations will fail as the objects were not created.
    Is there a way to commit immediately when the RFM is called without commiting the calling transaction from where this RFM is called.
    Any examples would be highly appreciated ..
    Regards,
    Anand.
    Edited by: Anand Ajitsaria on Feb 4, 2011 9:54 AM

Maybe you are looking for

  • Error 400 when trying to sign-in to Adobe Photoshop 9 [was:Error]

    Getting an Error 400 when trying to sign-in to Adobe Photoshop 9.  What is the problem?

  • IPod cannot be updated...required file cannot be found

    I have the latest iPod software and iTunes. When I plug my 5G ipod into my computer, after it transfers a few new songs, I get the following pop-up message: "The iPod 'name of iPod' cannot be updated. The required file cannot be found." When I click

  • Other than the -36.....

    I'm getting the following message; "A buffer overrun has been detected which has corrupted the programs internal state. The program cannot safely continue execution and must now be terminated." I hit "OK" and the entire QT program shuts down. Scripts

  • Creating condition records in product

    hi, I am trying to create condition records for a product.For a sales order (TA) i create, the pricing procedure determined is RVCXUS. But i dont see any of the condition type which matches condition type for a product (in F4) and condition type main

  • Problem Starting Weblogic

    Hi All, I´m using ALSB, ALDSP, weblogic server and so one under linux but it´s taking so much time to get RUNNING STATE. It´s taking at least 10 minutes to go up! I think there´s no hardware problem because this linux machine has 4GB of RAM and a bet