Get calling script name

Let's assume I have the following:
fileA.cfm > includes fileB.cfm > includes fileC.cfm
Within fileC.cfm, how can I figured out that fileB.cfm was the page that called it? I was looking through getPageContext() for any revalent information, but I'm stumped. If i use cgi.path_info that's invalid as it would give me fileA.cfm. This has to be something obvious that I'm missing

One way would be to use the session scope...
fileA.cfm source code:
<cflock...>
<cfset SESSION.last_source_location = GetFileFromPath(CGI.CF_TEMPLATE_PATH)>
</cflock>
<cfinclude template="fileB.cfm">
fileB.cfm source code:
<cflock...>
<cfset SESSION.last_source_location = GetFileFromPath(CGI.CF_TEMPLATE_PATH)>
</cflock>
<cfinclude template="fileC.cfm">
fileC.cfm source code:
<cfif IsDefined("SESSION.last_source_location") AND Len(SESSION.last_source_location) AND SESSION.last_source_location IS "fileB.cfm">
     <!--- Source location was valid. --->
<cfelse>
     <!--- Source location was  not valid. --->
</cfif>
<cfset SESSION.last_source_location = ""> <!--- Reset for use again. --->

Similar Messages

  • Getting calling class name

    Hi,
    I have a project where it is imperative that i know the calling class and the called class name. I have a solution working where i place the caled class on a stack and record it as a possible calling class. However there must be a simpler means of doing this. My code is poor. Is there a method of getting the calling class on a classPrepareEvent so that i have the class and the calling class.
    regards
    ciaran

    I suggest you start by taking a look at the example source code
    for the trace application, which is described here:
    http://java.sun.com/products/jpda/examples.html
    The example source code is included in your J2SE 1.4.xx bundle
    under the demo directory. Look in $JAVA_HOME/demo/jpda/examples.jar
    To compile or run the examples, you need to add
    $JAVA_HOME/lib/tools.jar to your classpath.
    After you unpack examples jar, look for
    com/sun/tools/example/trace/Trace.java

  • How to get calling jsp name?

    We are implementing iStore 12.1.3
    We have a jsp which can be called from multiple jsps. When the jsp is processed, navigation should go back to the calling jsp.
    Is there any in-built API which provides calling jsp name?
    Please advise urgently.
    Thanks in advance

    Is it a custom jsp or seeded jsp?
    you can go back to previous page programmatically, only if previous page reference is passed thru request object
    if it is seeded jsp, you will need to check if calling jsp is passing the name of page to destination page through request object.
    if it is custom jsp, introduce code like below on all the source/calling JSPs.
    <input type=hidden name="fromRef" value="<%=IBEUtil.htmlEncode("<name of page>")%>">
    and on processing page, write code to forward to fromRef.
    e.g. <jsp:forward page="<%=request.getParameter("fromRef")%>"/>
    thanks,
    Hrishikesh

  • Get Calling Application Name

    How can I get the name of the Application I use to connect to the DB from within a procedure/view?
    The user ID used has no DBA or system privileges, so it can not use v$Session....
    Thanks in advance for any help
    Jerome

    In the application call the procedure
    DBMS_APPLICATION.set_client_info('Client Application Info');
    The will set the client_info field in v$session.
    You can also get the same value calling the function in the stored proc
    DBMS_APPLICATION.GET_CLIENT_INFO

  • Caller Program name after SUBMIT or Call Tran (SAP-Query drill as ex)

    Hi ,  there is real simple situation
    I have SAP Query and do Drill Down to my Report or  Transaction.
    So I have two questions but as I believe they are equal:
    1) How I can get Caller SAP Query name from my Report ?
    2) How can we get  Caller Program name after SUBMIT or CALL TRANSACTION operator (in new started report for example )?

    Hi,
    there is a system variable sy-cprog ...check if u can use it...
    else from the caller prog move its name to SAP memory and retrive it in called prog..
    in caller prog
    data caller_prog type SYCPROG.
    move sy-repid to caller_prog.
    set parameter id 'ZCPROG' field caller_prog.
    submit <called_prog> and return.
    in called prog
    data caller_prog type SYCPROG.
    get parameter id 'ZCPROG' field caller_prog.
    write caller_prog.
    write / sy-repid.
    Cheers,
    jose.

  • SAP Script is not getting called for GI Output type WA03

    Dear All,
    I have designed one SAP script for goods issue output type WA03 for Tcode Migo.
    I have assigned the form name in NACE. But the problem is it is not picking my form, It is giving some Express document error. I am not able to know how the transaction is picking up the form since it is not going to the standard program even though i have kept breakpoint there. Can anybody let me know how the print program (SAPM07DR)is getting called from MIGO.
    print program  name is SAPM07DR.  Standard Script name is WASCHEIN.
    Regards,
    Ravindra Jain

    HI Ravi,
    Did you check the entry in NACE. I think you need to configure the Driver program and sap script there. just try to put a session break point and check why it is not picking.
    Thanks,
    Chidanand

  • How to get the report name from the call stack

    Hi,
    I have a question about how to get the caller information dynamically in a function module.
    For example.
    ZGET_CALLER_INFORAMTION,
    get the caller name -- how ??
    Thanks in advance
    Best Regards,
    Johnney

    Hi,
    You can use SY_CPROG -  caller in external procedures, bye using this u can get the progam name.
    Regards,
    kavitha.k

  • Can you get the file name of the current executing TSQL script?

    Can you get the file name of the current executing TSQL script? I wrote entries to a generic log file and would like to include the script name.

    Okay, So What you can do is
    1. Read get the version from your  database and redirect it to a text file(SQLCMD outout can be directed to text file using -o option or windows redirection operator >)
    2. Now you can read this value from the text file either inside a batch file or a powershell script and decide what operations you can do. 
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Script does not get called

    Hi there, I am trying to setup a quad view on my stage by
    placing 4 sprites on the stage with the same 3D cast member. I then
    apply a behaviour script that initalizes the 4 sprites in their
    correct positions and sets up the 4 different camers as follows...
    topView
    perspView
    sideView
    frontView
    ... however, doing so, the script gets called only on the
    first sprite and the other 3 sprites do not react with the
    behaviour script. As a matter of fact, I also have a sendAllSprites
    command inside the behaviour script and it does not send the
    message to all of the sprites with that piticular behaviour script.
    Is the reason why the behaviour script does not work on the other 3
    sprites because I need a diferent 3d castmember for each
    sprite?

    Hello,
    You don't need to place 4 sprites of the same W3D cast member
    in the score.
    1- Place a single occurence (sprite) of the W3D cast member
    in the score
    2- Create 4 cameras either in your 3D package or by code
    using member.newCamera():
    topView
    perspView
    sideView
    frontView
    3- Set the rect of the four cameras so they correspond to
    each corner of the screen
    4- Use sprite.addCamera() in order to add the four cameras to
    the W3D sprite
    That's all you need.
    Best regards,
    Karl Sigiscar.
    http://www.chromelib.com

  • Can we get the label name of the particular oracle field using open script

    hi
    can we get the label name of the oracle fields like column name ORDER NUMBER instead of ORDER_ORDER_NUMBER_0 when recording using openscript.

    Good morning
    Do you develop functional or load test scripts?
    I don't think we can in both cases because this is really the name of the field + the index.
    The zero refers to first line normally (then 1 for second line and so on).
    "Order number" is maybe the display label which is not enough to recognize and interact with a field.
    May I ask why you want this, then it could help me (us) to give you a good solution/workaround.
    Cheers
    JB

  • How can I turn off the phone saying "Call from" #/name when getting incoming call.

    How can I turn off the phone saying "Call from" #/name when getting incoming call before the ring tone starts?  I have a LG accolade

    I recommend checking your  prompts and alerts to turn this feature off. This may be you "Call Connect" or "Readout" alerts. Listed below are steps to update this feature. 
    With the flip open, press the Voice Command Key (on the left side of the phone).The Voice Commands feature has several settings which allow you to customize how you want to use it. Access Voice Commands, then press the Right Soft Key[Settings]. Your choices are below:
    -Confirm Choices--- Automatic/Always Confirm/ Never Confirm
    -Sensitivity--- Control the sensitivity as More Sensitive/ Automatic/Less Sensitive
    -Adapt Voice ---If the phone often asks you to repeat voice command,train the phone to recognize your voice patterns.Train Words/ Train Digits
    Prompts ---Mode/ Audio Playback/Timeout
    * For Mode, set Prompts/ Readout+ Alerts/ Readout/ Tones Only.
    * For Audio Playback, set Speakerphone or Earpiece.
    * For Timeout, set 5 seconds or 10seconds.

  • Get script name

    Hi,
    at the sql plus prompt, let's say i run a script
    @script1.sql
    Inside script1.sql, i want to run a command that tells me the script name it's currently running (which is itself 'script1.sh')
    Also inside this script if i call
    @start.sql
    The code inside start.sql should be able to tell it's name and also the parent script name (script1.sh)
    I don't want to pass the parent script name as parameter here (because anyone can enter wrong parameter value)
    Is this possible?
    I need this for some internal auditing purpose, in case you are wondering.
    Thanks
    -srinivas yelamanchili

    http://blog.tanelpoder.com/2007/12/26/sqlplus-is-my-second-home-part-5-reading-the-name-of-currently-executing-script/

  • How to get the caller's name in a custom exit.

    I am using the menu exit of ABAP Editor(SEUED001),but in the inclued program, how could I get the program name which is being editing in the editor? the sy-cprog returns the name of the include program.
    Edited by: yanluckly on Aug 23, 2010 7:58 AM

    SMOD->SEUED001->Display componens->double click on EXIT_SAPLEDITOR_002->See the source code...
    function exit_sapleditor_002.
    *"*"Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(PROGRAM) LIKE  SY-REPID
    *"       EXCEPTIONS
    *"              CANCELLED
    include zxseuu22 .
    endfunction.
    PROGRAM is the importing parameter for the function module.
    matt

  • How to get the table name in the trigger definition without hard coding.

    CREATE  TRIGGER db.mytablename
    AFTER UPDATE,INSERT
    AS
        INSERT INTO table1(col1)
        SELECT InsRec.col1   
        FROM
        INSERTED Ins
       --Below i am calling one sp for which i have to pass the table name
       EXEC myspname 'tablename'
      In the above trigger,presently i am hard coding the tablename
      but is it possible to get the table name dynamically on which the trigger is defined in order to avoid hard coding the table name

    I really liked your audit table concept.  You inspired me to modify it so that, the entire recordset gets captured and added a couple of other fields.  Wanted to share my end result.
    USE [YourDB]
    GO
    /****** Object: Trigger [dbo].[iudt_AutoAuditChanges] Script Date: 10/18/2013 12:49:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER TRIGGER [dbo].[iudt_AutoAuditChanges]
    ON [dbo].[YourTable]
    AFTER INSERT,DELETE,UPDATE
    AS
    BEGIN
    SET NOCOUNT ON;
    Declare @v_AuditID bigint
    IF OBJECT_ID('dbo.AutoAudit','U') IS NULL BEGIN
    CREATE TABLE [dbo].[AutoAudit]
    ( [AuditID] bigint identity,
    [AuditDate] DateTime,
    [AuditUserName] varchar(128),
    [TableName] varchar(128) NULL,
    [OldContent] XML NULL,
    [NewContent] XML NULL
    ALTER TABLE dbo.AutoAudit ADD CONSTRAINT
    PK_AutoAudit PRIMARY KEY CLUSTERED
    [AuditID]
    ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    CREATE NONCLUSTERED INDEX [idx_AutoAudit_TableName_AuditDate] ON [dbo].[AutoAudit]
    ( [TableName] ASC,
    [AuditDate] ASC
    )WITH (STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    END
    Select * Into #AuditDeleted from deleted
    Select * Into #AuditInserted from inserted
    While (Select COUNT(*) from #AuditDeleted) > 0 OR (Select COUNT(*) from #AuditInserted) > 0
    Begin
    INSERT INTO [dbo].[AutoAudit]
    ( [AuditDate], [AuditUserName], [TableName], [OldContent], [NewContent])
    SELECT
    GETDATE(),
    SUSER_NAME(),
    [TableName]=object_name([parent_obj]),
    [OldContent]=CAST((SELECT TOP 1 * FROM #AuditDeleted D FOR XML RAW) AS XML),
    [NewContent]=CAST((SELECT TOP 1 * FROM #AuditInserted I FOR XML RAW) AS XML)
    FROM sysobjects
    WHERE
    [xtype] = 'tr'
    and [name] = OBJECT_NAME(@@PROCID)
    Set @v_AuditID = SCOPE_IDENTITY()
    Delete from AutoAudit
    Where AuditID = @v_AuditID
    AND Convert(varchar(max),oldContent) = Convert(varchar(max),NewContent)
    Delete top(1) from #AuditDeleted
    Delete top(1) from #AuditInserted
    End
    END

  • Debug dynpro + call script form

    Hello ,
    I have a req, I need to debug the few dynpro, and one of the dynpro is calling a form and I have to figure it out, which form is this ( and from where it is called ). I have never worked with script form before, can any one let me know how I can figure it out that ( how to call a form, I mean it should be statemnt like, call form .... or ) ?
    One another thing, I went into the coding, and there I see the screen ( in execution mode, the screen shows some button, ( e.g show , and after pressing this button show ,the form appers ), but when I went in flowlogic of the screen, I cant see those button ?
    Any idea....
    Regards,

    Shah,
    Do like this.You might be pressing some push button after which the smart form or script is appearing.
    do screen debugging.
    enter /h in the command field and press enter.
    now press the push button.
    this will take you to the logic in the driver program where the smartform or script is getting invoked.
    if it is a smartform you will see a function module SSF_FUNCTION_MODULE_NAME.
    smartform name will be stored in LF_FORMNAME
    put a watch point here to get the smartform name.
    if it is a script you will come across the following functional modules.
    open_form,write_form,close_form.
    Script name will be given in the open form functional module.
    If any doubt revert it.
    K.Kiran.
    Message was edited by:
            Kiran K

Maybe you are looking for

  • Receiving an error as a open Sharing Preferences Pane.. Any idea?

    When I click on Sharing Preferences Pane I receive an error with heading "Preferences Error" and a quote "There was an error in Sharing Preferences" ..and closes  itself.. Cannot open the sharing preferences.. Crash log is below.. How can I fix this?

  • Is there a way to add a transition to every slide at once in Keynote for Ipad2

    Is there a way to add a transition to every slide in Keynote on my IPAD 2?  I've been doing each slide individually and it is taking too long! thanks,

  • Daily and Monthly Production Allocations

    Does anyone out there have experience with using PRA for daily production allocations? I know there are lots of companies using PRA for their monthly production allocations but I was hoping to get some feedback as to why companies have avoided doing

  • User denied their activities in the system

    Dear expert, One transaction posted in the system by an ID belongs to userA. But userA denied it. UserA claimed that someone might have been using his ID and posted it. How do we proof that the transaction was actually posted from userA's terminal ?

  • JAXB support in OSB

    Hi, I wanted to know if I can use JAXB in OSB(as a Java Callout). Is there any default support provided in OSB? If not, will it work if I import JAXB libraries on weblogic server and use them in Java Callout? Thanks Abhi