Creating subroutines within subroutines

Many times we have to code within subroutines (e.g. user exits for Sales). At time pieces of logic are reusable or can be abstracted into subroutines.
How can we create subroutines within a user exit subroutine? Or is there another way, perhaps an INCLUDE? Although I am a little wary about using INCLUDEs. Here is why
If condition 1
   If condition 2
     Logic1
   Else
    Logic2
Else
Logic1
Endif
Currently I would rewrite the entire code for Logic1 twice in the subroutine. This is the issue I am trying to resolve. Thank you.

It works if you do something like this
report prog1
include include1
form form1
perform task1
endform
INCLUDE1
form task1
endform.
But it will not work if you try something like this out
form form1
  include include1
  perform task1
endform

Similar Messages

  • Is there a way to create guides within ruler guides or aligned to ruler guides?

    So I was wondering for my own sake if there was a way to create guides within ruler guides or have it align to ruler guides? I am working on this magazine where the layout has a ruler guides. Which is inside the margins. I'm guessing this is to ensure the content is safe and also leaving adequate room for folios and running heads. This leaves me with the inside of the ruler guide to create my own grid. I tried doing this by hand and it seems to work fine however I was wondering is there a way to align the guides/grid (columns and rows) to the ruler guides instead of the margin or page? This would be extremely helpful as doing it by hand is quite the task. I'm trying to personally see how many rows and columns I can get in for a verstatile grid that can be used for different sorts of layout. (although I guess the grid could too many rows and columns) Any help would be greatly appreciated.

    Is there a way to make it align to the ruler guides instead of the page and margin? example of what i'm talking about:

  • How can I create cursors within the cursor?

    How can I create cursors within the cursor?
    Table1 2001 - 2007 data
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Seq_Num
    Value1
    Value2
    Table2_Historical (doesn't have Num as a field) 1990 - 2000 data
    Account_no
    Account_eff_dt
    No_account_holder
    Seq_Num
    Value1
    Value2
    Table3_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    My result table should be:
    Table_result_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    I have to get data from Table1 and Table2_Historical. If one account was open in 1998 and is still effective, the minimum value of that account is in the Table2_Historical.
    Let's say I open a cursor:
    cursor_first is
    select * from table3_06;
    open csr_first
    loop
    fetch cursor_first into
    v_Account_no
    v_Account_eff_dt
    v_No_account_holder
    v_Num
    EXIT WHEN csr_first%NOTFOUND;
    How can I open a second cursor from here that will get the Seq_Num from Table1
    csr_second
    select Seq_Num from Table1 where
    v_Account_no = Account_no
    v_Account_eff_dt <= Account_eff_dt
    v_No_account_holder=No_account_holder
    v_Num = Num
    How does it works???
    Thanks a lot

    Thanks so much for replying back. Here is what I am trying to do.
    I have to create a table for each year 2002, 2003, 2004, 2005, 2006 that has all the account numbers that are active each year plus some other characteristics.
    Let’s say I will create Table_result_06. This table will have the following fields. The account number, account effective date, Number of the account holder and the field Num (The primary key is a combination of all 4 fields), the beginning look of value 1 in 2006, the last look of value 1 in 2006.
    Table_result_06
    Account_no key
    Account_eff_dt key
    No_account_holder key
    Num key
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    All the active account numbers with the Account_eff_dt, No_account_holder and Num are in the Table3. As such I can build a query that connects Table3 with table Table1 on all 4 fileds, Account_no, Account_eff_dt, No_account_holder, Num and find the Value1_min for the min of req_sequence in 2006 and Value1_max for the max of req_sequence in 2006. Here my problem starts.
    Table 1 doesn’t have a new entry if nothing has changed in the account. So if this account was open in 1993 and nothing has changed I don’t have an entry in 2006 but this doesn’t mean that this account doesn’t exist in 2006. So to find the minimum value I have to go back in 1993 and find the max and min for that year and that will be max and min in 2006 as well.
    As such I have to go to Table_2 historical and search for min and max. But this table doesn’t have the field NUM and if I match only on the Account_no, Account_eff_dt and No_account_holder I don’t get a unique record.
    So how can I connect all three tables, Table 1 for max and min, if it doesn’t find anything will go to table 2 find the two values and populate Table_result_06.
    Thanks so much again for your hep,

  • Can I create folders within iWorks applications?

    How do you create folders within Pages or Number? I want to file documents locally by category.

    I'm certain you're aware of this already - if not, the new update (version 1.4) allows creation of folders within Pages, allowing you to group relevant documents to your own specification. Hope it helps (...sure has for me!)

  • Creating tracks within a recording

    How do I create tracks within one long recording? My wife is a professional speaker and we are creating CD's of her tapes etc. How do I add invisible track marks so people listening to the CD's can advance to a specific place in the tape. I would like to place tracks at 5 minute intervals.

    use an audio editor to split the one long track every 5 minutes or so, then save each "piece" as a seperate .wav file. then burn all the tracks to cd. you can use Audacity. tis free
    http://audacity.sourceforge.net/

  • Add ability to create bookmarks within iOS app

    It would be great to have the ability to create bookmarks within the iOS reader app. That way I can go directly from a PDFs download via website/Dropbox and not have to first edit the document on my computer to add any bookmarks.
    Acrobat Reader for iOS

    To Demo:
    My main email address linked to the mail app in my iPad is with Yahoo.  When I add a test group on my iCloud, my iPad keeps asking for my Yahoo password repeatedly and no sync seems to have taken place.  Can't understand why.  Might have to troubleshoot a little bit more.
    I agree that it is a pain to add a group of names individually and I generally use the Gmail on the notebook for the Gmail app - much easier and faster too.
    It appears that the standard mail app is geared towards individual personal mail rather than for professional use.  Even then...it could have been better.
    Thanks guys for all your input.  Looks like there is no solution within the standard mail/contact apps in the immediate future other than using other apps to supplement.

  • Does Pages have the facility to create folders within folders?

    Having the ability to do this would encourage me to change from Microsoft word to Pages. Is it possible?

    In Pages for OS X, you can't create folders within folders if you are using iCloud to store your documents, but you can do this if you are storing them on your hard disk.
    In Pages for iPhone, iPad and iPod touch, you can't create folders within folders, so you are free to switch if you need this feature. Note that Office is only available for the iPhone if you are an Office 365 subscriber

  • Create trigger within PL/SQL

    I have a procedure that creates a trigger. When I execute the procedure I get an error: ORA-01031, however, when I copy and paste the create trigger command, it executes and will create the trigger without any problems. What is causing the 'insufficient privileges' error when it attempts to create it within a procedure?
    Here is the stream of commands SQLPlus that shows what I am getting:
    SQL> CREATE OR REPLACE PROCEDURE prc_create_trigger
    2 (Table_Name in varchar2)
    3 IS
    4 v_create_trigger VARCHAR2(4000);
    5 BEGIN
    6 v_create_trigger := 'CREATE OR REPLACE TRIGGER trg_pauls_table ';
    7 v_create_trigger := v_create_trigger || 'AFTER INSERT ON ' || table_name || ' ';
    8 v_create_trigger := v_create_trigger || 'REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW ';
    9 v_create_trigger := v_create_trigger || 'DECLARE ';
    10 v_create_trigger := v_create_trigger || ' v_text varchar2(20);';
    11 v_create_trigger := v_create_trigger || 'BEGIN';
    12 v_create_trigger := v_create_trigger || ' v_text := ''Inserted Row'';';
    13 v_create_trigger := v_create_trigger || ' dbms_output.put_line(v_text);';
    14 v_create_trigger := v_create_trigger || 'END;';
    15
    16 DBMS_OUTPUT.put_line(v_create_trigger);
    17
    18 --
    19 execute IMMEDIATE v_create_trigger;
    20 END;
    21 /
    Procedure created.
    SQL> exec prc_create_trigger('pauls_table');
    CREATE OR REPLACE TRIGGER trg_pauls_table AFTER INSERT ON pauls_table
    REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW DECLARE v_text
    varchar2(20);BEGIN v_text := 'Inserted Row';
    dbms_output.put_line(v_text);END;
    BEGIN prc_create_trigger('pauls_table'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "BAAN.PRC_CREATE_TRIGGER", line 20
    ORA-06512: at line 1
    SQL> CREATE OR REPLACE TRIGGER trg_pauls_table AFTER INSERT ON pauls_table
    2 REFERENCING NEW AS newrow OLD AS oldrow FOR EACH ROW DECLARE v_text
    3 varchar2(20);BEGIN v_text := 'Inserted Row';
    4 dbms_output.put_line(v_text);END;
    5 /
    Trigger created.
    I am wanting to do this because I need to create this trigger dynamically when a table has been created. This trigger is simply for testing the procedure.
    Thank you for your assistance.
    Paul

    Why does the application need to drop and re-create tables in the first place? What is the purpose of this "re-org"? If it accomplishes anything useful, it's likely that there is some flaw in the application architecture/ design/ implementation that could be fixed once to remedy whatever problem this drop & rebuild option attempts to solve. If there really is a need to reorganize a table regularly, could the application at least be modified to use one of the various approaches Oracle provides for this sort of thing?
    The "re-org" process you're describing is, at best, a hack. A trigger on the TABLES_TO_BE_REORGED table that creates triggers on whatever table name was deleted from this table is, at best, a hack. Layering one hack on top of another is likely to cause lots of pain.
    For one thing, a trigger cannot commit. But DDL implicitly commits before and after the DDL is executed. So you cannot create a trigger within another trigger. You could have a trigger that creates a job that later runs and creates the new trigger, but that's adding an extra layer of asynchronisity to a problem that is already likely over-engineered. You could also declare the trigger that creates the trigger to be an autonomous transaction, but that would cause horrible problems if the re-org process ever were to encounter and exception and have to roll back.
    Justin

  • Pages: creating folders within folders

    Using Pages in iWork on a MacBook (system 10.9.4), is it possible to create folders within folders? Dragging one document  and dropping it on another one isn't working within a folder.

    That is an iOS method, not an OSX method.
    command shift n creates a new folder in Finder or in a Save dialog, then move or save the file into that folder.
    Peter

  • How do I or can I create folders within email on ipad2?

    Can anyone help me....am trying to create folders within email...I know iPhone users can do it, so assume iPad can too? Help.

    You have to have an IMAP email account in order to create folders in the mail app on the iPad.
    If you have an IMAP account, tap on the email account and in the window that shows your InBox, Sent Folder, Trash Folder, etc, there will be an Edit button at the top. Tap that button and a "New MailBox" button will appear at the bottom of the window. Tap that to create a new folder.

  • Hi. how to create Subroutine Pool and call it from sapscript

    HI,
    Can anyone tell is there any standard subroutine pool available which could fetch the customer number. 
    how to create an subroutine pool and call it from the sapscript..
    please help me
    Advance Thanks..
    Guhapriyan.

    Hi Guhapriyan,
    1. Create a FORM in your program.
    2. call it from sapscript using
    /:   PERFORM GET_COMPANY_INFO IN PROGRAM YHRR_OFFER_CONTRACT_FORM      
    /:   USING &P0001-BUKRS&                                               
    /:   CHANGING &COMP_NAME&                                              
    /:   ENDPERFORM                                                        
    3. The form in your program should be of the following  parameters only.
    form GET_COMPANY_INFO tables IN_PAR  structure ITCSY
                            OUT_PAR structure ITCSY.
    (important is IN_PAR, OUT_PAR -
    where in your read the values passed,
    and pass back the values
    thru internal table using varname, varvalue)
    regards,
    amit m.

  • Need to create subroutine pool for info structure

    Hi gurus,
    I need to create a subroutine pool for the info strucuture S891for one of the key figures.(in the extended update rules). and in that i need to write 3 routines for the 3 key figures.
    plz help me how to create the subroutine pool for this.
    I just went to se38 and choose type subroutine pool and created a prg. But do not know how to proceed further.
    Any idea on this?
    Regards,
    Sakthi.
    Edited by: sakthi sri on Sep 6, 2010 9:47 AM

    Hi,
    Please Check this link,
    http://help.sap.com/saphelp_nw70/helpdata/en/c0/980389e58611d194cc00a0c94260a5/content.htm
    How to create variant for csutom screen
    New transaction - require variant selection to be disabled
    This may help you.
    Regards,
    Renuka.

  • How to create pages within a page?

    Hello,
    I'm still pretty new to Dreamweaver and I'm wondering if someone could point me in a direction to learn to create a specific thing for a website. I want to make something like at the bottom of this website: http://www.andymartin.clara.net/iframes/
    He has the window within the main window there, that changes with the three links below it without actually changing the whole page. I was wondering if someone would be kind enough to point me to a tutorial on how this might be done? I'm working with version CS3. Thank you so much!
    Jason

    Jason
    I would stay away from Iframes, they are problematic on a number of different levels.  I would suggest that you start to learn html and css and get off on the right foot. Here is where I suggest you start.
    http://www.w3schools.com/
    Gary

  • Create Attachment within Graphical Mapping using UDF

    Hi!
    We want to create an attachment witihn a graphical mapping using an UDF function.
    I use that function:
    public String addAttachment(String filename, String mimeType, String content, Container container) throws StreamTransformationException{
         BASE64Decoder decoder=new BASE64Decoder();
         try {
              GlobalContainer globalContainer = container.getGlobalContainer();
              OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
              Attachment attachments = outputAttachments.create(filename, mimeType,decoder.decodeBuffer(content));
              outputAttachments.setAttachment(attachments);
              return "Adde1: "+filename;
         } catch (Exception e) {
              return e.toString();
    (SDN helped me much in creating that
    This function has no compiling errors, anything workes fine:
    It takes 3 input-parameters, see also: http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html
    filename (ok, more or less contentID)
    mimeType (more or less contentType)
    content: Base64-encoded String which should be set as content
    In my sample I use the following constants for that function:
    filename = "fn1.txt"
    mimeType="application/xml"
    content = "UG9seWZvbiB6d2l0c2NoZXJuZCBhw59lbiBNw6R4Y2hlbnMgVsO2Z2VsIFLDvGJlbiwgSm9naHVydCB1bmQgUXVhcms=" --> cames directly from http://de.wikipedia.org/wiki/Base64
    When using the message, I got this error within SXMB_MONI:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive for
    message 0022642d-b106-02df-8e8c-f41c243bd112(INBOUND). Reason: java.lang.NullPointerException: while trying to
    invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of an object returned from
    com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()</SAP:AdditionalText>
    This looks pretty much the same as Add Attachment from ABAP Mapping but this tread is also not answered.
    Adding attachment from PI level looks also in that direction, again, no answer.
    So, I was wondering if someone has solved such problem?

    Hi Divyesh!
    We did it that way:
    1. Choosing the XML-Mailstructure as Destination as described in Configuring the Receiver Mail Adapter - Advanced Adapter Engine - SAP Library -  Example (XI payload with mail package)
    2. now we have created a UDF for creating the "content"
    public void getContent(String[] text, String[] attFname, String[] attType, String[] attContent, ResultList result, Container container) throws StreamTransformationException{
    // vergleich ob alle att-Arrays selbe anzahl haben
    if (attFname.length!=attType.length || attFname.length!=attContent.length) {
        result.addValue(Integer.parseInt("Fehler: alle Attachment-Eingänge müssen die selbe Anzahl an Elementen haben!"));
        String CRLF = "\r\n";
        String output="This is a multi-part message in MIME format."+CRLF+CRLF+
        "--"+getBoundary(container)+CRLF+
        "Content-Type: text/plain; charset=UTF-8"+CRLF+
        "Content-Disposition: inline" + CRLF + CRLF +
        text[0]+CRLF;
    for (int i=0;i<attFname.length;i++) {
        output+="--"+getBoundary(container)+CRLF+
        "Content-Type: "+attType[i]+"; name="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Disposition: attachment; filename="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Transfer-Encoding: Base64"+CRLF+CRLF+attContent[i]+CRLF;
    output+="--"+getBoundary(container)+CRLF;
    result.addValue(output);
    This UDF is configured as "QUEUE"
    We have configured this input-structure
    The Content itself is allready base64.
    So we can call this mapping and it creates a Multipart-Mail for us.

  • How do you create folders within a folder on Pages?

    I have the lates version of Pages.
    I have a number of documents in folders ie for each month.  I would like to create another folder ie for each year and place all the folders into it.  So basically, can I or how do I create a folder to place folders to organize my Pages.
    Thank you

    Folder organisation is done in Finder, not from within Pages, although you can create a new folder from within the Save dialog box in most programs.

Maybe you are looking for

  • Request failed in OIM 11g

    After obtaining operational approvals, some of my request get dropped. In the OIM log I see the following error message - <Sep 2, 2011 3:57:56 PM PDT> <Warning> <oracle.wsm.agent.handler.wls.WLSPropertyUtils> <BEA-000000> <WLSPropertyUtils:getOperati

  • Canon G1 raw files unrecognized

    Hi all, I'm new to Mac and iPhoto. I have taken a number of raw images on my Canon G1 and am trying to import them into iPhoto version 8.0.4 (OS X 10.5.8). I use a USB CF card reader, not a direct camera connection. I have iPhoto set to copy to the i

  • Can't add friends in Game Center

    HI!  Our doughter has  iPod touch 5th gen. She has a child Apple ID account which we used to sing in to Game Center. She can use multiplayer option but can't add friends from her contacts. When we go to friends button she gets message: allow iCloud c

  • Animation question regarding darkening...

    Hi Folks, I have created an animation in Photoshop CS5 and when I am done I render to video.  When the rendering is done, if the file is sizeable I don't have a problem.  However when I reduce the file I get a darkening between the end of the first l

  • Quickly clicking on a button

    I want to set a button up so it is activated and it's function runs completely before it can be activated again. I have tried a ton of things, but I can't get it to survive multiple clicks. The swf does everything great so long as I click slowly but