Can we give name to a block of code in SP

Greetings
Version- 10G
I have a stored procedure which contain code like
if () then
update---
else if() then
insert --
update---
else if()
end if;
end if;
end if;
I have to use this code numbers of times in my procedure , is there any way I can give name this code & use it or call it where I need it in my SP.
Don't want to make the above code a seperate procedure.
Thanks in advance

Why not make it a separate procedure, it can be private to your package or procedure: e.g.
create procedure main
as
  procedure sub
  as
  begin
    if () then
      update---
    elsif() then
      insert --
      update---
    elsif()
    end if;
  end sub;
begin
  sub;
  sub;
  sub;
end main;
Sub can only be called from within main, but can be called as many times as you want. Otherwise you are looking at labels and gotos, which are almost defnintely wrong.

Similar Messages

  • Can we give name to individual Capacity

    If yes where we can give it
    in cm27 we have idividual capacity wise capacity planning table, so where to give name to that one.
    in cm27, left clomn individual capacity colomn is there.
    as we are defining IN. Capacities in work center ny numeric no. in capacity view, but I want to give name to individual capacities.
    Help Me Out
    Thanks Gurus
    Edited by: Samir Momin on Mar 20, 2009 12:18 PM

    Hi
    You create capacity using Tcode CR11.
    Capacity name
    Description by which the capacity (for example, a machine capacity, a labor capacity or a move capacity)
    is to be created in the system (when creating the capacity) or
    is known in the system (when changing, displaying or using the capacity).

  • Can you give names to groups?

    Can one give unique names to groups in a slide?

    I don't know how to move an object from it's starting position to another position on the screen. I know it can move off the screen but not to another position on the screen without a major workaround.

  • How can we pass argument to static block of code????

    hi ,
    My question is we can use static initialization block for having functionality like constructors for initializing static variable ,but we cannot pass arguments to static initialization block then how can I create functionality like parametrized constructors.Whats the alternative shall I use a static method to perform this functionality,since all methods in given class are static and
    there is no need of creating instance of class.

    jduprez wrote:
    Hello Jussi,Salut Jérôme
    That's probably a more maintenable design.
    However what do you base your remark on - I'm struck by the word obviously?
    Is there some design principle from which this advice so naturally ensues that it is obvious ?Yes I read my posting later on and thought about changing it, since it's not necessarily an obvious solution. I was making assumptions that I didn't clarify from the OP.
    In the OP's case, the "state" on which those methods operate is apparently fixed, presumably at the beginning of the program, so what's wrong with all this staticness?
    I can list:
    - threading issues (a non-issue after some initialization phase), that you wouldn't have with immutable instances
    - harder unit-testing (that's not an OO design problem, more a methodology problem)
    - mix and confusion between static and non-static state if the class ever happens to have both, in future maintenance. All good points, I see all-static classes as a "code smell" and especially in this case when there's parametrization involved.
    Now we just need to have the OP explain his situation a bit better.

  • Atomic block of code in SwingWorker thread?

    Hi,
    I am coding a Swing application. It has a SwingWorker thread that can be interrupted by a Progress bar.
    Inside the worker thread, there are a few lines of code (not a method) that should be executed all or none. In another word,
    if the thread runs in the middle of this block, the thread must finish this block. How can this be accomplished? This block of code has nothing to do with database read/write. The reason for the block of code being atomic is that I need to make sure of data consistency. There are no other thread except for
    the main thread(event-dispatch thread) and the worker thread.
    Thanks a lot!
    David

    You need to synchronize your atomic block and the code to interrupt the thread on the same object.

  • Hi guru's i want to dovelope or modify  bapi how we can give name for bapi

    hi guru's i want to dovelope or modify  bapi how we can give name for bapi plz help me...

    Hi,
    If u want to assign the form to Standard sales order, The, this form in the NACE.
    and the, Run from va02/03.
    Reward Points,
    Vamsi.

  • Can anyone give me user exit name for create/update purchase order partners

    Hello guys
      Can anyone gives me user exit name for create/update purchase order partners?
      Requirement is to insert/update partner when SC flag is checked while creating/updating purchase order (ME22N / ME21N)  by using user exit.

    hi,
    check these exits.
    Transaction Code - ME21N                    Create Purchase Order
    Enhancement/ Business Add-in            Description
    Enhancement
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N
    MEVME001                                WE default quantity calc. and over/ underdelivery tolerance
    MM06E001                                User exits for EDI inbound and outbound purchasing documents
    MM06E003                                Number range and document number
    MM06E004                                Control import data screens in purchase order
    MM06E005                                Customer fields in purchasing document
    MM06E007                                Change document for requisitions upon conversion into PO
    MM06E008                                Monitoring of contr. target value in case of release orders
    MM06E009                                Relevant texts for "Texts exist" indicator
    MM06E010                                Field selection for vendor address
    MMAL0001                                ALE source list distribution: Outbound processing
    MMAL0002                                ALE source list distribution: Inbound processing
    MMAL0003                                ALE purcasing info record distribution: Outbound processing
    MMAL0004                                ALE purchasing info record distribution: Inbound processing
    MMDA0001                                Default delivery addresses
    MMFAB001                                User exit for generation of release order
    MRFLB001                                Control Items for Contract Release Order
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.
    AMPL0001                                User subscreen for additional data on AMPL
    LMEDR001                                Enhancements to print program
    LMELA002                                Adopt batch no. from shipping notification when posting a GR
    LMELA010                                Inbound shipping notification: Transfer item data from IDOC
    LMEQR001                                User exit for source determination
    LMEXF001                                Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001                                Customer-Specific Source Determination in Retail
    M06B0001                                Role determination for purchase requisition release
    M06B0002                                Changes to comm. structure for purchase requisition release
    MEFLD004                                Determine earliest delivery date f. check w. GR (only PO)
    MEETA001                                Define schedule line type (backlog, immed. req., preview)
    ME590001                                Grouping of requsitions for PO split in ME59
    M06E0005                                Role determination for release of purchasing documents
    M06E0004                                Changes to communication structure for release purch. doc.
    M06B0005                                Changes to comm. structure for overall release of requisn.
    M06B0004                                Number range and document number
    M06B0003                                Number range and document number

  • How can I give a name to excel sheet and open another one?

    Hello!
    I use CSVWriter for writing in excel file.
    I have 2 questions:
    1.     How can I give a name to a Sheet in excel file?
    2.     How can I save the first Sheet and open another one with a different name?
    Thanks!

    This is the equivalent in Apache POI which may or may not help. I've never used CSVWriter.
    HSSFSheet sheet1 = workbook.createSheet("sheet1Name");
    HSSFSheet sheet2 = workbook.createSheet("sheet2Name");Then you can use either sheet object to write your contents. Look at the documentation for CSVWriter that pertains to sheets as it should tell you how.

  • Can you give me an example of using blacklist from in mail settings to block unwanted mail?

    I want to use serveradmin settings mail command line to set a list of domains/servers I do not want to receive emails from. Can you give me an example on how to set this in ML server?
    I managed to set the domains using the command line serveradmin but it is not working. This is a list of domains I have set so far:
    mail:postfix:blacklist_from:_array_index:0 = "bounces.servidordeenvio.com"
    mail:postfix:blacklist_from:_array_index:1 = "reiserver50.info"
    mail:postfix:blacklist_from:_array_index:2 = "vps5.central-adworks.com.br"
    mail:postfix:blacklist_from:_array_index:3 = "emailTrocar.com.br"
    mail:postfix:blacklist_from:_array_index:4 = "geeklemail21.com.br"
    mail:postfix:blacklist_from:_array_index:5 = "produtosnotaveis.org"
    But I still keep receiving emails from those domains with virus (which are intercepted by the virus filtering) and receiving alert messages from the server app suggesting me to include these domains in a blacklist.
    Thanks for your help..

    Thank you.
    I tried it out and did not work either but I finally found a way to add multiple entries. I read on the serveradmin man page that if you had multiple values you should better off use a file for input.
    I did create a plain file with as many as needed entries:
    mail:postfix:blacklist_from:_array_index:0 = "*@xxx.com"
    mail:postfix:blacklist_from:_array_index:1 = "*@xxxx.com"
    saved as blacklist then I issued the command:
    sudo serveradmin settings < blacklist
    This solved the setting of multiple values. I will monitor if it will really block the spam from the locations.
    Thanks again for your help and interest.

  • Hi guru's i want to dovelope smart form how can we give form name for sales

    hi guru's i want to dovelope smart form how can we give form name for sales order  plz help me  ...

    Hi,
    If u want to assign the form to Standard sales order, The, this form in the NACE.
    and the, Run from va02/03.
    Reward Points,
    Vamsi.

  • How can we give two name for a single material ??

    Hi friends
    how can we give two name for a single material ??
    e.g.. if single material is sold to different customer by different names
    then how can we do that ??

    Yes
    you can achieve it thro CMIR in T code VD51
    Go to T code VD51 choose that customer and material combination and click on to its details blue lens on application tool bar
    In the screen which is coming ,enter your description in the CUSTOMER DESCRIPTION tab the second one and save
    Now create a sales order and see
    Your requirement will be fulfilled
    If a material is pen description is ball pen in material master and for customer A you have defined it as Pen 1 and description as Super ball pen in VD51
    If a material is pen description is ball pen in material master and for customer B  you have defined it as Pen 1 and description as  VerySuper ball pen in VD51
    Now in sales order the description will appear as Super ball pen for Customer A
    Now in sales order the description will appear as Very Super ball pen for Customer B
    Hence the material pen whose description is ball pen in MMR will appear as super ball pen for customer A and very super ball pen for customer B
    Hope you have checked the field info record in VOV8
    I have tried this tested this and getting it
    Regards
    Raja
    Edited by: ramanathan raja on Dec 8, 2008 5:54 PM

  • Can we give a class name by java keyword ?

    can we give a class name by java keyword ?e. can we create a class call "for" / "if" anyhow ? Is there some way to create such kind of classes .. Is is possible with some other java like language.. & if there is any language & how one can embed the script/language in java ..
    Please let me know
    Regards

    can we give a class name by java keyword ?e. can we
    create a class call "for" / "if" anyhow ? Is there
    some way to create such kind of classes .. Is is
    possible with some other java like language.. & if
    there is any language & how one can embed the
    script/language in java ..
    I give up - why would you want to?

  • Can anyone give the name of the center to write SCJP Exam available in visa

    can anyone give the name of the center and its location to write SCJP Exam available in visakhapatnam city, Andhra pradesh,INDIA ?
    Thankq

    Hi Suryakiran,
    You can contact NIIT or SEED infotech or Aptech computer institute or any other computer institute over there having "prometric testing center facility" ....
    It's simple ....
    fees are around Rs.4500 to Rs.6000 /-
    I think this info. will help you.
    Cheers---
    Akshay_L

  • S6000- Can I give it a Device Name?

    s6000-
    Can I give it a Device Name which is then visible in a PC's 'wifi access list' ?
    At the moment it just shows the MAC address.
    Solved!
    Go to Solution.

    Hi Headey,
    Welcome to Lenovo Community Forums!
    I’m glad to inform you that the Wireless Device name can be set in an android based device, below is the link for the steps to change the name:
    How to change phone’s name in Wi-Fi & Bluetooth
    Do post us back for further queries.
    Best Regards
    Shiva Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • HT204053 My apple id and icloud account merge together, i want to delete my icloud account because of some problems in name but i cann't delete my icloud account also and  rename also can you give me suitable answer on my email address

    My apple id and icloud account merge together, i want to delete my icloud account because of some problems on name so i want to change name or delete my icloud account .
    <Subject Edited by Host>

    You can't delete an iCloud account.
    Once it is attached to an AppleID it is attached forever.
    You can edit the name on your iCloud account or setup an email alias if you made a mistake with the email address.

Maybe you are looking for

  • Help needed in creating user defined attribute

    Hi all, I want to create user defined attributes and make it available for all users in sun LDAP5.2,I have followed the below mentioned steps, 1.Under configuration-schema i have created attribute named "ldapproducts" 2.I have created new object clas

  • Old macintosh not working

    I have a Macintosh IIci from 1989 that does not display anything on the monitor. I recently took it out of my attic after abut 10 years of storage. Before I put it in storage, it worked completely fine. Now, if I plug the monitor into the built in vi

  • Want to Archive a document in Backend from Webdynpro

    Hi,   Is there any Function module to archive the document from the webdynpro application. The document needs to be attached to the invoice and it needs to be archived. Thanks Raghavendra

  • Output an exact sized canvas in PS CS5 for magazine advert?

    Hi I began in PS CS5 by setting up a canvas 4 x 7" and begun designing.  It didn't seem right to me so I decided to print a draft of my partially finished project and discovered it is in fact HUGE.  I need to output an advert for a trade magazine whi

  • Help me order a book, please!

    I am trying to order an ibook for my brothers wedding album, however it keeps rejecting, when i viewed it in the PDF file, the pics are cut off and not in the same format I have made the book in. How do I fix this so I can order this book?