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

document does not exist error in BAPI_DOCUMENT_CREATENEWVRS2

Former Member
0 Likes
2,472

Hi,

1- My requirement is to create a new version in DMS. I am using standard bapi BAPI_DOCUMENT_CREATENEWVRS2. I am giving following parameters to my bapi.

It is throwing an error document in return parameter SPE/3.1-3001-9028/000/C DOES NOT EXIST. I picked up the document number from DRAW table and I also checked that version A is in released state.

REFDOCUMENTTYPE = SPE

REFDOCUMENTNUMBER = 3.1-3001-9028

REFDOCUMENTPART = 000

REFDOCUMENTVERSION = A

NEWDOCUMENTVERSION= C

COPYORIGINALS = X

COPYOBJECTLINKS = *

Can anyone tell me where I am making a mistake?

Shilpa

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
1,498

Hi,

    Seeing the error, it seems that it is trying to create a Document version based on 'C' not 'A'. That error which you are getting usually occurs when you try to create a new document version with a document which is not existing.

Just cross check all your values in REFDOCUMENTTYPE, REFDOCUMENTNUMBER, REFDOCUMENTPART, REFDOCUMENTVERSION  and NEWDOCUMENTVERSION values are correctly passed. Only pass the above values and try.

And also try directly executing the BAPI in SE37, if there it is working correctly, then the values you are passing in the program must have not passed correctly.

Thanks & Regards

Bala Krishna

3 REPLIES 3
Read only

former_member585060
Active Contributor
0 Likes
1,499

Hi,

    Seeing the error, it seems that it is trying to create a Document version based on 'C' not 'A'. That error which you are getting usually occurs when you try to create a new document version with a document which is not existing.

Just cross check all your values in REFDOCUMENTTYPE, REFDOCUMENTNUMBER, REFDOCUMENTPART, REFDOCUMENTVERSION  and NEWDOCUMENTVERSION values are correctly passed. Only pass the above values and try.

And also try directly executing the BAPI in SE37, if there it is working correctly, then the values you are passing in the program must have not passed correctly.

Thanks & Regards

Bala Krishna

Read only

0 Likes
1,498

HI,

I am executing the bapi_docuemnt_createnewvrs2 in se37 only with parameters

docuemnt type spe

document version as c (released)

document part 000

document number 3.1-2601-9027

I tried with different document number too. It is always giving me same error after executing that the docuemnt does not exist, and one more thing If I am entering the ANEER number and execute it, shows the message "change master 40 does not allow changes" and if I go back and delete the ANEER number and again execute it, it is giving me return message as 000.

Please guide.

Shilpa

Read only

0 Likes
1,498

Hi,

     Open Include 'LCV115U12' in SE38 or function module 'CV115_DOC_OPEN_DISPLAY' in SE37 and place a break-point at line number 116 (at statement Get Document Data which calls function module 'CV200_DB_DRAW_SELECT'). Now execute the BAPI 'BAPI_DOCUMENT_CREATENEWVRS2' from SE37. The logic will get stopped at the breakpoint on function module 'CV200_DB_DRAW_SELECT'. Execute in single steps, in this function module you can see the SELECT on DRAW table with the given reference values, check whether the entry is fetched from DRAW or not. I think in your case it must be getting failed here.

One more thing, if the BAPI successfully creates a document, the Documents values will not be updated into the table. In order to get the values updated you have do a data base Commit after the BAPI execution, it can be done by BAPI 'BAPI_TRANSACTION_COMMIT'.

So execute the above 2 BAPIs in sequence, this can be done in SE37 also.

Goto SE37, give the BAPI 'BAPI_DOCUMENT_CREATENEWVRS2'.

From Menu, select Function module>Test > Test Sequences. Now give first the BAPI name 'BAPI_DOCUMENT_CREATENEWVRS2' then followed by BAPI   'BAPI_TRANSACTION_COMMIT'.

Click on Execute.

Thanks & Regards

Bala Krishna