Change documents with persistent class
Hi,
I have created a persistent class and want to use a set-method to change data in the mapped table - nothing special.
But: Does anybody know if there's a possibility to write change documents for the changed field without calling FMs like CHANGEDOCUMENT_SINGLE_CASE?
There would be the event if_os_state~changed but unfortunately no information about the changed field itself is available in this event. Is it possible to redefine events?
Thanks a lot for each answer!
Best regards
Jörg
Hi Narin,
thanks for your answer!
The first point is plain to me (although I don't really feel happy about this ) but I have problems understanding your second point because I don't really know what "Business object events" are... I'll try a different phrasing, maybe this is better:
My persistent class inherits the event if_os_state~changed. Can I redefine this event in my class so that I can add an additional parameter where I can put the information about the changed attribute?
Jörg
Similar Messages
-
Enhance ZMMJ or Normal Change Document with Custom User
Hi there,
I am wondering if it is possible to add a specific field into a change document.
We have a requirement whereby 2 different testers need to be added to a change. The first tester will perform testing of Development in DEV (as per our custom workflow) and then the second tester will perform the normal testing in QA.
Now these two testers might not necessarily be the same person or have the same authorization.
So, my question is that when you are assigning team members to the change (Developer, Tester, Change Manager, IT Operator), is there an option to add another user field here, such as Dev Tester?
Thank you.Hi Bradley,
SAP Note 1728284 has a PDF Attachment with a detailed description what needs to be done. Please follow this description to adapt your configuration.
Thanks
Vikram -
Change documents for item class 015
Dear Experts,
Kindly guide me how to get change documents for notification item class 015.
THANKS & REGARDSHi,
All the changes in the documents will be located in CDPOS and where as the status change documents are located in JCDS.
What we have to do is to enter the correct object number.
i think by this you get the issue resolved. -
Change Documents for Material Class
Hi,
I activated the change logging for a specific Material Class. However, when I check the change log, there is a material class which will show the characteristic change in the following format. For example I modified characteristic ABCDEF from 1 to 2. The log will show the following:
Document Number 099999
ABCDEF - 1 Deleted
ABCDEF - 2 Created
There are other class types/characterisitcs whose change logging is also activated but the change log will only show the "Created" part. The old value (before change) is not shown.
Document Number 088888
ABCDEF - 2 Created
How do I turn on the logging in such a way that the deleted value (old value) will always be shown in the log ?
ThanksWe have the same issue just come up last night. A test on one class last week yielded the 2 record change history model (old value deleted, new value created). Applying the same change to a different material class, we get only the single record model - no help or oss notes seem to mention that there are two different change history models in SAP.
CHECK THIS -- check your single record change log in table CDPOS ... you may have values in both value_old and value_new fields there. The 2 record model stores value_old on the "deleted" record and value_new field value on the "created" record.
That still does not answer why there are two models and how one controls which model is implemented for change history on a class/characteristic ... but it sheds just a little more light on it. -
Activating 'change documents' for notification item class 015
Dear Experts,
Kindly help me in activating 'change documents' for notification item class 015.
Thanks and Regards,
R N SabatHi R N Sabat
The creation of change documents for the classification has to be
activated for every class type. Go please to the customization of the
appropriate class type:
Cross-Application Components
-> Classification System
-> Classes
-> Maintain Object Types and Class Types
You will find there a flag to activate change documents.
As a precondition you'll have to activate the flag 'Multiple objects
allowed' before. If you already have classified objects
for this class type these classifications has to be converted before.
For the conversion of already existing classifications use please report
RCCLUKA2. It processes the conversion and sets the flag 'Multiple
objects allowed'. Regard please the documentation of report RCCLUKA2.
Thereafter you'll be able to activate change documents for this class
type.
Please check the 2 notes :
80907 Setting the several objs.for each class type indctr
65124 Classification Change Documents
If you have any questions , please let me know .
Enda. -
Updating linked fields in a persistent class
Hi all,
If a field of a persistent class is updated, what is the best way to update a related field?
Scenario:
A persistent class with public GET/SET access to a table field STUFF, and public GET access to a field CATEGORY.
Whenever SET_STUFF is called from the outside, the class should also re-evaluate and update CATEGORY.
The easiest is to modify the SET_STUFF method to determine the new category and update it if necessary. However GET/SET methods are always overwritten whenever the class is regenerated, which happens all too easily. Can this be done a bit more elegantly?
Most modifications can be done by redefinitions of the agent class and do not get overwritten each time the class it regenerated. e.g. I have done something similar by redefining the DB access methods to update various fields, but for my current requirement the update needs to be immediate, not during save.
Any input appreciated,
MIke
Edited by: Mike Pokraka on Sep 15, 2009 4:12 PMHi Naimesh,
>
Naimesh Patel wrote:
> Updating the field CATEGORY immediatly would lead to some problems while working with Persistent class because of the COMMIT WORK. As soon as COMMIT WORK after the CATEGORY's "save" hits, all pending save request would execute and may update some fields which you don't want to update at that point of time.
No COMMITs should be performed, that's part of what I'm trying to accomplish. STUFF may change several times during the lifetime of the process and CATEGORY must change with it. When the application finally does a COMMIT WORK then both are written to the DB. (In fact my real scenario involves both transient and persistent instances and multiple callers).
My objectives are to have a readonly attribute in the persistent class that changes in response to other fields changing. It should behave as though the app is calling a SET_STUFF and a SET_CATEGORY, but the persistent class must retain control of the CATEGORY field as several applications can modify STUFF.
My current workaround is an UPDATE_CATEGORY method that must be implemented by each caller, so it works. Layering another class above it an option but is a bit of overkill which also makes it a workaround.
I have found that EXT_HANDLER_WRITE_ACCESS seems to provide something, but the comments in there seem to indicate I shouldn't modify the object info. Unfortunately I have run out of time to experiment this week so the workaround will have to stay for now, but I'd still be interested in a more elegant solution.
Thanks for the input,
MIke -
Can't display archive change documents for agreement (COND_B)
Hello,
I want to display archive change document for object class : COND_B (agreement) via transaction MEB3:
The archive works fine, and I can found the archive change documents form SARA.
(Archive Objetc = CHANGEDOCU
Archive info structure = SAP_CHANGEDOCU2 (is active))
But the display from the application transaction : MEB3 doesn't work.
In the DEBUG:
the Function module is called automatiquely: COND_B_DISPLAY_DOCUMENT
THEN SUBMIT RSSCD100
THEN The function module is called with the no parameter READ_CHANGEDOCU (ie with space value)
THEN the program reads only from DB
Question : HOW I oblige the program to read from the archive (READ_CHANGEDOCU = 'X') ?
I checked these SAP notes 1050935,1299903, 1308024, 1128954, 1050335
but no results.
May be I forgot some customizing ( SARA,, AOBJ )?
Thanks for your help.Hi,
As I understand, the change documents archived using the CHANGEDOCU archiving object are no longer available using the application object.
Refer to Notes 1257133 and 140255 where they mention the above point.
If you want to read change documents along with the application, then you must first archive the change documents along with the application.
In your case, for agreements, you should use object SD_AGREEM so that the change documents also gets archived along with the agreements. Refer to note 761281 to check whether the archiving class CHANGEDOCU is already defined along with object SD_AGREEM in your system.
Hope this helps,
Naveen -
Regarding a Change Document Function Module ----- VERY VERY Urgent
I am using a Change Document Function module "CHANGEDOCUMENT_READ". It is taking a long time.
I am using the parameters:
Start date is the first date of the current month
Enddate as last date of the current month
Object class as 'MATERIAL'
Table Name as 'MBEW'Hi ,
When you want to read the change documents, please follow the below process.
1. Read the change documents headers with function modules
call function 'CHANGEDOCUMENT_READ_HEADERS'
exporting
date_of_change = cdhdr-udate
objectclass = cdhdr-objectclas
objectid = cdhdr-objectid
time_of_change = '000000'
username = cdhdr-username
tables
i_cdhdr = gt_cdhdr
exceptions
no_position_found = 1
wrong_access_to_archive = 2
time_zone_conversion_error = 3
others = 4.
2. From above step you will get data of change documents very quickly into Itab (gt_cdhdr)
3. Read the details on change documents with functiion module by using Itab in loop for each document.
loop at gt_cdhdr.
call function 'CHANGEDOCUMENT_READ_POSITIONS'
exporting
changenumber = gt_cdhdr-changenr
importing
header = cdhdr
tables
editpos = gt_cdshw
exceptions
no_position_found = 1
wrong_access_to_archive = 2
others = 3.
Above is the best way to read the change documents.
Rewards please if above info is useful.
Thanks. -
Change document required in CL20n
Hi,
I have prepared class (002) and assigned in CL20n.
Now i change the value in CL20n.
The "change document" or "Change history is not enable in CL20n.
I want to check the change history / Change document that tell me which value got changed with user ID, time, date.
Can anyone help me out.
Thanks,
KrutiHi Kruti
The creation of change documents for classification has to be activated for every class type. Go please to the customization of the appropriate class type:
Cross-Application Components
-> Classification System
-> Classes
-> Maintain Object Types and Class Types
You will find there a flag to activate change documents.
As a precondition you'll have to activate the flag 'Multiple objects
allowed' before. If you already have classified objects
for this class type these classifications has to be converted before.
For the conversion of already existing classifications use please report
RCCLUKA2. It processes the conversion and sets the flag 'Multiple
objects allowed'. Regard please the documentation of report RCCLUKA2.
Thereafter you'll be able to activate change documents for this class
type.
Please read the 2 notes which explain the process for activating change documents in Classification
80907 Setting the several objs.for each class type indctr
65124 Classification Change Documents
I Hope the information helps
Enda. -
How to read a xml file with StringReader class
Hi,
I need to read a XML document with StringReade class. My aplication receives an absolute path but this doesn't work:
StringReader oStringReader =
new StringReader(c:\java\libros.xml);
However it works with:
StringReader oStringReader =
new StringReader("<?xml version="1.0" e......");
ie, with the whole document as a String, but I need to do it as the frist way.
ThanksHi,
I need to read a XML document with StringReade class.
My aplication receives an absolute path but this
doesn't work:
StringReader oStringReader =
new StringReader(c:\java\libros.xml);
However it works with:
StringReader oStringReader =
new StringReader("<?xml version="1.0" e......");
ie, with the whole document as a String, but I need
to do it as the frist way.
Thankstake a look at this link:
http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html -
Hye,
Facing problem with the change document with update status. The tables CDHDR & CDPOS are getting updated , however my custom table ZEMPTABL is not getting updated with new values.
The steps for creation i followed is as:
1) Custom table : ZEMPTABL with Change document ticked for data elements
2) SCDO - Object created.
3) My program which calls function module for write document:
REPORT ZMSR_TRACKCHNG_CUSTOMTBL.
TABLES : ZEMPTABL.
DATA : GS_EMPTABL LIKE ZEMPTABL,
LS_EMPTABL LIKE ZEMPTABL.
DATA : T_CDTXT TYPE STANDARD TABLE OF CDTXT WITH HEADER LINE.
BREAK-POINT.
SELECT SINGLE * FROM ZEMPTABL INTO GS_EMPTABL
WHERE EMPNUM = '101'.
LS_EMPTABL = GS_EMPTABL.
GS_EMPTABL-EMPNUM = '101'.
GS_EMPTABL-EMPNAME = 'TET'.
T_CDTXT-TEILOBJID = 'ZTEST_TABL_CHNG'.
T_CDTXT-TEXTART = 'TEST'.
T_CDTXT-TEXTSPR = 'EN'.
T_CDTXT-UPDKZ = 'U'.
APPEND T_CDTXT.
CALL FUNCTION 'ZTEST_TABL_CHNG_WRITE_DOCUMENT'
EXPORTING
OBJECTID = 'ZTEST_TABL_CHNG'
TCODE = SY-TCODE
UTIME = SY-UZEIT
UDATE = SY-DATUM
USERNAME = SY-UNAME
PLANNED_CHANGE_NUMBER = ' '
OBJECT_CHANGE_INDICATOR = 'U'
PLANNED_OR_REAL_CHANGES = 'U'
NO_CHANGE_POINTERS = 'U'
UPD_ICDTXT_ZTEST_TABL_CHNG = 'U'
N_ZEMPTABL = GS_EMPTABL "new values
O_ZEMPTABL = LS_EMPTABL "old values
UPD_ZEMPTABL = 'U'
LV_OPT = ' '
TABLES
ICDTXT_ZTEST_TABL_CHNG = T_CDTXT
COMMIT WORK.
WAIT UP TO 3 SECONDS.
Can anyone let me know why the table is not getting updated with new valuesYou should have TWO function modules to call, like
* Update Database Table(s)
CALL FUNCTION 'ZTEST_TABL_CHNG_UPDATE' IN UPDATE TASK
EXPORTING
n_zemptabl = gs_emptabl "new values
o_zemptabl = ls_emptabl "old values
upd_zemptabl = 'U'.
* Insert Change Document(s)
CALL FUNCTION 'ZTEST_TABL_CHNG_WRITE_DOCUMENT' IN UPDATE TASK
EXPORTING
objectid = 'ZTEST_TABL_CHNG'
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
planned_change_number = ' '
object_change_indicator = 'U'
planned_or_real_changes = 'U'
no_change_pointers = 'U'
upd_icdtxt_ztest_tabl_chng = 'U'
n_zemptabl = gs_emptabl "new values
o_zemptabl = ls_emptabl "old values
upd_zemptabl = 'U'
lv_opt = ' '
TABLES
icdtxt_ztest_tabl_chng = t_cdtxt.
COMMIT WORK.
Regards
Raymond -
List all active change documents
Is there a way to list all ACTIVE change documents? In other words - I only want ot know which change documents are being used in the system...
ThanksThanks Anji - Seems there is no place to show if a change document is active, but I was being silly since if a change document is not active or being used, it will not appear in CDHDR / CDPOS!
A useful pool table is TCDOB - It lists all change documents with properties like which tables they monitor etc... -
Need to create a Change document for tracking Purpose on standard table
Hi Experts,
I am updating a field in standard table so need to create a change document for tracking the changes being done on the field.
I created the change Document with transaction SCDO but I am stuck at point - How to call that in the report program to enable the change document.
Please advice.
Thanks!!Hi
U can assign your transaction to Z-report like this:
PARAMETERS: TAB1 RADIOBUTTON GROUP R1 DEFAULT 'X',
TAB2 RADIOBUTTON GROUP R1,
TAB3 RADIOBUTTON GROUP R1.
DATA: TABNAME TYPE TABNAME.
START-OF-SELECTION.
CASE 'X'.
WHEN TAB1. TABNAME = 'BSID'.
WHEN TAB2. TABNAME = 'BSAD'.
WHEN TAB3. TABNAME = 'BKPF'.
ENDCASE.
CALL FUNCTION 'RS_TABLE_LIST_CREATE'
EXPORTING
TABLE_NAME = TABNAME
* ACTION = 'ANZE'
* WITHOUT_SUBMIT = ' '
* GENERATION_FORCED =
* NEW_SEL =
* NO_STRUCTURE_CHECK = ' '
* DATA_EXIT = ' '
* IMPORTING
* PROGNAME =
* TABLES
* SELTAB =
EXCEPTIONS
TABLE_IS_STRUCTURE = 1
TABLE_NOT_EXISTS = 2
DB_NOT_EXISTS = 3
NO_PERMISSION = 4
NO_CHANGE_ALLOWED = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
ABAP OO Class and Change Documents
I have created a class based on the IF_WORKFLOW interface. I created a couple of events. I created a workflow task assigned to a custom method of the class. I setup the Material Change Document to trigger the class event when there is a change. The workflow task does trigger when I change a material, but I don't know how to pass the key of the Change Document (matnr) to the workflow task/method using the ABAP OO Class interface. Any help?
Thanks,
KennethThanks for the reply Florin. Yes, I have seen Joclyn Dart's Whitepaper and blogs. They are very helpful, but I haven't seen much information within them about Change Documents. I tried your suggestions, but the material key is still not being filled when I trigger the change document and workflow task using tcode MM02.
Here is what I have done:
Created an Attribute 'Material' type mara-matnr and checked 'Key Attribute'.
Created an Attribute M_POR type SIBFLPOR.
Here are the methods:
Constructor with parameter 'Material' *
METHOD constructor.
me->m_por-catid = 'CL'.
me->m_por-typeid = 'ZMM_WF_MATTEC'.
me->m_por-instid = me->material.
ENDMETHOD.
Find_by_lpor with parameters LPOR and RESULT (default params) *
METHOD bi_persistent~find_by_lpor.
DATA: p_material TYPE matnr.
MOVE lpor-instid TO p_material.
TRY.
CREATE OBJECT result
TYPE
zmm_wf_mattec
EXPORTING
material = p_material.
CATCH cx_bo_error .
EXIT.
ENDTRY.
LPOR with parameter RESULT (default param) *
method BI_PERSISTENT~LPOR.
result = me->m_por.
endmethod.
ENDMETHOD.
Custom method MAT_CHANGED with parameter 'Material' * (not coded yet)
This is the task being triggered by the Change Documents *
METHOD mat_changed.
ENDMETHOD.
Edited by: Kenneth Moore on Nov 4, 2008 11:00 AM -
Problems with generating persistent classes
I've been following the tutorial for generating persistent classes from a
DB. I'm not having much luck:
First, with rd-schemagen, how do you tell it to only work on a specific
schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
generates the schema file for all schemas in the DB. Is there a usage
option for the tool (I haven't been able to find it yet)?
Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates an
ID class for ACT (ActId) which conflicts with the class generated for
ACT_ID (ActId). Since renaming the tables is not an option and I really
don't want to have to rename classes and change the mapping file every
time I regenerate, what is a solution for this problem?
Third, if I do the latter above so I can run the importtool and then I
run "rd-importtool test\test.mapping", it runs successfully for a bit
while spitting out information until I get this:
Exception in thread "main" java.lang.NullPointerException
at
com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapForeignKe
y(ImportTool.java:336)
at
com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapField(Imp
ortTool.java:207)
at
com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
gs(ImportTool.java:78)
at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run
(ImportTo
ol.java:408)
at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main
(ImportT
ool.java:385)Abe White <[email protected]> wrote in
news:[email protected]:
First, with rd-schemagen, how do you tell it to only work on a specific
schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
generates the schema file for all schemas in the DB. Is there a usage
option for the tool (I haven't been able to find it yet)?Try using -schemas <comma-separated list of schema names>
I apologize for the documentation in this area. We're going to upgrade
the tool and the documentation to a more recent version from our internal
R&D codebase when our 2.5 release comes out in the next couple of weeks.
This release will also include a system for customizing the tool's output
in many more ways.This works:
rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101
but this does not:
rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101,NBS_SRT_
101
Exception in thread "main" java.lang.IllegalArgumentException:
com.solarmetric.r
[email protected] = NBS_ODS_
101,NBS_SRT_10
1: java.lang.ArrayIndexOutOfBoundsException: 1
at serp.util.Options.setInto(Options.java:206)
at serp.util.Options.setInto(Options.java:168)
at com.solarmetric.rd.conf.Configurations.populateConfiguration
(Configur
ations.java:144)
at com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGenerator.main
(SchemaG
enerator.java:690)
Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates
an ID class for ACT (ActId) which conflicts with the class generated for
ACT_ID (ActId)This is a bug, and will also be fixed with 2.5. I can't even think of a
good way to tell you to work around it for now, unfortunately.I renamed the ID classes to ActOid and EntityOid and changed the .jdo file
to reflect that. Do you see any problems with this strategy?
Third, if I do the latter above so I can run the importtool and then I
run "rd-importtool test\test.mapping", it runs successfully for a bit
while spitting out information until I get this:
Exception in thread "main" java.lang.NullPointerExceptionCan you please send the generated .mapping, .jdo, and .java files?
Unless you want to wait until the 2.5 improvements to debug.I will send you all the files in a zip file by email.
Maybe you are looking for
-
I have a Problem with Romming Between SSIDs withing the same WLC but with deferent VLAN .
HI All, I have a Problem with Romming Between SSIDs withing the same WLC but with deferent VLAN . the WLC are providing the HQ and one of the Branches the Wireless services . Am using all the available 9 SSIDs at the HQ , and am using only 4 of it at
-
How to send an e-mail from an ADF BC application?
Hi all, I have a requirement of sending e-mail from my ADF BC application.I am using JSF and Jdeveloper 10.1.3.3.0. Can anyone please help me out? Thanx in advance, Arijit
-
I'm not sure where to post this but... Out of nowhere about a week ago my Mac starting blabbing - it tells me everthing I'm doing, i.e. "Firefox, maximum volue, apple discussions, post message..." and on and on and on and on...Why??? And how do I get
-
Parameter rsau/local/file does not exist
I would like to activate the paramater rsau/local/file, but it does not exist. The version i'm using now is ECC 6.0. Is it because the parameter is different in ecc6.0 or anywhere I can set the location for the security audit log?
-
Form Templates will not save properly
I have a few computers (All windows 7 64bit) that have recently been upgraded to Adobe XI 11.0.4. 2 of the computers are not able to save a form onto itself with changes. One computer is. To elaborate, if one user opens a form and fills out the fo