Sequential access on CDHDR table
How to improve this query on CDHDR which leads to Sequential access on CDHDR table so that it can improve performance, or is there any other means which i can achieve better performance on CDHDR?
the query as follows:
SELECT objectclas objectid changenr FROM cdhdr INTO TABLE it_cdhdr
WHERE changenr > changenr1 AND ( objectclas = 'VERKBELEG' ).
Thnaks in Advance
Ramada
Hi Ramada!
Your 2nd index (with change number) has no MANDT field - maybe this is the reason it's not used. Also a combination of change number and object class can be better; you might give it a try.
But in general there is no good way to select the CDHDR for changes done since xxx (change number or date / time).
Of course it's database optimizer decision, but likely you and up all the time with sequential read accesses -> it will be slow in production.
So I gave you a hint how to change the program design a little bit - from business process point of view, this shouldn't be a difference. But if you change from CDHDR to BDCP(S), then you can select changes much faster (usually in a few seconds, even for >100.000 entries).
Regards,
Christian
Similar Messages
-
CDHDR table query taking long time
Hi all,
Select query from CDHDR table is taking long time,in where condition i am giving OBJECTCLASS = 'MAT_FULL' udate = sy-datum and langu = 'EN'.
any suggestion to improve the performance.i want to select all the article which got changed on current date
regards
shibuThis will always be slow for large data volumes, since CDHDR is designed for quick access by object ID (in this case material number), not by date.
I'm afraid you would need to introduce a secondary index on OBJECTCLAS and UDATE, if that query is crucial enough to warrant the additional disk space and processing time taken by the new index.
Greetings
Thomas -
Archiving MM_SPSTOCK Issues with CDHDR Table
We're executing a number of small variants and in some cases it starts to read the CDHDR table sequentially and the job has to be canceled or eventually terminates. Also, in these cases it holds locks and the transaction MIGO fails and batch GR processes terminates. The sequential reading of CDHDR happens if we run one or multiple jobs of MM_SPSTOCK..
Anybody encounter the sequential read of CDHDR and/or the locking issues?
Any help will be appreciated.
Thanks.
SoyabNo I never faced this issue.
Make sure that you always have the most recent OSS notes applied before you start archiving of any archiving object.
For performance issues see OSS Note 548661 - Composite SAP note: Archive object MM_SPSTOCK -
Hi all,
I am developing a report for which I am fetching fields from CDPOS & CDHDR tables (both r cluster tables). when i run st05, it fetches values from a cluster table CDCLS which takes most of the database time.
Is there any view for CDPOS & CDHDR tables?
How to find the views for cluster tables?
Thanx in advance.
Vijay.hi,
check this code,
here i used function module to get details of cdhdr,cdpos.
TABLES : MARC.
DATA :BEGIN OF GI_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
DISPO LIKE MARC-DISPO,
END OF GI_MARC.
DATA : CHAR TYPE I,
COUNT TYPE I,
VAR TYPE I.
DATA : BEGIN OF GI_FINAL OCCURS 2000,
MATNR LIKE MARC-MATNR,
DISPO LIKE MARC-DISPO,
USERNAME LIKE CDHDR-USERNAME,
UDATE LIKE CDHDR-UDATE,
UTIME LIKE CDHDR-UTIME,
TCODE LIKE CDHDR-TCODE,
TABNAME LIKE CDPOS-TABNAME,
TABKEY LIKE CDPOS-TABKEY,
FNAME LIKE CDPOS-FNAME,
VALUE_NEW LIKE CDPOS-VALUE_NEW,
VALUE_OLD LIKE CDPOS-VALUE_OLD,
CHANGENR LIKE CDHDR-CHANGENR,
END OF GI_FINAL.
DATA : MATNR LIKE MARC-MATNR,
DISPO LIKE MARC-DISPO,
USERNAME1 LIKE CDHDR-USERNAME,
UDATE1 LIKE CDHDR-UDATE,
UTIME LIKE CDHDR-UTIME,
TCODE LIKE CDHDR-TCODE,
CHANGENR LIKE CDHDR-CHANGENR.
DATA : GI_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE.
DATA : GI_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
DATA : OBJECTCLAS LIKE CDHDR-OBJECTCLAS VALUE 'MATERIAL',
OBJECTID LIKE CDHDR-OBJECTID,
USERNAME LIKE CDHDR-USERNAME VALUE 'RSS-SPE',
UDATE LIKE CDHDR-UDATE VALUE '20070101',
CHANGE_IND LIKE CDHDR-CHANGE_IND VALUE 'U'.
type-pools: slis.
data: gt_slis_fcat type slis_t_fieldcat_alv.
data: gt_fieldcat type slis_t_fieldcat_alv.
*data: gt_fieldcatall type slis_t_fieldcat_alv.
data: g_repid like sy-repid.
data: gs_layout type slis_layout_alv.
gs_layout-zebra = 'X'.
gs_layout-colwidth_optimize = 'X'.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-110.
SELECT-OPTIONS : P_DISPO FOR MARC-DISPO.
SELECT-OPTIONS : RECORDS FOR CHAR.
SELECTION-SCREEN : END OF BLOCK B1.
START-OF-SELECTION.
perform process_data.
perform f_fieldcat_init using gt_fieldcat[].
perform alv_display tables gi_final using gt_fieldcat[].
form process_data.
SELECT MATNR WERKS DISPO FROM MARC INTO TABLE GI_MARC
WHERE DISPO IN P_DISPO
AND WERKS = '1011'." Becoz we hav to chk the
the changes made in the material while extendin tht matrl frm 1011 to
*other plant.
IF NOT GI_MARC[] IS INITIAL.
IF NOT RECORDS-LOW IS INITIAL .
IF NOT RECORDS-HIGH IS INITIAL.
DESCRIBE TABLE GI_MARC LINES COUNT.
IF RECORDS-HIGH < COUNT.
DELETE GI_MARC FROM RECORDS-HIGH TO COUNT.
ENDIF.
IF RECORDS-LOW <> 1.
IF RECORDS-LOW <> 0.
DELETE GI_MARC FROM 1 TO RECORDS-LOW.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
LOOP AT GI_MARC.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = GI_MARC-MATNR
IMPORTING
OUTPUT = GI_MARC-MATNR
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
OBJECTID = GI_MARC-MATNR .
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
ARCHIVE_HANDLE = 0
DATE_OF_CHANGE = UDATE
OBJECTCLASS = OBJECTCLAS
OBJECTID = OBJECTID
TIME_OF_CHANGE = '000000'
USERNAME = USERNAME
LOCAL_TIME = ' '
DATE_UNTIL = '99991231'
TIME_UNTIL = '235959'
TABLES
I_CDHDR = GI_CDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4
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 'ARCH_ANA_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Processing'.
IF NOT GI_CDHDR[] IS INITIAL.
LOOP AT GI_CDHDR.
MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
VAR = 1.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = GI_FINAL-MATNR
IMPORTING
OUTPUT = GI_FINAL-MATNR
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
ENDIF.
OBJECTID = GI_FINAL-MATNR ."to ensure that objid is in proper
*format
SELECT *
FROM CDPOS
INTO TABLE GI_CDPOS
PACKAGE SIZE 100
FOR ALL ENTRIES IN GI_cdhdr
WHERE OBJECTID = OBJECTID
AND CHANGENR = GI_CDHDR-CHANGENR
AND OBJECTCLAS = OBJECTCLAS
AND CHNGIND = CHANGE_IND." only those values will b
*takn which have been modified nd nt created
IF SY-SUBRC = 0.
LOOP AT GI_CDPOS.
MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
MOVE GI_CDPOS-TABNAME TO GI_FINAL-TABNAME.
MOVE GI_CDPOS-TABKEY TO GI_FINAL-TABKEY.
MOVE GI_CDPOS-FNAME TO GI_FINAL-FNAME.
MOVE GI_CDPOS-VALUE_NEW TO GI_FINAL-VALUE_NEW.
MOVE GI_CDPOS-VALUE_OLD TO GI_FINAL-VALUE_OLD.
APPEND GI_FINAL.
CLEAR GI_FINAL.
ENDIF.
VAR = VAR + 1.
ENDSELECT.
ENDLOOP.
ENDIF.
ENDLOOP.
CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Processing'.
ENDIF.
ENDLOOP.
endform.
form f_fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.
data: ls_fieldcat type slis_fieldcat_alv.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-seltext_l = 'Material number'.
ls_fieldcat-tabname = 'GI_final'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'DISPO'.
ls_fieldcat-seltext_l = 'mrp controller'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'USERNAME'.
ls_fieldcat-seltext_l = 'Username'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'CHANGENR'.
ls_fieldcat-seltext_l = 'Change Number'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'UDATE'.
ls_fieldcat-seltext_l = 'modified date'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'UTIME'.
ls_fieldcat-seltext_l = 'MODIFIED TIME'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'UDATE'.
ls_fieldcat-seltext_l = 'MODIFIED DATE'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'TCODE'.
ls_fieldcat-seltext_l = 'TRANSACTION CODE'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'TABNAME'.
ls_fieldcat-seltext_l = 'TABLE NAME'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'TABKEY'.
ls_fieldcat-seltext_l = 'TABLE KEY'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'FNAME'.
ls_fieldcat-seltext_l = 'FNAME'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'FVALUE'.
ls_fieldcat-seltext_l = 'FVALUE'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'VALUE_NEW'.
ls_fieldcat-seltext_l = 'NEW VALUE'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'VALUE_OLD'.
ls_fieldcat-seltext_l = 'OLD VALUE'.
append ls_fieldcat to lt_fieldcat.
endform. " f_fieldcat_init
form alv_display tables gi_final using gt_fieldcat .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' Material list '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = gs_layout
it_fieldcat = gt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = gi_final
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform.
regards
siva -
Can I create a Stored Procedure That access data from tables of another servers?
I'm developing a procedure and within it I'm trying to access another server and make a select into a table that belongs to this another server. When I compile this procedure I have this error message: " PLS-00904: insufficient privilege to access object BC.CADPAP", where BC.CADPAP is the problematic table.
How can I use more than one connection into an Oracle Stored Procedure?
How I can access tables of a server from a Stored Procedure since the moment I'm already connected with another server?
Can I create a Stored Procedure That access data from tables of another servers?You need to have a Database Link between two servers. Then you could do execute that statement without any problem. Try to create a database link with the help of
CREATE DATABASE LINK command. Refer Document for further details -
Create a new entry for zfield in the CDHDR table when sales order is create
Hi,
We have some custom field added to table VBAP and that field need is updated thorugh transaction VA01 or VA02.
The Function poeple is asking to Update the CDHDR table for the ztable when ever the field is updated ,and they want
the changes to appear in the sales order changes Log.
PrabhudasProblem solved.
By using the ..
Used this FM "VERKBELEG_WRITE_DOCUMENT" in MV45AFZZ in exit...DOCUMENT_SAVE.
by passign the only VBAK and VBAP table structure of XVBAP and YVABP and field name as ZZFIELD.
Prabhudas. -
How can I see which roles or users have access to a table?
How can I see which roles or users have access to a table?
For a given table, how can I see the grants, who and what?
Many thanksdba_tab_privs.
Grantee can be a role or an user, as roles are fake users.
Sybrand Bakker
Senior Oracle DBA -
How to find out the query is accessing the DB tables or not
Hi Gurus ,
How to find out the query is accessing the DB tables or not.
Where exactly we will find this information in SAP BW.
I know that this information we can find in ST03. But where exactly we will find the query information along with DB information?Lakshmi
Activate BI Technical Content for Query analysis and run query against that.
Hope this helps
Thanks
sat -
How to get the object class field value in CDHDR table for vendor
hi
how to get the object class field value in CDHDR table for vendorTry KRED/KRED_N as object class in CDHDR for Vendor.
-
Logical database vs direct access of database table
Hi
I have created a FI report. I am trying to get data from large FI tables like BSAK, BSEG, BKPF, RSEG. eventhough there are 10 records as per my criteria, system is taking morethan an hour time even in background processing. This may be becaz of lot of conditions that I am applying to filter the data. But still trying to improve the performance
For fetching data which is the better way for getting optimum performance of the report.
a) directly fetching data from database tables
b) using logical database collecting data into an itab
regards,
mallikHi,
If you are accessing the database tables more than once with different criteria then definetly it will take more time. In such case write only one Select statement on the table and get all the required data into an internal table and then process this internal table as per your logic.
Use of LDBs is definetly faster but filter conditions might not match with your filter conditions. In such case direct access of database table is preferable but as i said in above paragraph.
thanks,
sksingh -
How to Divert the changes to cdhdr table instead of dbtablog?
Hai everybody.
I am new to this forum. i got a job in abap recently. The below is my requirement.I want solution for this one. Anybody plz help me.
I am having ztransaction.
The change logs already were captured in DBTABLOG for table ZWPRFRUND (in transaction ZWPG).
The only report which is currently used to get the change logs is RSVTPROT
Now my requirement is,
we need to display the change logs in the form of ALV.
We should divert the changes to CDHDR table instead of DBTABLOG, then we can use the RSSCD100 to display change logs.
The Important items for the change LOG needed in case of changes to table in ZWPG are,DATE ,TIME,USER,FIRST NAME,FILED NAME,OLD VALUE,NEW VALUE
The above fields need to be displayed in the grid. In the above list FIELD NAME denotes any field of the table in the transaction in ZWPG
Thanks & Regards,
Sujatha.T.Check out my post in this thread:
How to record add-on table change logs?
You need to define a change document type and generate relevant code for this.
Andrew -
How to Access the XI_AF_MSG table
Hi Experts,
I request you to please let meknow that how can I access the different JAVA tables like XI_AF_MSG table or the AUDIT tables.
Actualy my requirement is to trace the audit log for a particular message ID in the Adapter Engine.This audit trace is not same as the audit log that found in the PI7.0 Runtime WorkBench.For exmaple.--
a message failed in the adapter engine after successfuly processed from PI Integration Engine. Now I want to trace the USERID by whom the message is resent or canceled.
please let me know how can I achive this and how can I access the different tables in JAVA layer.
Thanks
Sugata Bagchi MajumderThese 3 are the tables that are for XI Adapter in ABAP Stack.
SWFRXICNT
SWFRXIHDR
SWFRXIPRC
You can also try the following tables.
SXMSAEADPMOD XI: Adapter and Module Information
SXMSAEADPMODCHN XI: Adapter Module Chains
SXMSAEAGG XI: Adapter Runtime Data (Aggregated)
SXMSAERAW XI: Adapter Runtime Data (Raw Data)
Cheers,
Sarath.
Award if helpful. -
Anyway to fill the multiple owners in Access Control owner Table in GRC 10.0?
Hi,
Is their any way to fill the data in the access control owner table in case we have many owners?
Any script or any table for inserting this at one shot!Hi Pranjal,
not really recommended, but you can fill directly in table GRACOWNER.
Regards,
Alessandro -
Sequential Access Problem - Nothing is being written to file.
Okay, quick introduction. I am a student and am in an intro Java class. I am understanding most of it; however, I am having one issue with an exercise that I am working on.
Here is the purpose:
To create a simple car reservation application that stores the reservation information in a sequential access file.
In the code what I need to happen is when the user clicks the Reserve Car button, the application needs to first check to see if there are cars already reserved for that day (there is a limit of 4 which is taken care of in the While statement). If the file content is null, it skips this while first.
If the content is null, then I need to open the file for writing, which is taken care of using FileWriter. The program is then to write the date information using the currentDate variable created before the while statement. Next, it is supposed to write the name entered and display a message box stating that the car has been reserved (which it does display).
However, I can add an infinate amount of reservations without getting the error message box stating that the max has been reached. So, I checked the reservations.txt file (which was intially created as a blank file) and I see that nothing at all is getting written to it. Here is the code, can anyone offer any insight into what I am missing. I am not getting any compliation or run-time errors, so I am sure this is just a simple problem I am overlooking. Thanks!
// This application allows users to input their names and
// reserve cars on various days.
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.Date;
import javax.swing.*;
import javax.swing.event.*;
public class CarReservation extends JFrame
// JLabel and JSpinner to display date
private JLabel selectDateJLabel;
private JSpinner dateJSpinner;
// JLabel and JTextField to display name
private JLabel nameJLabel;
private JTextField nameJTextField;
// JButton to reserve car
private JButton reserveCarJButton;
// Printwriter to write to files
private PrintWriter output;
//BufferedReader to read data from file
private BufferedReader input;
// file user will select
private File reserveFile;
// no-argument constructor
public CarReservation()
createUserInterface();
// create and position GUI components
public void createUserInterface()
// get content pane for attaching GUI components
Container contentPane = getContentPane();
// enable explicit positioning of GUI components
contentPane.setLayout( null );
// set up selectDateJLabel
selectDateJLabel = new JLabel();
selectDateJLabel.setBounds( 16, 16, 96, 23 );
selectDateJLabel.setText( "Select the date:" );
contentPane.add( selectDateJLabel );
// set up dateJSpinner
dateJSpinner = new JSpinner( new SpinnerDateModel() );
dateJSpinner.setBounds( 16, 43, 250, 23 );
dateJSpinner.setEditor( new JSpinner.DateEditor(
dateJSpinner, "MM/dd/yyyy" ) );
contentPane.add( dateJSpinner );
dateJSpinner.addChangeListener(
new ChangeListener() // anonymous inner class
// event handler called when dateJSpinner is changed
public void stateChanged( ChangeEvent event )
dateJSpinnerChanged( event );
} // end anonymous inner class
); // end call to addActionListener
// set up nameJLabel
nameJLabel = new JLabel();
nameJLabel.setBounds( 16, 70, 100, 23 );
nameJLabel.setText( "Name: " );
contentPane.add( nameJLabel );
// set up nameJTextField
nameJTextField = new JTextField();
nameJTextField.setBounds( 16, 97, 250, 23 );
contentPane.add( nameJTextField );
// set up reserveCarJButton
reserveCarJButton = new JButton();
reserveCarJButton.setBounds( 16, 130, 250, 23 );
reserveCarJButton.setText( "Reserve Car" );
contentPane.add( reserveCarJButton );
reserveCarJButton.addActionListener(
new ActionListener() // anonymous inner class
// event handler called when reserveCarJButton is clicked
public void actionPerformed( ActionEvent event )
reserveCarJButtonActionPerformed( event );
} // end anonymous inner class
); // end call to addActionListener
// set properties of application's window
setTitle( "Car Reservation" ); // set title bar string
setSize( 287, 190 ); // set window size
setVisible( true ); // display window
} // end method createUserInterface
// write reservation to a file
private void reserveCarJButtonActionPerformed( ActionEvent event )
try
// get file
reserveFile = new File( "reservations.txt" );
// open file
FileReader currentFile = new FileReader( reserveFile );
input = new BufferedReader( currentFile );
// get date from dateJSpinner and format
Date fullDate = ( Date ) dateJSpinner.getValue();
String currentDate = fullDate.toString();
String monthDay = currentDate.substring( 0 , 10 );
String year = currentDate.substring( 24, 27 );
currentDate = ( monthDay + " " + year );
// declare variable to store number of people who reserve a car
int dateCount = 1;
// read a line from the file and store
String contents = input.readLine();
// while loop to read file data
while ( contents != null )
// if contents equal currentDate
if ( contents.equals( currentDate ) )
// check reservation number
if ( dateCount <4 )
dateCount++;
else
// display error message
JOptionPane.showMessageDialog( this,
"There are no more cars available for this day!",
"All Cars Reserved", JOptionPane.ERROR_MESSAGE );
// disable button
reserveCarJButton.setEnabled( false );
// exit the method
return;
} // end else
} // end if
// read next line of file
contents = input.readLine();
} // end while
// close the file
input.close();
FileWriter outputFile = new FileWriter( reserveFile, true );
output = new PrintWriter( outputFile );
// write day to file
output.println( currentDate );
// write reserved name to file
output.println( nameJTextField.getText() );
// display message that car has been reserved
JOptionPane.showMessageDialog( this, "Your car has been reserved",
"Thank You", JOptionPane.INFORMATION_MESSAGE);
} // end try
catch ( IOException exception )
JOptionPane.showMessageDialog( this, "Please make sure the file exists " +
"and is of the right format.", "I/O Error",
JOptionPane.ERROR_MESSAGE );
// disable buttons
dateJSpinner.setEnabled( false );
reserveCarJButton.setEnabled( false );
} // end catch
// clear nameJTextField
nameJTextField.setText( "" );
} // end method reserveCarJButtonActionPerformed
// enable reserveCarJButton
private void dateJSpinnerChanged( ChangeEvent event )
reserveCarJButton.setEnabled( true );
} // end method dateJSpinnerChanged
// main method
public static void main( String[] args )
CarReservation application = new CarReservation();
application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
} // end method mainThank you. Sorry about all the code. I have never posted in this forum before and was unsure what all you needed.
This was the problem though. Right after I posted my question, I went back and looked at the code over again and realized that I left that part out! I added it in and it works perfectly. I came back to update my post but you had already answered it!
I really appreciate the quick response.
Mike -
CDHDR table is not updated after execution of transaction CK 24
Hi Experts ,
I am Triggering my workflow from for CK 24 transaction based on the change document entry from CDHDR table , once the CK24 transaction executes .
Now the problem is after execution of the CK24 transaction now its not updating the table CDHDR, which was happening before .
Note: No customization has been made which can affect this updation .
Can any body please guide me on this , why the standard table is not being updated now with the change document entries .
Regards
SarmisthaYou can use following FMs
CHANGEDOCUMENT_READ_HEADERS Change document: Read change document header
CHANGEDOCUMENT_READ_POSITIONS Change document: Read change document items
IN CDPOS you have to give the same thing as CDHDR. You have to search with the respective Object class and provide the Object Id(Key fields like Document number). Another thing you will also get the change document number from the transaction itself from which you are change the Document.
Thanks
Arghadip
Maybe you are looking for
-
hi i am trying to install developer6i release 2 on suse linux 7.3 and before installation get the following error : rdbms' software is not available in the current distribution source and has not been installed. You must obtain and install 'rdbms' so
-
ITunes videos won't play after 10.8 upgrade--checkerboard pattern
On my Mac Mini (mid-2009) connected to an LG TV, after upgrading to Mountain Lion, all purchased videos on iTunes play audio but display a gray/white checkerboard pattern instead of a video. The same happens when I try to play the videos in Quicktime
-
Cannot back up iPhone 4 to new iMac
I am about at my wits end. I just purchase a brand-spanking new iMac. Which works great. However, the iTunes will not back up my iPhone 4. Period. It asks me if I want to install the latest software (I currently have the 5.0 software; this is the upd
-
Error message when installing Indesign CS3 trial. I need help ASAP
I have searched the forums and adobe.com and have tried everything that I saw. None of it worked for me. I have tried and tried to install Indesign CS3 trial. I keep getting the error message: Indesign has encountered a problem and must close. I have
-
After updating to the most recent security I have the following problems with Text edit and MS Word. I cannot use File Open to access a file. I get the spinning ball and application not responding. I can double-click the text or Word file and they wi