Mapping Help Needed - Message or Java UDF

Hello Gurus,
   I have a source structure as below.
Idoc
-group_a (0 to 99999)
--  sub_groupa_1 (0 to 99999)
      sga1_field_1
       sga1_field_2
--  sub_groupa_2
     sga2_field_1
     sga2_field_2
--  sub_groupa_n
     sgan_field_1
     sgan_field_2
-group_n
--  sub_groupn_1
     sgn1_field_1
     sgn1_field_2
--  sub_groupn_2
     sgn2_field_1
     sgn2_field_2
--  sub_groupn_n
     sgnn_field_1
     sgnn_field_2
every group creates an output group (lineitem), that works fine 
now my requirement is as below
a particular output field (per output group) = sum (sub_field_2s) wherever sub_field_1s = first occurence of sub_fld_1 of the corresponding group
I tried different things, but could not get the required results.
pls let me know if my explanation is not clear..
Please help..
thanks
KnowledgeQuest.

Hi,
Please provide your source and target structure...Also, if possible, please provide sample inputs/outputs so that we can visualize your problem correctly.
hope this helps,

Similar Messages

  • Mapping Help Needed

    Hello Gurus,
      I need help in message mapping. I have a requirement as below.
    E1EDP01 segment contains many E1EDP19 segments
    E1EDP19 segment contains QUALF, KTEXT and many other fields.
    in the output field, for every QUALF = "002", I need the value of KTEXT of the same E1EDP19.
    the output group is repeated per E1EDP01 (this is working fine)
    The problem is that KTEXT segment is not coming in every E1EDP19, so the result is erratic.
    the present code looks like
      Qualf (context E1EDP01)--
                                Equals  -- 
                   const-002 --           IF   --Outputfield
               KTEXT(context E1EDP01)--
    I tried many other things as well, but result is not as expected
    pls help.
    Thanks
    KQ

    Hi,
    I am not sure why it is not working in your case. I developed same mapping and it is giving correct result.
    Source Payload:
    <E1EDP19 SEGMENT="">
                <QUALF>002</QUALF>
                <IDTNR/>
                <KTEXT>A</KTEXT>
      </E1EDP19>
      <E1EDP19 SEGMENT="">
                <QUALF>003</QUALF>
                <IDTNR/>
      </E1EDP19>
      <E1EDP19 SEGMENT="">
                <QUALF>003</QUALF>
      </E1EDP19>
    <E1EDP19 SEGMENT="">
                <QUALF>002</QUALF>
                <IDTNR/>
                <KTEXT>SDN</KTEXT>
      </E1EDP19>
    Target field gets value as "SDN".
    Is this your requirement?
    Answers to your questions:
    1) the context cannot be E1EDP19, cos there are multiple P19 segments in P01 and it should be done on P01, as the output is based on per P01.
    Even if you are creating target based on line item level (E1EDP01), every E1EDP01 segment will have E1EDP19 and KTEXT with QUALF = 002. Also KTEXT of same E1EDP01 should go to target. Hence in your mapping context should be at E1EDP19 level.
    2) the Qualf comes more number of times than KTEXT, so they are not "matching" at context level.
    Map with default function will take care of this.
    -Gouri

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi,
    Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
    I have seen the Documents. But i couldn't able to understand it correctly.
    I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
    Is that possible to Create a Java class in the oracle Database itself ?.
    Where are the files located for the existing Java Class ?..
    Help Needed Please.
    Thanks,
    Murali.v

    Hi Murali,
    Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
    Configure deployment to a database to upload the java file instead of class
    The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
    Hope this helps,
    Sunil..

  • Message mapping help needed

    I am trying to map target based on a condition. Meaning I want to map E1EDKA2(1..99999) of DESAD01 Idoc to ShipTo(0..1) node if E1EDKA2-PARVW = WE.
    I tried all the variations with creatIf and formatByExample but I couldn't able to get it working.
    Here is the target XML structure
    <Delivery>
       <Header>
           <ShipmentNumber>1234</ShipmentNumber>
           <BOLNumber>ABDC</BOLNumber>
           <ShipTo>
                <Name>XYZ</Name>
           </ShipTo>
           <SoldTo>
                <Name>XYZ</Name>
           </SoldTo>
       </Header>
       <LineItems>
        </LineItems>
    </Delivery> 
    Thanks
    Suman

    Hi Sarvesh,
    I don't know what is the significance of checking 1 = 1. Anyway I could able to resolve the issue by my self. Thank you very much for taking time to help me.
    /ns0:MT_XML_Delivery/Delivery/Header/ShipmentNumber=/DESADV01/IDOC/E1EDK07/VBELN
    /ns0:MT_XML_Delivery/Delivery/Header/BOLNumber=/DESADV01/IDOC/E1EDK07/BOLNR
    /ns0:MT_XML_Delivery/Delivery/Header/ShipTo=createIf(stringEquals(/DESADV01/IDOC/*E1EDK08*/E1EDKA2/PARVW, const(value=WE)))
    /ns0:MT_XML_Delivery/Delivery/Header/ShipTo/Name=replaceString(/DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW, /DESADV01/IDOC/E1EDK08/E1EDKA2/PARVW, /DESADV01/IDOC/E1EDK08/E1EDKA2/NAME1)
    /ns0:MT_XML_Delivery/Delivery/Header/ShipTo/AccountNumber=/DESADV01/IDOC/E1EDK08/E1EDKA2/PARTN
    XI/PI is really strange. It needs to have that PRVW in the first field mapping, even though it is not being used. I just replaced PARVW with the NAME1 and mapped to name. For the ShipTo, I set E1EDK08 (next higher level structure) as the context.
    I think it will take time for me to learn this, as I come from webMethods and XSLT background.
    Thanks
    Suman

  • Help needed in SAP Java- Print option

    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    I call the two queries for different web items in the web template. I want a report to print them at once using the print structure in my previous message. If more information is needed please reply

  • ABAP MAPPING:Help needed

    Hi Friends,
    I have a scenario where I need to pick up  Idocs out of a packet of Idocs .The Idocs will be picked by checking for a certain condition for the Idoc Segement and of all the Idocs the Idocs which satisfy a particular condition should only be output and for this I have been asked to achieve this using ABAP Mapping.So any info in this regard would be of great help for me.
    Packet of Idocs----
    >  Idocs satisfying the cond.
      (sender)*********(Check for a condition)*****(Receiver)
    Please do provide with me a sample coding if possible.Please take up this with some priority.
    Thanks & Regards,
    Pradeep.

    Hi All,
    The output from the ABAP class needs to be transformed into a different message using Graphical Mapping .
    Please provide me some inputs for creating this ABAP mapping.
    Thanks & Regards,
    Pradeep.

  • Help needed with Sun Java Studio Creator and EJB in a Portlet Project

    Hi
    I have created an web-application with JSF in Sun Java Studio Creator 2. The web application uses a lot of EJB's which acts as the dataProviders. In a typical jsp page i have more that one data providers(the EJB's) getting used. When i run the project everything opens up properly in the browser and the application seems to be fine.
    But when i create a JSP 168 Portlet project and do exactly the same thing for some reason the Apache Pluto(comes as the default Portlet Container with Studio Creator) conks off.
    Then i started going ahead step by step:
    1. First i created a portletpage and added only one dataProvider(EJB) and ran the project...It gets deployed properly in Pluto and the browser comes up and everything shows up fine.
    2. Just to re-confirm i did the same thing with another dataProvider(EJB). So still we have just 1 EJB in the portlet page. As expected it also worked fiine.
    3. Then when I added more that one dataProviders(EJBs) in the porlet page the Apache Pluto conks off(saying that Pluto is not available)
    I tried doing a lot of things but nothing works...Surprisingly the same thing works when u create a JSF web Application project but the same thing does not work when u create a JSR 168 JSF Portlet Project...
    Did anybody face the same problem..Is it a bug in the Studio Creator...Any help would be highly appreciated.

    Hi,
    There are a few discussion threads in the feedbackprograms portal for Creator 2 EA 2. The URL is:
    https://feedbackprograms.sun.com/login.html
    In the EA discussion forum you will find threads which discuss the concerned topic. In specific look for threads titled:
    # Deploying Portlets
    # Taking a JSC Portlet to Tomcat creates a Faces Mapping Error
    # Problem with Pluto when trying to deploy a portlet
    # Request: JSR-168 Portlet Project without JSF
    We kindly request you to post your further queries related to EA in the above mentioned forum.
    Cheers
    Giri

  • Graphical mess-mapping help needed: select single segment from many

    Hi All,
    I am sending a standard PO IDOC from R/3  and converting it into a file before sending to 3rd party.
    The IDOC used is ORDERS.
    In this IDOC segment E1EDK14 gets repeated in R/3 and I want to use the value of 009th occurance (E1EDK14 009) to map my values.
    When I look at XML, it looks as follows
    <E1EDK14 SEGMENT="1">
             <QUALF>014</QUALF>
             <ORGID>AB1</ORGID>
          </E1EDK14>
          <E1EDK14 SEGMENT="1">
             <QUALF>009</QUALF>
             <ORGID>CD1</ORGID>
          </E1EDK14>
          <E1EDK14 SEGMENT="1">
             <QUALF>013</QUALF>
             <ORGID>AA</ORGID>
          </E1EDK14>
          <E1EDK14 SEGMENT="1">
             <QUALF>011</QUALF>
             <ORGID>GDE</ORGID>
          </E1EDK14>
    I need to get the ORGID value of 009th segment( i.e when QUALF (above) has value '009'.
    I tried to put a simple if condition in mapping (if qualf = 009-->then get ORGID), but it does not work.
    Can you help.
    Many thanks
    Shirin

    Thanks Prakasu,
    I tried it again, but it is picking the first segment value and not the 009th one.
    Many thanks
    Shirin
    Edited by: Shirin K on Oct 24, 2008 10:56 AM
    Edited by: Shirin K on Oct 24, 2008 11:00 AM

  • Value Mapping -- Help needed.

    Hi experts,
    I have a scenario ,
    I have 2 fields in my source structure and based on these two fields,i need to fetch 8 field values from a table to map into idoc control record.
    The table might be in SAP or in Legacy
    If it is a Ztable in SAP, how can I achieve this?
    If it is in Legacay , how can I achieve this?
    My client told us to do this through Value mapping?
    Please help me in acheiving this.
    Thanks in advance.
    Regards
    Krupa.

    Hi,
    Use the RFC Lookup API to call an RFC from the mapping and get the values from the Table in the R3 system . Look into this document by Michal to understand RFC lookup,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Else, use value mapping as shown in this blog,
    /people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
    Regards
    Bhavesh

  • Help Needed With A Java Installation

    Hello,
    I'm beyond being a novice with regards to Java. To be quite honest, I don't have the time right now to learn the language, nor do I have the need for anything other than what I am about to ask. I say this upfront to avoid unfriendly comments from people who may criticize my "laziness", NOT to sound disrespectful to those who post or answer questions in this forum.
    With that said, here's my question...
    I have a Sun/Cobalt RaQ4i server. I'd like to run a few free license Java games that I found on a website. The problem is, RaQ appliances do not ship with Java installed. I've been looking for some way to get it on my server for a few days now, with little luck. I've searched the Java help forums, the Sun/Cobalt forums and a few other help sites such as www.raqzone.com. (...which is why laziness is in quotes up there.) I did find this page... "http://developer.cobalt.com/java/java.raq.php". I have now installed both, the package and the update, on the server. However, the applet still does not run. I don't need the JSP feature, as my site is done in ASP. I don't know what a servlet is, but thought it might be similar to an applet, and would do the trick. *?* Apparently, I was wrong. Can ANYONE tell me what I need to do to get the desired results when I try to run a Java applet on my Cobalt RaQ?? I'd also be willing to be a fee to have it installed... correctly, of course! :)
    Thanks in advance for any directions or guidance,
    -Daniel
    [email protected]

    Assuming you're running Solaris, you can download the Java Runtime Environment (JRE) from http://java.sun.com/
    One of the provided programs is appletviewer, which you will be able to use to run applets if they are on your local machine. I'm not entirely sure about Solaris, but the JRE may also install the Java Plugin to your browser so you can view applets in the browser.
    Apologies if this was already mentioned in the link you provided - registration/login is required, so I didn't read it.
    I hope you have more luck with your applets,
    -Troy

  • Help Needed on a java program

    I am very new to java and our teacher has given us a program
    that i am having quite a bit of trouble with. I was wondering if anyone could help me out.
    This is the program which i have bolded.
    {You will write a Java class to play the TicTacToe game. This program will have at least two data members, one for the status of the board and one to keep track of whose turn it is. All data members must be private. You will create a user interface that allows client code to play the game.
    The user interface must include:
    � Boolean xPlay(int num) which allows x to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    � Boolean oPlay(int num) which allows o to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    � Boolean isEmpty(int num) will check to see if the square labeled by num is empty.
    � Void display() which displays the current game status to the screen.
    � Char whoWon() which will return X, O, or C depending on the outcome of the game.
    � You must not allow the same player to play twice in a row. Should the client code attempt to, xPlay or oPlay should print an error and do nothing else.
    � Also calling whoWon when the game is not over should produce an error message and return a character other than X, O, or C.
    � Client code for the moment is up to you. Assume you have two human players that can enter the number of the square in which they want to play.
    Verifying user input WILL be done by the client code.}

    This is the program which i have bolded.Hmmm, that doesn't look like any programming language I've ever seen. I guess you have the wrong forum here, because it isn't Java.
    That looks like a natural-language programming language that directly understands a homework assignment. Either that, or you really did just post the assignment. You wouldn't have done that though, right?

  • Help needed with operating java on other programs

    I have a fairly difficult (I think) question.
    I am trying to create a program to enact itself on other programs.
    It needs to perform 4 functions.
    1) Open an exe (such as notepad)
    2) Use the exe to open another file (such as a .txt)
    3) Find the color of a specific pixel on the screen (ie, (300,800)) and
    4) Pull a number from a field in the program
    I would apprieciate any help on this, whether in the form of an answer, or a url that could help me with it.
    thanks

    you could try shell commands to the dos prompt like:
    try {
         Properties systemProps = System.getProperties();
         String osVersion = systemProps.getProperty("os.name");
         if (osVersion.equals("Windows 98"))     {               
              Runtime.getRuntime().exec("start \"notepad"");
         else if (osVersion.equals("Windows 95"))     {               
              Runtime.getRuntime().exec("start \"notepad"");
         else {  // win nt (2000 or xp)
              Runtime.getRuntime().exec("cmd.exe /c notepad");
         }catch(IOException err) {}Or locate the notepad.exe and use the runtime class to launch it, to open a txt file is exactly the same but substitute the txt file name instead of notepad, that should launch notepad and open the txt in it, if you mean open notepad and then control it and open a file, that java can?t do, need another language to do it or work with another language and java together. Not sure about the rest,

  • Help needed with JNI -  java.lang.UnsatisfiedLinkError

    I need some help with JNI. I am running on Sun Solaris 7 using their CC compiler. I wrote a simple java program that calls a native method to get a pid. Everything work until I use cout or cerr. Can anyone help? Below is what I am working with.
    Note: The application works. The problem is when the C++ code tries to display text output.
    My error log is as follows:
    java Pid
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/dew/test/libPid.so: ld.so.1: /usr/j2se/bin/../bin/sparc/native_threads/java: fatal: relocation error: file /home/dew/test/libPid.so: symbol __1cDstdEcerr_: referenced symbol not found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at Pid.<clinit>(Pid.java:5)
    Pid.java
    ========
    * Pid: Obtains the pid from the jvm.
    class Pid {
    static { System.loadLibrary("Pid"); }
    public native int getPid();
    public static void main(String args[])
    System.out.println("Before construction of Pid");
    Pid z = new Pid();
    System.out.println(z.getPid());
    z = null;
    Pid.cpp
    =========
    * Native method that obtains and returns the processid.
    #include "Pid.h"
    #include "unistd.h"
    #include <iostream.h>
    JNIEXPORT jint JNICALL Java_Pid_getPid(JNIEnv *env, jobject obj) {
    /* cout << "Getting pid\n"; */
    cerr << "Getting pid\n";
    /* printf("Getting pid\n"); */
    return getpid();

    I forgot to include my build information.
    JAVA_HOME = /usr/j2se/
    LD_LIBRARY_PATH = ./:/opt/readline/lib:/opt/termcap/lib:/usr/bxpro/xcessory/lib:/${JAVA_HOME}/lib:/usr/RogueWave/workspaces/SOLARIS7/SUNPRO50/0d/lib:/usr/RogueWave/workspaces/SOLARIS7/SUNPRO50/3d/lib:/usr/sybase/lib
    javac Pid.java
    javah Pid
    CC -G -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris Pid.cpp -o libPid.so
    Thanks again,
    Don

  • Books & Tools: Help needed for Begining Java....

    Hi,
    I am a Computer science Graduate & working. I am new to Java but not Programming. I have some knowledge on OOPS concepts, .Net, Java, C# & web development.
    I need Help To pick the Best Book/Books that can make me comfortable in programming Java & Understanding whole Java concept.
    I followed many books but found they are not following the Right approach.
    I would appreciate if someone can suggest me a Complete Book/Books, which you think have helped.
    Thanks.

    This is the starter set:
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com . A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoritative than this.

  • Help needed to pass Java 2 1.2 SCJP, please

    I took the programmers exam (1.2) two weeks ago, I scored 57%. Though a respectable score, I was still gutted.
    So now I am re-revising at the moment, trying to improve where I can.
    Just wondered what anyone would recommend with the revision I should do just to improve things some more?
    I feel a little dispondant at this time, so a little bit of advice will help me bounce back, bigger & better.
    Thanks to everyone has helped me here at this forum, you are great, thanks, Dave.

    I believe that it is possible to pass SCJP with a very high score.The books I studied helped me pass SCJP with a fairly high score, even with limited experience.
    Based on my experience, I would suggest the following approach:
    1. Learn the basics, make sure you can do simple stuff with Java. Make sure you can write a simple program easily--without having to spend a lot of time looking up, for example, how to declare a "main" method in an application. From your post, I'm guessing you may have already achieved this, but if you're still having trouble with the most basic stuff, you might want to get a hold of some good tutorials. There are some online on java.sun.com, and there are a number of excellent books. I used Just Java, by Peter van der Linden. If an updated version of the book is available, it's very useful.
    2. Once you've achieved step 1, Get a good exam study guide. I used Complete Java 2 Certification Study Guide published by Sybex. This will help know specific topics will appear on the exam. More importantly, it will help you learn those specific topics in the depth required to earn a high score on the exam. This kind of book will also give you sample exam questions. Make sure you know the answers to all of the questions and that you know why those answers are correct.
    3. I also found the Coriolis Exam Cram to be quite helpful. Once you know the exam topics in detail, this book will help you cram the core information you'll need to know. It also provides more sample questions. Study them carefull. Finally, it provides a single foldout cardboard sheet containing stuff to memorize for the exam.
    I followed essentially the plan I've suggested, and it got me a score of 81%. You can do it too. In fact, you can probably beat me handily, if you don't forget (as I did) to study the "java.io" package!
    I believe certification is well-worth the effort for those of us who are learning Java. No, I don't have hundreds of employers beating down my door now that I'm certified, but as I continue learning to use Java effectively, I'm able to move ahead confident in my knowledge of basics like constructors, arrays, Strings and what-not.
    Go for it!
    Don't give up!

Maybe you are looking for

  • Mid 2010 macbook pro recall?

    details: Macbook Pro Mid 2010 15 inch Serial Number: W8****AGW Keeps crashing and showing black screen and restarts unexpectedly whilst doing any thing with  MS office and other apps How I can find whether my macbook pro is under Callback option Is t

  • Oracle rac templates 11g R2 buildcluster.sh error

    Hi All, am facing below error, while creating oracle rac templates. kindly let us know how to resolve below error. ===error========================= Oracle RAC 11gR2 OneCommand (v1.2) for Oracle VM - (c) 2010-2011 Oracle Corporation    Cksum: [117022

  • How to update 2 datagrids in 2 different app at the same time?

    I'm very new to flex/flash builder and my question is: first I have to explain how the applications works. The first applications have a form for a customer to fill and datagrid to show the results.The data is send using PHP to a database in the serv

  • Workflow using LR & PS together for sharpening

    I use LR 3.3 as my default image organizer and processor. But sometimes I  want to go into PS to use the tools there (I use CS4). Let's say I want to make a  high quality JPG from a RAW file that resides within the LR catalog.  I've started with some

  • Has anyone figured out how to fix pixellating display issues Mavericks

    Hi everyone, I have been getting pixellated blocks, corrupted dialog boxes, 'snow' icons etc after upgrading to Mavericks... I have a mid 2010 27" iMac and have recently been getting the glitching graphics... looking at other posts, they seem to focu