Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Change Document Type

Former Member
0 Likes
589

Hello,

I have a requirement to create a custom program to change the type of a document.

I did a search in here and found this thread : http://scn.sap.com/thread/17947 but its not changing.

I get errors saying "No user master exists for this user" and "original is already checked in and stored"

Here are my steps:

CALL FUNCTION 'BAPI_DOCUMENT_GETACTVERSION'

CALL FUNCTION 'BAPI_DOCUMENT_CREATENEWVRS2   , this seems to work...kind of. It creates a new version, but I dont see this version in DRAD, only in DRAW.

CALL FUNCTION 'BAPI_DOCUMENT_GETACTVERSION'  - this gets the new version i created appropriately

CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'  - I get the details of the new version-

CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2' - I set the delete flag and the new value for version, but this is where it tosses the error

"original is already checked in and stored"

Is there an easier way to change the document type that I'm not finding? This just doesnt seem to work.

I tried another approach of deleting the old version and creating a new document using bapis, but that gave errors as well that it couldnt create them.

Any help will be awarded points! thanks guys and gals!!

1 REPLY 1
Read only

Former Member
0 Likes
492

Update:

I continue to get the "original is already checked in and stored"

My client has given me additional information.

These are the four type of documents they would like to have the ability to change:

DRW

QTE

PKG

TAR

I tried to delete the old and create a new document using the same data, but that did not work due to the range of numbers allowed the document number. The internal and external range are seperate and so I would not be able to keep the same document number.