Help Required for XSLT mapping

Hi Folks,
I am working on a scenario, where we had 17 different one to one mapping with same source strcture but different target structures. Source is a Idoc common for everyone.
Sample Target Structure :
Message Type(XYZ)
                 RECORDS(0,u)
                                         A(0,1)
                                         B(0,1)
                                         C(0,1)
                                         D(0,1)
As per our requirement we need the output in which we need to have "GLOBE " at the top and the value of A, B, C and D on single row for each ouurance of RECORD. For 2nd occurance we need to change the line and 2 nd set of ABCD on 2nd row and so on. e.g.
GLOBE
0002044452KNA1 0000027079 0001E
0002044452KNA1 0000027080 0001E
0002044452KNA1 0000027080 0001E
To acheive the above output we are using a XSLT map after Message Mapping
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" encoding="UTF-8" omit-xml-declaration="yes"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">GLOBE<xsl:text>&#xD;&#xA;</xsl:text>
<xsl:for-each select="//RECORDS">
  <xsl:for-each select="*">
     <xsl:value-of select="current()"/>
  </xsl:for-each><xsl:text>&#xD;&#xA;</xsl:text></xsl:for-each>
</xsl:template>
</xsl:stylesheet>
NOW WE HAVE changed the 17 one to one maps to one multi mapping (1:17) as our source is same.
Now as the output of this multi mapping is getting into XSL code, it is not able to parse it.
How can we do the changes in this particular code So that we can Achieve:                     17 different file out of single multi mapping and XSL map like it was comming previously from 17 different maps.
Thanks
Pradeep

Hi Pradeep,
Depending on how you setup your multi mapping, when you execute you will end up with something like this as the xml output:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
  <ns0:Message1>
    <XYZ></XYZ>
    <XYZ></XYZ>
  </ns0:Message1>
</ns0:Messages>
Or this:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
  <ns0:Message1>
    <XYZ></XYZ>
  </ns0:Message1>
  <ns0:Message2>
    <XYZ></XYZ>
  </ns0:Message2>
</ns0:Messages>
The single xml message with the u201CMessagesu201D wrapper is not split into separate messages until it hits one of the adapters in the adapter engine.  Perhaps you can try to adjust the xslt to expect this as input, but the output would still need to be <ns0:Messages>.  That might be what is causing the failure with your current xslt.  Can the flat file conversion in the file adapter?
Thanks,
-Russ

