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

'BAPI_DOCUMENT_CREATE2

Former Member
0 Likes
1,410

Hello Friends,

I am using this BAPI to create the document. this bapi is used with in side a loop, so I am trying to create more then one document .....surprisingly things work and it creates me the document, but when comes second time, then document is not created, and give me error msg.. that the characterisctis Copyright Client has to be filled in status created ?

Any idea what I am doing wrong..

Regards,

14 REPLIES 14
Read only

Former Member
0 Likes
1,338

Hello,

Maybe its connected with commit which does not comes after the first execution. Try adding also BAPI_DOCUMENT_SETCOMMITMODE to your code.

Regards

Marek

Read only

0 Likes
1,338

Hello Marek,

Thanks for your reply,

Actually what is woundring to me is that it works first time, and then I have different other bussiness logic to implement, and then by second time, it give me that error msg....

Dont know what is going on ?

Any way, where I have to add this BAPI ?

Regards,

Message was edited by:

Shah H

Read only

0 Likes
1,338

Unfortunatelly, I did not find that BAPI "BAPI_DOCUMENT_SETCOMMITMODE" in system.....

Message was edited by:

Shah H

Read only

0 Likes
1,338

Does any one has any idea, what I am doing wronge ?

Regards,

Read only

0 Likes
1,338

What is the error number and id?

Rob

Read only

0 Likes
1,338

hi ROB,

I am not sitting in front of SYSTEM, but i guess it was 11 or so...

Any idea, what I am doing wrong...

Regards,

Read only

0 Likes
1,338

Let us now the error message when you get back to the system.

Not the number of errors - the error number.

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
1,338

The error msg is " the value of characteristic copyright client can only be fillied with status created" somthing like that----

Regards,

Yes i guess the error no is 11

Message was edited by:

Shah H

Read only

0 Likes
1,338

Hi Rob,

Any idea, what could be possibly wrong, because first time things works fine, it create the document, + all characteristics, and 2nd time I just change few characteristcs ( however the objlink and classification remains same ) it give me that error...

Any idea, what I am doing wrong...

Kind regards

Read only

0 Likes
1,338

Hello Rob,

Here is the error msg, and error no:

MSG ID = ZCV

MSG NR= 011

MSG = Das Merkmal "Copyright Client" muss im Status "Created" gefüllt sein.

means ( the characteristi copyright client has to be fillied in status created )...

Any idea why I am getting this msg....

Regards,

Read only

0 Likes
1,338

ZCF looks like a custom message class (at least I don't see it in our system), but the language is German.Is there a long text with this message?

Rob

Read only

0 Likes
1,338

Hi Rob,

Thanks for your reply....

Actually problem solved, ....... it was a tough one....

kind regards,

Shah .

Read only

0 Likes
1,338

Weel, what was the problem?

Rob

Read only

0 Likes
1,338

Actually in BAPI_DOCUMENT_CREATE2, there are futher various FM are called, and one of them was CTMS_CHAR_FIRST_ASSIGNED_VALUE and in this FM it check a flag if it set or not ( WI-WSELE ) and if WSELE is initial, it throws exception.

before my loop start ( for creating documents ) I am calling BAPI_DOCUMENT_GET_DETAIL... and this bapi set this flag, and that's why first time it creates the document, but the second time the flag wsele was initial and throws me exception. So now I am calling document_getdetail inside loop... and things looks pretty fine....

But what I do not understand is, if I dont want to read the document at all, cant I create the new document......... dont know the real logic behind, but any how its working.....

Regards,