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_change2.

Former Member
0 Likes
6,106

Hi Experts,

I am trying to update Document file through bapi BAPI_DOCUMENT_CHANGE2,but it is not updating it is adding files to the concerned document. Can anyone tell me the exact parameter to pass so that it will update.

Thanks,

Vinod.

6 REPLIES 6
Read only

roberto_vacca2
Active Contributor
0 Likes
3,337

Hi.

Function should be called in this way:

call function 'BAPI_DOCUMENT_CHANGE2'

        exporting

             documenttype    = documenttype

             documentnumber  = documentnumber

             documentpart    = documentpart

             documentversion = documentversion

             documentdata    = dd  "Like bapi_doc_draw2 Can be empty

             documentdatax   = ddx "like bapi_doc_drawx2 Can be empty

        importing

             return          = return

        tables

             objectlinks     = objectlinks.


if return-type na 'EA'.

     commit work.

   else.

     rollback work.

   endif.


Hope to help.

Bye.

Read only

0 Likes
3,337

Hi Roberto,

Thanks for the quick response, even i have called in the same way but it is not updating the previous file it is go on adding the next file.

Thanks,

Vinod.

Read only

0 Likes
3,337

Hi.

please report how do you pass BAPI_DOC_DRAWX2 flags. It's important you've filled correctly this structure.

Hope to help.

Read only

0 Likes
3,337

Hi Roberto,

I have passed these all parameters.

Read only

0 Likes
3,337

Hi.

It seems correct.

You should before BAPI_DOCUMENT_GETDETAIL2 and then change with these data.

  It's important to read before change. That should be working as others bapi.

If you can't get out, try a BDC equivalent solution.

Hope to help.

Read only

Former Member
0 Likes
3,337

Hi Vinod ,

please go through this links ,

http://www.erpgenie.com/sap/abap/bapi/example.htm

Hope useful,

regards,

sudheer