Updating a standard database table
how to update a standard db table using t-code
(without any program)
To data in standard tables are related to the transaction.
The data which you are storing through transaction which will be stored in more than one table at a time.
Its possible to enter the data in one table bye writing the simple code.
But that is not right way.
You have to use the BDC or BAPI function module to store the transaction data.
Regards,
Madan.
Similar Messages
-
Updating the standard Database table
Dear All
requirement to change the Standard DB table i.e DPR_PROJECT
regards
Moderator Message: Put some effort into not only solving your issue but also into framing a proper question. Thread locked
Edited by: kishan P on Sep 3, 2010 10:29 PMHI Jaipai,
You have to find standard function modules / BAPI / class to update data from that table.
If you have to change the table's structure, use enhancement to do that.
Thanks!
Duy -
Problem in updating of standard database tables( S011, S012, S013).
Hi Gurus,
Here i am having the probelm with these transactions MCE1, MCE3, MCE5, MCE7.
In these t-codes we are not able to get Purchase Order Values... Please help me out from this ... To get the PO Value what should i do .... there PO values are showing '0.00' (Zero)..
These t-codes are using S011, S012, S013 tables, in those tables also PO value is not updating ( in these tables field NETWR is showing Zeros only)
this is urgent for my client...
Rewards in advance....
Regards,
Naveen MyneniThis is not ABAP but configuration issue. I'd suggest to contact your MM consultant or move this question to MM area.
-
Query on updating standard database tables in ECC6.0
Hi All,
I have a requirement to updated standard database tables: AUFK, AFIH, CSKS, PRPS.
I have to update all the records in the database table at a time with one field FERC_IND. (This field is available in ECC6.0)
This field present in the tables (AUFK, AFIH, CSKS, PRPS) to be updated with some value.
Can you let me know if any BAPI is available to update the field FERC_IND in the above said tables???
Thanks in advanceHI,
TBTCO
http://help.sap.com/saphelp_nw04/helpdata/en/fa/096fdc543b11d1898e0000e8322d00/frameset.htm
RSERRORLOG
If a record in PSA has a green status then no info is recorded anywhere.
In case of yellow or red status the info is written into RSERRORHEAD table. If a field 'ERROR' has 'X" then this record will be marked in PSA with the red status. If a record has been changed and before SAVE had a yellow status then 'X' will be in the 'CHANGED' field. There is also 'DELETED' field. And 'REQUEST' field is a name of the request related to this PSA load. It's the same name as you see to the right from a PSA icon in PSA area of RSA1.
There is also a RSERRORLOG table which contains parameters for error messages.
ARFCSDATA
http://help.sap.com/saphelp_nw04/helpdata/en/e7/07fd6eff3211d386ea0000e82011b8/frameset.htm
RSBATCHDATA
BI_WRITE_PROT_TO_APPLLOG
RSMONMESS
table for error ?
TST01
TST03 and TST01 tables belongs to spool process.
TST03 consist of data what we are going to print. This table stores the actual data.
TST01 table stores the header information like authoer name,printer type,page size...etc.
TBTCP
cancelled job log stored in TBTCP table
RSERRORHEAD
If a record in PSA has a green status then no info is recorded anywhere.
In case of yellow or red status the info is written into RSERRORHEAD table. If a field 'ERROR' has 'X" then this record will be marked in PSA with the red status. If a record has been changed and before SAVE had a yellow status then 'X' will be in the 'CHANGED' field. There is also 'DELETED' field. And 'REQUEST' field is a name of the request related to this PSA load. It's the same name as you see to the right from a PSA icon in PSA area of RSA1.
There is also a RSERRORLOG table which contains parameters for error messages.
REPOSRC
The source code of the programs in stored in REPOSRC table.
The program attributes information is in TADIR.
Tarak -
Updating values in database table through Transaction
Hi,
Actually We have one transaction named EWAWA01. In that when we display the values from the transaction, there is a netweight field. The transaction displaying netweight values, but that value is not updated in the database table named EWA_WA_WEIGHPROC. How can i update that netweight value in the table.data:v_v_EWA_WA_WEIGHPROC type (v_EWA_WA_WEIGHPROC lenth) c.
decleare the data in charter type.
after pass the data charter type.
v_EWA_WA_WEIGHPROC = EWA_WA_WEIGHPROC
update db. -
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 -
How to find for ex : kunnr is updating how many database tables
Hi all
How to find for ex : kunnr is updating how many database tables .
Rgds
Rafi .hi rafi
go to se15->abap dictionary->fields->table fields-> give kunnr at field name text box->press f8.
then it will show ,in how many tables the kunnr field exist.the kunnr field updates those tables.
don't forget reward points.
kiran -
Update ztable from database table directly
hi all,
can u tell me the possible ways to update a ztable from database table directly.
i mean is there anyway to update ztable whenever entry is created in database table .
i dont want to update using insert,modify statements.
points will be rewarded to all hlpful answers.A slightly dirty solution:
Use SAP functions for reading from CDHEADER and CDPOS tables [with enough filters such that you extract minimum records possible] to read changes to MARA table fields since last run of your program. Use this information to update your ZTABLE. I would recommend having a table maintainance generator on ZTABLE. The actual update should be by a BDC by calling transaction SM30 for ZTABLE maintainance. Now the program may be set up as a batch job running 1ce an hour. You get updates to the extent of 1 hour latency.
Alternatively, you may look if an opportunistic BADI / user Exit is there alongside MM01/02 transactions - assuming the latter are the only ones updating MARA. In this BADI you may write the code to update ZTABLE- again, look to do it by BDC call transaction sm30 to maintain ZTable. To lighten up the code -load on BADI you may simply raise a custom event and move on. You will configure a job that runs your program when that particular event is raised. This will need the 'burden' of figuring out the changes, though.
An elegant way would be to fire a MATMAS fIDOC for every change to Material, capture that and turn back the changes to ZTABLE. This will facilitate the delta load. -
Create new rows or update rows in database table
I have few table in database.
I catch some values in my bean. Now I must put that values in my database tables. Values are in different tables.
How can I update tables in database? Ok I know that my solution is updateable (entity) viewObject but please ... some example or description are welcome!
Thx.
Message was edited by:
sinnermanHi Frank. I read developer guide but this is detail and if you can help ... thanx in advance.
I put code ... in my bean ... I need to insert row in table and commit. Please if you can answer me what`s wrong?
code:
FacesContext fc = FacesContext.getCurrentInstance();
Application app = fc.getApplication();
//Find corresponding object where variable "bindings" reside
DCBindingContainer binding =
(DCBindingContainer)app.getVariableResolver().resolveVariable(fc,
"bindings");
//Find the data control by name from the binding container
DCDataControl dcCtl =
binding.findDataControl("TMFStudServiceDataControl");
//Retreive application module
TMFStudServiceImpl am =
(TMFStudServiceImpl)dcCtl.getApplicationModule();
ViewObject vo = am.getGetIdStudentAnketaPitanje();
ViewObject studentAnketaOdgovor = am.getStudentAnketaOdgovor();
while (j < my_list.size()) {
t = (Object)lista.get(j);
System.out.println("IdOdgovora: " + t.toString());
vo.setNamedWhereClauseParam("p_id_odgovora", t.toString());
vo.executeQuery();
Row currRow = vo.next();
System.out.println("IdStudentAnketaPitanje: +currRow.getAttribute("IdStudentAnketaPitanje"));
//am.insertStudentAnketaOdgovor();
Row newStudentAnketaOdgovor = studentAnketaOdgovor.createRow();
studentAnketaOdgovor.last();
studentAnketaOdgovor.next();
newStudentAnketaOdgovor.setAttribute("IdStudentAnketaPitanje", 1);
newStudentAnketaOdgovor.setAttribute("IdOdgovor", 2);
studentAnketaOdgovor.insertRow(newStudentAnketaOdgovor);
am.getDBTransaction().commit();
} -
Update & upload the database table
Hi
I have a small issue. In which i have to Upload the data from a flat file based on primary key its a customised table in which there are 4 primary keys. Based on this the customer numbers should be updated and on emore thing is the data should not be repeated. In the selection screen i'll provide a path based on this path it will upload all the data in the flat file
Regards
NandaHi,
Below is the sample code :
*& Report ZCUSTOMER_MASTER_UPLOAD
REPORT ZCUSTOMER_MASTER_UPLOAD
no standard page heading line-size 255.
*include bdcrecx1.
TABLES : T100. "Company Codes
* Internal table declaration *
DATA : begin of it_customer occurs 0, "Internal table for creating customer
INDEX(4), "Index
KUNNR(16), "Customer No
BUKRS(4), "Company code
VKORG(4), "Sales Organization
VTWEG(2), "Distribution Channel
SPART(2), "Division
KTOKD(4), "Account group
ANRED(30), "Title
NAME1(35), "Name1
SORTL(10), "Search field
NAME2(35), "Name2
NAME3(35), "Name3
NAME4(35), "Name4
STRAS(35), "House and street
STREET2(35),
PFACH(10), "PO box
ORT01(35), "City
PSTLZ(10), "Postal code
ORT02(35), "District
PFORT(35), "PO Box city
PSTL2(10), "Postal code
LAND1(3), "Country Key
REGIO(3), "Region
SPRAS(2), "Language key
TELX1(30), "Telex number
TELF1(16), "First telephone number
TELFX(30), "Fax number
TELF2(16), "Second telephone number
TELTX(30), "Second telex number
KNURL(132), "URL
STCEG(20), "VAT Registration number
AKONT(10), "Recon Account
ZUAWA(4), "Sort key
ZTERM(4), "Terms of payment key
ZWELS(10), "List of payment methods to be considered
BZIRK(6), "Sales district
* AWAHR(3), "Order probability
VKBUR(4), "Sales office
VKGRP(3), "Sales group
KDGRP(2), "Customer group
WAERS(5), "Currency
KALKS(1), "Pricing procedure assigned to this customer
VERSG(1), "Customer statistics group
LPRIO(2), "Delivery Priority
VWERK(4), "Delivering Plant
* ANTLF(1) VALUE 9, "Maximum partial deliveries allowed
INCO1(3), "Inco terms1
INCO2(28), "Inco terms2
ZTERM_01(4), "Terms of payment key
KTGRD(2), "Account assignment group
TAXKD_01(1), "Tax classification1
TAXKD_02(1), "Tax classification2
er_message(100),
end of it_customer.
data : begin of it_customer_ext occurs 0, "Internal table for extending customer
KUNNR(16), "Customer No
VKORG(4), "Sales Organization
VTWEG(2), "Distribution channel
SPART(2), "Division
KTOKD(4), "Account group
BZIRK(6), "Sales district
VKBUR(4), "Sales office
VKGRP(3), "Sales group
KDGRP(2), "Customer group
WAERS(5), "Currency
KALKS(1), "Pricing procedure assigned to this customer
VERSG(1), "Customer statistics group
LPRIO(2), "Delivery priority
VWERK(4), "Delivery plant
INCO1(3), "Incoterms (part 1)
INCO2(28), "Incoterms (part 2)
ZTERM(4), "Terms of payment key
KTGRD(2), "Account assignment group for this customer
TAXKD_01(1), "Tax classification1
TAXKD_02(1), "Tax classification2
end of it_customer_ext.
* Internal table to get the error data *
DATA : it_error like it_customer occurs 0 with header line.
DATA : BDCDATA like BDCDATA occurs 0 with header line.
DATA : i_msgtab like bdcmsgcoll occurs 0 with header line.
* Internal table to find the error from the legacy data *
DATA : begin of it_erfind occurs 0,
INDEX(10), "Index for error file
kunnr(16),
er_message(100), "For Error Message
end of it_erfind.
* Variables declaration *
DATA : g_message(200),
time(10),
date(10) ,
v_error_filename like RLGRAP-FILENAME.
date = sy-datum.
time = sy-uzeit.
* Initialization
initialization.
* Generating Error file name with date and time.
perform make_file_name.
* Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
parameter: p_file like IBIPPARMS-PATH obligatory.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-005.
parameters : pm_crt radiobutton group g1 default 'X',
pm_ext radiobutton group g1.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-003.
SELECTION-SCREEN COMMENT 33(79) text-004.
SELECTION-SCREEN end OF LINE.
SELECTION-SCREEN:END OF BLOCK B1.
at selection-screen ON VALUE-REQUEST FOR p_file .
perform get_filename.
* Start of selection
start-of-selection.
perform upload_data.
if pm_crt = 'X'. "If Customer creation is selected
perform fill_data_create.
elseif pm_ext = 'X'. "If Customer extension is selected
perform fill_data_extension.
endif.
end-of-selection.
FORM fill_data_create.
loop at it_customer.
perform bdc_dynpro using 'SAPMF02D' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
it_customer-KUNNR.
perform bdc_field using 'RF02D-BUKRS'
it_customer-BUKRS.
perform bdc_field using 'RF02D-VKORG'
it_customer-VKORG.
perform bdc_field using 'RF02D-VTWEG'
it_customer-VTWEG.
perform bdc_field using 'RF02D-SPART'
it_customer-SPART.
perform bdc_field using 'RF02D-KTOKD'
it_customer-KTOKD.
perform bdc_dynpro using 'SAPMF02D' '0110'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-KNURL'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-ANRED'
it_customer-ANRED.
perform bdc_field using 'KNA1-NAME1'
it_customer-NAME1.
perform bdc_field using 'KNA1-SORTL'
it_customer-SORTL.
perform bdc_field using 'KNA1-NAME2'
it_customer-NAME2.
perform bdc_field using 'KNA1-NAME3'
it_customer-NAME3.
perform bdc_field using 'KNA1-NAME4'
it_customer-NAME4.
perform bdc_field using 'KNA1-STRAS'
it_customer-STRAS.
perform bdc_field using 'KNA1-STREET2'
it_customer-STREET2.
perform bdc_field using 'KNA1-PFACH'
it_customer-PFACH.
perform bdc_field using 'KNA1-ORT01'
it_customer-ORT01.
perform bdc_field using 'KNA1-PSTLZ'
it_customer-PSTLZ.
perform bdc_field using 'KNA1-ORT02'
it_customer-ORT02.
perform bdc_field using 'KNA1-PFORT'
it_customer-PFORT.
perform bdc_field using 'KNA1-PSTL2'
it_customer-PSTL2.
perform bdc_field using 'KNA1-LAND1'
it_customer-LAND1.
perform bdc_field using 'KNA1-REGIO'
it_customer-REGIO.
perform bdc_field using 'KNA1-SPRAS'
it_customer-SPRAS.
perform bdc_field using 'KNA1-TELX1'
it_customer-TELX1.
perform bdc_field using 'KNA1-TELF1'
it_customer-TELF1.
perform bdc_field using 'KNA1-TELFX'
it_customer-TELFX.
perform bdc_field using 'KNA1-TELF2'
it_customer-TELF2.
perform bdc_field using 'KNA1-TELTX'
it_customer-TELTX.
perform bdc_field using 'KNA1-KNURL'
it_customer-KNURL.
if it_customer-KTOKD = 'Z002' or
it_customer-KTOKD = 'Z003' or
it_customer-KTOKD = 'Z004' or
it_customer-KTOKD = 'Z005' or
it_customer-KTOKD = 'Z006' or
it_customer-KTOKD = 'Z007'.
perform customer_001.
elseif it_customer-KTOKD = 'Z011'.
perform customer_002.
else.
perform customer_003.
endif.
perform bdc_transaction tables i_msgtab using 'XD01' 'A' 'L' .
* To fetch the error message from the standard error table
select single * from T100 where SPRSL = 'E'
and ARBGB = SY-MSGID
and MSGNR = SY-MSGNO.
G_MESSAGE = T100-TEXT.
* subroutine to change the error message for every document number
perform REPLACE_PARAMETERS using SY-MSGV1
SY-MSGV2
SY-MSGV3
SY-MSGV4
changing G_MESSAGE.
write: / 'System variables:'.
skip.
write: / ' Sy-msgty:', SY-MSGTY.
write: / ' Sy-msgid:', SY-MSGID.
write: / ' Sy-msgno:', SY-MSGNO.
write: / ' Sy-msgv1:', SY-MSGV1.
write: / ' Sy-msgv2:', SY-MSGV2.
write: / ' Sy-msgv3:', SY-MSGV3.
write: / ' Sy-msgv4:', SY-MSGV4.
skip.
write: / 'Message:'.
skip.
write: / SY-MSGTY, G_MESSAGE.
* To find out the error in the legacy data if there is anything and pass
* the document no with error message to the seperate internal table
* called it_erfind
if sy-msgty = 'E'.
it_erfind-index = it_customer-index.
it_erfind-er_message = G_MESSAGE.
append it_erfind.
endif.
* Finally we are segregating the error and downloading the error data.
at last.
* To segregate the error
perform segregate_error.
* To download the error from it_error internal table with err mesg
perform error_download.
perform display_message.
endat.
endloop.
clear it_customer.
ENDFORM.
FORM fill_data_extension.
loop at it_customer_ext.
perform bdc_dynpro using 'SAPMF02D' '0107'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
it_customer_ext-KUNNR.
perform bdc_field using 'RF02D-VKORG'
it_customer_ext-VKORG.
perform bdc_field using 'RF02D-VTWEG'
it_customer_ext-VTWEG.
perform bdc_field using 'RF02D-SPART'
it_customer_ext-SPART.
perform bdc_field using 'RF02D-KTOKD'
it_customer_ext-KTOKD.
if it_customer_ext-KTOKD = 'Z002' or
it_customer_ext-KTOKD = 'Z003' or
it_customer_ext-KTOKD = 'Z004' or
it_customer_ext-KTOKD = 'Z005' or
it_customer_ext-KTOKD = 'Z006' or
it_customer_ext-KTOKD = 'Z007' or
it_customer_ext-KTOKD = 'Z011'.
perform customer_extension_001.
else.
perform customer_extension_002.
endif.
perform bdc_transaction tables i_msgtab using 'VD01' 'N' 'L' .
* To fetch the error message from the standard error table
select single * from T100 where SPRSL = 'E'
and ARBGB = SY-MSGID
and MSGNR = SY-MSGNO.
G_MESSAGE = T100-TEXT.
* subroutine to change the error message for every document number
perform REPLACE_PARAMETERS using SY-MSGV1
SY-MSGV2
SY-MSGV3
SY-MSGV4
changing G_MESSAGE.
write: / 'System variables:'.
skip.
write: / ' Sy-msgty:', SY-MSGTY.
write: / ' Sy-msgid:', SY-MSGID.
write: / ' Sy-msgno:', SY-MSGNO.
write: / ' Sy-msgv1:', SY-MSGV1.
write: / ' Sy-msgv2:', SY-MSGV2.
write: / ' Sy-msgv3:', SY-MSGV3.
write: / ' Sy-msgv4:', SY-MSGV4.
skip.
write: / 'Message:'.
skip.
write: / SY-MSGTY, G_MESSAGE.
* To find out the error in the legacy data if there is anything and pass
* the document no with error message to the seperate internal table
* called it_erfind
if sy-msgty = 'E'.
it_erfind-kunnr = it_customer_ext-kunnr.
it_erfind-er_message = G_MESSAGE.
append it_erfind.
endif.
* Finally we are segregating the error and downloading the error data.
at last.
* To segregate the error
perform segregate_error.
* To download the error from it_error internal table with err mesg
perform error_download.
perform display_message.
endat.
endloop.
clear it_customer_ext.
ENDFORM.
*This subroutine is used to fill the data for the Account groups
*Z002,Z003,Z004,Z005,Z006 AND Z007
FORM customer_001.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-TXJCD'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BZIRK'
it_customer-BZIRK.
perform bdc_field using 'KNVV-VKBUR'
it_customer-VKBUR.
perform bdc_field using 'KNVV-VKGRP'
it_customer-VKGRP.
perform bdc_field using 'KNVV-VERSG'
it_customer-VERSG.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
* perform bdc_transaction using 'XD01'.
ENDFORM.
*This subroutine is used to fill the data for the Account group Z011
FORM customer_002.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0125'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-NIELS'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0370'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-CIVVE'
'X'.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BZIRK'
it_customer-BZIRK.
perform bdc_field using 'KNVV-VERSG'
it_customer-VERSG.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
ENDFORM.
*This subroutine is used to fill the data for the Account groups
*Z020,Z021,Z022,Z023,Z200,Z201.
FORM customer_003.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-STCEG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-STCEG'
it_customer-STCEG.
perform bdc_dynpro using 'SAPMF02D' '0125'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-NIELS'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0370'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNA1-CIVVE'
'X'.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0210'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-KNRZE'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNB1-AKONT'
it_customer-AKONT.
perform bdc_field using 'KNB1-ZUAWA'
it_customer-ZUAWA.
perform bdc_dynpro using 'SAPMF02D' '0215'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-ZWELS'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNB1-ZTERM'
it_customer-ZTERM.
perform bdc_field using 'KNB1-ZWELS'
it_customer-ZWELS.
perform bdc_dynpro using 'SAPMF02D' '0220'.
perform bdc_field using 'BDC_CURSOR'
'KNB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0230'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-VRSNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0610'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BZIRK'
it_customer-BZIRK.
* perform bdc_field using 'KNVV-AWAHR'
* it_customer-AWAHR.
perform bdc_field using 'KNVV-VKBUR'
it_customer-VKBUR.
perform bdc_field using 'KNVV-VKGRP'
it_customer-VKGRP.
perform bdc_field using 'KNVV-KDGRP'
it_customer-KDGRP.
perform bdc_field using 'KNVV-WAERS'
it_customer-WAERS.
perform bdc_field using 'KNVV-KALKS'
it_customer-KALKS.
perform bdc_field using 'KNVV-VERSG'
it_customer-VERSG.
perform bdc_dynpro using 'SAPMF02D' '0315'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VWERK'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-LPRIO'
it_customer-LPRIO.
* perform bdc_field using 'KNVV-KZAZU'
* 'X'.
perform bdc_field using 'KNVV-VWERK'
it_customer-VWERK.
* perform bdc_field using 'KNVV-ANTLF'
* it_customer-ANTLF.
perform bdc_dynpro using 'SAPMF02D' '0320'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-KTGRD'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-INCO1'
it_customer-INCO1.
perform bdc_field using 'KNVV-INCO2'
it_customer-INCO2.
perform bdc_field using 'KNVV-ZTERM'
it_customer-ZTERM_01.
perform bdc_field using 'KNVV-KTGRD'
it_customer-KTGRD.
perform bdc_dynpro using 'SAPMF02D' '1350'.
perform bdc_field using 'BDC_CURSOR'
'KNVI-TAXKD(02)'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVI-TAXKD(01)'
it_customer-TAXKD_01.
perform bdc_field using 'KNVI-TAXKD(02)'
it_customer-TAXKD_02.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
* perform bdc_transaction using 'XD01'.
ENDFORM.
FORM customer_extension_001.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BZIRK'
it_customer_ext-BZIRK.
if not it_customer_ext-KTOKD = 'Z011'.
perform bdc_field using 'KNVV-VKBUR'
it_customer_ext-VKBUR.
perform bdc_field using 'KNVV-VKGRP'
it_customer_ext-VKGRP.
endif.
perform bdc_field using 'KNVV-VERSG'
it_customer_ext-VERSG.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
ENDFORM.
FORM customer_extension_002.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VERSG'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-BZIRK'
it_customer_ext-BZIRK.
* perform bdc_field using 'KNVV-AWAHR'
* '100'.
perform bdc_field using 'KNVV-VKBUR'
it_customer_ext-VKBUR.
perform bdc_field using 'KNVV-VKGRP'
it_customer_ext-VKGRP.
perform bdc_field using 'KNVV-KDGRP'
it_customer_ext-KDGRP.
perform bdc_field using 'KNVV-WAERS'
it_customer_ext-WAERS.
perform bdc_field using 'KNVV-KALKS'
it_customer_ext-KALKS.
perform bdc_field using 'KNVV-VERSG'
it_customer_ext-VERSG.
perform bdc_dynpro using 'SAPMF02D' '0315'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-VWERK'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-LPRIO'
it_customer_ext-LPRIO.
* perform bdc_field using 'KNVV-KZAZU'
* 'X'.
perform bdc_field using 'KNVV-VWERK'
it_customer_ext-VWERK.
* perform bdc_field using 'KNVV-ANTLF'
* '9'.
perform bdc_dynpro using 'SAPMF02D' '0320'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-KTGRD'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'KNVV-INCO1'
it_customer_ext-INCO1.
perform bdc_field using 'KNVV-INCO2'
it_customer_ext-INCO2.
perform bdc_field using 'KNVV-ZTERM'
it_customer_ext-ZTERM.
perform bdc_field using 'KNVV-KTGRD'
it_customer_ext-KTGRD.
perform bdc_dynpro using 'SAPMF02D' '1350'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
ENDFORM.
*Subrotine to replace the parameters
FORM REPLACE_PARAMETERS USING P_PAR_1 P_PAR_2 P_PAR_3
P_PAR_4 CHANGING P_MESSAGE.
* erst mal pruefen, ob numerierte Parameter verwendet wurden
DO.
REPLACE '&1' WITH P_PAR_1 INTO P_MESSAGE.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
DO.
REPLACE '&2' WITH P_PAR_2 INTO P_MESSAGE.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
DO.
REPLACE '&3' WITH P_PAR_3 INTO P_MESSAGE.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
DO.
REPLACE '&4' WITH P_PAR_4 INTO P_MESSAGE.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
* falls keine numerierten Parameter vorh., ersetzen wie gehabt
REPLACE '&' WITH P_PAR_1 INTO P_MESSAGE.
CONDENSE P_MESSAGE.
IF SY-SUBRC EQ 0.
REPLACE '&' WITH P_PAR_2 INTO P_MESSAGE.
CONDENSE P_MESSAGE.
IF SY-SUBRC EQ 0.
REPLACE '&' WITH P_PAR_3 INTO P_MESSAGE.
CONDENSE P_MESSAGE.
IF SY-SUBRC EQ 0.
REPLACE '&' WITH P_PAR_4 INTO P_MESSAGE.
CONDENSE P_MESSAGE.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
*Subroutine to segregate the error data from the legacy data
FORM segregate_error.
loop at it_erfind.
if pm_crt = 'X'.
loop at it_customer where index = it_erfind-index.
move-corresponding it_customer to it_error.
it_error-er_message = it_erfind-er_message.
append it_error.
endloop.
elseif pm_ext = 'X'.
loop at it_customer_ext where kunnr = it_erfind-kunnr.
move-corresponding it_customer_ext to it_error.
it_error-er_message = it_erfind-er_message.
append it_error.
endloop.
endif.
endloop.
ENDFORM.
*Subroutine to download the error data from the it_error table.
FORM error_download.
if it_error[] is not initial.
call function 'WS_DOWNLOAD'
exporting
CODEPAGE = 'IBM'
FILENAME = v_error_filename
FILETYPE = 'DAT'
tables
DATA_TAB = IT_ERROR.
endif.
ENDFORM.
* Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
* Insert field *
FORM BDC_FIELD USING FNAM FVAL.
* IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
* ENDIF.
ENDFORM.
FORM bdc_transaction tables MESSTAB USING TCODE CTUMODE CUPDATE .
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO MESSTAB.
REFRESH BDCDATA.
clear BDCDATA.
ENDFORM. " bdc_transaction
* Uploading data file to internal table. *
FORM upload_data.
if pm_crt = 'X'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = p_file
* CODEPAGE = 'IBM '
FILETYPE = 'DAT'
TABLES
DATA_TAB = it_customer
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
elseif pm_ext = 'X'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = p_file
* CODEPAGE = 'IBM '
FILETYPE = 'DAT'
TABLES
DATA_TAB = it_customer_ext
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
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.
{size:13}Here you can use sort and delete statement to delete the duplicate entries.{size}
ENDFORM.
*& Form display_message
FORM display_message .
if it_error[] is initial.
message i019(zmsg). "Success
else.
message e020(zmsg). "Failed
endif.
ENDFORM. " display_message
*& Form get_filename
* text
* --> p1 text
* <-- p2 text
FORM get_filename .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = p_file
IMPORTING
FILE_NAME = p_file .
if sy-subrc NE 0 .
write : / 'Enter File Name'.
endif.
ENDFORM. " get_filename
*& Form make_file_name
FORM make_file_name .
write sy-datum to date MM/DD/YYYY.
write sy-uzeit to time USING EDIT MASK ' __ __ __'.
concatenate Text-002 date time '.txt'
into v_error_filename.
ENDFORM. " make_file_name
Thanks,
Sriram Ponna. -
Update JList from database table
Hi! I have a JList that take some value from a mysql table. I want that the JList add or remove value when insert or delete row from db table.
Can you help me?Well then you need to write the add/remove code of the JList yourself. So when ever you updated the database you update the ListModel as well.
Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" for a working example that dynamically updates a ListModel. -
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 PMhi,
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 -
How to Delete the Standard Database table KONV which is Related to ME47
Hi Experts,
i am having the Query that i want to delete some condition types in ME47 Transaction which is related to MM in my requirement. that i have checked that all data is storing in KONV Cluster table but deleting data for standard table we should not delete it directly.so i searched for BAPI and Functional Module i did not get it . can you prefer and BAPI OR Functional Module through that we can delete Record in the KONV Table for this Issuse.WHY would you want to do that directly with a function? Why don't you just fix the pricing issue in the RFQ's in question?
-
How to update a standard table
Hi all,
I want to update table makt with a program from table itab.
Loop at itab into wa.
modify makt from wa.
endloop.
I even can not debug the loop...
Is it not possible to update sap tables?
Thanks.You can definitely modify Standard Database table from ABAP Program.
1.Syntax for modifying Database table from Workarea is,
MODIFY dbtab FROM workarea.
Effect
When a wa work area that is not table-type is specified, which meets the requirements for use in Open SQL statements, a line is searched for in the database table that has the same content in the primary key as the corresponding beginning part of the work area.
If such a line is not found, a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found, this line is overwritten according to the same rules as for the UPDATE statement.
If the change would lead to a double entry in a unique secondary index, then it is not executed and sy-subrc is set to 4.
Notes
The wa work area should always be declared with reference to the database table or the view in the ABAP Dictionary.
If the the database table or view is specified statically, then you the specification of the work area using FROM wa can be ommitted outside of classes if a dbtab table work area is declared for the corresponding database table or for the view using the TABLES statement. The system enhances the MODIFY statement implicitly with the FROM dbtab addition.
Eg. :
DATA message_wa TYPE t100.
message_wa-sprsl = 'EN'.
message_wa-arbgb = 'MYMSGCLASS'.
message_wa-msgnr = '100'.
message_wa-text = 'Some new message ...'.
MODIFY t100 FROM message_wa.
2. Syntax for changing Database table from internal table is ,
MODIFY dbtab FROM TABLE itab.
Effect
If an itab internal table is specified, the system processes all lines in the internal table according to the rules for the wa work area. The line type of the internal table has to meet the requirements for use in Open SQL statements.
If the change to a line in the internal table would lead to a double entry in a unique secondary index, the corresponding line is not inserted and sy-subrc is set to 4. If the internal table is empty, sy-subrc is set to 0. The sy-dbcnt system field is always set to the number of lines that were actually processed
Reward if helpful. -
Hi All,
i need to do direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table . So i am looping the internal table and what is the best approach to update the database table is it to use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001 each time in the loop to update each record and commit work which hits database for each record or use the statement UPDATE pa0001 from table it_0001 and if count = 1000 then COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,
Thanks,
Latha.My Code to update PA0006 is :
DATA: t_pa0006 TYPE STANDARD TABLE OF pa0006 INITIAL SIZE 0,
wa_pa0006 LIKE LINE OF t_pa0006,
w_lin TYPE i.
FIELD-SYMBOLS: <fs_pa0006> LIKE LINE OF t_pa0006.
SELECT * FROM pa0006 INTO TABLE t_pa0006 WHERE uname = 'PKHAROR'.
LOOP AT t_pa0006 ASSIGNING <fs_pa0006>.
<fs_pa0006>-stras = 'My Street'.
ENDLOOP.
DESCRIBE TABLE t_pa0006 LINES w_lin.
UPDATE pa0006 FROM TABLE t_pa0006.
IF sy-subrc EQ 0.
COMMIT WORK.
WRITE:/ w_lin, ' Records have been updated..'.
ENDIF.
Reward points for useful answers
Regards
Pradeep
Regards
Pradeep
Maybe you are looking for
-
Device issue with WLC (excluded client)
I have a single client that is having issues staying connected to my WLC running code 7.0.220.0 Here are the debugs, it just keeps on looping: *apfMsConnTask_0: Jul 18 10:41:06.352: 00:40:96:b8:78:7a Adding mobile on LWAPP AP 10:8c:cf:78:93:80(0) *ap
-
Material Cost estimate error in CK11N
Hallo friend, While I cost estimate in particular material through CK11N then this error occur as No price could be determined for material/batch 1002769-750/ plant XYZ. Even the material is maintained in BOM and Routing also. What would be the pr
-
FILE TO INBOUND ABAP PROXY - " LOOP_IN_MESSAGE_ROUTING ERROR "
Hi , Getting the following Error in *FILE TO INBOUND ABAP PROXY* which is updating a Database table in R/3. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Call Adapter --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30"
-
Lengthen and shorten the search bar and the URL bar
I like to be able to change the size of the search bar and the URL bar. I hate not seeing the whole URL as needed. And sometimes, I want to read everything I type in the search bar. This is a non-negotiable for me and I have stuck with the 3.+++ beca
-
Hi, I am working on BPC 10 NW and i have a doubt about the BPF functionality cause i have created a BPF template with several steps and every step has some hyperlinks. My doubt is: I supose the BPF should block the hyperlinks inside a step after it i