Similar Messages

  • Which tools can use for XSLT mapping?

    which tools can use for XSLT mapping?

    Hi,
    Altova map force tool , u will get it for 1month trial.and later you can create xslt mapping in notepad itself.
    reg,
    avinash M

  • Help required on XSLT Conditional Mapping

    Hi,
    We need help on XSLT mapping in BPEL based on a condition. We are transforming from OAG format to a client specific format. We need to map a single tag (but repetitive) on the left hand side (OAG) to different tags on the right hand side. The same tag on the left hand side repeats with different values. Depending on the value the mapping to the right hand side varies. The left hand side (OAG) looks something like this.
    <PARTNER>
    <PARTNRID>2002</PARTNRID>
    <PARTNRTYPE>Supplier</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">2000 Century Way</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    <PARTNER>
    <PARTNRID>204</PARTNRID>
    <PARTNRTYPE>BillTo</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">90 Fifth Avenue</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    Please note that the tag PARTNER and it's underlying tags appear twice in the XML file.
    Based on the value in the tag PARTNRTYPE, the mapping to the right hand side differs. If the value is 2002, PARTNRID should map to Supplier ID on the right hand side and if the value is 24, PARTNRID should map to BillTo ID on the right hand side. The right hand side should look something like
    <Supplier>
    <SupplierID>2002</SupplierID>
    <Address>2000 Century Way</Address>
    </Supplier>
    <BillTo>
    <BillToID>204</BillToID>
    <Address>90 Fifth Avenue</Address>
    </BillTo>
    Please let us know how to achieve this. Your help is much appreciated. Thanks in advance.
    Thanks,
    Prasanna

    Hi Prasanna ,
    I am not an expert but what about this:
    <SUPPLIERID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
    </SUPPLIERID>
    <BILLTOID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
    </BILLTOID>or
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
        <SUPPLIERID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </SUPPLIERID>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '24'">
        <BILLTOID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </BILLTOID>
      </xsl:when>
    </xsl:choose>Regards Pete

  • Help required for unicode compatibilty

    Dear All,
    We are in a process of analyzing the impact of unicode compatibility for our environment.
    Following is our scenario:
    - ECC6.0 is non unicode systsem
    - Need to buid unicode CRM 7, SCM 7, PI 7.1 and BI7
    - Need to integrate the above systems to non unicode ECC system.
    Our questions are :
    1. Is there any performance consideration when using communication between an Unicode and non-Unicode system?
       Is Unicode - Unicode faster than Unicode - non-Unicode communication performance wise?
    2. Do we face any  technical or functinal problems while trying to integrate
       unicode BI/ NW Java Stack  to non unicode systems.
    3. Do we need to review our sizing estimations due to unicode implemenation?
    5. what will be the storage consumption increase for unicode systems compared to non unicode?
    It would be greatly helpful for me if you can clarify these doubts.
    Thanks and Regards

    Hi,
    1. I think no one has really measured this. I expect a slightly higher requirement for Unicode <--> Non-Unicode interfaces.
    2. Please have a look at SAP Notes 838402, 73606, 975768 and 1358929 for restrictions in Non-Unicode systems. SAP highly recommends to go for Unicode in the whole landscape.
    3. and 5.  If you use the SAP quicksizer (http://service.sap.com/quicksizing), then Unicode is integrated.
    " Please note that the Quick Sizer results include Unicode requirements. For more
    information on additional requirements caused by Unicode, see
    http://service.sap.com/unicode -> Unicode Media Library -> Unicode information on
    specific topics: SAP Business Suite Unicode Hardware Requirements"
    Best regards,
    Nils Buerckel
    SAP AG

  • Seeburger help required for 810 and Dispatch Advice (IDOC type DESADV).

    Hi All,
    1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
    --- Seeburger Workbench
    --- Seeburger Mapping Designer (BIC)
    --- Seeburger Counter and Varaibles
    --- Seeburger AS2 Spoke
    --- Any other Seeburger Component setting required
    I have understand blog for 850 -- /people/rajeshkumar.pasupula/blog/2009/08/05/wanna-implement-seeburger-for-edi-find-the-booster
    2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
    3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
    Regards

    Hi Rickkk,
    1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
    --- Seeburger Workbench
    --- Seeburger Mapping Designer (BIC)
    --- Seeburger Counter and Varaibles
    --- Seeburger AS2 Spoke
    --- Any other Seeburger Component setting required
    For SEEBURGER workbench please go through this blog and navigate the enbebbed links furthur to know about Seeburger workbench too.
    /people/prateek.srivastava3/blog/2009/08/01/seeburger--part-1--the-basics
    2
    2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
    For 810 i think the procedure would be the same but themseeburger mapping program that validates the ANSX 810 would be different.As far as 997is concerned 997 is a functional acknowledgement.Its a genric format that is used to send acknowledgement for any EDI transaction set that has been sent.
    3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
      The logic will be based on the trading partner guidelines which will contain the description of all the semantic and syntactiic description about the segments ,its feilds.we need to consider the guidelines and target side specifications too while mapping.
    Thanks,
    Ram.

  • PCUI 4.0, Search Help Required for New field

    Hi everyone
    I am working in CRM 4.0 Sales Order application
    We created a new field in CRM sales Order in Header level in SAP GUI through EEWB.
    The search help for the new field is working fine in SAP GUI. We want to add the same field with F4 help functionaliity in PCUI as well.
    The field has been added in structure CRMT_BSP_SLS_OD1_General. It also shows domain value for the field however Origin of input field ie empty
    The field has been added in PCUI and is successfully showing data inputted in SAPGUI
    However we need search help functionality for the field
    i tried these two steps
    1) i checked on domain value checkbox and changed the field from input to dropdown. However the dropdown is empty in PCUI. Whenever i check box domain values for some field then all the possible values in SPA GUI are displayed in PCUI, however this is not working here.
    2) I put Value_table in F4 of the field
    This is also throwing up empty values
    Am i missing something in this case
    Please let me know how to go about it
    TIA
    Asad

    Hi Frederic
    Thanks for your response
    I am not sure what is meant by regenerating the field group in this case
    I added the entries for my view in the field group and generated the layout of the field group (If this is what you mean)
    The field is working fine. I am able to save values to the field and able to see values saved in GUI.
    I haven't linked search help of the field in PCUI
    I am not sure how to go about it.
    I used the data element in the structure for the field.
    The data element has Domain entry in <b>Entry Help/Check</b> of the structure
    If i check the Domain Value checkbox in my field group then the domain values should be available in dropdown if the field is dropdown
    However i am not able to see the possible values of the field (It is present in SAP GUI)
    Does something else needs to be done in this case
    TIA
    Asad

  • Help Required for Mapping Key figures from Cube to APO Planning area.

    Hello Experts,
    We have created cube in APO BW and now we want to map it to Planning area how we can map.
    Can any body explain how we can map keyfigures?
    What is the use of livechache how it will be updated?
    Regards
    Ram

    Hi,
    I am not very sure about the 9ARE aggregate (haven't used it in backups), but RTSCUBE is used to copy time Series (TS) KF data from cube to planning area (SNP or DP).
    Are you trying to restore some time series data from your backup cube to the planning area? If yes, then do a mapping of characteristic from cube to planning area in RTSCUBE, and also map the TS KF between cube and planning area.
    If your KF is not a time series KF, then you can't copy it from cube to planning area. You could get data to cube for some reporting, otherwise I am not sure what use the backup is for you. For SNP, most of the data would be received from R/3, so there's not much point in having a backup.
    Hope this helps.
    Thanks - Pawan

  • Help required for mapping

    Hi experts,
    i require to populate the target node based on conditions from the input fields...
    I need to check for 5 values for a field and if yes then only target node needs to be created..
    Ex: input: master
          oouput: group
    group node needs to be populated only if master is equal to 100,200,300,400..if not no node...
    how to achive this....
    Thanks in advance.

    Hi reddy,
    We have an option called <b>"fix values"</b> in mapping under conversion functions,
    map the source field to the fix values , in fix values enter the key as 100,500..... and all the corresponding values as Y,
    Then in mapping you can make a single condition "IF without Else" and check the output of the FIX values for Y, IF output is equal to Y then pass the sorce field.
    this is for simplifying your logic by using single condition in mapping.
    Contact me at [email protected] for a screenshot of this mapping
    Thanks
    Saravanan.N
    Message was edited by:
            saravanan

  • Mapping Help required for ORDER Idoc to EDI file

    Hi
    My source strcture is as follows
    E1EDP01
    E1EDP01
       E1EDPT1 (TDID=0001)
         E1EDPT2
             TDLINE = abcd
       E1EDPT1 (TDID=0001)
         E1EDPT2
             TDLINE = XYZ
    and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)
    The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this
    (Sometimes E1EDPT2 populate multiple times for one E1EDPT1)

    >and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)
    Why don't you create the LineItems only when TDID = 0001 because this will ensure to populate item fields with correct value.
    The mapping logic to produce the LineItems should be like this..
    IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---LineItem.
    >The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this
    In this mapping make sure the context of TDLINE is set to E1EDPT1 and then use RemoveContext ---SplitByValue to the output of "IF" function. e.g.
    IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---SplitByValue---FIELD1.

  • Help required in Idoc mapping!!

    Hi,
    I have an idoc to file scenario:
    Idoc looks like this
    Idoc
    Header
    E1BPE1WLMV (0.....999)
         field1
    E1BPE1MALG (0.....999)
          field2
    Target
    Details
         field3
    My requirement is that :
    field 3 should b mapped to only the first occurence of field1. (and not the subsequent occurences).
         Please suggest how can i proceed ?

    Thanks guys...but I have got some more inputs for my requirement now:
    Source:
    Idoc
    Header
    E1BPE1WLMV (0.....999)
    field1
    E1BPE1MALG (0.....999)
    field2
    Target:
    Details
    field3 (= field1)
    field4 (=field2)
    The Details should be created for unique combination of field1 and field 2. For e.g.
    Field 1 comes 2,3,4
    Field 2 comes 1,5
    Then detail should be created 6 times for
    field1= 2 & field2= 1
    field1= 2 & field2= 5
    field1= 3 & field2= 1
    field1= 3 & field2= 5
    field1= 4 & field2= 1
    field1= 4 & field2= 5
    Could you please help ?
    Edited by: jayagupta21 on Apr 14, 2011 7:24 AM

  • Help! Urgent help required for adjusting image

    Hi - hoping someone can help.
    I sent the attached PDF -  http://www.sensecreative.co.uk/custUploads/SENSE-36-7977-95928/77317/SENSE-36-7977-95928-7 7317-2440.zip - to print with Sense Creative. The cards were printed and they've turned out quite visibly green on the reverse (where it should be white).
    I've printed the artwork on several printers I have access to and it looks as it should, however SC are saying that the issue is with the artwork
    "The green tinge you see on the reverse of these cards is prevalent in the artwork. The makeup of the background is approximately c-15 m-11 y-15 k-0. the predominant levels of the yellow and cyan will give you the green tint. Upping the levels of the artwork in or substituting the cyan, magenta and yellow levels with more black in Photoshop will likely give you the result you require. We are satisfied that in both instances, the artwork has printed correctly and the colours are well within tolerance given the nature of the artwork."
    So, I'm in a bit of a pickle as the cards are needed for an event next week.
    How do I change the image levels? Or are they talking nonsense and trying to pass the buck?
    Help!

    station_two,
    Acrobat View> Tools> Print Production> Output Preview: Object Inspector will call out the objects' profiles if you click on each one individually (in this case all appeaar to be "Device CMYK" or Untagged CMYK)
    untagged CMYK has the same pitfalls as untagged RGB... if one applys or assumes the wrong SOURCE PROFILE it doesn't CONVERT colors to Monitor RGB or Print Space correctly

  • Urgent Help Required for Check Box in Table Column

    Hi all,
    Could any body help me to solve my problem?
    First of all I have created a table whose one column is check box. The column of the tables are Name,Phone,ID,Address and a checkBox columns.In one view
    the table will be found with data. I want to click on some of the rows(suppose there are 5 rows, but based on some condition I have selected the check box of 3 rows).
    Next there will be a button(Supose SEND Button).
    After selecting the check box I want to press that button and then a new window will come which will show two tables. one for  selected rows(with the same columns name except check box) and another for Unchecked rows with the same column name(Name,Phone,ID,Address).
    Could any body help me by sending the details and code?
    Thanks and Regards.
    Sudip

    Hi Sudip,
    1) create custom controller and appropriate context structure there (dataNode(Name,Phone,ID,Address,Check))
    2) create view StartView. Map data node from custom controller to node in view. Create table and bind context node attributes to appropriate table columns.
    3) create view ResultView. Map data node from custom controller to node in view. Create 2 nodes (CheckedData, UncheckedData) with supply methods. Create filtering implementation in supply methods (add checked and unchecked node elements to appropriate nodes).
    4) create new window with resultView as default view
    4) in startView in button action handler put something like
         IWDWindowInfo _windowInfo = wdComponentAPI.getComponentInfo().findInWindows("Popup");
         IWDWindowManager manager = wdComponentAPI.getWindowManager();
         IWDWindow _window = manager.createWindow(_windowInfo, true);
         _window.open();        
    So, just tried localy and it works.
    Best regards, Maksim Rashchynski.

  • Urgent help required for update Plz help!!

    Hi i am updating my E51 and its displaying updating software please wait estimated time left 15 minutes for the past 1 hour.
    Please tell me what should i do....
    Its really urgent pls help....

    Hi,
    There might be a problem with either the NSU or the phone itself. Any updates on what happened?
    Next time make sure you meet the certain system requirements before proceeding with the update.
    Message Edited by nj15 on 01-Oct-2008 01:44 PM

  • Urgent Help Required for Connect Four Game

    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
         int player1;
         int player2;
         public PlayGame()
              //this.player1 = player1;
              //this.player2 = player2;
         public void StartGame()
         try{
         // int X = 0, Y = 0;
         //int value;
         int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
         int[][] ConnectFourArray = new int[6][7];
         int num1, num2;
         for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
         //Player player1;
         //Player player2;
         public ClassConnectFour()
              //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end class
    I am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda
    //

    Hi,
    Thanks for your help but I really don't understand the table lookup algorithm. Could you please send me some code to implement that.
    I will send you the formatted code as well
    Thanks for your help.
    looking forward to your reply.
    Koonda
    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
    int player1;
    int player2;
    public PlayGame()
    //this.player1 = player1;
    //this.player2 = player2;
    public void StartGame()
    try{
    // int X = 0, Y = 0;
    //int value;
    int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    int[][] ConnectFourArray = new int[6][7];
    int num1, num2;
    for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
    //Player player1;
    //Player player2;
    public ClassConnectFour()
    //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end classI am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda

  • Help required for file to Multi file Blog

    Hi,
    I'm working with following blog for file to multi file scenario...
    "/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    But in Configuration part, I'm unable to find ..TITLE_IDTYPE option for RB_SPLIT.. Screen, there is only two options are available one is Standard and another one is Extended ???!!!
    Note : we are using SP16
    So,  How can I go ahead to complete this scenario ??!!!
    Can anybody help me out to complete this file to mulfile scenario without BPM.
    Thanks.,
    Esha

    Hi Esha,
    the names seem to have changed since SP14 (the version of this blog entry).
    I did a multi-mapping with SP15 once, using "Extended".
    Kind regards,
    Dennis

Maybe you are looking for