Help with ABAP Structure to XML - Simple Transformation

Hi guys,
I need help with a Simple Transformation. I am trying to convert a structure in ABAP to XML String but i ma getting short dumps...
Can any of you help.
Thanks in advance.
*& Report  ZTESTXML
REPORT  ZTESTXML.
class demo DEFINITION.
   PUBLIC SECTION.
   CLASS-METHODS main.
   ENDCLASS.
   CLASS demo IMPLEMENTATION.
     method main.
       data : begin of account,
                partner type bu_partner,
                primary(1),
                update(3),
                email(50),
                memberid(4),
                telephone(12),
                fax(10),
                dept(20),
                end of account.
        data : xmlstr type xstring.
                account-partner = '12345'.
                account-primary = 'N'.
                account-update = 'Yes'.
                account-email = 'zz at hotmail.com'.
                account-memberid = '555'.
                account-telephone = '123-448-6710'.
                account-fax = '345-123-7899'.
                account-dept = 'Info Systems'.
                call TRANSFORMATION ztest_inttable
                                    SOURCE account = 'account'
                                    result XML xmlstr.
       call FUNCTION 'DISPLAY_XML_STRING'
           EXPORTING xml_string = xmlstr.
       ENDMETHOD.
       ENDCLASS.
       start-of-SELECTION.
         demo=>main( ).
Transformation
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  <tt:root name="account"/>
  <tt:template>
    <IGT_CRM_AccountInfo>
      <Account>
        <tt:ref name=".account">
          <tt:attribute name="Id" value-ref="PARTNER"/>
          <tt:attribute name="Primary" value-ref="primary"/>
          <tt:attribute name="Update" value-ref="update"/>
          <Contact>
            <tt:attribute name="EMail" value-ref="email"/>
            <tt:attribute name="Member Id" value-ref="memberid"/>
          </Contact>
          <Communications>
            <tt:attribute name="Telephone" value-ref="telephone"/>
            <tt:attribute name="Fax" value-ref="fax"/>
          </Communications>
          <IGT>
            <tt:attribute name="Department" value-ref="dept"/>
          </IGT>
        </tt:ref>
      </Account>
    </IGT_CRM_AccountInfo>
  </tt:template>
</tt:transform>
Dump message
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_ST_REF_ACCESS', was not caught in
procedure "MAIN" "(METHOD)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The goal was to access variable "PARTNER". However, this access was not
possible.

to convert abap itab or variable into xml string use ABAP key word call transformation.
call transformation (`ID`)
            source output = itab[]
            result xml xml_out.
where itab is your internal table or any abap variable.
xml_out is type string which will hold the resulting xml.
ID is the transformation program. if you wanto use your own transformation, use your XSLT or ST program there.
Raja

