Runtime Constant in XSLT :-(

Hi together,
I have one problem with constant at the runtime.
The tag <RCVPRN> is empty, but I need this for my IDoc communication.
In the SAP help stands this:
Runtime Constants
$ReceiverService
Service on the receiver side that receives the message. For example, the name of a business system.
As of SAP XI 3.0, use this constant instead of the constant RECEIVER_SYSTEM used previously.
Yes
See also: Service
If you want to access one of the constants in the XSLT program, you first have to declare the constant as a parameter, for example:
<xsl:param name="MessageId" />
In my XSLT mapping I have this:
<RCVPOR>empty</RCVPOR>
<RCVPRT>LS</RCVPRT>
<xsl:param name="ReceiverService"/>
<RCVPRN>
<xsl:value-of select="$ReceiverService"/>
</RCVPRN>
</EDI_DC40>
But during the runtime the constant is empty
  <RCVPOR>empty</RCVPOR>
  <RCVPRT>LS</RCVPRT>
  <RCVPRN />
   </EDI_DC40>
Have you an idea for my problem?
Bye
Stefan

Hi Udo/all,
Thank you for your answer.
Please see in my last post:
Idoc with XSLT Mapping ALE service error
I mark in my channel:
Take Sender from Payload and Take Receiver from Payload
I must set control field by xslt maping, because the receiver is flexible.
With your setting I became a converting error to an ALE logical system.
I need the runtime constant in the xslt mapping.
Idea?
bye
stefan

Similar Messages

  • Accessing runtime constants with XSLT doesn't work

    Hi PI-experts,
    I'm trying to insert the Message ID from my message in a XSLT Mapping. I followed the description in SAP Help:
    First declare a param:
    <xsl:param name="MessageId"/>
    Later, use it:
    <MESSAGE_ID><xsl:value-of select="$MessageId"/></MESSAGE_ID>
    But the field MESSAGE_ID is always empty.
    Any explanations ?
    What do I need to do, to make it work ?

    Hi Udo and all,
    i have a bpm, where i first collect some messages and then execute a transformation step, which calls a XSLT Mapping to merge multiple messages into one. After this Transformation Step i added another Transformation Step, which calls a Message Mapping. This Message Mapping is a one to one mapping (every field in the source gets mapped to its twin in the target structure, both messages are the same). Only one field is changed, i wrote user-defined function as proposed in Michal's blog, retrieve the MessageID and set it to this field. I tested the BPM and it definitly works, the Message ID is set to the correct value.
    Is this a different behaviour than you have experienced in the past?
    I'm running on PI 7.0 with SP 16.
    Best Regards
    Sven

  • XSLT mapping, how can I include a Runtime Constants in target message

    Hi, I would like in my XSLT mapping, to have an attribute include the MessageID.
    From my understanding of the online help [http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm], I have the following code in my XSL:
                   <xsl:param name="MessageId" />
                   <xsl:attribute name="filename">Output_<xsl:value-of select="$MessageId"/>.xml</xsl:attribute>
    But for now the result is to have a filename attribute that only contains: "Output_.xml" as if the $MessageId is empty.
    Anyone experienced successfully using one of those runtime constants with XSLT mapping ?
    Cheers,
    greg

    Hi, found the answer of why it was not running: I'm in a transform step of a BPM:
    For more info check this thread:
    [/message/435521#435521 [original link is broken]|/message/435521#435521 [original link is broken]]

  • Reg problem in Runtime Constants $SenderService

    Hi
          Have a problem , I am using ABAP XSLT Processor  mapping (I have used message split for this particular scenario i.e. input is single file and output is multiple file)
    Instead of hard coding the sender service i tried to use Runtime Constants $SenderService but this was not working .
    For one to one scenrio it is working fine ,also in JAVA XSLT Processor  it is working fine ....
    can any one help on this
    Ramamurthy

    are you testing your XSL program in XI or outside ?
    These runtime consants can be accessed only inside XI.
    also,
    <i>
    If you want to access one of the constants in the XSLT program, you first have to declare the constant as a parameter, for example:
    <xsl:param name="MessageId" /></i>
    ref: more @
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm

  • ** Not able to access Runtime Constants in ABAP XSL

    Hi friends,
    We have written one ABAP XSLT program. (XSLT program runs in ABAP Engine). This program is for the interface Mapping in XI. Source Interface occurrence is 1 and target interface occurrence is 0..unbounded. ie. We use Message Split to send source messages to multiple target messages. For this we have written one ABAP XSLT program. To find Value mappings we use 'SenderService' Runtime Constant to determine Sender Service (for Source Agency) at runtime. But the problem is,  inside template the constant $SenderService did not have the value.  I have given below the coding
    <xsl:param name = 'SenderService'/>
    <xsl:template match="/">
         <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
                 <ns0:Message1>          
                  <ns1:employeeDemographicsRequest xmlns:ns1="http://aprilbiztec.com">
    <!-- here we are $SenderService did not receive the value -->
    Friends, Could you kindly help me to solve this problem ? (ie how to access Runtime Constants in ABAP XSLT when use message Split)
    Thanks in advance.
    Kind Regards
    Jeagthees P.
    Note :
    1) In normal ABAP XSLT, we are able to access Runtime Constant.
    2) For the same scenario, if we use normal XSLT ie. JAVA XSLT, we are able to access Runtime Constant.

    Hi,
    As far as I know you cannot access Runtime constants if there is a message split.
    Regards,
    Kumar

  • Selection dynamic Mapping Runtime Constant with a qualifier

    Hello all,
    i want to access a Mapping Runtime Constant out of a message mapping specified with a qualifier.
    In the Integration Directory i specified in the identifier tab the following Value Pairs:
    Agency               Scheme          Name
    http://Sap.com/xi/XI    XIParty         ABC
    R3D_310                 Partner         111
    R3T_310                 Partner         222
    R3P_310                 Partner         333
    In the message mapping i want to have the Name for the agency "R3T_310".
    I know i can access the Name with:
    constant = (String) map.get(StreamTransformationConstants.SENDER_PARTY);
    But i getting everytime the name "ABC", which i don't want.
    At this point i need your help, to find out how i can dynamically get the correct one??
    many thanks for your help
    ilka

    Ilka,
    You can also access other Mapping Runtime constants. For example, SENDER_PARTY_AGENCY.
    If needed, you can also access SENDER_PARTY_SCHEME and SENDER_SERVICE.
    The SAP Help link for all the Mapping Runtime constants accessible with StreamTransformationConstants is:
    http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/frameset.htm
    Hope this helps,
    Bhanu

  • Runtime constant: mapping-programm

    Hello,
    we got a exception branch for mapping errors in BPM.
    Now we want to inform the user, which mapping programm caused the error.
    Is there a runtime constant?
    I already analyzed:
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
    Regards Mario

    Hi Mario,
    You can raise alerts if mapping, receiver determination etc.. fails in the integartion engine. You need to configure alert rules for this. You can go to RWB->Alert Configuration->Where did the error occur? choose integration engine and you can see different error categories and error codes which can be configured using alert rules. Refer this michal's weblog for configuring the same..
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    You can also raise an alerts from BPM for any mapping failures, send step system errors/application errors using fault messages (through exception branch).
    Refer this weblog for configuring an alert in the BPM
    /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
    In you BPM, You can add Container Variables to Messages by using Container Opertaions(Append/Assign)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/59/e1283f2bbad036e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/4a773f12f14a18e10000000a114084/frameset.htm
    And also you can throw this exceptions via Alerts.
    Also go through these links....
    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/4a773f12f14a18e10000000a114084/frameset.htm
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/sap.user72/blog/2005/02/23/raising-exceptions-in-sap-xi-mapping
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    /people/aravindh.prasanna/blog/2005/12/23/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part--1
    Regards,
    Abhy
    Message was edited by: Abhy Thomas
    Message was edited by: Abhy Thomas

  • How to read runtime constants in ejb Module?

    Hi all,
    Anyone knows how to have special access to Runtime Constants at ejb Modules? I've searched and all I found is for Java and ABAP Mapping ...I hope it is possible! I want to read the interface name in order to choose which code my module should apply, as a case statement I mean.
    Thanks in advance,
    Ricardo.

    Hi Ricardo !
    Check these links:
    http://help.sap.com/saphelp_nw70/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
    Parameter MessageId
    Regards,
    Matias.

  • Jvm runtime constant pool

    Hi there,
    this is my query:
    As we know java builds a constant pool for all the symbols if a class in a class file. This class file when loaded by VM, the constant pool is translated into the runtime constant pool in the method area of the Heap.
    Does any one know if there is only 1 runtime constant pool per class or is it 1 per class instance(Object). The JVM spec did not clarify on this. Also if its 1 per class then how does the JVM know where all the instances of a class are while resolving references and also when garbage collecting???
    thank a lot.
    Rishabh.

    rishabhchandra wrote:
    As we know java builds a constant pool for all the symbols if a class in a class file. This class file when loaded by VM, the constant pool is translated into the runtime constant pool in the method area of the Heap.
    Symbols?
    It builds it for literals.
    Does any one know if there is only 1 runtime constant pool per class or is it 1 per class instance(Object). Certainly not by instance.
    And more likely it is per class loader. A class can't be unloaded unless its class loader is unloader so there would be no point in managing a pool per class when it could be managed via the class loader.
    The JVM spec did not clarify on this. Nor should it. That is an implementation detail of how the VM is implemented.
    Also if its 1 per class then how does the JVM know where all the instances of a class are while resolving references and also when garbage collecting???Not sure that question is sensical. The only reason it would need to know is because it is using the class. And the class might not own the pool, but it certainly references it.
    As for garbage collection that only occurs in the context of this question if the class loader is collected.

  • Mapping runtime constant to get system details of the XI box

    Hi
       We have a need to get the XI system details ( sysid and the client) at runtime - when executing a mapping that we designed using Message mapping . Is there any runtime constant/udf that we  can use to retrieve this information ?
    We are on XI 3.0 SP23.

    Hi,
    refer this blog by Michal..
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    just ignore the BPM part...you will need only the mapping logic and your target message will have the necessary value...also refer this link for the list of parameters that you can access:
    http://help.sap.com/saphelp_nwpi71/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
    http://help.sap.com/saphelp_nwpi71/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/frameset.htm
    Regards,
    Abhishek.

  • Accessing Runtime Constants in PCK

    Hi all
    Anybody tried accessing runtime constants such as message ID  in PCK, successfully?
    I have written a java mapping using StreamTransformationConstants class to retrieve MessageId value. The same java mapping works fine in XI, but not PCK.
    Any idea?
    Many thanks.
    YJ

    to the target  date mapping we have created a userdefined fuction fileName which is failing the error message when we  test the interface mapping is Runtime exception occurred during execution of application mapping program com/sap/xi/tf/_XI_ERP_FI_BAPI_ACC_DOCUMENT_POST_REQ_MM_: com.sap.aii.utilxi.misc.api.BaseRuntimeException; RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:BAPI_ACC_DOCUMENT_POST/DOCUMENTHEADER/HEADER_TXT. The message is: Exception:[java.lang.NullPointerException] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[null, com.sap.aii.mappingtool.tf3.rt.Context@0000000000000]
    is this help full
    when it is succesfull the input <HEADER_TXT>Payroll for 01/2008</HEADER_TXT>
    <DOC_DATE>20080131</DOC_DATE> 
                                                    when it is failed the input is
    <HEADER_TXT>Payroll for 20/08.t</HEADER_TXT>
    <DOC_DATE>08.t20</DOC_DATE>
    thanks and regards
    sandeep
    thanks
    sandeep

  • Runtime constant (Filename) errors out in BPM

    Hi,
    I have a BPMCollectTime scenario to collect the Source files. The filename (Message Mapping/Transformation) from the files is captured in TRANSFORM STEP(before sending them out from BPM). The file is sent to SEND step one at a time.
    Question : Filename of the source file is captured through user defined function.
    Following is the code.
    ================
    String  v_result_time;          //test Variable
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key =  DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    if (key == null) { v_result_time= "Create Key Failed";}
    else
    {v_result_time= "Create Key worked";
    String valueOld = conf.get(key);
    v_result_time = valueOld;
    return v_result_time;
    The Mapping gives a runtime error in the BPM. This is a sporadic error. 
    I have selected the Adapter specific attribute(File name).
    The BPM errors out sometimes? I am not sure if I am missing any setting. If I delete the work item and run the same scenario it works.
    Question 1 : What is the cause of the above error?
    Question 2 : Does BPM support Adapter specific attribute such as filename?
    Kindly Advice.
    Thanks,
    Gowri

    Hi Everyone,
    Thanks for all the help.
    DTN will not change the response filename to source filename. This option cannot be used. The correlation id is defined as response file name. Response filename is fixed for invoice file.
    Here is the example.
    For invoice file name HDTN20070430163110.TXT, response file received is nav1_2b5.rsp file. For HDTN20070430163314.TXT , response file is nav1_2b5.rsp
    So my correlation id is dummy fixed value. I have known the fact that it is not possible to use context object filename.
    Bhavesh -  I have defined transform step for accessing filename using dynamic configuration. Following is the code used in mapping.
    ================
    String v_result_time; //test Variable
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    if (key == null) { v_result_time= "Create Key Failed";}
    else
    {v_result_time= "Create Key worked";
    String valueOld = conf.get(key);
    v_result_time = valueOld;
    return v_result_time;
    ====================================
    BPM errors out sometime with following error
    Component mapping has returned error.
    com/sap/xi/tf/_MM_DTNData_2_DTNFilename_java.lang.NullpointerException.
    Error: Exception CX_MERGE_SPLIT occurred (program: CL_MERGE_SPLIT_SERVICE========CP, include: CL_
    If I delete this workitem and repeat the same scenario, it works. I have still not understood, why the scenario works sometime.
    Kindly Advice.
    Thanks,
    Gowri

  • PI 7.0 - UDF to access runtime constants

    Hi experts,
    I've created some user-defined functions to use in my Message Mappings. I'm particularly interested in having Message Mappings that allow me to send error e-mails everytime an integration process fails.
    So, in every Message Mapping I've created an UDF with the following code (saw this on SAP Help):
    MappingTrace trace;
    String constant;
    java.util.Map map;
    trace = container.getTrace();
    // get constant map
    map = container.getTransformationParameters();
    constant = (String) map.get(
            StreamTransformationConstants.INTERFACE_NAMESPACE);
    trace.addInfo("INTERFACE_NAMESPACE:" + constant);
    return constant;
    Now, almost everything is working fine. I'm receiving some error e-mails with the correct namespace, but the rest of them comes with a "null" instead of namespace - this is only happening in some Message Mappings - I have MM_A and MM_B of the same interface responsible for sending e-mails on diferent stages of the integration process; The e-mail received from MM_A contains the correct namespace but the other don't (comes with null).
    Can you help me on this?
    Thanks in advance.
    Regards,
    Ricardo Inácio

    PI is available in the options during the install of ECC.

  • Runtime constants - UserName ?

    Hi,
    My scenario is HTTP - XI - PROXY(ECC).
    I would like to capture user id of the person who posted the data using HTTP post to XI.
    I could see this user id in SXMB_MONI as below. But, <b>I do not know how to capture/read this user id into mapping</b> using technical context objects or dynamic access configuration since there is no context object to access this field.
    - <SAP:RunTime xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Date>20071017</SAP:Date>
      <SAP:Time>102604</SAP:Time>
      <SAP:Host>uspls247</SAP:Host>
      <SAP:SystemId>XS1</SAP:SystemId>
      <SAP:SystemNr>08</SAP:SystemNr>
      <SAP:OS>SunOS</SAP:OS>
      <SAP:DB>ORACLE</SAP:DB>
      <SAP:Language />
      <SAP:ProcStatus>003</SAP:ProcStatus>
      <SAP:AdapterStatus>000</SAP:AdapterStatus>
    <b>  <SAP:User>SM903673</SAP:User></b>
      <SAP:TraceLevel>3</SAP:TraceLevel>
    I have looked at the following help in SAP Library and blogs which did not help.
    http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    /message/686478#686478 [original link is broken]
    /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
    Thank you in advance

    Hi Mallik,
    Your problem is quite common, and the solutions are several, mostly crappy tricks.
    Since you can not access to the data out of the payload, it's impossible get the data in the mapping, so the best solution is to develop a java bean and add it to the HTTP adapter module.
    I was in SAP teched last week, and I did a 'hands on' with PI7.1 with a very similar solution, but instead of getting the data of the username of the message, it was the systemID of the sender machine, so same solution for your problem
    gime your mail and i will send you the docs and the code.
    Cheers.
    Eduardo.

  • Using runtime constant $TimeSent

    $TimeSent puts a Z at the end of the timestamp of the system time.
    1.What is the Z?
    2. How do I get rid of the Z?
    Thanks
    Chirag

    Hi chirag,
    In graphical mapping you can use the below UDF, just import,
    "java.text.SimpleDateFormat"
    String DATE_FORMAT_NOW = "yyyyMMddHHmmssSSS";
       Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
        return sdf.format(cal.getTime());

Maybe you are looking for