Can we define a constant within a subroutine

Can we define a constant within a subroutine

Hi,
Yes, we can define a constant within a subroutine.
perform f_check_company_code.
form f_check_company_code.
constant : lv_bukrs like bsis-bukrs value '1000'.
loop at itab.
  if itab-bukrs = lv_bukrs.
    delete itab.
    clear itab.
  endif.
endloop.
Thanks,
Sriram POnna.
endform

Similar Messages

  • Can we define a parameter within a subroutine?

    Can we define a parameter within a subroutine?

    Hi,
    see first of all u cannt declare parameters in subroutine if u want u can declare variables locally that is by using the keyword DATA but u cant declare PARAMETERS locally ..
    if it is helpfull plzz reward..
    plzz dont forget to reward.....

  • Can you define "single quote" character as a constant

    Hello all,
    I want to do something like this:
    CONSTANTS: q type c value ' .   " << thats a single quote character
    DATA: final_string type string,
              VAL1(12) type c,
              VAL2(12) type c.
    concatenate q val1 '-' val2 q into final_string. .
    How can I define the single quote character as a constant?
    Thanks

    Hello Ed,
    FAQ.
    You can declare single quote as constant
    If you are aware for single quote (') SAP uses an escape character which is the single quote itself('). Hence for every single quote you have to add an additional single quote.
    CONSTANTS: q type c value ''''.
    Suhas

  • Use of Class Vs Interface for defining application constants

    I want to use some constants through out the application. For that I found two ways to do that as given below
    1. We can define constants in a class as
    public class ConstantClass {
    public static final String applConstant = "Some Constant";
    and use it ConstantClass.applConstant whereever needed
    Or
    2. We can define an interface as
    public interface IConstantInterface {
    String applConstant = "Some Constant";
    and use it IConstantInterface.applConstant
    Can you pls explain which is the best method to be used in the application and why?
    Thanks in advance.

    Hmmm - that would imply that if I have a reference a
    static final variable in a 3rd party class, then
    compile my class to a .class file, then the 3rd party
    changes their class file, that my .class file would
    not contain the correct values.Yep, that is what would happen
    I doubt this. I haven't read the compiler specs, but
    my assumption would be that compile time optimizations
    such as this only apply to constants within a single
    .class file.You don't need the compiler specs, you just need a compiler.
    Compile the two classes below, and run Main. Your output should look like:
    3
    Hello
    5
    Hooky
    Then delete the Constants.class file and run Main again and see what happens.
    == Constants.java ==
    public class Constants {
    public static final int INT_CONSTANT = 3;
    public static final String STRING_CONSTANT = "Hello";
    public static int i = 5;
    public static String s = "Hooky";
    == End Constants.java ==
    == Main.java ==
    public class Main {
    public static void main(String[] args) {
    System.out.println(Constants.INT_CONSTANT);
    System.out.println(Constants.STRING_CONSTANT);
    System.out.println(Constants.i);
    System.out.println(Constants.s);
    == End Main.java ==
    In case you are wondering:
    java version "1.4.1_02"
    OS: Solaris 8
    Arch: Sparc
    I get the same thing on windows with 1.4 and 1.3
    and on FreeBSD with diablo jdk 1.3

  • How to define a constant in TSQL ?

    I need to define a group of int constants and use them by a group of functions . 
    so how I define a constant ?
    and how to make it accessible by multiple functions ?

    Hi, 
    I am guessing that you are developer by your nickname, so i will add something for developers :-)
    This is actually a good question and the answer is that you can use database (and this is where this forum come to help you, and
    Kalman Toth gave you the basic answer), but if your need is for application that you are developing then there are several more option which you need to check what is best for you.
    define a group of int constants in application can be done:
    >> Using database table (best for big collection or a Collection that you need some changing)
    >> Using ini file (very useful for constant Collection)
    >> Using app config file (useful for constant Collection, remember that changing the file will restart the app and all users sessions will end in some cases)
    >> Using static class
    and so on
    I hope this is useful :-)
    [Personal Site] [Blog] [Facebook]

  • Can we define alternate material in a BOM

    Dear All,
    Can we define alternate material in a BOM,If yes,How???
    pl. guide....
    Tushar Aute

    Hi,
    In BOM , alternative items are assigned to alternative item group on the general data tab page.
    In the production order in the general data tab page.
    We can define the alternative item based on priority , strategy and usage probability.
    Priority:
    This defines the priority of the item within the alternative item group.
    This determines the priority of planned withdrawls of items.
    EX Two items are assigned to alternative item group
    item A Priority 1
    item B Priority 2
    The system reads the item A first.
    Strategy:
    use the strategy to determine how the planned withdrawl is controlled
    within the alternative item group.
    The strategy should be same for all alternative items within a alternative
    item group.
    If the value 2( 100% check) is defined for the strategy the first material in
    the defined priority sequence for which sufficient quantities are available
    are reserved.
    Usage Probability:
    MRP Plans these alternative material components according to probability
    of use.Material requirements for BOM Components are planned according
    to usage probability.
    The planned withdrawls for the production order are based on the reservation lists.These lists are based on the priority and strategy.
    Regards,
    nandha
    Edited by: S.Nandakumar on Feb 21, 2008 7:21 AM

  • Custome BAPI - declare ITAB and define the Function Module and Subroutine

    Hello Experts
    I want to create a Custom BAPI and it has the following scenario:
    1) a Function Module which collects some records into it internal table, say ITAB
    2) a Subroutine which moved the records from ITAB to BAPI table
    Now, I want to declare ITAB and define the Function Module and Subroutine.
    Where and How can I do this?
    Plz suggest.
    Regards
    BD

    Hi,
      1) Got to SE37 and create an RFC .
      2) Declare the ITAB directly in the TABLES tab of the FM.
      3) Inside the FM source Code tab, collect all the data using SELECT query and directly or by using logic, put the data into the
          ITAB.
      4) Since the data collected is directly put into the itab you dont need a subroutine to be written.
      5) If subroutine is a necessity, then just write PERFORM SUB ROUTINE NAME.
           AND DEFINE THE FORM ENDFORM OF THE SUBROUTINE AFTER THE ENDFUNCTION OF THE FM
       Let me know if any issues....
    Regards,
    Vimal.

  • How can we define custom error page in protal application

    How can we define custom error page in protal application, like we define "jsp Error page " in JSPs

    Hi,
    Check these:
    Customization of Portal Runtime Errors and portal standard error codes
    http://help.sap.com/saphelp_nw04/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ec/1273b2c413b2449e554eb7b910bce7/frameset.htm
    Regards,
    Praveen Gudapati

  • How can I define Double Click Processing in SAP Query ?

    The first question is : How Can I define drill-down for SAP Query report ?
    The second one :  How can I program Double Click in SAP Query report for Different columns like ALV Grid processing ?

    you can attach a repot or at tcode etc in an SAP query using report assignment in SQ01 but as far as i remember you cannot attach multiple reports.
    regards,
    khusro habib

  • How can I Sync same contacts within Google account & iphone, ipad?

    My boss has iPhone 4, ipad & Blackberry, Iphone & ipad enable icloud. All devices sync with google account. After some days we found duplicates contacts & some same contacts 4/5 save in Google account.
    How can I Sync same contacts within Google account & above devices?
    Thanks,
    Qamrul

    Sync your iPad with computer iTunes.
    Note: your contacts should be in computer Outlook (Windows) or Contacts (Mac) application.
    If you have iCloud configured in iPhone, do the same for iPad.
    Setttings > iCloud >
         Account: your Apple ID
         Contacts: ON
         Documents & Data: ON

  • Can we share music/apps within a family while using different iTunes accounts?

    Can we share music/apps within a family while using different iTunes accounts?
    Recently purchased iPhone 5 for my wife and I + my daugther has an iPod.  I'd like for us all to have separate iTunes accounts so we can each use iCloud without getting each other's notifications, but would like to have one central repository for mucsic and apps.  I'm afraid if I set up iTunes accoutn for the tow of them, I'll have to re-purchase the music and apps (way too many!)

    It can be done, but you will have to sign in to your account on her itunes to updated the apps. Try these instructions:
    http://support.apple.com/kb/HT1848

  • How can i access the stepname within a steps post-expression?

    How can i access the stepname within a steps post-expression?
    i only saw the step-id of the step: Step.TS.Id
    is there a pssibility to get the stepname from the id?
    thank you!

    Hi Fischer,
    use the expression NameOf(Step).
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How can I define "java.util.ResourceBundle" in my Code ?

    Dear Mr. MLRon,
    Thanks to you for your replying to me.
    How can I define "java.util.ResourceBundle" in my Code ? To more understanding about my problem I can say that the Persian Font is Like as Arabic, but the Java can not Recognize it. please tell me how can I add "java.util.ResourceBundle" to my code and what should I do then?
    Thank you in advance,
    Tantan.

    Please stop starting new threads for this. Please reply in the original thread!
    http://forum.java.sun.com/thread.jspa?threadID=627917

  • I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    Can I define the time periods when my children's devices have access to the wi-fi network?
    Yes, using the Timed Access feature in AirPort Utility, you can setup specific rules for each wireless device which define the exact timeframe each day that the device will be allowed to connect to the wireless network.
    Example....junior's iPhone can connect.....
    Everyday......Between.....9 AM and 10:00 PM
    or
    Weekdays.......Between......4 PM and 9 PM
    and Weekends.....Between......9 AM and 11 PM
    At the same time, your own personal devices will have Unlimited Access at all times.

  • HP Officejet Pro 8600 Plus e-All-in-One Printer - N911g can not define a custom size paper.

    HP Officejet Pro 8600 Plus e-All-in-One Printer - N911g can not define a custom size paper.  I would like to have a custom size to work with a card making program.

    Can you help me out?
    I have an HP Officejet Pro 8600 N911a
    When I try to print to a custom print size (2.75" x 6" in my case), I get the same error everyone else is reporting: "Paper detected does not match paper size or type selected. Make sure the paper size or type is correct to continue the job."
    I am currently trying to print using Microsoft Word for Mac 2011 version 14.4.5, but I have the same problem with printing from Adobe Reader 9.8.5 or Preview 8.0.
    I am running OS X Yosemite 10.10.
    My printer's firmware is "up to date" as of 28-Aug-2014.
    This is what I did:
    1. Open System Preferences from the Apple menu.
    2. Click on the Printers & Scanners icon.
    3. Click on the + sign under the list of printers to add a printer
    4. Click on IP
    5. Enter my IP address in the Address field (verified as "valid and complete host name or address")
    6. Ignore Protocol field (default is Line Printer Daemon - LPD)
    7. Ignore Queue field (default is blank for default queue)
    8. Ignore Name field (default is IP address)
    9. Ignore Location field (default is blank)
    10. Under the Use dropdown menu, I select "Select Software"
    11. HP Deskjet 9800 is not an option.
    I searched for 9800, but there is no HP printer with that number in the options.
    I tried selecting "HP DeskJet 980C - Gutenprint v5.2.3" to see if that would work, but I received the same error message as above. I tried selecting other random HP printers, but so far I've had no luck.
    I've been googling about for a way to manually add a printer driver to this "Select Software" list, but I've found nothing (apparently, no one else wants to do this). I did not find a driver download for the HP DeskJet 9800 for OS X Yosemite 10.10 on the Drivers & Software section of the hp.com website.
    Additional details on settings for Microsoft Word for Mac 2011 version 14.4.5:
    Selected File > Page Setup from menu
    Under the Paper Size drop down menu, I selected manage custom size.
    - Click + to add a paper size
    - Enter "2.75" in width and "6 in" height in the paper size fields.
    - Enter "0 in" as the User Defined Non-Printable Area for top, left, right and bottom.
    - Double-clicked Untiled in the custom size list and rename the size as Receipt
    - Click OK to return to the Page Setup dialog box
    Under Settings: Page Attributes:
    - Format for "HP Officejet Pro 8600"
    - Paper size: Receipt
    - Orientation: "tall/portrait"
    - Scale: 100%
    - Click OK
    Select Format > Document and set all page margins to 0.25"
    Thank you. 

Maybe you are looking for

  • Can't get IDE drive to work with K8N NEO2

    I built my computer two months ago.  The only hard drive I installed was a Samsung 160GB SATA.  The Windows XP installation was flawless and the system has worked perfectly ever since.   This past week I decided to install my old Western Digital IDE

  • BEx-in Excel sheet particular row has to highlightned

    Hi folks, We are having requirement in Bex. that particular  material M00021 has to be highlightened. Every time we will pull data from R/3. the colour may be any colour but it has to highlightened irrespective of the kay figures(so exceptions will n

  • Export in PDF with Bookmarks

    Hi, I'd like export my document in PDF. Is pages able to create bookmarks automatically via titles? I don't see anything like this. It's very comfortable to read a PDF with content table. Thanks for helping.

  • DataGuard 10gr2 (10.2.0.4) AIX 5.2-primary Aix 6.1-Standby possible?

    We currently have 10.2.0.4 DG configuration running on three AIX 5.2 servers (one primary, two standbys). We will be installing some new servers that will be pre-loaded with AIX 6.1. If we were to install 10.2.0.4 on these new AIX 6.1 servers is it p

  • Can't figure out why this object = null

    I have a component which is used as an itemrenderer(in a datagrid). Inside the checkIfEditable() function it can't seem to find "img". It says it's null. I've got no clue why it would do that? If I look at the this.img variable during debugging it al