How can we find whether we clicked UIImage or text in UItableViewCell

In tableview didselectrowatindexpath method how can we find if we click image in that cell[i mean the image which i set using cell.image ] or text in that cell[i mean the text which i set using cell.textlabel.text]
Basically i have to do separate functionality if i click image or text....
I have customized the cell and put view for this thing but bluecolor selection is not coming while i click that cell....
Please help me out.....

//////////// Custom tableviewcell....
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier tableView:(UITableView*)tableview cellRow:(NSInteger)cellRow cellSection:(NSInteger)cellSection{
if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
// Initialization code
ratingView=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,30, 35)];
textLabel=[[UILabel alloc] initWithFrame:CGRectMake(37,0, self.frame.size.width, self.frame.size.height-9)];
//[textLabel setBackgroundColor:[UIColor redColor]];
textLabel.textAlignment=UITextAlignmentLeft;
//textLabel.text=@"sample";
[textLabel setFont:[UIFont boldSystemFontOfSize:18]];
[ratingView setImage:[UIImage imageNamed:@"Rating.png"]];
[self addSubview:textLabel];
[self addSubview:ratingView];
[textLabel setTextColor:[UIColor blackColor]];
[textLabel setHighlightedTextColor:[UIColor whiteColor]];
imageChanged=NO;
chaptersTableView=tableview;
row=cellRow;
section=cellSection;
return self;
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
NSLog(@"I m inside touches began method");
for ( UITouch *touch in touches )
CGPoint touchPoint = [touch locationInView:self];
CGRect imageRect = CGRectMake(0, 0, 40, self.frame.size.height);
if ( CGRectContainsPoint(imageRect, touchPoint) )
NSLog(@"I have clicked on imageview");
else
//[self setBackgroundColor:[UIColor colorWithRed:2.0/255.0 green:114.0/255.0 blue:237.0/255.0 alpha:1.0]];
//[self.textLabel setBackgroundColor:[UIColor colorWithRed:2.0/255.0 green:114.0/255.0 blue:237.0/255.0 alpha:1.0]];
NSLog(@"I have clicked on tableView");
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
//NSLog(@"I am inside touches cancelled");
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
@try
for ( UITouch *touch in touches )
CGPoint touchPoint = [touch locationInView:self];
CGRect imageRect = CGRectMake(0, 0, 40, self.frame.size.height);
if ( CGRectContainsPoint(imageRect, touchPoint) )
// NSLog(@"I have clicked on imageview");
if(!imageChanged)
//[_imageViewTarget performSelector:changeImageAction];
[self.ratingView setImage:[UIImage imageNamed:@"Rating-filled.png"]];
[self setImageChanged:YES];
else
[self.ratingView setImage:[UIImage imageNamed:@"Rating.png"]];
[self setImageChanged:NO];
else
NSIndexPath *newSetRow = [NSIndexPath indexPathForRow:row inSection:section];
[chaptersTableView selectRowAtIndexPath:newSetRow animated:NO scrollPosition:UITableViewScrollPositionNone];
//[chaptersTableView selectRowAtIndexPath:<#(NSIndexPath *)indexPath#> animated:<#(BOOL)animated#> scrollPosition:<#(UITableViewScrollPosition)scrollPosition#>
[_imageViewTarget performSelector:changeImageAction];
//NSLog(@"I have clicked on tableView");
//NSLog(@"I m inside touches ended ");
@catch (NSException *ex) {
NSLog(@"Exception caught %@",[ex description]);
-(void)setImageViewTarget:(id)target action:(SEL)action
_imageViewTarget=target;
changeImageAction=action;
-(void)checkImage
if(self.imageChanged)
NSLog(@"imchan %@",self);
//NSLog(@"I m going to change the filled image");
[self.imageView setImage:[UIImage imageNamed:@"Rating-filled.png"]];
else
NSLog(@"imnotch %@",self);
////////////// my view controller
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
cell=(CustomTableCell*)[tv dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"Identifier for row %d in section %d",indexPath.row,indexPath.section]];
if(cell==nil)
//cell=[[[CustomTableCell alloc] initWithFrame:CGRectZero reuseIdentifier:[NSString stringWithFormat:@"Identifier for row %d in section %d",indexPath.row,indexPath.section] tableView:tv] autorelease];
cell=[[[CustomTableCell alloc] initWithFrame:CGRectZero reuseIdentifier:[NSString stringWithFormat:@"Identifier for row %d in section %d",indexPath.row,indexPath.section] tableView:tv cellRow:indexPath.row cellSection:indexPath.section]autorelease];
//cell=[[[CustomTableCell alloc] initWithFrame:CGRectZero reuseIdentifier:[NSString stringWithFormat:@"Identifier for row %d in section %d",indexPath.row,indexPath.section]] autorelease];
NSLog(@"** %d sec %d ** %@",[indexPath row],[indexPath section],cell);
[cell setImageViewTarget:self action:@selector(changeImageView)];
NSLog(@"%d***",cell.frame.size.height);
@try {
if(searchResults)
[cell.textLabel setText:[searchResultArray objectAtIndex:indexPath.row]];
else
switch (indexPath.section) {
case 0:
[cell.textLabel setText:[[nameDictionary objectForKey:@"a"] objectAtIndex:indexPath.row]];
break;
case 1:
[cell.textLabel setText:[[nameDictionary objectForKey:@"b"] objectAtIndex:indexPath.row]];
break;
case 2:
[cell.textLabel setText:[[nameDictionary objectForKey:@"c"] objectAtIndex:indexPath.row]];
break;
default:
break;
@catch (NSException *ex ){
NSLog(@"Exception caught %@",[ex description]);
//if(indexPath.row<10)
// [cell.textLabel setText:[NSString stringWithFormat:@"sample %d in section %d",indexPath.row,indexPath.section]];
[cell checkImage];
[cell setImageViewTarget:self action:@selector(changeImageView)];
//cell.selectionStyle=UITableViewCellSelectionStyleBlue;
return cell;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
NSLog(@"I am inside did select row at index path");
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//[tableView getHeaderView];
if(searchResults)
return 1;
return 3;
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
if(searchResults)
return [[[searchResultArray objectAtIndex:0] capitalizedString] substringToIndex:1];
else
if(section==0)
//[tableView getHeaderView];
return @"A";
else if(section==1)
//[tableView getHeaderView];
return @"B";
else if(section==2)
//[tableView getHeaderView];
return @"C";
return @"";
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
return [NSArray arrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@" M",@"N",@"O",@"P",nil];
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
//NSLog(@"i m inside touches began method");
-(void)changeImageView
//NSIndexPath *newSetRow = [NSIndexPath indexPathForRow:2 inSection:0];
//[mTableView selectRowAtIndexPath:newSetRow animated:NO scrollPosition:UITableViewScrollPositionNone];
NSLog(@"I m inside changeImageView");
SampleViewController *sample=[[SampleViewController alloc] init];
[self.navigationController pushViewController:sample animated:NO];
//[cell.ratingView setImage:[UIImage imageNamed:@"Rating-filled.png"]];
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
return 36;
}

Similar Messages

  • How can I find all exclamation marks in my iTunes without clicking on each song?  Is there a way to delete all instead of one at a time?

    How can I find all exclamation marks in my iTunes without clicking on each song?  Can they be deleted all at once instead of one song at a time?

    Lost & Found
    Create a playlist called Found, select everything in Music and drag it into the Found playlist (it may take some time to count the tracks that are to be dropped). Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist.
    Optional: It depends a bit on why things aren't where iTunes expects to find them but if they are in sensible Artist & Album folders in some common location then my FindTracks script should be able to reconnect them to iTunes. FindTracks uses some fuzzy matching routines and searches for multiple potential locations. For more details see this thread. Once you have repaired the tracks that can be found you can drag the contents of the Lost playlist into Found which will update things.
    Or, you can simply delete all the tracks in the Lost playlist with Ctrl-A to select them and then Shift-Delete to delete.
    tt2

  • Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal, How can i know whether my phone is in use??

    Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal bcz it seems to be wiped out all data including settings. it might be in use somewhere turning new fresh Gadget.  How can i know whether my phone is in use??

    You would know for a fact if the device is in use, but if you go back to the find my iPhone app in iCloud.com, you can either select to erase it, or place it in lost mode, in which case, once the device makes a connection to the internet, it will automatically go into that mode.

  • In VIEWING (to print) my iTunes music (in finder), how can i view subfolders without clicking on the  triangle of each main folder?

    In VIEWING (to print) my iTunes music (in finder), how can i view subfolders without clicking on the  triangle of each main folder?
    I am trying to print a list of all my music. For example, main folder is BEATLES.  Subfolders are Magical Mystery Tour, Yellow Submarine, Abbey Road, etc...
    and I want to view and print all the subfolders. This is a recovery project after my hard drive failed. I know this is truly a "finder" question and will double post there.
    Thanks.
    Amy

    amy lynn wrote:
    way too much ink.
    Don't know what this means but okay.

  • How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    If you are on a More Everything plan, International texting is included at no additional charge.
    If you are on any other plan, there will be a charge.
    From Verizon FAQ
    If you have The MORE Everything Plan, unlimited international text and multimedia messaging is included for no additional cost.
    For all other plans, you can find pricing, dialing and coverage information for a specific country on our International Messagingpage.

  • I am trying to export my bookmarks to an HTML file, but the "organize" option does not appear when I click on the "bookmarks" option on the menu bar. How can I find the organize option?

    How can I find the "organize" option or export my bookmarks to HTML when no "organize" option appears when I click on the "bookmarks" word on the menu bar?

    Menu changed to show "Show All Bookmarks" see item #7 "Menu changes (wording)" in
    You can make Firefox 4.0.1 look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • How can I find out whether or not I already have subscribed to Creative Cloud.  I thought I had done so last year.  Marjorie Carr

    How can I find out whether or not I subscribed to Creative Cloud and Behance  last winter?  <Removed by Moderator>

    Sign in to your Adobe account online thru the main Adobe site and check to see the status of your subscription(s).  It should list any you have or had.

  • When I start my MacBook Air, I get a problem report on the Time Capsule 802.11n. When I click Continue, it asks for a password. I don't know what the password is because I didn't set this up. How can I find out what the password is?

    When I start my MacBook Air, I get a problem report on the Time Capsule 802.11n. When I click Continue, it asks for a password. I don't know what the password is because I didn't set this up. How can I find out what the password is?

    Who set it up?

  • How can i find the capacity of my iphone 4s. whether it is 8G or 16G.  I do not want to switch it on as it is not connected to any network at the moment

    how can i find the capacity of my iphone 4s. whether it is 8G or 16G.  I do not want to switch it on as it is not connected to any network at the moment

    If you have the serial number of the phone, put it in here
    To find the serial number without switching it on, read this article:
    Find the serial number and other information for your iPhone, iPad, and iPod touch - Apple Support

  • How can you find out whether anything in a table's been selected?

    How can you find out is there anything(a cell or a row) in a table's been selected???
    it's doesn't matter which cell or which row's been selected in a table, but just to know is there anything been selected
    I can't figure out the code to do that >.<
    is there anything to do with
    bookTable.getCellEditor()?

    How can you find out is there anything(a cell or a row) in a table's been selected???
    it's doesn't matter which cell or which row's been selected in a table, but just to know is there anything been selected
    I can't figure out the code to do that >.<
    is there anything to do with
    bookTable.getCellEditor()?

  • How can i find the installed forms version in 6i...?

    Dear all,
    How can i find the installed forms version in 6i, the situation is we have given a solution which will work in only forms6i latest version, before implementing the same we need to check whether the forms latest version has been installed or not
    Is there any way to find out without opening the forms builder..?
    Even if we un install the forms from a machine, the forms60_path variable will remain in regedit, so we cannot go based on that and aslo i dont know whether regedit will have the version details and all.
    It would be greatly appreciated if any one can give a solution.
    Thanks in Advance.
    Thangaraj.

    you query the registry, the registry has the version number saved, but I cannot remember exactly where and I don't have 6i Installed on my machine.
    You just open the Forms Builder and click on Help/About.
    But Jan's method is the best.

  • Re: How can I find my cabinet number and when it w...

    Hi,
    I've been told by BT help chat that my address can get BT Faster Broadband but not Infinity. I'm connected to the Trowbridge SSTRO exchange which is apparently "FTTC available in some areas")  Presumably that's to do with the distance of my house from either the exchange (2.2km) or the street cabinet (not sure which cabinet I'm connected to or where it is). If I've understood correctly, Faster Broadband uses the same fibre infrastructure as Infinity but because the speed can't be guaranteed as above 15Mb/s it can't be sold as Infinity. I am currently a Sky Talk subscriber so many of the BT utilities come back with an "number not recognised" error when I enter the phone number. So I guess I have 2 questions:
    o If I take up Faster Broadband, how can I find out what speed I can actually expect?   
    o How can I find out how long it will be before I can get the full Infinity service?
    I might add that a friend of mine in Trowbridge (1.1km from SSTRO) has full Infinity.
    Thanks for any help, Midsomerjambo

    Hi midsomerjambo,
    BT Infinity and BT Faster Unlimited  Broadband is just BT Retail's brandname for their fibre broadband service.
    The reason why BT Retail say you can't get FTTC BT Infinity is because the FTTC estimation is below 15mbps.
    However you should be able to get BT Faster Unlimited Broadband (FTTC) which is the same as BT Infinity FTTC but for those who have been estimated 15mbps or less on FTTC
    BT Retail set a minimum speed required in order to get BT Infinity which is an FTTC estimation of 15mbps or above, if you have been estimated less than 15mbps for FTTC then you won't be able to get BT Infinity but may be given the choice of BT Faster Unlimited Broadband which still uses the same FTTC Openreach infrastructure and equipment .
    What does it say for your landline number when you go to http://dslchecker.bt.com/adsl , If you don't have a BT Wholesale compatible number then you can check by your address by going to http://dslchecker.bt.com/adsl/ADSLChecker.AddressOutput (won't be as accurate as the landline number checker, but will give you an idea of the estimation speed)
    FTTC fibre broadband uses VDSL or VDSL2 signals that travel from the FTTC cabinet to your property via the existing copper (sometimes aluminium) line. The further away you are from your FTTC cabinet the slower the fibre FTTC broadband will be.
    However VDSL/2 signals used for FTTC broadband connection degrade far quicker in terms of distance than conventional ADSL broadband signal do.
    Generally speaking if your landline is over 1500 meters in length from the FTTC cabinet to your property then you may not be able to get BT Infinity as you may not be able to achieve over 15mbps from an FTTC service, though may be offered BT Retail's sub 15mbps FTTC service called BT Faster Unlimited Broadband.
    Here is a graph that shows the ADSL(G.DMT,ADSL2 and ADSL2+) and VDSL/2 (FTTC) signal with distance. Please be aware that all ADSL connections are depend on distance from local exchange, where as FTTC (VDSL/2) connections are depend on distance from your FTTC (DSLAM) cabinet. Though all connection types are also depend on line quality.
    This graph is also just a general estimation of what the speed could be achieved and not the actual speed you will receive. Also your line maybe longer than you would think as it may not go the direct way to either the cabinet or exchange.
    As to your other question How can I find out how long it will be before I can get the full Infinity service?
    The Openreach Superfast Fibre Broadband Scheme is being rolled out, done and managed by Openreach for ALL ISPs/CPs so BT Retail (a communication provider/ISP whom operates this forum) does not have much input or say whether Openreach will improve the FTTC fibre infrastructre in your area.
    Unless Openreach (who owns and maintain the fibre broadband infrastructure in your exchange area) either installs a new PCP and Dslam cabinet nearer to your property, or you order FTTPoD (Fibre to the Premisies On Demand) [not currently being supported by any ISP] which may cost you thousands, then I'm afraid it may be several years or so until the FTTC fibre infrastructure is improved by Openreach.
    Hope that helps,
    Cheers
    jac_95 | BT.com Help Site | BT Service Status
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Try a Search
    See if someone in the community had the same problem and how they got it resolved.

  • How can I find out if Apple Softare is authentie

    I'm curious to know whether my copy of Aperture is authentic.  It's always coming up as  Trial.  Should that turn off after awhile?  How can I find this out?

    Did you have the trial version installed on your machine at some point? The trial version names the library Aperture Trial (or something like that). The name of the library can be changed in the Finder just as you would change the name of any file. Once you've renamed the library double click it to open Aperture and this will now be your default library,
    If your are referring to something else post back

  • How can i find the printing program?

    hi
    i have sap script how can i find the printing program ?
    ami

    ami bardogo wrote:
    hi
    what is the different between the commands 'break' and 'break-point'
    thanks,
    ami
      h2 Breakpoints  h2
    Apart from being able to execute an ABAP program in the Debugger, you can also start the Debugger call by the choosing a breakpoint. This is achieved by setting one or more of these breakpoints in the program. A breakpoint is a signal at a particular point in the program that tells the ABAP runtime processor to interrupt processing and start the Debugger. The Debugger is activated when the program reaches this point.
    There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For more information, refer to the chapter Watchpoints.
    Breakpoint Variants
    The Debugger contains different breakpoint variants:
    Static
    A user-specific breakpoint is inserted in the source code as an ABAP statement using the keyword BREAK-POINT. A non user-specific breakpoint is set in the ABAP Editor using the BREAK user name statement.
    Directly set
    dynamic breakpoints
    Can be set in the ABAP Editor or the Debugger by double-clicking a line, for example. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
    Breakpoints
    at statements
    The Debugger stops the program immediately before the specified statement is executed.
    Breakpoints
    at subroutines
    The Debugger stops the program immediately before the specified subroutine is called.
    Breakpoints at function modules
    The Debugger stops the program immediately before the specified function module is called.
    Breakpoints at methods
    The Debugger stops the program immediately before the specified method is called.
    Breakpoints at exceptions and system exceptions
    The Debugger stops the program immediately after a system exception, that is, after a runtime error has been intercepted.
    Static Breakpoints
    Static breakpoints are always user-independent if there is no specification of a user name. Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP program, the system always interrupts the program at that point for that user or only for the user name. This procedure is only useful in the development phase of an application when program execution is always to be interrupted at the same place. For more information, refer to the chapter Static Breakpoints.
    In HTTP sessions, a static breakpoint is skipped if you did not set additional dynamic HTTP breakpoints in the editor of a BSP page. Instead, a corresponding system log entry is written, which can be checked using transaction SM21.
    Dynamic Breakpoints
    Dynamic breakpoints are user-specific. Therefore, you should use them if you only want the program to be interrupted when you run it yourself, not when it is being executed by other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
    Dynamic breakpoints are more flexible than static breakpoints because you can deactivate or delete them at runtime. They have the following advantages:
    ·        You do not have to change the program code.
    ·        You can set them even when the program is locked by another programmer.
    ·        You can define a counter that only activates the breakpoint after it has been reached.
    Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the source code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger. For more information, refer to the chapter Dynamic Breakpoints.
    In HTTP sessions, the system stops both at static and dynamic breakpoints if a dynamic breakpoint was set in the editor of a BSP page before program execution.
    Lifetime and Transfer of Breakpoints
    A static breakpoint remains intact as long as the BREAK-POINT or BREAK-POINT name statement is not removed from the source code. Without saving, dynamic breakpoints only remain intact in the relevant internal session. However, they remain in effect during the entire user session if they are saved by choosing the menu path Breakpoints ® Save in the ABAP Debugger. For more details on the subject of user sessions and modes, refer to Modularization Techniques in the ABAP keyword documentation.
    If you call an HTTP session during a user session, only the HTTP breakpoints are loaded when the HTTP session is started. You activate HTTP debugging in the ABAP Editor by choosing Utilities ® Settings ® HTTP Debugging. Depending on the setting, the system then displays either the HTTP or standard breakpoints in the Editor.
    If you call an update session during a user session, breakpoints that were defined beforehand in the calling processing unit are copied to the new update session, where they can be displayed under Breakpoints. If, in the ABAP Debugger, you check Update Debugging  under Settings and then, for example, call the update module func using CALL FUNCTION func IN UPDATE TASK, a new window is opened in which you can debug this function module in the update session. All the breakpoints that were set in the calling processing unit can also be processed here.
    For further information on special breakpoints, refer to:
    Breakpoints at Statements
    Breakpoints at Subroutines
    Breakpoints at Function Module Calls
    Breakpoints at Methods
    Breakpoints at System Exceptions
    h2 page  break h2
    WINDOW TYPES
    When defining a layout set window, you must select a window type for the window. You can choose between three types:
    • Constant windows (CONST)
    • Variable windows (VAR)
    • Main windows (MAIN)
    CONSTANT WINDOW
    A window of type CONST has the same contents and size on all layout set pages, on which a corresponding page window is defined. This allows the processing of the window contents to be optimized internally.
    Page windows whose allocated window is of type CONST must have the same size throughout the layout set. If a window of type CONST is full, all remaining text the application program wants to output in this window, is lost. Constant windows do not trigger a page break. In other words: all text exceeding the window size is simply truncated.
    VARIABLE WINDOW
    The contents of variable windows is processed again for each page, on which the window appears. The system outputs only as much text as fits into the window. Text exceeding the window size is truncated; the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different layout set pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike. The only difference is that constant windows have the same size throughout the layout set.
    MAIN WINDOW
    Each layout set must have one window of type MAIN. Such a window is called the main window of the layout set. For SAPscript layout sets, the main window has a central meaning:
    • It controls the page break.
    • It contains the text body that may cover several pages.
    • It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the layout set. The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page. This page must not call itself as subsequent page (recursive call), since this would produce an endless loop. In such a case, SAPscript terminates the output after three subsequent pages.
    HOW THE COMPOSER WORKS
    The composer or layout set processor is the central formatting module for the print output. It prepares the texts for the different output devices by using the allocated styles or layout sets.
    Processing a layout set happens in a certain order. You must know some facts concerning the different window types, the setting of subsequent pages, or the dynamic control from within the print program.
    Page control in layout sets
    Define subsequent page statically
    Define subsequent page dynamically
    Format a layout set page
    PAGE CONTROL IN LAYOUT SETS
    SAPscript automatically triggers a page break as soon as the main window of one page is full. To be able to execute the page break, the system must know on which subsequent page to continue outputting the text. You can specify the subsequent page either statically when defining the layout set, or you can set the subsequent page dynamically during layout set output.
    If the subsequent page is not specified, SAPscript automatically terminates printing, thereby ignoring any other output statements of the application program.
    DEFINE SUBSEQUENT PAGE STATICALLY
    You define the subsequent page statically with the layout set maintenance transaction. First, specify the start page in the layout set header. The system automatically calls this page whenever the layout set is started. With this page, or, more correctly, with the page window of this page, the text output starts. For each page, specify the subsequent page in the page definition. After a page break, the system continues text output on the subsequent page defined for the last page. By specifying start page and subsequent pages, you can define a page sequence.
    DEFINE SUBSEQUENT PAGE DYNAMICALLY
    The page sequence set in the layout set definition can be changed by the application program dynamically at runtime. If you want the layout set to start with a page other than the one defined in the layout set header, specify the desired start page using the parameter STARTPAGE when you call the function module START_FORM. However, this new start page is valid only for the current call of the function module.
    If you want to break to a subsequent page other than the one specified in the page definition, use the control statement NEW-PAGE to set the name of the new page.
    NEW-PAGE .
    NEW-PAGE ends the output on the current page. The new subsequent page is only valid for the current call of the control statement. You can either include the control statement explicitly into the text of a text element or pass it to the layout set output using the function module CONTROL_FORM.
    FORMAT LAYOUT SET PAGE
    The process of formatting the output is controlled by the text contents in the BODY area of the main window. If the main window is completely filled, or if the control statement NEW-PAGE appears in the main window, the system executes a page break. Only at this point in time the system formats the contents of the windows of the other types and replaces the variables with the current values.
    For each other window, the system first outputs the default text element, if it exists. Then it processes and formats the list of the active text elements of this window, which you set using the function module WRITE_FORM with the parameter FUNCTION (SET, APPEND, DELETE). Any text that does not fit into the page window is truncated.
    As a consequence to this processing order of the composer, the reservation of space for the TOP and BOTTOM areas must be made beforehand. If the BODY area of the main window already contains text, a new text output to the TOP area does not appear on the current page but on the subsequent page in the TOP area. The same applies for the BOTTOM area. If the BODY area is filled to such an extend that the new BOTTOM text no longer fits into the current main window, this text appears on the subsequent page in the BOTTOM area.
    A frequent error in application programs is that for the subsequent page (for example, NEXT) of a layout set no main window is defined. If the formatted text of the previous page did not fit into the corresponding main window , the composer searches the subsequent pages for a main window to output the text remainder. However, if the subsequent page of NEXT is NEXT again, the composer encounters an endless loop.
    To be able to create correct page breaks in longer text, you should define a main window on each layout set page.
    LAYOUT SET CONTROL
    To output SAPscript layout sets, in the print program you must always start the output with OPEN_FORM and end it with CLOSE_FORM. The function module OPEN_FORM initializes the SAPscript composer and opens the specified layout set for subsequent output. The system combines all output for this layout set up to the CLOSE_FORM to one print request. If CLOSE_FORM is missing, nothing will be printed.
    To output data in a layout set, you must use the SAPscript function modules WRITE_FORM, WRITE_FORM_LINES, and CONTROL_FORM. You can use these function modules any number of times in any order between opening and closing a layout set.
    You cannot use the ABAP/4 statement WRITE to write output to a SAPscript layout set.
    Several print requests
    Start a layout set again
    Switch layout sets
    Find layout sets
    SEVERAL PRINT REQUESTS
    Within one transaction, you can open and close several layout sets using OPEN_FORM and CLOSE_FORM, however not simultaneously. You can use parameters in the OPEN_FORM to control whether the output is stored in the same print request. But also the SAP spool decides, depending on several plausibility checks, whether new output is appended to an existing print request or whether to create a new print request anyway.
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'CLOSE_FORM'
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'CLOSE_FORM'
    You cannot combine ABAP/4 list output and SAPscript output in one print request.
    START A LAYOUT SET AGAIN
    Usually a print program does not print only one urging letter or one account statement, but several layout sets for different customers. To have the output for each customer begin with the start page of the layout set, you must start the current layout set again and again.
    To start a layout set again, you must first end the current layout set and then open the layout set again. Within one print request, first call the function module END_FORM. It executes the final processing for the current layout set. Then start the layout set again using START_FORM. Output then begins again on the start page of the desired layout set.
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'START_FORM'
    CALL FUNCTION 'END_FORM'
    CALL FUNCTION 'START_FORM'
    CALL FUNCTION 'END_FORM'
    CALL FUNCTION CLOSE_FORM
    If you use START_FORM and END_FORM, you must not specify a layout set for OPEN_FORM. However, in this case you can use the SAPscript output functions only after opening a layout set with START_FORM.

  • How can we find out data in an editable ALV grid has been changed or not?

    Hi Experts,
    How can we find out whether a data in an editable ALV grid has been changed or not.
    I am using the
    FM -> REUSE_ALV_GRID_DISPLAY_LVC
    for ALV display.
    I have to chekc whther data has been changed or not befor saving. if changed then only i want to
    SAVE
    . I cannot use the internal table comparison method for this purpose also i am not using OOP ALV.
    So kindly sugest me an alternative.
    Thanks and Regards,
    Shahana

    Hi,
    Thanks for your answer. I already saw this post.
    See this method.
    CALL METHOD reuse_alv_grid->check_changed_data
    IMPORTING
    e_valid = lv_check.
    This will update the internal table with the edited values. Then we can go for internal table comparison.
    But my scenario will not allow me for itab comparisons.I just want to know the ALV data has been changed or not.
    Regards,
    Shahana

