Looping over CFFILE only writes last line
Here is the code in question:
<CFSET LINECOUNT = 0>
<cfloop list="#populate#" index="CL">
<CFOUTPUT>#CL#:<input type="text" name="#CL#"><BR></CFOUTPUT>
<CFSET LINECOUNT = LINECOUNT + 1>
<CFSET ThisNewLine = '<input type="text" name="#CL#">#CL#'>
<cffile action="append" file="#Application.BaseRef#Temp\#URL.Field#.CFM" output="#ThisNewLine#" addnewline="Yes">
</cfloop>
Linecount = <CFOUTPUT>#LineCount#</CFOUTPUT>
The list populate# has 28 items in it, the output to the screen is 28 lines of input boxes, the line count variable value is 28 but only one line (The last line) is written to the file.
What is the world am I overlooking?
Thanks,
Kev
Well, I went to clean up my code to get rid of all the debug "stuff" I put in there trying to determine the root cause so I could post the whole shebang for you and after I removed all the "stuff" I executed it again to make sure that I didn't introduce a new error and whatever was causing the problem is now no longer there. I apologize to the community for wasting the bandwidth.
If ignorance is bliss, why am I not happy?
Similar Messages
-
Only the last line item is shown in main window...
Hello Experts,
I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
called a subroutine in a custom program which loops through the line items but the problem is
only the last line item is being shown. I tried using CONTROL_FORM to create a new line
but it does not work. Note that I did not customize RFFOUS_C since it is being used by
multiple companies. Below is my code:
SAPSCRIPT:
510-C
Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
DEFINE <YC_XBLNR& = ''
DEFINE <YC_BLDAT& = ''
DEFINE <YC_SGTXT& = ''
DEFINE <YC_DMBTR& = ''
PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
USING ®UH-LAUFD&
USING ®UH-LAUFI&
USING ®UH-XVORL&
USING ®UH-ZBUKR&
USING ®UH-LIFNR&
USING ®UH-VBLNR&
CHANGING <YC_XBLNR&
CHANGING <YC_BLDAT&
CHANGING <YC_SGTXT&
CHANGING <YC_DMBTR&
ENDPERFORM
PROTECT
<YC_XBLNR& <YC_BLDAT& <YC_SGTXT& <YC_DMBTR&
ENDPROTECT
End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
PROGRAM:
IF gt_regup[] IS NOT INITIAL.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
* DEVICE = 'PRINTER'
* DIALOG = 'X'
form = lcc_z2574ffi_ra
* LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
OTHERS = 12.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT gt_regup INTO lw_regup.
m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
m_line_items 'LTYC_BLDAT' lw_regup-bldat.
m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
DELETE ex_output WHERE value IS INITIAL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '510-C'
function = 'APPEND'
* TYPE = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.Hi,
Write the at last event in the program and check if it works
At last.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards,
Sravanthi -
SAPScript: why the window only show the LAST line
Dears,
In my form, one of the window only show the LAST line of the it.
I have set the window enough space, also when debuging the program , open_form, write_form,
all of those sy-subrc = 0.
both static texts and dynamic texts are set in the window, but only the last line shown.
Anyone could help me?
Thanks a lot.
Sincerely,
Julie LvHi,
There are several possibilities to resolve your problem.
You can work with 2 main windows on in1 page.
With NEW-WINDOW you switch to the next main-window
How to use it.
make an item in main window with that /: NEW-WINDOW command
if you are ready with first loop call a WRITE_FORM with that NEW-WINDOW statement.
to cojntinue in the other main.
Other possibility is. (in case there are not ot many lines)
Use for every line other variable names.
Fill these in the loop. And after loop WRITE FORM
eg. (if maximum is 3 lines)
&VAR1_1& &VAR1_2& &VAR1_3& &VAR1_4&
&VAR2_1& &VAR2_2& &VAR2_3& &VAR2_4&
&VAR3_1& &VAR3_2& &VAR3_3& &VAR3_4&
Hope this helps.
Gr., Frank -
Cannot retrieve all vector objects - reading only last line .. Please help
<pre>
When I test the vector in the method that adds the elements, each line is returned. Testing the vector in the method getData(), all items are returned within the while loop, but the test returns only the last line of in the vector. Can anyone help me out and let me know what I'm doing wrong.
Here's a summary of what I'm doing and the code follows.....
My bean class:
- creates a vector and adds several lines to the vector
- using StringTokenizer and Enumeration, parses the data and checks to see if the line has the required amount of tokens (which is 4). If so, then the string is passed to my main class
In the main class, the string is parsed into its appropriate attribute and then the required ones are displayed in the browser.
//Vector class bean
public SpecBean()
public Vector addData()
vecdata.addElement ("3|4||");
vecdata.addElement ("2|3||1200");
vecdata.addElement ("1|2|Q|");
vecdata.addElement ("4|2|U|4356");
return vecdata;
public String getData()
StringTokenizer st;
String record = new String();
Enumeration enumdata = vecdata.elements();
while (enumdata.hasMoreElements())
record = enumdata.nextElement().toString();
System.out.println (record);
st = new StringTokenizer( record, "|");
int numberOfTokens = st.countTokens();
if (numberOfTokens < 4)
record = "Incomplete Data";
return record;
// end class...
//begin main class -- this is a servlet which is why the
//out.println statements are there
try {
SpecBean specs = new SpecBean();
specs.getItemListing();
token = new StringTokenizer ((String)specs.getData(), "|");
out.println ("<table width=\"100%\" border=1>");
out.println("<tr>");
out.println ("<td width=\"40%\">");
while (token.hasMoreTokens())
String id = token.nextToken();
String orderNum = token.nextToken();
String name = token.nextToken();
String confNum = token.nextToken();
out.println (title + "</td>");
out.println ("<td width=\"20%\" align=\"right\">" + "$" + price + "</td>");
out.println ("<td width=\"40%\">" + notes);
//end main class
Thank you.<pre>
My apologies. What I was looking to do was return EVERY line from the vector that had an equivalent of 4 tokens and no less. I just realized that the sample data I had entered into the vector only had one line w/ 4 tokens. When this is modified and there are 2+ lines that contain 4 tokens, the only line that is retrieved is the very last line. So if the data in the vector was:
public Vector addData()
vecdata.addElement ("3|4|rtd|222");
vecdata.addElement ("2|3||1200");
vecdata.addElement ("1|2|QsT|");
vecdata.addElement ("4|2|U|4356");
return vecdata;
public String getData()
StringTokenizer st;
String record = new String();
Enumeration enumdata = vecdata.elements();
while (enumdata.hasMoreElements())
record = enumdata.nextElement().toString();
System.out.println (record);
st = new StringTokenizer( record, "|");
int numberOfTokens = st.countTokens();
if (numberOfTokens < 4)
record = "Incomplete Data";
return record;
The output to the browser is
4 2 U 4356
and not
3 4 rtd 222
4 2 U 4356
I did some print statements throughout addData() and getData() to see if all of the objects in the vector were still there and everything checked out until I hit the end of the getData(). Before 'return record' the print statement returned '4 2 U 4356' only. I'm not sure what I have missed to have the getData() method return only one matching line and not all of them.
Your help is appreciated. Thank you. -
hey All.
I was wondering if any experts out there can share their expeirences with looping over all of the matrix line items on a sales order form. I have to do this for a client and I would like to know what the best methods are when it comes to speed and performance. Does anyone have any sample code they can share for doing this? I need to update things like price/quantity on each line item when the user presses a button. I know there are different ways to loop over and access these items so I am hoping someone has figured out the best way
Thanks for the help,
CurtisHi Curtis...
The primary two ways of looping data in a matrix... Using the DdDatasouce and Using the oMatrix.Columns.Item("uid").Cells.(row).Specific ...
The first thing one need to know when choosing is:
- Is it a system matrix or you own matrix
- Does you need to read data only or do you need to write data also
- Do you need data from one row/few rows or all rows
The primary reason for these questions is that in system matrixes you are limited to only read from datasources (write is not possible)
This is in my experience the best way to do the following
Read all data from a system matrix:
- Make a Omatrix.FlushToDatasource an read all data from the datasource (Performance = Fast)
Read a specific line on a system matrix:
- Use oMatrix.GetLineData(row) and use the datasource to get data (from the datasource offset)
Write data to a system matrix:
- Since you can't do this using the datasouce only (slow/very slow) solution is to use oMatrix.Columns.Item("uid").Cells.(row).Specific.. There are additional limits to this, because in order to write data the columns must be both editable and visible. (Performance = Slow/very slow (1+ min to update perhaps 100 lines, but 1-10 lines is somewhat ok))
Read/Write data to own matrix
- Always use the datasource... -
Printing in only last line item printing in main window
Hi All,
My requiremnet is to print same data in two blocks for F110 payment cheque
Iam using 2 main windows to print same data if block exceeds it will go to next page
iam calling the windows as shown below
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN00'
element = hlp_ep_element
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc EQ 2.
err_element-fname = t042e-zforn.
err_element-fenst = 'MAIN00'.
err_element-elemt = hlp_ep_element.
err_element-text = text_525.
COLLECT err_element.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN01'
element = hlp_ep_element
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc EQ 2.
err_element-fname = t042e-zforn.
err_element-fenst = 'MAIN01'.
err_element-elemt = hlp_ep_element.
err_element-text = text_525.
COLLECT err_element.
ENDIF.
Iam getting only last line item printing in main window
Please provide the inputs.
Thanks,
Kamalakar.
Please use code tags.
Edited by: Rob Burbank on Nov 25, 2011 11:51 AMHi,
My requirement was to print same block twice in cheque printing of F110.
I have used the function module 'WRITE_FORM_LINES' to print more than one line item in secondary window in the script .
fill the Lines internal table as shown below.
Example :
lines-tdformat = 'TM'.
CONCATENATE regup-xblnr ',,' w_date ',,' w_bsak-sgtxt ',,' w_gross ',,' w_dis ',,'
w_net INTO lines-tdline.
APPEND lines.
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
function = 'APPEND'
header = header_t
type = 'BODY'
window = 'MAIN01'
IMPORTING
FROMPAGE =
PENDING_LINES =
TABLES
lines = lines
EXCEPTIONS
function = 1
type = 2
unopened = 3
unstarted = 4
window = 5
bad_pageformat_for_print = 6
spool_error = 7
codepage = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF. -
Add a different character to the last line of a loop
Hi,
I'm attempting to use some pl/sql to generate an RMAN copy script. After each line there needs to be comma, but the last line of the loop should have a semi-colon to terminate the statement. How can I do that?
In the example below, the copy for controlfile 3 needs to be a semi-colon, not a comma:
run
SHUTDOWN IMMEDIATE
STARTUP MOUNT
COPY
DATAFILE 1 TO '/u20/oraflash/ORCL1/dbcopy/system01.dbf',
DATAFILE 2 TO '/u20/oraflash/ORCL1/dbcopy/undotbs01.dbf',
DATAFILE 3 TO '/u20/oraflash/ORCL1/dbcopy/drsys01.dbf',
DATAFILE 4 TO '/u20/oraflash/ORCL1/dbcopy/example01.dbf',
DATAFILE 5 TO '/u20/oraflash/ORCL1/dbcopy/indx01.dbf',
DATAFILE 6 TO '/u20/oraflash/ORCL1/dbcopy/tools01.dbf',
DATAFILE 7 TO '/u20/oraflash/ORCL1/dbcopy/users01.dbf',
DATAFILE 8 TO '/u20/oraflash/ORCL1/dbcopy/xdb01.dbf',
CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control01.ctl',
CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control02.ctl',
CURRENT CONTROLFILE TO '/u20/oraflash/ORCL1/dbcopy/control03.ctl',
ALTER DATABASE OPEN
My script is:
set serveroutput on format wrapped
set feedback off
spool db_copy.rcv
declare
cursor df is
select
file#,
substr(name,29,50) name
from
v$datafile;
cursor cf is
select
substr(name,27,50) name
from
v$controlfile;
BEGIN
DBMS_OUTPUT.ENABLE(2000);
DBMS_OUTPUT.PUT_LINE('run');
DBMS_OUTPUT.PUT_LINE('{');
DBMS_OUTPUT.PUT_LINE('SHUTDOWN IMMEDIATE');
DBMS_OUTPUT.PUT_LINE('STARTUP MOUNT');
DBMS_OUTPUT.PUT_LINE('COPY');
for dfbkup in df loop
dbms_output.put_line(' DATAFILE '||dfbkup.file#||
' TO ''' || '/u20/oraflash/ORCL1/dbcopy/' || dfbkup.name ||''',');
end loop;
for cfbkup in cf loop
dbms_output.put_line(' CURRENT CONTROLFILE' ||
' TO ''' || '/u20/oraflash/ORCL1/dbcopy/' || cfbkup.name ||''',');
end loop;
DBMS_OUTPUT.PUT_LINE(' ;');
DBMS_OUTPUT.PUT_LINE('ALTER DATABASE OPEN');
DBMS_OUTPUT.PUT_LINE('}');
end;
spool offHi
Try this then and remove any returns that I've put in as appropriate
DECLARE
l_string VARCHAR2(32767);
l_num NUMBER := 1;
CURSOR df IS
SELECT file#, SUBSTR (name, 29, 50) name
FROM v$datafile;
CURSOR cf IS
SELECT SUBSTR (name, 27, 50) name
FROM v$controlfile;
BEGIN
l_string := ('run
l_string := l_string||('{
l_string := l_string||('SHUTDOWN IMMEDIATE
l_string := l_string||('STARTUP MOUNT
l_string := l_string||('COPY
FOR dfbkup IN df
LOOP
l_string := l_string||( ' DATAFILE '
|| dfbkup.file#
|| ' TO '''
|| '/u20/oraflash/ORCL1/dbcopy/'
|| dfbkup.name
|| ''',
END LOOP;
FOR cfbkup IN cf
LOOP
l_string := l_string||( ' CURRENT CONTROLFILE'
|| ' TO '''
|| '/u20/oraflash/ORCL1/dbcopy/'
|| cfbkup.name
|| ''',
END LOOP;
l_string := RTRIM(l_string,'
l_string := l_string||(' ;
l_string := l_string||('ALTER DATABASE OPEN
l_string := l_string||('}');
WHILE l_num <= LENGTH(l_string) LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(l_string, l_num, 200));
l_num := l_num + 200;
END LOOP;
END;Cheers
Ben -
I dropped my Iphone 5 which resulted in it shattering and the screen was still on but it was black with only a white line through it so I couldnt access the phone however I switched over to my Droid and now I cannot send or receive messages and I cant turn off imessage because I cant see anything on the screen. Help?
Then the bottom of the support document states that if you do not have access to the device (which unfortunately because of the screen issue you do not) to contact Apple Care. That is what you need to do.
-
Revision: 20754
Revision: 20754
Author: [email protected]
Date: 2011-03-10 03:36:05 -0800 (Thu, 10 Mar 2011)
Log Message:
My latest EndpointPushNotifier change changed the style of the code quite a bit (sorry for that, it was my IDE settings getting in the loop here) I only changed one char line 389.
Modified Paths:
blazeds/trunk/modules/core/src/flex/messaging/client/EndpointPushNotifier.javaI seem to have fixed it by putting <div class="clearfloat"></div> after the navigation bar?
-
Fields only to be displayed for last line item
I copied WESCHEINVERS3( goods receipt form) script to zxxxx and placed some fields in Main window using Perform statement. When i am displaying the output these fields are getting displayed under each line item. but i want them to be displayed under last line item.Please suggest how can i do this.
Thanks
K Srinivasdata: v_cnt1 type i, v_cnt2 type i.
count the number line item using describe lines statement in V_cnt1
and in the table loop count the number of item into V_cnt2.
place the field that you want at the end of all line item in the footer of the table and put a condition in the condition tab v_cnt1 = v_cnt2. -
Video CC problem in 5.5: only last line shows up
Using Captivate 5.5. My slide has imported slide video and I want to caption the narration contained in the video. There is no other slide audio.
I can enter the caption text in the Slide Notes rows as expected, and I check the Video CC box for each row.
However, when I preview the slide, only the last row of text appears on-screen. It appears right at the beginning of the slide and doesn't go away.
Any ideas why the first line of the captions doesn't appear?
Thanks!It could be that your eMac is covered under Apple's eMac Repair Extension Program for Video and Power Issues. You can read more about it here:
http://www.apple.com/support/emac/repairextensionprogram/
It could be a coincidence that you started having problems after installing Mac OS X 10.4.7. Let us know if your eMac falls within the serial number ranges on the repair site. -
How to only read the last line in the text file by using BufferedReader ?
Dear all,
Hello, I am new to Java. Do anybody know how to read the last line (this is the last record) in the text file.The method I am now using is reading from the first line until I reach the last line in the text file. Thank you!!
BufferedReader br = new BufferedReader(new FileReader("c:\\sdk1.4.1\\bin\\dbExport.txt"));
DataInputStream in = new DataInputStream(new FileInputStream("c:\\sdk1.4.1\\bin\\dbExport.txt"));
String input;
String firstinput;
String secondinput;
int count=90;
int year=1955;
while ((input = br.readLine()) != null) {
firstinput = input.substring(0, 10);
secondinput = input.substring(10);
String insertStore1 = ("INSERT INTO AUTHORS " +
"VALUES ('" + count + "', '" + firstinput + "', '" + secondinput + "', 1955)");
System.out.println(insertStore1);
int result = stmt.executeUpdate(insertStore1);I suppose you could use a java.io.RandomAccessFile.
-
How can I get the size of all lines or the last line number in a DB?
I want to display a certain number of lines from a DB.
But before I fetch them out, I must know how many lines of this DB has.
I donnot know if there is some methods have this function. I know the last() method can move the cursor to the last line, but some DB cannot support this function.
Could someone know the answer or some examples about displaying data in a jsp?
Thanks a lot.To get the number of rows in a ResultSet, loop over the result set with while(res.next()). Read each row into an object. Add each object into a, say, LinkedList. At the end, you will have the rows nicely converted to objects (which you probably should do anyway), and list.size() will give the number of objects.
There are other ways to get the number of objects, but list.size() is the easy and reliable way. If you don't need the rows converted to objects ...why did you select them in the first place?
Tricks with last() and whatnot sort of work. They read the entire result set into memory. But you'll need to write the while(res.next()) loop anyway. No point in having the computer do the same thing twice. -
Balance ragged lines - except last line?
Hi everyone
Is there any way to balance the lines of an entire paragraph except for the very last line? I would like to make it visible when a new paragraph begins, and a shorter line would be my choice. It would be great if there were a global solution for this, at the moment I am fiddling around manually quite a bit. Then again, maybe this is how it's done...
I'm using CS6. Thanks for your help!incubo1 wrote:
I'll keep fiddling around with this. I clean up manually very much the way described by Joel, with a few forced breaks or non-breaks etc. The problem is that my boss changes the text at the last moment every single time (since I'm unfortunately the author as well as the designer) which leaves me with a huge mess. I would love it if the final proof-read actually were the final one but she always alters the text after I show her the layout. I guess I need to resign to the fact that I will always have to undo all my manual adjustments and start over.
Here is some *good* news, then. I prefer to manual fix using No Break over non-breaking spaces (I only use nbsp's where they are 'significant') and frequently run into the same problem: an editor or author doing some huge text edits, making all my previous "nicifications" obsolete -- or even harmful.
A couple of years ago I tried to write an InDesign plugin to make No Break visible, along with Show Hidden Characters. Alas, that ran into the ground due to my inexperience in writing plugins. But there is an almost as good option: Show Local Formatting (http://www.indiscripts.com/post/2010/05/show-local-formatting-in-indesign-cs4)
This script toggles a hidden option of InDesign that clearly marks any manual formatting with a red line in 'normal' view mode -- it won't print out or export to PDF. If you stick religiously to paragraph and character styles and only use local formatting for manual fixes, this is an incredibly useful tool.
Even better: you can assign a hotkey to it using the Keyboard Shortcut Editor, or include it into your dropdown menu's: http://in-tools.com/article/scripts-blog/showing-text-formatting-overrides/ -
How to get footer only in last page of report
anybody tell me
1).how to get footer only in last page while we are displaying reports
and header only in first page .
2) how to create search help and how to use it .
3) how to create lock objects and how can we use itHi
This posting has an example of using a splitter container:
Changing width of a custom container dynamically
This posting has a discussion about using TOP-OF-PAGE:
Display Page numbers in ALV
This posting has an example of using picture control:
Insert picture in selection screen.
This posting has an example of putting a picture on top of an ALV grid:
Logo in OO ALV Grid
The page footer is defined using the statement END-OF-PAGE.
The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement.
<u><b>CREATION:</b></u>
Go to SE11 Tcode
select search help
give the 'z' search help name and create
select the selection method ur table name eg : 'mara'
dialog module 'display value immediately'.
add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
where left position when displaying and spos = search position
and then save and activate ..
<b>Creating Search Help:</b>
http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm
http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_imp.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee2b446011d189700000e8322d00/frameset.htm
A lock object is a virtual link of several SAP tables which is used to synchronize simultaneous access by two users to the same set of data ( SAP lock concept).
Locks are requested and released in the programming of online transactions by calling certain function modules which are automatically generated from the definition of the lock objects. These lock objects must be explicitly created in the ABAP Dictionary.
<b>To set locks, you must perform the following steps:</b>
1. You must define a lock object in the ABAP Dictionary. The name of the lock object should begin with E.
2. The function modules for requesting and releasing locks which are created automatically when the lock object is activated must be linked to the programming of the relevant online transactions.
<u><b>Reasons for Setting Locks</b></u>
Suppose a travel agent want to book a flight. The customer wants to fly to a particular city with a certain airline on a certain day. The booking must only be possible if there are still free places on the flight. To avoid the possibility of overbooking, the database entry corresponding to the flight must be locked against access from other transactions. This ensures that one user can find out the number of free places, make the booking, and change the number of free places without the data being changed in the meantime by another transaction.
<u><b>Lock Mechanisms in the Database System</b></u>
The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. This means that database locks can never be set for longer than a single database LUW; in other words, a single dialog step in an R/3 application program.
Physical locks in the database system are therefore insufficient for the requirements of an R/3 transaction. Locks in the R/3 System must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must apply on all servers in that R/3 System.
<u><b>SAP Locks</b></u>
To complement the SAP LUW concept, in which bundled database changes are made in a single database LUW, the R/3 System also contains a lock mechanism, fully independent of database locks, that allows you to set a lock that spans several dialog steps. These locks are known as SAP locks.
The SAP lock concept is based on lock objects. Lock objects allow you to set an SAP lock for an entire application object. An application object consists of one or more entries in a database table, or entries from more than one database table that are linked using foreign key relationships.
Before you can set an SAP lock in an ABAP program, you must first create a lock object in the ABAP Dictionary. A lock object definition contains the database tables and their key fields on the basis of which you want to set a lock. When you create a lock object, the system automatically generates two function modules with the names ENQUEUE_<lock object name> and DEQUEUE_<lock object name> . You can then set and release SAP locks in your ABAP program by calling these function modules in a CALL FUNCTION statement.
<u><b>Lock Types</b></u>
There are two types of lock in the R/3 System:
<u><b>
Shared lock</b></u>
Shared locks (or read locks) allow you to prevent data from being changed while you are reading it. They prevent other programs from setting an exclusive lock (write lock) to change the object. It does not, however, prevent other programs from setting further read locks.
<u><b>Exclusive lock</b></u>
Exclusive locks (or write locks) allow you to prevent data from being changed while you are changing it yourself. An exclusive lock, as its name suggests, locks an application object for exclusive use by the program that sets it. No other program can then set either a shared lock or an exclusive lock for the same application object.
example uses the lock object ESFLIGHT and its function modules ENQUEUE_ESFLIGHT and DEQUEUE_ESFLIGHT to lock and unlock the object.
For more information about creating lock objects and the corresponding function modules, refer to the Lock objects section of the ABAP Dictionary documentation.
The PAI processing for screen 100 in this transaction processes the user input and prepares for the requested action (Change or Display). If the user chooses Change, the program locks the relevant database object by calling the corresponding ENQUEUE function.
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SHOW'....
WHEN 'CHNG'.
* <...Authority-check and other code...>
CALL FUNCTION 'ENQUEUE_ESFLIGHT'
EXPORTING
MANDT = SY-MANDT
CARRID = SPFLI-CARRID
CONNID = SPFLI-CONNID
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID
TYPE 'E'
NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
The ENQUEUE function module can trigger the following exceptions:
FOREIGN_LOCK determines whether a conflicting lock already exists. The system variable SY-MSGV1 contains the name of the user that owns the lock.
The SYSTEM_FAILURE exception is triggered if the enqueue server is unable to set the lock for technical reasons.
At the end of a transaction, the locks are released automatically. However, there are exceptions if you have called update routines within the transaction. You can release a lock explicitly by calling the corresponding DEQUEUE module. As the programmer, you must decide for yourself the point at which it makes most sense to release the locks (for example, to make the data available to other transactions).
If you need to use the DEQUEUE function module call several times in a program, it makes good sense to write it in a subroutine, which you then call as required.
The subroutine UNLOCK_FLIGHT calls the DEQUEUE function module for the lock object ESFLIGHT:
FORM UNLOCK_FLIGHT.
CALL FUNCTION 'DEQUEUE_ESFLIGHT'
EXPORTING
MANDT = SY-MANDT
CARRID = SPFLI-CARRID
CONNID = SPFLI-CONNID
EXCEPTIONS
OTHERS = 1.
SET SCREEN 100.
ENDFORM.
You might use this for the BACK and EXIT functions in a PAI module for screen 200 in this example transaction. In the program, the system checks whether the user leaves the screen without having saved his or her changes. If so, the PROMPT_AND_SAVE routine sends a reminder, and gives the user the opportunity to save the changes. The flight can be unlocked by calling the UNLOCK_FLIGHT subroutine.
MODULE USER_COMMAND_0200 INPUT.
CASE OK_CODE.
WHEN 'SAVE'....
WHEN 'EXIT'.
CLEAR OK_CODE.
IF OLD_SPFLI NE SPFLI.
PERFORM PROMPT_AND_SAVE.
ENDIF.
PERFORM UNLOCK_FLIGHT.
LEAVE TO SCREEN 0.
WHEN 'BACK'....
<b>
Another Example</b> :
please see this link with Screen shot .....
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/frameset.htm
Reward all helpfull answers
Regards
Pavan
Maybe you are looking for
-
Number that shows as my phone number reads invalid...
I pay the fee for unlimited calls in the US and also for having a line others can call. I have always thought my incoming line was one number and for ages it has been. Recently, even though the number still shows up on my end, if I call it, it ring
-
Text Style question re INSTR Global text source - Logic Pro X
I write arrangments for an 18 piece big band. The line up is 5 saxes, 4 trumpets, 4 trombones, piano, bass, drums, male vocalist & female vocalist. I only have one GM sound module (Kentron SD2). I use a Midisport 2x4 Midi Interface between the Mac Mi
-
Technical Routing Vs Logical Routing
Hi Friends, Plz differentiale Technical Routing and Logical Routing
-
Hi, I have a old IPod Nano, rarely used. I don't know how to download a podcast to it. Can anyone help me?
-
Primavera 6.2 page setup
When I open the page setup menu box in either Header/Footer I get HTML formating instead of 'normal' text No icons showing type of font or whether to place the font 'left, right, centre etc' <HTML><Body bgColor=#0ffff> for example The menu box at the