Logging change in a specific field in a sap table
Hi,
i would know if it's possible to log the change only one a field in a table like AUFK.
I create a new field and i want to know who and when a change is make.
Thanks a lot.
Edited by: draconagi on Mar 9, 2011 3:14 PM
Edited by: draconagi on Mar 9, 2011 3:14 PM
Hello Lalitha,
Guess FM DYNP VALUES READ can help you. You can append all screen elements' name onto the table DYNPFIELDS. When you use this FM, it will give new values of all the fields.
Note: This FM Read screen field values before PAI field transport.
Regards,
Anubhab
Similar Messages
-
How to update specific fields of a db table using MODIFY
Hi all.
I understand that MODIFY allows us to insert a record into the database if the a record with the same key is not there. If a record is there, it would update that record.
However, when the record is there, could i update SPECIFIC fields of the record, instead of updating ALL fields of the record?Yes, you can with exception that you can not modify primary key values.
Here are the details about MODIFY db table command with examples
MODIFY - Change a database table
Variants:
MODIFY dbtab. or MODIFY *dbtab. or
MODIFY (dbtabname) ... .
MODIFY dbtab FROM TABLE itab. or MODIFY (dbtabname) FROM TABLE itab.
MODIFY dbtab VERSION vers. or MODIFY *dbtab VERSION vers.
Effect
Inserts new lines or updates existing lines in a database table (s. relational database). If a line with the specified primary key already exists, an UPDATE is executed. Otherwise, an INSERT is performed. You can specify the name of the database table either in the program itself in the form MODIFY dbtab ... or at runtime as the contents of the field dbtabname in the form MODIFY (dbtabname) ... . In both cases, the database table must be defined in the ABAP Dictionary. If the program contains the name of the database table, it must also have a corresponding TABLES statement. Normally, records are inserted or updated only in the current client. Data can only be inserted or updated using a view, if the view refers to a single table and was created in the ABAP Dictionary with the maintenance status "No restriction".
MODIFY belongs to the Open SQL command set.
When the statement has been executed, the system field SY-DBCNT contains the number of edited lines.
The Return code is set as follows:
SY-SUBRC = 0:
All lines were successfully inserted or updated.
SY-SUBRC = 4:
One or more lines could not be inserted or updated.
Notes
1. You cannot modify a line if there is already a line in the table with identical key field values in a UNIQUE index.
2. Automatic definition of INSERT and UPDATE is expensive. You should therefore use MODIFY only if you cannot define the INSERT and UPDATE cases yourself in the program.
3. Since the MODIFY statement does not perform authority checks, you have to program them yourself.
4. Adding or changing lines with the MODIFY command is only completed after a database commit (see LUW) has been performed. Before the database commit has been performed, any database changes can be reversed with a database rollback (see Programming transactions).
5. Synchronization of simultanous accesses by several users to the same set of data cannot be exclusively achieved with the lock mechanism of the database system. In several cases, you are recommended to use the SAP lock mechanism.
Variant 1
MODIFY dbtab. or
MODIFY *dbtab. or
MODIFY (dbtabname) ... .
Extras:
... FROM wa
... CLIENT SPECIFIED
See Cannot Use Short Forms and
Cannot Use *Work Areas.
Effect
Inserts a new line or updates an existing line in a database table. If you specify the name of the database table yourself, the primary key for identifying the line to be inserted or updated and the relevant values are taken from the table work area dbtab or *dbtab (see TABLES). If you declare the name of the database table explicitly, the program must also contain a corresponding TABLES statement. If the name of the database table is not determined until runtime, you need to use the addition ... FROM wa.
Example
Insert or change data of the customer Robinson in the current client:
TABLES SCUSTOM.
SCUSTOM-ID = '12400177'.
SCUSTOM-NAME = 'Robinson'.
SCUSTOM-POSTCODE = '69542'.
SCUSTOM-CITY = 'Heidelberg'.
SCUSTOM-CUSTTYPE = 'P'.
SCUSTOM-DISCOUNT = '003'.
SCUSTOM-TELEPHONE = '06201/44889'.
MODIFY SCUSTOM.
Addition 1
... FROM wa
Effect
The values for the line to be inserted or updated are not taken from the table work area dbtab, but from the explicitly specified work area wa. When doing this, the data is read from left to right according to the structure of the table work area dbtab (see TABLES). Since the structure of wa is not taken into account, the work area wa must be at least as wide (see DATA) as the table work area dbtab and the alignment of the work area wa must correspond to the alignment of the table work area. Otherwise, a runtime error occurs.
Note
If a work area is not explicitly specified, the values for the line to be inserted or updated are also taken from the table work area dbtab if the statement is in a FORM or FUNCTION where the table work area is stored in a formal parameter or local variable of the same name.
Addition 2
... CLIENT SPECIFIED
Effect
Switches off automatic client handling. This allows you to edit data across all clients even when dealing with client-specific tables. The client field is treated like a normal table field that can be programmed to accept values in the table work area dbtab or *dbtab where the line to be edited occurs.
The addition CLIENT SPECIFIED must be specified immediately after the name of the database table.
Variant 2
MODIFY dbtab FROM TABLE itab.or
MODIFY (dbtabname) FROM TABLE itab.
Addition:
... CLIENT SPECIFIED
Effect
Mass modify: Inserts new lines or updates existing lines of a database table. The primary keys for identifying the lines to be inserted or updated and the relevant values are taken from the internal table itab. The lines of the internal table itab must satisfy the same conditions as the work area wa in addition 1 to variant 1.
Note
If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0.
Addition
... CLIENT SPECIFIED
Effect
As for variant 1.
Variant 3
MODIFY dbtab VERSION vers. or
MODIFY *dbtab VERSION vers.
See Cannot Use the VERSION Addition.
Note
This variant is obsolete.
Effect
Inserts a new line or updates an existing line in a database table, the name of which is taken from the field vers at runtime. If no line exists with the specified primary key, an INSERT is executed. Otherwise, an UPDATE is performed. The database table must be defined in the ABAP/4 Dictionary and its name must conform to the naming conventions for R/2 ATAB tables. These stipulate that the name must begin with 'T' and may contain up to four further characters. The field vers must contain the table name without the leading 'T'. Only lines in the current client are inserted or updated. The line to be inserted is taken from the statically specified table work area dbtab or *dbtab.
SY-SUBRC is set to 0 if the line is successfully inserted or updated. SY-SUBRC <> 0 is not possible since any other result causes a runtime error.
Hope this helps.
ashish -
Changing the order of fields in an internal table
Hi all,
I'm using field symbol as internal table. this table has got a standard database structure.
I want to make the 3rd column of this internal table as 1st colums keeping rest of the columns as it is.
Is there any way to do this?
Thanks,
Anil.Hi
Instead of directly taking the type as a standard structure , declare the FS internal table as type of types structure.
Data: fs_scarr like type_s_scarr.
FIELD-SYMBOLS <scarr2> TYPE fs_scarr
In the types put the third column as first one and use into corresponding in select query
or else
while displaying the internal table change the order of the columns
Loop at itab into fs_itab.
write : col3
col2
col4
endloop.
Thanks,
Viquar Iqbal -
To change name of output field hearder in SAP Standered report.
Dear All,
Is there any options to change the name of output field hearder in SAP Standered report.
Regards,
Pankaj Vashistaanswered
-
Creating Lock object for a field in a sap table
Hi ,
I need to lock a field in sap table
eg. To lock a Standard price(stprs) field in Material Valuation (mbew) table.Try with the following Code :
CALL FUNCTION 'ENQUEUE_EZMBEW'
EXPORTING
MODE_MBEW = 'S'
MANDT = SY-MANDT
MATNR = '000000000000000043'
BWKEY = '0001'
STPRS = '20,00'
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 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.
Thank you,
Sekhar. -
Standard screen changes-addition of a field in vendor master table
Hi Champs,
My requirement is to add a field in LFB1 table.
I have added the field in the table using append structure, that was fine.
I need to add the same for input/output on the screen 215 of program SAPMF02K (for the screen of Payment transaction Accounting at company code level).
The screen enhancement available for vendor master is for adding a new sub screen. But I need my field to be input/output on screen 215 of program SAPMF02K (for the screen of Payment transaction Accounting at company code level).
The only option left with me was to make changes in the Standard SAP screen as there are no enhancements available to suffice my requirement.
After taking the access key, if suppose i make changes in the standard screen viz. given a dictionary refrence to the new field created on screen 215. My query is do i need to do any kind of coding in PBO or PAI of the screen.
A quick reply would be overwhelming.
Thanks
Regards,
NishantOfcouse Nishanth, u need to code in PBO and PAI event.
PAI -> To read the User input and for doing validations or some thing as per ur requirement
Hope this helps,
Shiva kankanala -
How can we change value of a field in the Repeating Table using SharePoint Workflow 2013.
Hi
I have an InfoPath form published on a SharePoint Library. The form contains a Repeating table and after submit a workflow runs. In this workflow I want to change some values of the fields within Repeating table.
How can I do this?
Thanks.Hi,
I found a similar thread posted by you here:
http://social.technet.microsoft.com/Forums/en-US/e1fa36c1-cb5c-456d-ba40-2f26301913d2/how-to-loop-through-each-row-in-a-repeating-table-using-sharepoint-workflows?forum=sharepointgeneralprevious
I suppose both the threads are reuqesting the method to get values from repeating table via workflow, so we can focus on the issue on the other case. If there is more requestment here, let me know.
Regards,
Rebecca Tu
TechNet Community Support -
Hi Experts,
I wish to thank anybody replying this message first.
I have some questions to be cleared, may be you can provide me some help.
To log changes on specific fiekds from a custom table, one has to use SCDO to generate change object and fct modules.
These fct modules shoudl be called from program to log changes in tables CHDR and CDPOS.
In the process of modifying a PO (me22n), I have several additional custom fields added in SAP table EKPO. These fields are available in PO trhough a custom tab on PO screen. I want to log the changes on these custom fields. The data elements of these fields are checked within change document check box. I modify the PO on several fields including custom fields , examine the content of CHDR and CDPOS and then find out that changes are logged for SAP EKPO fields modified but not for the EKPO custom fields.
So here is my question:
Do I have to call the generated changed document fct modules from an user exit or BADI prior to saving to have the log changes or SAP handle it automatically ? If Yes, then which user exit or BAdi should I use ?
Thank you for your time
Dean Q.I found that SAP log the changes aumatically
Thank u all -
Table for the report RPUAUD00 Logged Changes in Infotype data
Hi
I have a query with the program RPUAUD00 Logged changes in Infotype Data. In which table stores the details of the program RPUAUD00. for example in the 1st period there is a LWP record for the employee. If in the 2nd period the LWP entered in 1st period has deleted, in the log the LWP displays for 1st period new field contents, Action Indicator I. The deleted information displayes in Old field contents with the Action Indicator D. We want to know in which table the LWP insert and LWP delete (d) details are stored.
This information required to create a report for ESI. In the report No of days (payroll processed for) has to mention. To know the no of days need to access the report RPUAUD00. From the RPUAUD00 the details of LWP insert and delete can be known.
Request to help in solving the issue
Thanks & Regards
EKP YadavHello:
Logged changes in Infotype Data are stored in cluster table PCL4 ID LA and SA for employee and LB and SB for applicant. Maybe L is for longterm and S for shorterm
Cheers.
Antoine -
Capturing Log changes made to Z Table
Hi All,
I have to detect changes for a Z-field in a Z-table. Im going to use CDHDR table and CDPOS table to check if any changes are made to field. I enabled log data changes in technical settings of Z-table and also change document for the Z-field. I created an object class (Z .) and generated update program and function modules. It generated a FM ZMMARC_WRITE_DOCUMENT. I think this will write the change document records to CDHDR. I checked in SCU3, there were activation logs and also checked the entry in TCDOB.it was ok. But when this field is being changed by a custom transaction (YM11, YM12) this entry (change records) does not go into CDHDR table. So Im not able to detect any change records for the particular field ( and the object class).
Am I missing any step here? Because, I read somewhere that the function module ZMMARC_WRITE_DOCUMENT has to be called in all the programs that update the Z-table. Can you please provide any help on this? Any help on this would be appreciated.
Thanks.
Regards
s.anilkumarHere are the errors I'm getting.
CONNECT SCOTT/TIGER
Connected.
create or replace trigger audit_tablea
after insert or update or delete on tablea
for each row
begin
insert into tableb values(
:new.field1,
:new.field2,
:old.field1,
:old.field2)
end;
Warning: Trigger created with compilation errors.
insert into tablea values('hello','world')
ERROR at line 1:
ORA-04098: trigger 'SCOTT.AUDIT_TABLEA' is invalid and failed re-validation -
How to change value in PPMeter field in IQ02
Hi,
Please guide me how can we change the value in PPMeter field in IQ02(in tab 'other').
The device has already been installed and billing for several months has also been done.
Please guide.
Thanks and Regards
Edited by: MPVash Vash on Dec 4, 2008 7:06 AMTransactions SMOD and CMOD are available for enhancing and preassigning fields for devices.
There is one customer exit under the SAP enhancement EMDK0001.
When creating a device using Plant Maintenance (PM), you can enter data directly onto the Other tab page. You do this by using transaction IQ01 to define enhancement ITOB0001. This is not possible via transaction IQ04. In change mode, however, you can use both transactions to access customer-specific fields.
Table EQUI contains device data. The customer include CI_EQUL is used to include customer-specific fields in the database table. You cannot preassign fields for devices. You can use the field selection to display fields for device and connection (both based on equipment) differently.
Regards,
Shiva Kumar -
Changing Non key field to Key field in a custom table
Hello Abap gurus:
I have a requirement in which i need to change a non key field in my custom table(Z TABLE) to key field.
For example; i have field sequence as
field 1 key field
field 2 key field
field 3 key field
field 4 non-key field
field 5 non-key field
field 6 non-key field
field 7 non-key field.
i want to change field 7 as key field.
Can i do perform operation??
when i am tryingto perform bove operation it is taking long time to get the table activated.
Could any one please help me in getting this resolved.
regards,
Sravanthi.Use DB Utility (se14) to perform alter table or conversion. The latter is used when atemps to perform first operation fails. Which one is used, really depends on system and current DB table state (i.e. if has any content and what is being adjusted).
The way Max suggested is similar to [conversion process|http://help.sap.com/saphelp_nw04/helpdata/EN/cf/21f1b8446011d189700000e8322d00/content.htm] which system takes care of itself.
Refer [Adjusting Database Structures|http://help.sap.com/saphelp_nw04/helpdata/EN/cf/21f1ab446011d189700000e8322d00/content.htm] and already given link to conversion.
Please also consider potential errors while doing conversion . This can lead to data loss, so you should think of some backup to prevent that.
Regards
Marcin -
Change All Field Names in a Table to have a Lowercase First Letter
I have an SQL database with many tables. All of the field names in each table start with an Uppercase letter. I would like to programmatically change all of the field names in each table to start with a lowercase letter. Can this be done?
E.g.: "FieldName" to "fieldname"
Thanks.O.K. Just in case anyone else runs into this, I used Carl's answer to guide me in the right direction. This is my final code that created the commands I needed to run a batch (where TMaster is my schema name and the WHERE statement contains
the datatypes in your tables):
SELECT
'EXEC SP_RENAME ''TMaster.'+TABLE_NAME+'.'+COLUMN_NAME+''',
'''+LOWER(SUBSTRING(COLUMN_NAME,1,1))+SUBSTRING(COLUMN_NAME,2,255)
+''',
''COLUMN'''
FROMINFORMATION_SCHEMA.COLUMNS
WHEREDATA_TYPE='int'. -
Report Painter: How to add new(customer specific) field to CCSS table
Dear Experts,
We have requirement to display the orders based on Profit center or Profit center groups in report painter. So in report library(6O1), we want to add fieild PRCTR or any customer specific field(ZPRCTR) to CCSS table. Could you please let us know how to add field ?
or is possible to add customer specific field(ZPRCTR) in CCSS and link that field to Profit Cetner(PRCTR) and profit center group.
Please help us..
Thanks in advanceYou can check the below OSS notes:-
<https://service.sap.com/sap/support/notes/929889>
<https://service.sap.com/sap/support/notes/522581>
<https://service.sap.com/sap/support/notes/43493>
Regards,
Gaurav -
How to read specific fields from BW table into ABAP?
Hi Experts,
Can someone help me how to use to FM: RFC_READ_TABLE to read specific fields from a BW table '/bic/zcust_chO01' which DOESN't EXIST IN ABAP.
I am getting an error in OPTIONS & DATA parameters.
Any help would be higly appreciated with points.
Thanks
DanDan,
FM: RFC_READ_TABLE is a RF FM so by providing BW system's RF destination you can get the values from required table.
TRY this:
CALL FUNCTION RFC_READ_TABLE destination <BW_RF_destination>
Susanth.
Maybe you are looking for
-
How to rotate a thumbnail image in Finder?
Is there a way to rotate a thumbnail image in Finder? When I click a photo in a Finder folder, the image automatically opens in Preview and the image is correctly displayed right side up. But the thumbnail image is displaying a vertical photo horizon
-
Hi i wanted to transfer the music from my iphone to the computer with out erasing from my phone then when i called techinical suppost he told me to click transfer purchase (my name) and now the music i bought in itunes that was on my iphone 4 is all
-
Best way to share data? New workflow: MacBook Pro and an older iMac
I have an iMac 24" 2.16 GHz Intel Core 2 Duo running 10.6.8 that has been the workhorse for my graphic design business since 2006. Connected to the iMac are two back up drives: The first is an iomega 2 TB that I use for a system wide back up (via Tim
-
How much time i must wait for iphone 5 send to POLAND??
I wanna know when i get my iphone 5 if I buy one in AOS uk??
-
hello, I want to create a plugin asking link to web address. how do I create my object PDAction? thank you for your help