Maybe you are looking for

  • TC 2 TB A1409 Wan internet connection no longer working but light is still green?

    TC 2 TB A1409 Wan internet connection no longer working but light is still green? My TC and modem have been up and running for at least the last 2 years without any issues. It recently started acting up and I would have restart it as I had no interne

  • OpenLDAP and Octet String.

    Hi all, I had a new problem with my jsp's applications that must connect to a openLDAP server. I resolve the connection and the search problems, as I said in other post. Now the problem is that I must use the connection for authenticate the simple us

  • Exception java.sql.SQLException: This Connection has either timed out

    I am using JRUN 4 & SQL Server 2000 and Driver is Type 4 SQL Server 2000. Type 4 driver : com.microsoft.jdbc.sqlserver.SQLServerDriver I am able to connect & fire the query but while insertion record it gives me this error. Exception java.sql.SQLExce

  • CANopen: the PC doesn't communicate with the motor controller

    Hi there, I'm new with both Labview and CANopen and I'm trying to write a RXPDO on my Linmot motor controller(VI attached). I'm using a PCI CAN Series 2 card.  My VI worked just once ; I was able for example to move the motor with the JOG commands. 

  • Excel Interface

    There is a user requirement for exporting a report in excel when the report is exported in excel and when it is opened, the excel sheet opens in a small window Now the user has to click on the maximise icon of the excel sheet to open the excell sheet