on 06-09-2009 12:23 PM
Hi Experts,
Does anyone know how to use Program Exit available in Customization screen for Status of DMS.
My requirement is to change the Status of previous version of a DIR to EX(Expired) as soon as new version of DIR is loaded with "IN" (Initial) status.
So, i am thinking of developing a program which will be triggered when status of new version is set to "IN" and will change the status of previous version to "EX".
I know what the program coding needs but my doubt is that how do i get the input to this custom program. To get the previous version first i need to know which DIR is being processed.
The program would need the Document Number as the input. How can the program get this data in runtime when the status is being changed for latest version of the Document?
Please let me know if any doubts.
Thanks & Regards
Abhishek
Points Awaiting !!
hi, Abisheck
check these BAPIs
hi,
Please check the following BAPI,
1. 'Document.GetStatusList'
2. 'Document.GetStatus'
3. 'Document.SetStatus'
please let me know
benakaraja ES
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Benaka,
Thanks for the reply.
I know about these BAPI's. i am already done with the program coding which needs to be triggered.
I just need a way to get the Document Number for which Status is being "IN" being set. The input for the program is the Document number.
Can someone provide me link or documentation on using Program Exit for Status changes?
Thanks & Regards
Abhishek
Points Awaiting !!
hi,
Please check your entry once again, in Bapi, 'Document.CheckIn'
Allocate document data
lf_doctype = 'DRW'.
lf_docnumber = '4711'.
lf_docversion = '000'.
lf_docpart = '00'.
lf_status = 'RE'. note: u are not enterd, status i guess, while u chek in the status should be changed from old to new.. try out by entring status,
Benakaraja ES
hi,
please, understand logic...bhehind,
Use
In the past you were able to create document info records with BAPI_DOCUMENT_CREATE2 and set them to locked status (e.g. RE) from the beginning. But now you get the following error message 'The status set requires a previous status' if you try to do the same.
Reason
This former behavior was not intended to be the standard for DMS BAPIs. To close this design gap it was necessary to change the system behavior. Therefore note 1157678 was created. The reason for this change was that it should not be possible to create a document info record in a 'locked' status from the beginning. The reson for this is in the follwoing statement of the DMS development:
It is not possible to create version of a document in a locked status if the source is in locked status.The DIR has to go through all the statuses defined.
From BAPI it was possible to create new version of a document in locked status if the source document is in locked status.This is incorrect because
There is no authorization check happening.
The DIR would not go through all the defined statues but directly to a locked status, which is also not correct.
Due to this information the only possibility is to create your documents with another status or to de-implement note 1157678. But as this is a standard note the de-implementation would
mean to be a modification of the standard.
I understand that this change means to be a serious change in the system logic but please note that due to the missing authorization checks and so on the former behavior causes a lot of inconsistent behavior too. And therefore this needs to be corrected by note 1157678.
Benakaraja ES
Hi
Entering program exit and form routine in DC10 for a particular status will invoke that program ON saving the document .
This will be called in create mode only (as far as i understand ).
You need to follow below steps to make it work .
1. Create a report ( which will be the program exit )
2. In this report call your subroutine (Form routine) .
3. In the subroutine definition , Write your logic here.
4. The main point here is : when R/3 finds out the program exit filled in DC10 for a status ,
it will EXPORT the relevant data to ABAP memory
.
You just have to call :
IMPORT draw from MEMORY ID 'DRAW' to get the keys of teh document which is newly created .
Once you have the keys, get it's last version /versions using 'CV115_DOCVERSION_GET_LAST'
and perform your logic .
Don't forget about the COMMIT WORK statement at the end .:)
Hope this solves your issue.
Best Regards,
Roopa
Hi Roopa,
This is what i was expecting...thght i am very bad in posting my queries..thnks
Further to ur answers i have some more queries..
Do you know which report we need to use for program exit.. i think SAP keeps std report names which we need to use for writing subroutines..??
Thanks again
Abhishek
Hi Abhishek,
Hope you must be using change number in your DMS system.
When a new Version is created, you are planning to move the earlier version status to EX.
I hope, change number used for earlier version must be closed.
How are you able to move the status of earlier version when change number of that version is closed.
Is it possible to change the status in background without change number is active, this may lead to data corruption. OR
Are you using the new version change number to do this, i hope it is not possible to edit a DIR Versionw with two different change numbers.
As i would like to use change number for the similar functioanlity in DMS, i am looking for this solution.
could you please explain for me.
Best Regards,
Madhu
Hi Madhu,
I am not using ECM for this functionality in our scenario as it is fully automated process.
btw how r u using ECM ?
If you are using ECM, are u not using Revisions instead of versions? Or using revisons for some changes and then using versions for major chnages.
Is thr any specific requirement why you need to change the status of previous Document version to EX. If you are using ECM the active versions functionality is automatically set to new versions as soon as you set the new version to Released.
Not sure if you understood anything . plz let me know in detail about ur requirement.
Thanks & Regards
Abhishek
hi, abhishek,
Check this bapi,
BAPI_DOCUMENT_CREATENEWVERSION,
Benakaraja
??
Edited by: benaka rajes on Jun 25, 2009 12:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.