Application Development 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: 

FM for linking a document to a material

Former Member
0 Kudos

Hello all,

Please tell me what function or method to use to assign a document to a material. A inconvient solution for me is using BDC data in trans. MM02.

Your helpful answer will be rewarded.

Thank you!

Bogdan

4 REPLIES 4

Vinod_Chandran
Active Contributor
0 Kudos

Hi Bogdan,

Can you be more specific? What you mean by document?

Cheers

Vinod

0 Kudos

Hi Vinod,

By document i meant linked document. You can look on transction MM03 or MM02->Additional Data->Document Data.

Thank you

Bogdan

0 Kudos

Hi Bogdan,

You can use BAPI_DOCUMENT_SAVEOBJECTLINKS.

You will have to fill the table BAPI_DOC_DRAD.

Object Type will be "MARA" , Object key will be material number . See table DRAD for refernce .

With this BAPI you can link one document to many materials in one call . If you have more that one Document you will have to call again,

Cheers.

0 Kudos

Hi Sinha,

Your solution seems to be the right one, but is not working. Do you have an ideea why? here are the some test value:

DOCUMENTTYPE Z01

DOCUMENTNUMBER E0100

DOCUMENTPART 000

DOCUMENTVERSION 00

OBJECTLINKS ( 1 record 😞

D OBJECTTYPE OBJECTKEY

MARA 000000000950700189

the others fields are empty.

Thank you a lot!

Bogdan