Similar Messages

  • I need help with event structure. I am trying to feed the index of the array, the index can vary from 0 to 7. Based on the logic ouput of a comparison, the index buffer should increment ?

    I need help with event structure.
    I am trying to feed the index of the array, the index number can vary from 0 to 7.
    Based on the logic ouput of a comparison, the index buffer should increment
    or decrement every time the output of comparsion changes(event change). I guess I need to use event structure?
    (My event code doesn't execute when there is an  event at its input /comparator changes its boolean state.
    Anyone coded on similar lines? Any ideas appreciated.
    Thanks in advance!

    You don't need an Event Structure, a simple State Machine would be more appropriate.
    There are many examples of State Machines within this forum.
    RayR

  • Help with ABAP

    I need some help with some ABAP.
    I have a date value which is for example 01.01.2008.  I want to store it in a DATS info object which is of length 8.  How can I strip out the . in a transformation rule and should this logic be written in a START routine.
    Thanks

    Thanks for this.
    the description for PDATE mentions an input value of DD/MM/YYYY, you would'nt know whether / could also mean . and/or how can I see the logic before PDATE?
    Another problem encountered - since the field is referencing 0DATE (by default for DATS fields) I cannot make changes to the conversion exit or info object transfer routine
    Edited by: Niten Shah on May 28, 2008 2:05
    Okay have found the Function Modules behind the conversion routines:
    CONVERSION_EXIT_xxxxx_INPUT
    CONVERSION_EXIT_xxxxx_OUTPUT
    Edited by: Niten Shah on May 28, 2008 2:10 PM

  • Help with Photo Gallery using XML file

    I am creating a photo gallery using Spry.  I used the Photo Gallery Demo (Photo Gallery Version 2) on the labs.adobe.com website.  I was successful in creating my site, and having the layout I want.  However I would like to display a caption with each photo that is in the large view.
    As this example uses XML, I updated my file to look like this:
    <photos id="images">
                <photo path="aff2010_01.jpg" width="263" height="350" thumbpath="aff2010_01.jpg" thumbwidth="56"
                   thumbheight="75" pcaption="CaptionHere01"></photo>
                <photo path="aff2010_02.jpg" width="350" height="263" thumbpath="aff2010_02.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere02"></photo>
                <photo path="aff2010_03.jpg" width="350" height="263" thumbpath="aff2010_03.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere03"></photo>
    </photos>
    The images when read into the main file (index.asp) show the images in the thumbnail area and display the correct image in the picture pain.  Since I added the pcaption field to the XML file, how do I get it to display?  The code in my index.html file looks like this:

    rest of the code here:
            <div id="previews">
                <div id="controls">
                    <ul id="transport">
                        <li><a href="#" class="previousBtn" title="Previous">Previous</a></li>
                        <li><a href="#" class="playBtn" title="Play/Pause" id="playLabel"><span class="playLabel">Play</span><span class="pauseLabel">Pause</span></a></li>
                        <li><a href="#" class="nextBtn" title="Next">Next</a></li>
                    </ul>
                </div>
                <div id="thumbnails" spry:region="dsPhotos" class="SpryHiddenRegion">
                    <div class="thumbnail" spry:repeat="dsPhotos"><a href="{path}"><img alt="" src="{thumbpath}"/></a><br /></div>
                    <p class="ClearAll"></p>
                </div>
            </div>
            <div id="picture">
                <div id="mainImageOutline"><img id="mainImage" alt="main image" src=""/><br /> Caption:  {pcaption}</div>
            </div>
            <p class="clear"></p>
        </div>
    Any help with getting the caption to display would be greatly appreciated.  The Caption {pcaption} does not work,

  • XML Simple Transformation with Name attribute

    Current logic for reference:
    ERS tag is presented in XML file as: <ERSFlag>X</ERSFlag>
    Transformation logic to populate ERS flag value into PO_item structure is as:
                      <tt:cond><ERSFlag>
                        <tt:value ref="$po_item.ers_flag"/>
                      </ERSFlag></tt:cond>
    New Changes:
    XML template with New tag: TaxField1. New Tag included as:
    - <TaxField1 name="GST" value="">
    - <MultiCurrencyMoney>
           <Transaction currency="CAD">400.0000000000000</Transaction>
           <Base currency="USD">380.68</Base>
           <Local currency="CAD">400.0000000000000</Local>
      </MultiCurrencyMoney>
    </TaxField1>
    I have added new field Taxfield1 with Char1 in structure po_item. I would need to Populate 'Y' to new field Taxfield1 in po_item structure based on the above XML tag.
    Could anyone please let me know the Tranformation code to populate 'Y' to new field Taxcode1 in po_item structure based on the above XML tag.
    Thanks in advance.

    Share solution with us. Thank you!!!

  • Help with program structure - simple question.

    Hi. I need a piece of advice on how to create the correct structure for my program. It consist on two main processes:
    1)Detecting time difference between 2 rising edges, and showing the data. I used the concept of another user "panoramarts" that you can see here:
    http://forums.ni.com/t5/Digital-I-O/Measuring-Time​-between-two-Digital-Signals/m-p/2091868#M16230
    (If anyone knows a better way to do it I will really appreciate it)
    2) A continuous process.
    I attached a picture of the structure I am using. The numbers I will refer to, are indicated there.
    The program basically starts counting the time until a rising edge is detected (number 2 in the picture). After that the next sequence is executed (number 3 in the picture) counting the time again until the next edge is detected. After that the subtraction is made to have the time difference and then displayed (number 4 in the picture).
    Here is the problem: I have a continuous process that must be executed, so if I place it in "Number 1" then the edge detection must be running otherwise i do not see the continuous process (is like Labview execute de FLAT sequence, and after that the continuous process). If a place the continuous process in another While loop, then is like sometimes I get inaccurate data from the edge detection.
    How can I solve that? Is there another way to acquire time between edges? I hope you can help me without the VI.
    I am using Arduino, so I can not use DAQmx VI's.
    DMDsync
    Attachments:
    program structure.jpg ‏54 KB

    Thanks for the quick feedback!
    I believe my problem is that I am not using the best way to estimate time between edges. As I previously said, I am using almost the exact VI that "Panoramarts" shared in this link:
    http://forums.ni.com/t5/Digital-I-O/Measuring-Time​-between-two-Digital-Signals/m-p/2091868#M16230
    The only difference is that instead of a DAQ assistant in each of the While Loops, I use the same input for both of them. It works ok. It measure the time difference between the 1st and 2nd edges, the 3rd and 4th, and so on. All that VI is inside a while loop to continuously perform the counting. May be I can simplify my question:
    How can I continuously measure time difference between incoming edges (it could be a Boolean variable varying from true to false periodically) in a VI that already has a continuous process running?
    As Altenbach said, I used a wait statement in the continuous process (as it is not necessary a fast data update for it, because it is just a simple temperature measurement), but that delay created some faulty timing in the edge timing sequence.
    Any ideas?
    Thanks again!
    DMDsync

  • Help with abap code in Transformation

    Hi Experts,
    we have a scenario where we load delta data from an DSO into a Cube.
    The records in the DSO looks like below.
    Location as (L)
    WorkOrder as (W)
    Startdate(DDMMYYYY)/time (HH:MM:SS) as (S)
    Finishdate/time as (F)
    L1
    W1
    21/04/2009/10:00:00
    21/04/2009/12:00:00
    L1
    W2
    21/04/2009/14:00:00
    21/04/2009/23:00:00
    || L1 ||W3||  21/04/2009/16:00:00 ||21/04/2009/20:00:00 || 
    Total time ( April 2009 ) for above Location L1 should be calculated as a difference between W1 and W2 since W3 is a overlapping record. So the result would be 13 Hrs. Work Orders are summarised, so we dont need work order info in the output.
    Can you experts help me with the code to implement??
    Thanks,
    DV

    For each location, for example L1, move the records to an internal table itab.
    sort itab by startdate.
    read table itab index 1. 
    You will get the first value.
    sort itab by finishdate descending.
    read table itab index 1.
    you will get the second value.
    Calculate the difference and populate it to the internal table.
    finally modify the source package.
    I have just given the logic.  I hope you can build upon this.
    I hope it helps.
    Thanks.

  • Help with Spry Detail Regions, XML Data Sets, for IMG gallery

    Hello,
    I'm working on a site for a friend of mine, a photo gallery. You can see the gallery here, it's a temporary one I'm working on
    http://www.emiliajozefa.com/a_index.html
    Here are some important parts of my code:
    //initially load these data sets. the function will be called by the links to update components later<script type="text/javascript">
         var intNumPhoto = 0;
         dsGallery = new Spry.Data.XMLDataSet("photofile.xml", "galleries/ride/photo");
         dsNav = new Spry.Data.XMLDataSet("photofile.xml", "galleries/ride");
         function updateSpryComponents(galleryDir){
              alert("updating spry components for " + galleryDir);
              intNumPhoto = 0;
              dsGallery = Spry.Data.XMLDataSet("photofile.xml", "galleries/" + galleryDir + "/photo");
              dsNav = Spry.Data.XMLDataSet("photofile.xml", "galleries/" + galleryDir);
              dsGallery.setCurrentRow(intNumPhoto);
              //document.getElementById('nav').innerHTML='<H1>'+enlarge.inp.value+'</H1>';
              document.getElementById('nav').innerHTML=
              "<span spry:detailregion = 'dsGallery'>
             <a href = 'javascript:' onclick = 'if(intNumPhoto > 0){intNumPhoto -= 1}; dsGallery.setCurrentRow(intNumPhoto);'>&lt;</a> {@id} / </span>
             <span spry:detailregion = 'dsNav'>{@numPhotos}
             <a href = 'javascript:' onclick = 'if(intNumPhoto < ({@numPhotos} - 1)){intNumPhoto += 1; }; dsGallery.setCurrentRow(intNumPhoto);'>&gt;</a>
             </span>";
    </script> <--- later ----><!-- SIDEBAR NAV. When link i clicked, set DataSet to the location of the new gallery -->
         <div id = "sideBarNav">
             <a href = "javascript:" onclick ='updateSpryComponents('ride');">Tannersville</a>
                <br />
              <a href = "javascript:" onclick = "updateSpryComponents('dive');">Dive</a>
            <br />
              <a href = "javascript:" onclick = "updateSpryComponents('poland');">Poland</a>
            <br />
              <a href = "javascript:" onclick = "updateSpryComponents('alaska');">Alaska</a>
        </div>
    </div>
    <div id = "content2">
         <!-- PHOTO CONTAINER I think I somehow need to refresh this section of the code to reload new data-->
         <div id = "fotoContainer" spry:detailregion="dsGallery"><img src = "photos/{@path}" width = "{@width}" height = "{@height}"/></div>
         <!-- IMAGE NAVIGATION -->
         <div id = "nav">       
             <span spry:detailregion = "dsGallery" id = "galSpan">
             <a href = "javascript:" onclick = "if(intNumPhoto > 0){intNumPhoto -= 1}; dsGallery.setCurrentRow(intNumPhoto);">&lt;</a> {@id} / </span>
             <span spry:detailregion = "dsNav" id = "navSpan">{@numPhotos}
             <a href = "javascript:" onclick = "if(intNumPhoto < ({@numPhotos} - 1)){intNumPhoto += 1; }; dsGallery.setCurrentRow(intNumPhoto);">&gt;</a>
             </span>
         </div>
    You could view source there to get the code. Here is what I believe is my problem
    I'm trying to automate the site so that when you click on one of the links on the left, without refreshing the page, the paths to the galleries xml file changes, and the spry Detail Regions (1 for the images, 1 for the navigation - left and right arrows). I think the problem is that once the link changes the set and calls my updateSpryComponenets() function, the detail regions need to be refreshed. I'm currently trying to solve this by dynamically rewriting the HTML thru .innterHTML, everytime I call updateSpryComponents().There may also be a problem in the Javascript function updateSpryControllers because if I put the alert after the spry calls, I never get the alert
    Thanks in advance for any help!

    Update:
    Ok, the first query on the Recent tab doesnt work for me because it wont show unless its already voted, and since these are supposed to be new blurts, that kind of breaks the whole site:
    "SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt Group By Id_blurt ORDER BY Blurt.`Date` DESC";
    So I replaced it with what I originally had.
    "SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date FROM Blurt ORDER BY Blurt.`Date` DESC";
    But this doesn't provide me with the initial average rating:(

  • Help with flex4unit ant build.xml: Socket timeout waiting for flexunit report

    I'm having trouble setting up ant to build and test my project locally and I'm not sure what the next step is.
    Info:
    Running on XP/Cygwin.
    All of the files that FlexUnit4 references when used in Flash Builder are in my '${basename}/libs' folder (eg FlexUnit4_1.0.swc).
    I've placed the flexunit4 task in my ant/libs folder.
    I'm getting two errors...
    I don't think I've set up the 'socket' stuff right for the tests. It just sits and waits then dies...
    [flexunit] Waiting for client connection ...
    (about a minute later)
    [flexunit] Stopping server ...
    [flexunit] End of test data reached, sending acknowledgement to player ...
    [flexunit] Closing client connection ...
    [flexunit] Closing server on port [1024] ...
    BUILD FAILED
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    Plus this is the error I get from the flash player:
    ReferenceError: Error #1065: Variable mx.skins.spark::BorderSkin is not defined.
    I don't know why it's complaining about Borderskin as I think I have included all the flex4 libs I could find. I suspect this second error is causing the first error?
    Any help appreciated. I think I'm just setting it up all wrong.
    Screencap of errors:
    http://twitpic.com/l7ay8
    build.xml:
    http://gist.github.com/20804

    Finally got everything working using the files from the CI Example which what i probably should have done in the first place.
    So a rough guide for anyone just starting out with this:
    Download the Flex 4 'workspace' from the digital primates hudson server . This appears to contain flexunit library and examples in various stages of development.
    I used Flex Builder 4 Beta 2 to set up my Test Suite and Test Cases.
    I then loaded the libs folder from:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject
    into my flex project's libs folder:
    this includes:
    FlexUnit4.swc
    FlexUnit4CIListener.swc
    flexUnit4UIRunner.swc
    flexTasks.jar
    flexUnitTasks.jar
    I didn't need to remove the FlexUnit4 stuff that is 'referenced' automatically by flash builder when you start adding flexunit4 tests/suites.
    Then I used a modified version of the TestRunner.mxml found in:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject\src\test\flex
    The lines to pay attention to are the ones that look like:
    static public function currentRunTestSuite():Array {
        var testsToRun:Array = new Array();
        testsToRun.push(packagename.TestSuiteName);
        testsToRun.push(packagename.TestClassName);
        return testsToRun;
    Just make sure you update this list to include all of the test suites &/or individual tests you want to run.
    I made this a static function and modified the code in the "FlexUnitApplication.mxml" file to use this function so i'd only need to update one list of suites/tests.
    FlexUnitApplication.mxml is generated automatically when you run FlexUnit4 tests in the Flash Builder 4 Beta 2 IDE.
    This is the build.xml file I'm using in the project:
    http://gist.github.com/208211
    Change the name of the project from "Flare" to whatever and adjust the other path settings where required (though you might want to write this from scratch at least once so you understand roughly what is going on).
    The Debug Flash Player must be installed on the server otherwise you'll get a:
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    ...while it waits for the non-existant debugger to attach. (This is obvious but I did forget and was a bit bewildered for a moment)
    Need to also ensure the environment variable:FLEX_HOME is set to the location you installed the flex sdk...by editing your .bashrc setting the environment variable the in the Hudson Configuration.
    You'll need to point Hudson at your ant installation and your jdk installation. If you downloaded he sdk, be aware you might need to point it to the jdk folder inside the place you installed the sdk.
    And I think that's all the problems I had. Hope it's useful to someone... if anyone who actually knows what they are doing can point out any potential issues/better ways of doing things, feel free to comment.
    Thanks to Brian (legrosb) and Mike (mlabriola) for their assistance!

  • Help with Flex Ant build.xml error

    So I've started on a new project and I'm new to Flex. A lot of learning curve here. Anyway, I'm trying to deploy a project that uses flex and is built with Ant. We've moving up from a version of Flex 2 to Flex 3. The build file works fine in the Flex 2 app but for some reason does not seem to be working with Flex 3. I'm hoping someone can give me some insight on what might be wrong or where to start.
    The error is Command not found: compc
    The part of the build file it has a problem with is:
    <compc include-classes="${classes}"
         ouput="${flex.dist.dir}/${flex.app.name}.swc"
         keep-generated-actionscript="false"
         headless-server="${headless.server}"
         incremental="true">
    <load_config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
    <source-path path-element="${FLEX_HOME}/frameworks" />
    <source-path path-element="${flex.app.root}" />
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
         <include name="libs" />
         <include name="../bundles/{local}" />
    </compiler.library-path>
    <compiler.library-path dir="${flex.app.root}" appent="true">
         <include name="libs" />
    </compiler.library-path>
    </compc>
    Any help at all would be greatly appreciated, thank you.

    Sorry, I meant to address that. Yes, since we've moved up to the Flex 3 sdk, we are pointing at a new directory. The old directory was flex_sdk and the new directory is flex_sdk_340.
    FLEX_HOME is being set in the build.properties file for local building and then overidden in the build.xml file with this code:
    <target name="build">
         <available property="FLEX_HOME" value="/apps/flex_sdk_340" file="/apps/flex_sdk_340" />
         <echo>FLEX_HOME = ${FLEX_HOME}</echo>
         <antcall target="compile" />
    </target>
    I did notice a warning about not using the available property, so I removed it and just changed what FLEX_HOME was set to in the build.properties file to the server directory. Would mess up local building but regardless it didn't matter because it had no effect on the error being generated. I alos looked a little into the file property of the available tag trying to figure out if that was somehow an issue but I wasn't able to come to any conclusion.
    Before the program errors out, it does displayt he echo statement and the value of FLEX_HOME appears to be correct in that it does show /apps/flex_sdk_340.
    Thank you so much for your continued help. This is truly frustrating because nothing but a directory name has really changed and yet it stopped working. I can't find any information anywhere on what could be wrong and this is really my last resort.

  • Need help with Link passed from XML

    This is to create a flash driven navigation menu. What I have
    is a coldfusion page that serves a simple XML formatted page. There
    are 3 XML components, linkLabel, linkURL and linkType. The label
    just passes text, the type is just a number 0-9 that is used to
    determine the style of the button. The linkURL that is passed from
    coldfusion comes across encoded for XML, so what I end up with is
    url's that replace "&" with ";amp;".
    So my question is this, is there an easy way in the
    actionscript to replace the ";amp;" with "&"? Other than that
    little problem, the rest of the script runs just fine, I just can't
    seem to find the syntax I'm looking for to replace items in a
    string. I saw the code for replacesel() but this doesn't seem to do
    it, unless i'm writing it wrong.

    Just in case you want something similar in future:
    string = string.split("&amp;").join("&");
    is an easy way to replace something in a string (here
    '&amp;' gets replaced with '&').
    greets,
    blemmo

  • Help with java.util.logging SocketHandler - Simple TCP Server

    I have a simple TCP serverString clientSentence;
                 ServerSocket welcomeSocket = new ServerSocket(5050);
                 while(true) {
                    Socket connectionSocket = welcomeSocket.accept();
                    BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
                    while ((clientSentence = inFromClient.readLine()) != null) {
                         System.out.println("Received: " + clientSentence);
                 }And I have a java.util.logging logger using a SocketHandler. I'm just calling logger.log("my message"); I get the expected result to System.out: "my message". But when I go on to call again logger.log("my next message") I get both messages in queue: "my message" and "my next message" on the next line. So, I get from these two calls to logger.log() the following result in System.out
    my message
    my message
    my next message...whereas I expected
    my message
    my next messageWhy is "my message" being saved even after being passed through the TCP connection to the server? I tried handler.flush() but that doesn't help. Pretty sure the problem isn't at the server end because when I create two loggers with their own SocketHandlers the server doesn't double up on their messages. (In other words, if I let one logger say simply "my message" and the second logger say "my next message" I get the expected output. It's like each logger needs to be flushed after sending to the server.
    Any advice appreciated.

    Yes, I was just rereading your post and it's apparent that you were suspecting the client code. Your posting only the server led me to believe that you were focusing on that and I kind of skipped over the last part.
    So to answer your question, yes, the server code looks okay. And you were suspecting the client anyway, so problem solved.

  • Help with ABAP PLEASE

    Dear BW Experts,
    When we run this ABC quarter report,  it returns values of 12 months of actuals, 12 months of forecast, and quarter one, two, three and four results. Where the quarter 1, 2, 3, 4 is to add 3 months of actuals and 3 months of forecast.
    Usually depending on the forecast version you enter, like for eg. for forecast version F04, the report returns, 4 months of actuals with values and rest of the 8 months 0 value, and for Forecast values it returns 4 months of 0 value and 8 months of forecast. From this, results, the Q1 result would be = 3 months of actuals (Jan, feb, mar) + 3 months of Forecast (Jan, feb, mar).
    Since the 3 months of forecast (Jan, feb, mar) is 0, it should add up the 3 months of actuals (Jan, feb, mar).
    The following is the code we have currently, and the ABAP resource gave us the following but it's not working, it only returns the first month January's values when i use this variable, however we are not able to point out where the concern is...I was hoping if you could help please. My background in ABAP is very limited, so any suggestions you have would be appreciated.
    WHEN 'ZPOPERQ1'.
        IF I_STEP = 2.
          CLEAR L_S_RANGE.
          LOOP AT i_t_var_range INTO loc_var_range
               WHERE vnam = 'ZPROJVER' or vnam = 'ZFORVERS'.
            if loc_var_range-low+1(2) = '01'.
                l_s_range-low = '000'.
                l_s_range-high = '000'.
            else.
                l_s_range-low = '001'.
                if loc_var_range-low+1(2) = '02'.
                    l_s_range-high = '001'.
                elseif loc_var_range-low+1(2) = '03'.
                    l_s_range-high = '002'.
                else.
                    l_s_range-high = '003'.
                endif.
            endif.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            APPEND l_s_range TO e_t_range.
          endloop.
        ENDIF.

    Hi Edwin,
    i changed the variable to what you suggested then saved and activated the zxrsru01. I then ran the report, which aborts with the following message...
    "ABORT ERROR FOR VARIABLE IN CUSTOMER ENHANCEMENT ZPOPERQ1"
    Can you please suggest if there is anything else that needs to be changed.
    Thank you...

  • Help with XQueriyng an AWS XML file

    --Oracle Database 11g Express Edition Release 11.2.0.2.0 - Beta
    I am trying to query an XML file returned from Amazon AWS. I'm learning this slowly, and i think examples would really help . I'm reading and looking through the documentation " [Using XQuery with Oracle XML DB|http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm] ".
    I made an batch of 2 ItemLookup requests to AWS, which returned one item for the first lookup, and two for the second, which i think is a good example. I used a bogus account id (it's used for tracking) and a key pair which i deleted after using it, so it is the actual reply. It is too large to be passed as a literal, so i put it on pastebin. It shows a valid request. There are two levels of validity, one is no error, the other IsValid. Had there been an error, like a missing parameter, the following would be between the </Arguments> and <RequestProcessingTime> tags:
        <Errors>
          <Error>
            <Code>AWS.MissingParameters</Code>
            <Message>Your request is missing required parameters. Required parameters include ItemId.</Message>
          </Error>
        </Errors>Meaning, first the XML document must be checked for the Errors tag; second, the IsValid element must be True; third, actual data can be perused. The Errors tag mean there may be multiple errors. The IsValid is per Items (not Item). Then individual details may be grabbed, such as ListPrice.
    I'm guessing XQuery is the right way to go here, using XMLTABLE to create records to be queried. Here is what i have so far:
    SELECT
    FROM
         XMLTABLE
          XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
          '/ItemLookupResponse/OperationRequest/Errors/Error,
         for $Error in /ItemLookupResponse/OperationRequest/Errors/Error
           return
              <Error>
               $Error/Code,
               $Error/Message
              </Error>,
          for $Item in /ItemLookupResponse/Items
           return
              <Item>
               $Item/Request/IsValid
              </Item>'
          PASSING
              (code to get XML document: e.g. ItemLookup('036500101794', 'UPC', 'OfficeProducts', '5011363525517', 'EAN', 'Toys'))
          COLUMNS
              Id FOR ORDINALITY,
              Error_Code     VARCHAR2(10) PATH 'Code',
              Error_Message     VARCHAR2(10) PATH 'Message',
              IsValid          VARCHAR2(05) PATH 'IsValid'
         );Of which the response is:
            ID ERROR_CODE ERROR_MESS ISVAL
             1                       True
             2                       TrueOstensibly, there are no errors, so the first record is the IsValid element for the first Items tag, and the second for the second. Now, i need to loop inside each Items for all of its Item tags.
    1) Is this a good approach. I ask because this is really my first XQuery.
    2) Is the for loop for Errors good? I am assuming it will only have a record if there is an error.
    3) Do i nest for loops to get each Item in each Items?
    4) How do i know which Items is being used when in the (sub) Item tag?
    I would appreciate any help. It just hasn't "clicked" yet, and i am having a hard time knowing what to do.

    OK, figured it out....The XMLTABLE does the join, so the FULL JOIN is simply not required:
    Making the final code:
         WITH
              XML(Document)
         AS
               SELECT
                   Amazon_PAPI.Get_Response(Amazon_PAPI.ItemLookup('036500101794', 'UPC', 'OfficeProducts', '5011363525517', 'EAN', 'Toys'))
               FROM
                   Dual
         SELECT
              Items.Id,
              Items.Code,
              Items.Message,
              Items.Isvalid,
              Item.Id Item_Id,
              Item.ASIN
         FROM
              XMLTABLE
               XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
               '/ItemLookupResponse/OperationRequest/Errors/Error
               | /ItemLookupResponse/Items'
               PASSING
                   (SELECT Document FROM XML)
               COLUMNS
                    Id          FOR ORDINALITY,
                   Code          VARCHAR2(0050)     PATH 'Code',
                   Message          VARCHAR2(4000)     PATH 'Message',
                   IsValid          VARCHAR2(005)     PATH 'Request/IsValid',
                   Item          XMLTYPE          PATH 'Item'
              ) Items
         LEFT JOIN
              XMLTABLE
               XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
               '/Item'
               PASSING
                   Items.Item
               COLUMNS
                   Id                    FOR ORDINALITY,
                   ASIN                    VARCHAR2(0010)     PATH 'ASIN'
              ) Item
          ON
              1 = 1
         ORDER BY
              Items.Id,
              Item.Id;With the result, when successful:
            ID CODE                                     MESSAGE                                            ISVAL    ITEM_ID ASIN
             1                                                                                             True       1 B004WL0L9S
             2                                                                                             True       1 B0042ET8OO
             2                                                                                             True       2 B00004TQMQAnd when not successful:
            ID CODE                                     MESSAGE                                            ISVAL    ITEM_ID ASIN
             1 AWS.InvalidEnumeratedParameter           The value you specified for IdType is invalid.
                                                        Valid values include ['ASIN', 'SKU',
                                                        'UPC', 'EAN','ISBN'].
             2 AWS.RestrictedParameterValueCombination  Your request contained a restricted parameter
                                                        combination.  When IdType equals UPCa, SearchIndex
                                                        cannot be present.Still looking to test a no-error IsValid = False case though. :)

  • Need help with ABAP coding using java

    Dear experts,
    I have used ABAP to code many reports/function modules.However as i know java quite well,i want to achieve the same using java.I have utilized JCO to retrieve information from RFC in this mission.
    However i realized that i had to code all things using ABAP and use java only as interface to connect to
    SAP fetch that module and display information on console.It was not that fun.
    I want that i should not Login to SAP but work only using java.
    I heard SAP Netweaver is a good choice.But i dont know much about it.Will i be able to develop reports only by java and how ?
    Plz suggest.

    hi,
    I hope that you already have the J2ME Toolkit and that your emulator works okay. In the toolkit you get several examples to show you how to program a MIDlet. One has to do with a HTTP client server connection. Also in the API documentation for the J2ME there is a Connector class that you used to set up this communication and in the description of this class it pretty thoroughly explains how to set up an HTTP protocol client.
    However, if you want to do some other kind of networking then you are pretty much out of luck, as the TCPIP socket protocol has not been fully implemented and is optional to the J2ME specifications, only the HTTP protocol is certain to be available. This means that mobile phone companies can add other networking functionality to their phone's java virtual machine if they feel like it. This is a bummer I know.
    I hope this helps.
    Cheers,
    Mark

