How to get itemChild Array from plist into table 2 ?????

Hi there,
I am creating a project for the IPhone, using UITableViews.
I have been looking at James' code and trying to adapt it.
My project has two tableviews, and two tableview controllers. THe plist is an Array of dictionaries and each dictionary houses a name string and an ItemChild Array.
The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
here is the shape of the plist.
<array>
<dict>
<key>name</key>
<string>Category A</string>
<key>ItemChild</key>
<array>
<string>aaaa</string>
<string>bbbb</string>
<string>cccc</string>
<string>dddd</string>
</array>
</dict>
<dict>
<key>name</key>
<string>Category B</string>
<key>ItemChild</key>
<array>
<string>aaaa</string>
<string>bbbb</string>
<string>cccc</string>
<string>dddd</string>
</array>
</dict>
<dict>
<key>name</key>
<string>Category C</string>
<key>ItemChild</key>
<array>
<string>aaaa</string>
<string>bbbb</string>
<string>cccc</string>
<string>dddd</string>
</array>
</dict>
</array>
</plist>
here are the implementation files for the first and second tableviewControllers
@implementation TableTutViewController
@synthesize dataList1;
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"newData" ofType:@"plist"];
NSMutableArray* tmpArray = [[NSMutableArray alloc]
initWithContentsOfFile:path];
self.dataList1 = tmpArray;
[tmpArray release];
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return dataList1.count;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
objectForKey:@"name"]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
#pragma mark -
#pragma mark Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SecondViewController *secondViewController = [[SecondViewController alloc]
initWithNibName:@"SecondViewController" bundle:nil];
secondViewController.dataList1 = [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
[self.navigationController pushViewController:secondViewController animated:YES];
[secondViewController release];
#pragma mark -
#pragma mark Memory management
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
- (void)viewDidUnload {
- (void)dealloc {
[super dealloc];
@end
And here is the code for the secondViewController
#import "SecondViewController.h"
#import "TableTutAppDelegate.h"
#import "TableTutViewController.h"
@implementation SecondViewController
@synthesize dataList1;
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
- (void)viewDidUnload {
#pragma mark Table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.dataList1 count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
objectForKey:@"ItemChild"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
- (void)dealloc {
[dataList1 release];
[super dealloc];
@end
Any idea's on what is missing would be great. Do I need to create a new array to put the itemChild array into before loading it into the cell.textLabel.text??
Any help would be fantastic,
thanks
Alex
Message was edited by: alex200

Hey Alex, welcome to the Dev Forum!
alex200 wrote:
I have been looking at James' code and trying to adapt it.
Have you been looking at James as well? I'm wondering if you two are at the same school.
The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
Actually you passed the ItemChild arrays correctly (assuming dataList1 is declared as shown), but when you wanted the name for each element, you forgot that ItemChild was an array of strings, not an array of dictionaries:
// SecondViewController.h
@interface SecondViewController : UITableViewController {
NSMutableArray *dataList1;
@property (nonatomic, retain) NSMutableArray *dataList1;
@end
// SecondViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cell.textLabel.text = [self.dataList1 objectAtIndex:indexPath.row]; // <-- dataList1 is an array of strings
// objectForKey:@"ItemChild"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
Other than the above, there wasn't much to correct. I just set the title of the first controller's nav item, since that's needed to display the default return button in the second controller's nav bar (but you probably had set that title in IB), and I also passed the name of the selected Category row to the second controller's nav item:
// TableTutViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Categories"; // <-- added in case title isn't in xib
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SecondViewController *secondViewController = [[SecondViewController alloc]
initWithNibName:@"SecondViewController" bundle:nil];
secondViewController.dataList1 =
[[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
secondViewController.navigationItem.title =
[[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"name"]; // <-- add title
[self.navigationController pushViewController:secondViewController animated:YES];
[secondViewController release];
Overall it looks like you did a nice job. I think ItemChild was an array of dictionaries in James' plist, so that might be the reason your code matched his plist instead of yours.
- Ray

Similar Messages

  • How to get byte array from jpg in resource for Image XObject?

    Hi,
    Does anyone know how to get an array of bytes from a jpg from resource without an external library except MFC?
    The array of bytes is needed to create an Image XObject so it can be included in an appearance for an annotation.

    Sounds like a standard Windows programming question, not specific to the SDK.

  • How to get color group from illustrator into flash

    Hi,
    I have difficulties with the color management between Illustrator and Flash.
    I have the original vector files in Illustrator and would like to use the color groups, I have in Illustrator, also in Flash.
    One way doing it is using the Kuler.
    But I can not get the colors from Illustrator into Kuler.
    Can someone advice how to manage that process?
    Many thanks in advance!

    I'm fairly new to this having only recently started using these tools again after six years, but will try to help! Go to "Explore", find a theme you like and click the "Edit" selection when you mouse over it. From there you can edit it or save a copy of it as is as whatever name you wish. In Photoshop or Illustrator, they will now show up in Adobe Color Themes (Window > Extensions > Adobe Color Themes) under "All Themes" in the drop menu. In these apps (and others that are Adobe Color Theme aware), any themes that you favorite on the site will show up under "My Favorites".
    If you're using Fireworks, it's different as it still uses Kuler (Window > Extensions > Kuler).  Themes you save or favorite on the site don't automatically show up there, however you can search for themes by name, and if you select "Custom" from the theme group dropdown, you can enter up to four names that will show up in that dropdown menu and produce as many results as the window can hold for an individual term. For instance, I saved a theme as "Copy of Industrial Calm" which if I enter in the search box, the "group" is a group of one. However, if I just type "Industrial", the window fills with options, yet there are MANY more results on the Adobe Color site and you would have to be specific to get the right one in that window.
    Hope that helps.

  • How to get the data from a cluster table to BW

    Dear All,
    I want to extract the data from R/3 to BW by using 2 tables and one Cluster B2.
    Actually my report contains some fields from PA2001, PA2002 and one cluster table B2 (Table ZES). Can I create View by using these 3 tables? If it is not possible how can I get the data from the cluster? Can I create generic datasource by using cluster tables directly?
    In SE11 Transaction the Cluster (table ZES) is showing invalid table.
    I referred some Forums, but no use.
    Can any body tell me procedure to get the data from a cluster (table ZES) ?
    Waiting for you results.
    Thanks and regards
    Rajesh

    HI Siggi,
    Thank you for your reply..
    I am also planning to do FM to get the data. But it is saying that the Cluster table ZES does not exist (ZES is the the standard table, in SE11 also).
    How can I use the Fields from the that table.?
    What can I do now, can you please explain me about this point.
    Waiting for your reply.
    Thanks and Regards
    Rajesh
    Message was edited by:
            rajesh

  • Please help how to get return array from rpg program on java code?

    Hi
    I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
    please suggest me regarding this issues I amn't so much aware on java & AS400.
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(p2.toBytes(" "));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
    byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
    parmList[1].getOutputDataLength();
    //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();
    Reply With Quote

    Try this :
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    AS400Array arrP2 = new AS400Array(p2, 4);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(arrP2.toBytes({"","","",""}));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
         Object[] objArr =  (Object [])arrP2.toObject( parmList[1].getOutputData() );
         for(int i =0; i<objArr.length;i++){
                System.out.println( " SKU " + i +" : " + objArr.toString());
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();

  • How to get An Array from PostgreSQL.

    When I design a programm to get an array object from a postgreSQL database, the programm give the following exception:
    "This method is not yet implemented"
    Who can help me?
    Thanks!!!!
    Here are my codes:
    import java.sql.*;
    class test {
    public static void main(String args[]) {
    String url = "jdbc:postgresql://localhost:5432/testdb";
    String query = "select * from table1";
    try {
    Class.forName("org.postgresql.Driver");
    Connection con = DriverManager.getConnection(url,"aa", "bb");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(queryStr);
    while(rs.next()) {
         Array array = rs.getArray("idnum");
    } catch(Exception ex) {
    System.out.println("Get Data Fail: " + ex);
    the table struct of "table1"
    =============================
    varchar(10) int4[]
    name | idnum
    -----------------+--------------------------------
    Bill | {100430,134630000,10000,10000}

    You pass a string to the getArray method. The parameter should be an integer, representing the desired column.

  • How to get SelectOneChoice value from a af:Table

    JDeveloper v11.1.2.4.0 - JSF
    Greetings,
    im having a problem getting a column value that is a select one choice object.
    This is not a common problem since i actually did different thing than others so please follow my problem
    description and if you have any answer/questions please reply below.
    I have create a Database View that returns me 3 columns, lets say TestCode, TestDescription, TestValue.
    I have added one extra temporally column in my OV and called Temp.
    I drag & drop my OV, delete Temp value, and its column position, i drag&drop a LOV that is from another View,
    that shows me Doctor's name & surname and return doctor's id as select one choice value.
    Im using a function that go thru the iterator, gets the rows, and save them in database (doesn't matter how).
    The problem is, my selectonechoice, do not have row.bindings.DoctorId.InputValue but bindings.DoctorId.InputValue instead, so i can retrieve the current row's selectonechoice value.
    So when my loop is finish and insert the rows in to my database, all row's doctor's id is the same since the binding do not change thru the loop.
    I don't know how to get the current row's select one choice value to use the correct value on each row loop.
    Here is my loop function:
            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iterator = bc.findIteratorBinding("ExaminationsIterator");
            DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
             RowSetIterator rsi = iterator.getRowSetIterator(); 
             int i=0;
            OperationBinding save_exams = bindings.getOperationBinding("SAVE_EXAMINATION");
            OperationBinding save_exams_commit = bindings.getOperationBinding("SAVE_EXAMINATION_COMMIT");
            try{
             while(i < rsi.getRowCount()){
                 Row r = iterator.getCurrentRow();
                 save_exams.getParamsMap().put("CodeTest", r.getAttribute("CodeTest"));
                 save_exams.getParamsMap().put("Dates", r.getAttribute("Dates"));  
                 save_exams.getParamsMap().put("CodeId", orderid.getValue());  
                 save_exams.getParamsMap().put("Times", r.getAttribute("Times"));   
                 save_exams.getParamsMap().put("DoctorId", resolveExpression("#{bindings.DoctorId.attributeValue}").toString());
                 save_exams.getParamsMap().put("IdPatients", patientid.getValue());  
                 save_exams.execute();
                 rsi.next();
                 i++;
                save_exams_commit.execute();
    I get the current doctor's id binding and not each row's value.
    Can you assist me on this please?

    I have created a work around solution, until any more expert than me come with more advance solution.
    1) I add a LOV at doctor's id on target View object.
    2) On runtime, i populate my Database View
    3) go through all rows in my DB View iterator
    4) add each row on the target View Object (missing the doctor's id, since i want that to be on runtime) & commit rows
    5) after the loop is done and the target view object show me the results of the DB View, i choose on runtime the doctor's id and commit the changes so
    the new rows, with new updated date will be finally populated to the database.
    Hope this helps if anyone have a similar task.
    Please let me know if you find a more direct solution, that working with 2 tables to populate 1.

  • How to get scource timecode from AVCHD into CS6?

    The scource material I record with my Sony FS-100 camera records timecode and displays it when played back in the camera. Importing the media into CS6 (and CS5) all clips start at 00:00:00:00 no matter how I select the timecode display.
    Importing directly from the SD card as .MTS files or with the Sony software as .M2TS doesn't make a difference.
    I have to edit a project shot with two camera's and separate audio, all with a synced identical timecode.
    How can I get Premiere to recognize the scource timecode of the clips?

    podieopos wrote:
    Which causes some other difficulties. The camera starts naming the clips from scratch after inserting a new SD card, starting with 00001.mts again, creating the danger of errors with double filenames...
    Any solutions for that?
    This is the single biggest problem with AVCHD, in my opinion, and it makes no sense to me why it works this way - especially having worked with P2 media which shares a lot of the same metadata controls but also has unique file naming.
    The general workaround is to make sure that you put your SD contents for each card in it's own unique folder on your hard drive. How unique you want to make that folder is up to you. For me, a typical project is this:
    D:\ drive (or whatever letter you have)Project folder (so something like "197 HS Graduation Project 2012")Video
    ReelA_01 (this folder is for the 1st SDHC card from camera A)
    ReelA_02 (this is the 2nd SDHC card from camera A
    ReelB_01 (1st SDHC card from camera B)
    ReelC_01 (1st SDHC card from camera C)
    You get the idea though...unique folder for each card so I more or less know where everything is.
    I create a similar folder structure for the bins inside PPro, so I have:
    Video
    ReelA_01
    ReelA_02
    Again, you get the picture. It's important to keep track of your media because one day you might move your project or your media files to a different drive or into a different directory and have those clips go offline inside PPro. You'll be able to reconnect all your lost media successfully IF you have kept good about your media in the project bin as well as your hard drive. Come up with whatever naming system or directory structure you want, but my advice is to make it as clear and understandable to you as possible and to be CONSISTENT every single time.

  • How to get common datas from two int.tables

    hi,
    please tell me , how to i will get the common datas between two int. tables
    & place them in third int. table.
    give me syntax.
    regards
    subhasis.

    Hi Subhasis,
    <b>SORT :</b></u>
    SORT itab.
    Extras:
    1. ... BY f1 f2 ... fn
    2. ... ASCENDING
    3. ... DESCENDING
    4. ... AS TEXT
    5. ... STABLE
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
    Effect
    The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
    Addition 1
    ... BY f1 f2 ... fn
    Effect
    Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
    You can also specify the sort fields dynamically in the form (name). If name is blank at runtime, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
    If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table.
    You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
    If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
    Addition 2
    ... ASCENDING
    Effect
    Sorts in ascending order. This is also the default if no sort order is specified directly after SORT. For this reason, it is not necessary to specify ASCENDING explicitly as the default sort order.
    With the addition BY, you can also specify ASCENDING directly after a sort field to define ascending order explicitly as the sort sequence for this field.
    Addition 3
    ... DESCENDING
    Effect
    Sorts in descending order. If the addition comes right after SORT, DESCENDING is taken as the default for all fields of the sort key.
    With the addition BY, you can also specify DESCENDING directly after a sort field.
    Addition 4
    ... AS TEXT
    Effect
    Text fields are sorted appropriate to the locale. This means that the relative order of characters is defined according to the text environment being used.
    When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the logon language specified in the user master record. If necessary, however, you can change the text environment explicitly in your program by using a SET-LOCALE statement.
    If the addition comes directly after itab, locale-specific rules are used for all fields of the sort key where the type of these fields is C or W. After the sort, the sequence of entries usually does not match the sequence which results otherwise, without using the addition AS TEXT, i.e. with binary sorting.
    With the addition BY, you can also specify AS TEXT directly after a sort field, provided it is of type C or W, or a structured type. Otherwise, a runtime error occurs. In sort fields with a structured type, AS TEXT only affects subcomponents with type C or W.
    In case of an invalid character, a SYSLOG message is written, and the respective record is inserted at the end.
    Note
    Please keep the rules for site-specific sorting in mind.
    Example
    Sort a name table with different keys:
    TYPES: BEGIN OF PERSON_TYPE,
             NAME(10)   TYPE C,
             AGE        TYPE I,
             COUNTRY(3) TYPE C,
           END OF PERSON_TYPE.
    DATA: PERSON TYPE STANDARD TABLE OF PERSON_TYPE WITH
                      NON-UNIQUE DEFAULT KEY INITIAL SIZE 5,
          WA_PERSON TYPE PERSON_TYPE.
    WA_PERSON-NAME    = 'Muller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Moller'. WA_PERSON-AGE = 25.
    WA_PERSON-COUNTRY = 'FRG'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Möller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Miller'. WA_PERSON-AGE = 23.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    SORT PERSON.
    Now, the sequence of the table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Muller  22  USA
    Möller  22  USA
    If, for example, you apply German sort rules where the umlaut comes directly after the letter 'o' in the sort, the data record beginning with 'Möller' would not be in the right place in this sequence. It should come second.
    Provided a German-language locale is set (e.g. sorting is according to German grammatical rules, see also SET LOCALE), you can sort the names according to German rules as follows:
    SORT PERSON BY NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Möller  22  USA
    Muller  22  USA
    Further examples:
    SORT PERSON DESCENDING BY COUNTRY AGE NAME.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Möller  22  USA
    Muller  22  USA
    Moller  25  FRG
    SORT PERSON DESCENDING BY AGE ASCENDING NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Muller  22  USA
    Möller  22  USA
    Miller  23  USA
    Moller  25  FRG
    Addition 5
    ... STABLE
    Effect
    Uses a stable sort, that is, the relative sequence of entries that have the same sort key remains unchanged.
    Unlike additions 2 to 4, you cannot use this addition directly after a sort field.
    Notes
    General:
    The number of sort fields is restricted to 250.
    The sort process is only stable if you use the STABLE addition. Otherwise, a predefined sequence of fields used to sort a list is not usually retained.
    It does not make sense to use the SORT command for a SORTED TABLE. If the table type is statically declared, the system returns a syntax error if you try to SORT the table. If the table type is not statically declared (for example, because the table was passed to a FORM routine as an INDEX TABLE in a parameter), and the system can interpret the SORT statement as an empty operation, it ignores the statement. This is the case when the key in the BY clause corresponds to the beginning of the table key. Otherwise, a runtime error occurs.
    To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement.
    When using the addition AS TEXT, the sequence of entries after the sort does not usually match the sequence resulting from a binary sort, i.e. if the addition AS TEXT is not specified. The consequence of this is that after the SORT, you are not allowed to access with the READ TABLE itab ... BINARY SEARCH statement.
    If you still want to access data sorted apppropriate to the locale with a binary search, you can do this by including an additional component in the table where you can explictly store the data formatted using the CONVERT TEXT ... INTO SORTABLE CODE statement. This is also recommended for performance reasons if you have to re-sort the table several times according to locale-specific criteria.
    If the internal table has more than 2^19 lines or is larger than 12 MB, the system sorts it physically using an external auxiliary file. You can specify the directory in which the file should be created using the SAP profile parameter DIR_SORTTMP. By default, the system uses the SAP data directory (SAP profile parameter DIR_DATA).
    Notes
    Performance:
    The runtime required to sort an internal table increases with the number of entries and the length of the sort key.
    Sorting an internal table with 100 entries with a 50 byte key requires about 1300 msn (standardized microseconds). Using a 30-byte key, the runtime is about 950 msn.
    If one of the specified sort criteria is itself an internal table, SORT may sometimes take much longer.
    The runtime increases if you use a stable sort.
    Physical sorting reduces the runtime required for subsequent sequential processing.
    Reward If Useful.
    Regards,
    Chitra

  • How do you store input from keyboard into a string array

    I am trying to learn java and one of the programs I am trying to write needs to be able to accept a machine hostname at the keyboard and stuff it into a string array element. I am sure I will be using something along the lines of:
    BufferedReader in = new BufferedReader(new InputStreamReader(
                             System.in));
                   String str = "";
                   System.out.print("Enter a FQDN to look up: ");
                   str = in.readLine();
    but how do I get the input stuffed into hostname[ ].
    Any hints or assistance will be appreciated.
    Michael

    Well part of. I need to be able to take a random number of hostnames (ie. mblack.mkblack.com, fred.mblack.com, joe.mblack.com, ...) and after the user presses the enter key between each entry, the inputted information is stored in an array element. for example with the three shown above the array would look like this after the user finished.
    hostname {"mblack.mblack.com","fred.mblack.com","joe.mblack.com"};
    the algorithm would be
    Prompt for hostname
    get user input and press enter
    store hostname into array element
    prompt for next hostname or enter with no input to complete entry and execute lookup.class methods.
    I have the program written and working fine if I use a static array where I put the hostnames in the list, but cannot figure out how to get the information from the keyboard to the array element.
    Thanks for the help though, the response is very much appreciated.
    Michael

  • How do i get a video from iphoto into imovie

    how do i get a video from iphoto into imovie

    Hi Margaret,
    I'm not certain, but try this...
    In finder, locate the video, then drag & drop it on iMovie's icon.

  • How to Getting 10lack records from 2 tables and share  into 10 tables

    Hi Experts,
    i have some special requirement about counting records before we we procees them in to intenal table.
    here is the sample code .
    **Needed to get users for ref users data
    DATA: BEGIN OF gt_usr02 OCCURS 0,
            bname LIKE usr02-bname,
          END OF gt_usr02.
    DATA:g_wa_usr02 LIKE LINE OF gt_usr02.
    **Needed To get reference users data
    DATA: BEGIN OF gt_usrefus OCCURS 0,
            bname LIKE usrefus-bname,
            refuser LIKE usrefus-refuser,
            END OF gt_usrefus.
    DATA:g_wa_usrefus LIKE LINE OF gt_usrefus.
    SELECTION-SCREEN :BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS : s_user FOR usr02-bname.
    SELECTION-SCREEN :END OF BLOCK blk1.
    START-OF-SELECTION.
    REFRESH:gt_usr02,gt_usrefus.
    CLEAR:gt_usr02,gt_usrefus
    CLEAR:g_wa_usr02,g_wa_usrefus ,
    SELECT bname FROM usr02 INTO TABLE
           gt_usr02 WHERE bname IN s_user. "say suppose "*" in s_user
    1.Here i need to get no of records befor we are getting data from this select statement
    basically i need to know the no of records (like count (sy-dbcnt) with same condition like below.
    IF NOT gt_usr02 IS INITIAL.
        SELECT bname refuser FROM usrefus INTO TABLE  gt_usrefus
         FOR ALL ENTRIES IN  gt_usr02
        WHERE bname =  gt_usr02-bname AND refuser <> space.
      ENDIF.
    2.if i found no of records based on that  i have to broke those records into diff tables
    say i found 10,000 records ,that time i have spilt those 10,000 records into 10 tables(Similar strcture like table gt_usrefus ) with 1000 records each .
    Can you help us.this requirement is for avoiding memory issues.

    Hi nagraju102,
    - please try to post code formatted as code
    - splitting a table of 10000 records into 10 tables of 1000 records will use not less memory at all, even a little bit more for the administrative overhead
    - the numer of lines in an internal table can  determinde used system function lines( itab )
    - you can create an internal table of references and then create any number of internal tables,
    data:
      lt_tabref type table of ref to data.
    field-symbols:
      <table> type  table,
      <tabref> type ref to data.
    DO 10 TIMES.
      append initial line to lt_tabref assigning <tabref>.
      create data <tabref> type table of usrefus.
      assign <tabref>->* to <table>.
      perform fill_table changing  <table>."fill this table as you prefer
    ENDDO.
    Here you have 10 internal tables with USREFUS structure.
    Regards,
    Clemens

  • How to get a formula from the user from a text box in a webpage

    Hi. I would like to know how to get the formula from the user who enters in a textbox. This formula can have any number of variables starting with a and goes on.
    The complexity of the formula can go upto sin, cos, ln, exp. Also user enters the minimum and maximum values of these variables. Based on a specific algorithm (which I use) I would calculate a *set of values, say 10, for each of these variables, substitute in the formula and based on the result of this formula, I select ONE suitable  value for each of the variables.
    I don't know how to get this formula (which most likely to be different each time) and substitute the values *which I found earlier.
    Kindly help me out in this issue.
    Thanks

    The textbox is the easy part. It's no different than getting a String parameter out of an HTTP request.
    The hard part is parsing the String into a "formula" for evaluation. You'll have to write a parser or find one.
    Google for "Java math expression parser" and see what you get.
    Or write your own with JavaCC.
    %

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get a value from JavaScript

    How to get return value from Java Script and catch it in c++ code. I have tried following code, but its not working in my case.
    what I want is if it returns true then call some function if it returns false then do nothing, so how to get those values in c++
    ScriptData::ScriptDataType fDataType = resultData.GetType();
    if (fDataType == kTrue)
           CAlert::InformationAlert("sucess");
           //call some function
                        else
                                  CAlert::InformationAlert("Error");
         // do nothing
    JavaScript Code:
        if(app.scriptArgs.isDefined("paramkeyname1"))
               var value = app.scriptArgs.get("paramkeyname1");
               alert(value);
                return true;
      else
               alert ("SORRY");
               return false;

    How to get java script result into JSResult i m not getting it.
    I have wriiten follwing code in c++ :
              WideString scriptPath("\\InDesign\\Source1.jsx");
              IDFile scriptFile(scriptPath);
              InterfacePtr<IScriptRunner>scriptRunner(Utils<IScriptUtils>()->QueryScriptRunner(scriptFi le));
              if(scriptRunner)
                        ScriptRecordData arguments;
                        ScriptIDValuePair arg;
                        ScriptID aID;
                        ScriptData script(scriptFile);
                        ScriptData resultData;
                        PMString errorString;
                        KeyValuePair<ScriptID,ScriptData> ScriptIDValuePair(aID,script);
                        arguments.push_back(ScriptIDValuePair);
                        PMString paramkeyname1;
                        Utils<IScriptArgs>()->Save();
                        Utils<IScriptArgs>()->Set("paramkeyname1",scriptPath);
                        Utils<IScriptUtils>()->DispatchScriptRunner(scriptRunner,script,arguments,resultData,erro rString,kFalse);
                        Utils<IScriptArgs>()->Restore();
                        ScriptData::ScriptDataType fDataType = resultData.GetType(); // here i should get true or false which i m passing it from javascript code......not as s_boolean
                        if (fDataType == kTrue)
                                       //CAlert::InformationAlert("sucess");
                                     iOrigActionComponent->DoAction(ac, actionID, mousePoint, widget);
                        else
                                    this->PreProcess(PMString(kCstAFltAboutBoxStringKey));
    Java script code:
    function main()
           var scrpt_var;
           var scriptPath,scrptMsg;
           var frntDoc=app.documents[0];
           if(app.scriptArgs.isDefined("paramkeyname1"))
               var value = app.scriptArgs.get("paramkeyname1");
                alert(value);
                 return true; // i want this value i should get in c++ code...How to get these values in c++
           else
              alert ("Error");
              return false; // i want this value i should get in c++ code...How to get these values in c++

Maybe you are looking for

  • Using CQ to generate HTML

    Hi, Our current implementation invloves passing a serialised object via a GET request to a Sling servlet, it is deserialsed, the object is added as a request attribute and forwarded  to a relavent JSP page depending on a property in the object. This

  • ITunes hangs upon loading

    Used iTunes for Windows with no problems up until installing latest version. After updating & acknowledging terms and conditions library loads but program then hangs - in Task Manager it's marked as not responding. Windows 7 x64 is fully up to date.

  • SAPScript font printing

    Dear all, I have a same version of SAPScript layout in both Dev and Prod server. But the printing in Dev suddenly having alignment problem. Below is the printing example before and after in DEV; the spacing between each character become wider: Before

  • Threshold value for price changes

    hello, We are trying to change the price for material and getting error Threshold value for price changes was exceeded msg no is CKPRCH 032 Being Sd guy I'm not able to understand where we need to check and what changes to be done Please guide Regard

  • CRM tables for iBASE, Counter and pricing details.

    Hi Everybody, Can anybody help me with the name of the tables and the joining condition for iBASE, Counter and pricing agreement tables. Say, I have only service contract number and GUID, to start with. I'm looking for counter id and the reading, fro