Update MS Access Database table using ABAP
Hi All,
I have a requirement wherein I have to update the existing records in MS Access database using ABAP Code. Can someone provide sample code through which I can achieve this. Thanks!!!
Regards,
Nitish Reddy.
Edited by: Nitish Cherukupally on Mar 30, 2009 4:02 PM
hi,
please refer to this link
http://learningabap.wordpress.com/2007/04/11/get-data-from-ms-access-into-internal-table/
http://abapcode.blogspot.com/2007/05/get-data-from-ms-access-into-internal.html
http://abapcode.blogspot.com/2007/06/sample-program-to-upload-excel-document.html
MS Access Database using ABAP Program
thanks
Similar Messages
-
I'm new to VS. I have run the following code. It does not produce any error, and it does not add or update data to my Access database table.
dbUpdate("UPDATE prgSettings SET varValue='test' WHERE varSetting='test'")
Function dbUpdate(ByVal _SQLupdate As String) As String
Dim OleConn As New OleDbConnection(My.Settings.DatabaseConnectionString.ToString)
Dim oleComm As OleDbCommand
Dim returnValue As Object
Dim sqlstring As String = _SQLupdate.ToString
Try
OleConn.Open()
MsgBox(OleConn.State.ToString)
oleComm = New OleDbCommand(sqlstring, OleConn)
returnValue = oleComm.ExecuteNonQuery()
Catch ex As Exception
' Error occurred while trying to execute reader
' send error message to console (change below line to customize error handling)
Console.WriteLine(ex.Message)
Return 0
End Try
MsgBox(returnValue)
Return returnValue
End Function
Any suggestions will be appreciated.
Thanks.You code looks pretty good, at a quick glance. Maybe you can simplify things a bit.
For Insert, please see these samples.
http://www.java2s.com/Code/CSharp/Database-ADO.net/Insert.htm
For Update, please see these samples.
http://www.java2s.com/Code/CSharp/Database-ADO.net/Update.htm
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.
Best to keep samples here to VB.NET
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
Accessing Oracle Tables using ABAP
Dear All,
We are using SAP ECC 6.0, we need to access some of the tables in oracle system using ABAP program. Is there any wany to access the oracle tables.
Please suggest and do the needful.
Thanks in advance,
ChandraDECLARE YOUR ORACLE INSTANCE INTO TABLE DBCON
AND USE THE FOLLOWING FM TO ACCESS YOUR DATA
RSDBC_DB_DATA_GET
RSDBC_DB_DSOURCE_CHECK
RSDBC_DB_DSOURCE_CONVERT
RSDBC_DB_DSOURCE_GENERATE
RSDBC_DB_FIELDS_CHECKS
RSDBC_DB_FIELDS_GET
RSDBC_DB_SCHEMAS_GET
RSDBC_DB_TABLES_GET
RSDL_CONNECTION_CHECK
RSDL_DB_GET_ALL_TABLES
RSDL_DB_GET_DATA
RSDL_DB_GET_DATA_BWS
RSDL_DB_RFC_GET
RSDL_TRACEFILE_DISPLAY
RSDS_ACCESS_DB_DATA_UPLOAD
RSDS_ACCESS_DB_DATA_UPLOAD_2
RSDS_ACCESS_DB_FIELDS_GET
RSDS_ACCESS_DB_TABLES_GET
OR WRITE YOUR OWN CODE USING THIS OBJECTS
cl_sql_connection
cl_sql_statement
cl_sql_result_set -
How to adjust database table using ABAP code
Hi Experts,
There is any function module can use to adjust the db table?
Because I found that after I modified the database table by using FM 'DDIF_TABL_PUT' and 'DDIF_TABL_ACTIVATE',
the table feel like no changes when I check the table in SE11.
But after I switched to edit mode, then only table changed to the expected properties.
Hope anyone can some hints,
Thanks in advance.Thanks, your answer is helpful.
But I found a answer after debug SE14,
Share the answer if anyone need:
DD_DATABASE_UTILITY -
Access table using ABAP program in other database
Dear SAP Expert,
We have requirement that related to SAP interface.
Our SAP system run on Oracle database 11g (Unix).
Illustration: SAP system = A non SAP system = B
We need to access a table using ABAP program (from SAP system A) in other database (system B) that are not necessarily SAP database. The non-SAP system using SQL Server 2008 (Windows).
What is the best practice for this interface
Do we need database link? If yes, please help to inform me the details step to configure it.
Thanks and RegardsHi Friend,
You try using an intermediate system..passing your input required to fetch the data..and PI should call the respective query to retrive record..once the full flow is completed you should get the return through some table in the calling program.
else.
ask the other system guy to write a function with select query and ask him to expose as RFC and that RFC we have to call it as RFC in our program to get the required values and only thing we need here is a proper connector in place.
Regards
S.Janagar -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
In ecatt - how to check at database level using ABAP
Hi,
How to check at database level using ABAP in Ecatt tool.
say,for example I want to check a particular sales order is invoiced or not ,at the database level and if it is invoiced I have stop proceeding to invoicing of that sales order number.
Could anybody suggest on this with an example?
thanks.Hi,
you can use the command GETTAB to access single db records.
Full specified or partitial specified keys can be use at GETTAB. It will return always only one record, also if a couple could match your selection.
For more advanced scenarios you can also use eCATTs Inline ABAP. In a block between the commands ABAP. ENDABAP. you can code ABAP statements, e.g. SELECT ... INTO TABLE ...
eCATT script parameters of type 'V' defined in that script using ABAP/ENDABAP will be transfered into the ABAP block and back to script after ABAP perform.
Best regards
Jens -
How to transfer data in change log table of dso to z-table using abap code
Hi can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept
PROGRAM NAME: ZBW_DELTA_TO_GSTAR **
report ZBW_DELTA_TO_GSTAR no standard page heading
line-size 120
line-count 75
message-id ZBW_MSG_CLS.
tables: ZGIV_DLTA_EBV_BB,
ZGIV_DLTA_EM2_BL,
ZGIV_DLTA_EM2_BK.
Selection Screen Definitions
SELECTION-SCREEN: BEGIN OF BLOCK INNER WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN: SKIP 1.
PARAMETERS: EBVBB RADIOBUTTON GROUP ROLL,
EM2BL RADIOBUTTON GROUP ROLL,
EM2BK RADIOBUTTON GROUP ROLL.
SELECTION-SCREEN: END OF BLOCK INNER.
Data: WS_UPDATE_FLAG Type C,
UCounter(9) Type N,
ICounter(9) Type N.
DATA: T_ZGIV_DLTA_EBV_BB Type Standard Table of ZGIV_DLTA_EBV_BB,
s_ZGIV_DLTA_EBV_BB LIKE line of T_ZGIV_DLTA_EBV_BB.
DATA: T_ZGIV_DLTA_EM2_BK Type Standard Table of ZGIV_DLTA_EM2_BK,
s_ZGIV_DLTA_EM2_BK LIKE line of T_ZGIV_DLTA_EM2_BK.
DATA: T_ZGIV_DLTA_EM2_BL Type Standard Table of ZGIV_DLTA_EM2_BL,
s_ZGIV_DLTA_EM2_BL LIKE line of T_ZGIV_DLTA_EM2_BL.
Standard Internal Tables - Describe usage.
data: begin of i_AEPSD_O0140 occurs 0.
include structure /BIC/AEPSD_O0140.
data: end of i_AEPSD_O0140.
data: begin of i_AEPSD_O0240 occurs 0.
include structure /BIC/AEPSD_O0240.
data: end of i_AEPSD_O0240.
data: begin of i_AEPSD_O0340 occurs 0.
include structure /BIC/AEPSD_O0340.
data: end of i_AEPSD_O0340.
data: begin of i_GIV_DLTA_EBV_BB occurs 0.
include structure ZGIV_DLTA_EBV_BB.
data: end of i_GIV_DLTA_EBV_BB.
data: begin of i_GIV_DLTA_EM2_BK occurs 0.
include structure ZGIV_DLTA_EM2_BK.
data: end of i_GIV_DLTA_EM2_BK.
data: begin of i_GIV_DLTA_EM2_BL occurs 0.
include structure ZGIV_DLTA_EM2_BL.
data: end of i_GIV_DLTA_EM2_BL.
Miscellaneous Program Variables and Constants.
TOP-OF-PAGE
top-of-page.
START-OF-SELECTION
start-of-selection.
Clear: i_GIV_DLTA_EBV_BB,
i_GIV_DLTA_EM2_BK,
i_GIV_DLTA_EM2_BL,
UCounter, ICounter.
IF EBVBB = 'X'.
PERFORM 100_EXTRACT_EBV_BB_DELTA_RECS.
ELSEIF EM2BK = 'X'.
PERFORM 100_EXTRACT_EM2_BK_DELTA_RECS.
ELSE.
PERFORM 100_EXTRACT_EM2_BL_DELTA_RECS.
ENDIF.
FORM 100_EXTRACT_EBV_BB_DELTA_RECS
FORM 100_EXTRACT_EBV_BB_DELTA_RECS.
Refresh: i_AEPSD_O0140,
i_GIV_DLTA_EBV_BB.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EBV_BB .
Select * From /BIC/AEPSD_O0140
Into TABLE i_AEPSD_O0140.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0140.
MOVE-CORRESPONDING i_AEPSD_O0140 TO s_ZGIV_DLTA_EBV_BB.
MOVE SY-DATUM to s_ZGIV_DLTA_EBV_BB-create_dt.
INSERT ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EBV_BB_DELTA_RECS
FORM 100_EXTRACT_EM2_BK_DELTA_RECS
FORM 100_EXTRACT_EM2_BK_DELTA_RECS.
Refresh: i_AEPSD_O0240,
i_GIV_DLTA_EM2_BK.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EM2_BK .
Select * From /BIC/AEPSD_O0240
Into TABLE i_AEPSD_O0240.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0240.
MOVE-CORRESPONDING i_AEPSD_O0240 TO s_ZGIV_DLTA_EM2_BK.
MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BK-create_dt.
INSERT ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EM2_BK_DELTA_RECS
FORM 100_EXTRACT_EM2_BL_DELTA_RECS
FORM 100_EXTRACT_EM2_BL_DELTA_RECS.
Refresh: i_AEPSD_O0340,
i_GIV_DLTA_EM2_BL.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EM2_BL .
Select * From /BIC/AEPSD_O0340
Into TABLE i_AEPSD_O0340.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0340.
MOVE-CORRESPONDING i_AEPSD_O0340 TO s_ZGIV_DLTA_EM2_BL.
MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BL-create_dt.
INSERT ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EM2_BL_DELTA_RECS
END-OF-SELECTION
end-of-selection.
perform D1000_REPORT_DATA.
D1000_REPORT_DATA
form D1000_REPORT_DATA.
*Display the title of the program
write: /25 SY-TITLE.
skip.
Diaplay the details of the user and time
write: /1 'Executed by', 15 SY-UNAME, 30 'Date',
38 SY-DATUM, 53 'Time', 60 SY-UZEIT.
skip 2.
write: / 'Delta Records have been extracted ',
/ 'Updates : ', UCounter,
/ 'Inserts : ', ICounter.
skip.
skip 3.
write: /20 'End of the report'.
endform. "D1000_REPORT_DATA
chgeck it out this also may hep you -
Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency
I need to insert multiple rows into a database table using the JDBC adapter (receiver).
I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?Hi Bhavesh/Kanwaljit,
If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
Why i am saying this?
If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
<i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
Doesnt this mean that rows are inserted one by one?
Correct me if i am wrong.
This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
Regards,
Sumit -
Efficient way of updating data to database table
what is the efficient way of updating data to database table .
i have huge amount of data in my internal table , how to use update statement in this case .
1. database table having 20 fields ,
2. one is key field and suppose 20 th field i want to change .
3. I have data for only 2 fields , i.e for ( 1 st and last 20 th field ) .
i can't use update statement in loop , as it is not good practice(hits database several times ) .
do it effects all the 20 fields for particular record .Hi,
Use UPDATE statement , check below description from SAP help.
UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab.
Effect
Mass update of several lines in a database table.Here, the primary key for identifying the lines tobe updated and the values to be changed are taken from the lines of theinternal table itab.
The system field SY-DBCNT contains the number of updated lines,i.e. the number of lines in the internal table itab which havekey values corresponding to lines in the database table.
Regards
L Appana -
Creation of Database table using function module DB_CREATE_TABLE
I used the function module DB_CREATE_TABLE to create a database table from a report program.
The SY-SUBRC value being returned is 0 but I am not able to access the table using SE11(that is if it gets created). Kindly let me know if you know how to resolve this problem.
Is there any other function module to create a database table from a report program?
Thanks & Regards,
PranjaliHello,
Check this programs how they are using the this FM.
LSDB3U14
LSDB6U04 DD: Creation of temporary tables (only keys or complete)
LSMC2F00 Procedures for Creating and Deleting Dependent Matchcode ID Objects
LSUGXU08
LSUGXU18 Rückgabe aller DB-spezifischen Parameter der Freiplatzprüfung im Upgra
RCNV0002 DD: Convert CDHDR and CDPOS
RDDMV4TB Generate Exchange TADIR
RDDMVCUA Generate Exchange TADIR
RDDMVFTX Repository Switch: Generate New Empty Clone Table DDFTX
RDDMVNTB Filling the Exchange Nametabs (DDYTT, DDYTF)
RDDMVTRE Generate Exchange TADIR
RSINFINI INFORMIX Performance Monitor: Additional DB Definitions for SAP R/3
RTXWCF1F Include LTXW4F01 -
Problem in accessing mseg table using MSEG~M Index.
Hi Experts,
I am facing problem in accessing mseg table using MSEG~M Index. I used same sequence of fields and i tried with mandt field also. but it is not taking the Index and it is going for TImeout ABAP dump.
This are my codes used in different ways
1. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg CLIENT SPECIFIED INTO TABLE t_mseg2
WHERE mandt EQ sy-mandt AND
matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
2. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg INTO TABLE t_mseg2
WHERE matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
3. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg INTO TABLE t_mseg2
WHERE matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'.
The above all code is not at all taking the index in Quality server .but in Development it is taking .In Quality server it is reading all datas without using the index and going Timeout ABAP dmup
Please, Suggest me some solutions.
Thanks in Advance.
Regards,
NandhaHi,
Without NE also not working out. i am facing same problem still.
SELECT bwart
matnr
lifnr
dmbtr
kostl
aufnr
FROM mseg CLIENT SPECIFIED INTO TABLE t_mseg
WHERE mandt EQ sy-mandt AND
werks EQ p_werks AND
bwart IN (122,201,262) AND
mjahr EQ p_year AND
bukrs EQ p_cc
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
Please,check and help me out from this issue.
Regards,
Nandha -
Loading standard R/3 Hierarchy in BO Database Table using Data Services
Hello,
i'm trying to load Cost Center Hierarchy from R/3 to BO database table using SAP BO Dataservices 4.0
i have replicated the Data Flow and Abap Data Flow explained in SAP documentatio (SAP BusinessObjects Data Services 4-0 SP1 Supplement for SAP) and http://wiki.sdn.sap.com/wiki/display/BOBJ/ReadingR3Hierarchies
but it doesn't work
i get errors like:
[Merge:Merge]
Length <64> for Tran Merge input ABAP_DF_Hierarchy_Leaf_Values column <PARENT_DESC> does not match the length <30> of Tran Merge input ABAP_DF_Hierarchy_Extraction column <PARENT_ID>. The matching columns of Merge transform must have the same data type length. (BODI-1111062)
[Merge:Merge]
Length <30> for Tran Merge input ABAP_DF_Hierarchy_Extraction column <PARENT_ID> does not match the length <64> of Transform Merge output column <PARENT_DESC>. The matching columns of Merge transform must have the same data type length. (BODI-1111062)
thanks for your support
BilalIt appears that the structures of the two Data Transports going into the Merge Transform don't have the columns in the same order. One of the Data Transports has PARENT_DESC listed before PARENT_ID and the other Data Transport has PARENT_ID before PARENT_DESC.
Basically, you need to change the order of the columns in one of the Data Transports so that it structurally matches the other Data Transport that it's being merged (UNIONed) with. -
Join multi access database tables
Anybody knows how to join multi Access database tables
by using LAbview SQL tool kit? It seems Labview SQL does not support "JOIN" feature.
ThanksBut I still dont know how to join multiple tables.
I've tried:
SELECT pd.NAME, pp.PART_ID, pp.MATERIAL, pt.NAME
FROM PRODUCT pd INNER JOIN LOOKUP_PRODUCTPART pp
ON pd.PRODUCT_ID=pp.PRODUCT_ID INNER JOIN PART pt
ON pp.PART_ID=pt.PART_ID
But it doesn't work.
Hm.. the following (joinig two tables) works. It's shows that INNER JOIN works in LabVIEW:
SELECT pd.NAME, pp.PART_ID, pp.MATERIAL, pt.NAME
FROM PRODUCT pd INNER JOIN LOOKUP_PRODUCTPART pp
ON pd.PRODUCT_ID=pp.PRODUCT_ID -
Linking Java to Access Database tables
Hello,
I need use JCreator to link Java to Access Database tables.
Could any one tell me what kind of drivers I need use?
Also, where could I find the examples of linking Java to Access Database tables?
Thank you,
DanielThanks.
I have read the tutorial and downloaded the sample code from the web http://java.sun.com/docs/books/tutorial/jdbc/
In the CreateCoffee.java programming, I made the following changes:
// String url = "jdbc:mySubprotocol:myDataSource";
String url = "jdbc:odbc:DB1";
DB1 is an Access Database file located in the same folder as CreateCoffee.java.
//Class.forName("myDriver.ClassName");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Every time when I run the CreateCoffee.java programming, it shows the following running error:
SQLException:[Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified.
Could any one have any suggestions for solving the above problem?
Thank you,
Daniel
Maybe you are looking for
-
Database installation questions
I am new to oracle database just want to download new oracle database 10g for learning But I am not sure which one I should download below? 1.Oracle Database 10g Release 1 (10.1.0.2) Enterprise/Standard Edition for Microsoft Windows (32-bit) 2.Oracle
-
No invoice number was found error on checkout
I am recieving an error - no invoice number found - when trying to checkout. Can anyone tell me what the problem might be?
-
After compiling and running the following code: import javax.xml.soap.SOAPConnectionFactory; import javax.xml.soap.SOAPConnection; import javax.xml.soap.MessageFactory; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPPart; import javax.x
-
I was running iTunes 7.1, when Apple suggested I download the new 7.1.1.5 version in mid-March. I downloaded and the install failed.... mysteriously. After searching around in the temp directory, the iTunesSetup file left behind by the install showed
-
RS-422 PPS Generation in LabWindows/CVI
I'm trying to generate a RS-422 PPS signal using the PXI-8431/8 PXI board, LabWindows/CVI and the standard CVI library functions but I can't find a way of producing a signal that remains HI persistently for X number of ms. I realize that using the P