Maybe you are looking for

  • CProjects - Set-up field control - Usage of conditions

    Hello In cProjects, in set-up field control it is possible to adjust behavior (display, updatable, mandatory, u2026) field by field. My questions are: - Where to find the complete list of conditions available? - Is any condition is usable everywhere,

  • Error Message while doing F-51 (Post with Clearing)

    Hi All, We are getting an error message as  "Consolidated companies " " & 009062 are diff" while executing F-51 (Post with Clearing). While executing F-51 we are using the document type as KG. Can you please let us know the possible reasons for such

  • Need help with JavaScript "Galleria" gallery coding

    I am trying to create a clickable gallery with the filmstrip either on the top or on left hand side for people to click to see my portfolio. I want the first photo to be auto loaded. I downloaded the javascript from; http://galleria.aino.se/ I have t

  • No speaker sound with itunes and media

    The speakers on iphone 4S work fine for all activities with the exception of itunes and video. Speaker phone works; notification works; ringer works. Everything works fine with the earplugs and bluetooth and volume can be adjusted. Speaker works just

  • (New) Fiori Launchpad Logon Screen Configuration possible?

    Hello, the old launchpad used for Fiori Wave 1 apps was very pretty (nice background image; nice formatted logon fields for user name password). For the new Fiori Wave 2 launachpad I just get the following (not nice ;-)) logon fields. Is it possible