Professional Documents
Culture Documents
| SAP Blogs
Community
A New Home in
New Year for SAP
Community:
Exciting times
ahead for the SAP
Community! Read about the migration and join SAP Community Groups!
S M Firoz Ashraf
October 13, 2012 | 6 minute read
Like
Requirement: Users want that using transaction CV01N, they should be able to
link the material document at header level and the same should be displayed in
RSS Feed transaction MIGO.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 1/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
(You may also refer to SAP Note 1417841 and Online SAP Help Documentation on
this part)
Step No. 1: Since we want the documents to be attached at header level. Hence
find if your system has the function module
OBJECT_CHECK_MKPF
Step No. 2: Now using SE80, go to Package CV. Under Screens of function
Group CV130,
create a subscreen (Copy screen 1204 to 9002 for example).
Replace EQUI-EQUNR with MKPF-MBLNR and MKPF-MJHAR. Copy
the same screen under CV140.
Kindly note that you have to take the access keys from SAP to create
the subscreens under CV130 and CV140.
Step No. 3: After you have created the screen 9002, ABAP development for the
first part on DMS side is done. Now you need to
do the configuration in SPRO.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 3/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Enter the the document type ZMG that you created above, enter MKPF under
Object. Screen 9002 will automatically get picked. Save your entries.
Now DIR can be created and attachments to material header document can be
done in transaction CV01N.
To verify this go to CV01N and enter or select ZMG from the drop down and press
enter.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 4/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Enter the description and document status in ‘Document Data’ tab and click on
‘Open Original’ icon at the bottom of the screen (marked 1 in the screen shot).
This will open up a pop-up window to select the file that you want to attach. Next
click on ‘Check In Orig.’ icon at the same bottom screen (marked 2).
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 5/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Now click on tab ‘Object Links’ Here you can see your screen 9002 with two fields
material Doc. and year. Enter and valid document, press enter and the doucment
header ‘Description’ will get populated.
Note that you have to append two fields (MBLNR and MJAHR) in standard
structure MCDOKOB for CV01N to retain the data entered in fields MBLNR and
MJAHR.
If you don’t maintain these fields in MCDOKOB then after entering the MBLNR
and MJAHR values in the above sscreen when you press enter, the values will
disappear.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 6/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
You need to use the BADI MB_MIGO_BADI to add a new header tab containing
your screen with a button to show the list of attachments.
Step No. 1: Using SE80, create a subscreen under a seperate Z program. For
example, screen 100 under ZMMM120.
Place a pushbutton on the screen and in the PAI, write a module (Say, MODULE
GET_ATTACHMENT.) to fetch the attachments.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 7/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
DATA: v_mblnr TYPE mblnr, v_gjahr TYPE gjahr, v_zeile TYPE mblpo,
Note that the Doc.No. (MBLNR) and Doc. Year (MJAHR) will be IMPORTed from
the point in BADI implementation where it has been EXPORTed to Memory ID
‘MIGODMS’.
Once we get the Doc.No. and Doc. Year we will simply use the FM
DOCUMENT_ASSIGNMENT using document object as MKPF and document key
as MBLNR & MJAHR concatenated togeather.
Step No. 2: After you have created your subscreen, go to SE19 and create an
implementation of BADI MB_MIGO_BADI.
METHOD if_ex_mb_migo_badi~pbo_header .
e_cprog = ‘ZMMM0120’.
e_dynnr = ‘0100’. “External fields: Input
e_heading = ‘DMS Attachment List’.
* Export data to function group (for display on subscreen)
CALL FUNCTION ‘MIGO_BADI_EXAMPLE_PUT_HEADER’
EXPORTING
is_migo_badi_header_fields = gs_exdata_header.
ENDMETHOD.
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 8/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Next, in the method LINE_MODIFY do the following coding to EXPORT the Doc.No.
and year to Memory ID.
METHOD if_ex_mb_migo_badi~line_modify.
EXPORT p1 = cs_goitem–mblnr
p2 = cs_goitem–mjahr
TO MEMORY ID ‘MIGODMS’.
ENDMETHOD.
This completes the whole process of creating the DIR and displaying the
attachment list on MIGO Header Screen.
To verify this go to transaction MIGO, enter any Doc. No. and press enter. You will
find a new tab in the header havign a push button. Clicking this button generates
a pop-up window showing all the attachments done through DIR (transaction
CV01N).
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 9/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
References:
Regards,
Firoz.
PS: Transaction CV04N might give Short Dump.To overcome this please do the
following:
Using SE80, go to Package CV. Under Screens of function Group CV100, create a
subscreen (Copy screen 1247 to 9002). Rename MCDOKOB-BANFN with
MCDOKOB-MBLNR and MCDOKOB-BNFPO with MCDOKOB-MJAHR.
Issue No. 1: The attachment push button is working only once. When the pop-up
window is closed (being in the MIGO screen) and when trying to click the
attachment button again, the pop-u[p window that shows the list of attachment
is not opening.
e_force_change = ‘X’.
Alert Moderator
Assigned Tags
MM Inventory Management
cv01n
dir
dms
migo
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 10/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
View more...
Related Questions
DMS-Document attachment in MIRO
By Former Member May 04, 2010
12 Comments
Atul Tulaskar
October 16, 2012 at 10:12 am
excellent Firoz...
we have requirement of object link to the PO header level. Could u please help us?
Like 0 | Share
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 11/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Hi Atul,
You simply need to do the first part as explained in my blog. Create your screen for PO header
under function group CV130. You may copy screen 148 (which is for PO Item) and remove the item
(EBELP). Just keep EBELN.
Once you have done the first part find out the enhancement at PO Header level and call up the
attachment list as explained in part B.
Regards,
Firoz.
Like 0 | Share
Atul Tulaskar
October 17, 2012 at 12:01 pm
Like 0 | Share
Former Member
May 27, 2013 at 11:41 am
Dear Firoz,
Nice Blog
when i do the same i got duplicate TAB for DMS attachment in MIGO(GRN) Transaction.
and with this , I have tried out for HR the object is PLOGI with screen no 500 but not getting success, with
same i am not able to get in to MIRO also
Regards
Tushar Dave
Like 0 | Share
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 12/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Hi Tushar,
Can u please share the screen shot where you are getting the duplicate tab in MIRO?
Regards,
Firoz.
Like 0 | Share
Former Member
September 10, 2013 at 5:59 am
Hi Firoz,
but i am sorry to say that i was facing that problem in May 27 2013 in one of my project
But now in my new project with development client i want to do same for HR object
(PLOGI) and MIGO(GRN) , and in Invoice generation (VF03)
Regards
Tushar Dave
Like 0 | Share
Bruno Esperança
March 3, 2014 at 9:49 am
BR,
Bruno
Like 1 | Share
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 13/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
Bharath Padmanabhan
May 16, 2017 at 2:22 am
Hi Firoz,
The level of detail captured in this blog is amazing. Your narration style to capture every single possible
issues along the way is extremely good!
Thanks a million for taking your valuable time to condense several weeks of your hardwork for us.
Cheers,
Aspire
Like 1 | Share
Mangesh Nirmale
October 5, 2017 at 11:00 am
Mangesh
Like 0 | Share
karteek k
October 9, 2017 at 3:16 pm
Perfect explanation!
Thank you,
Karteek
Like 0 | Share
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 14/15
10/30/23, 4:55 PM DMS – Linking Material Document in DIR and Displaying the attachments in MIGO. | SAP Blogs
S Abinath
June 23, 2020 at 4:21 pm
Hi,
Like 0 | Share
Fatima Mustafayeva
January 6, 2022 at 9:52 am
Also could you tell me please if it is possible to save an attachment file for hold migo document?
As per my knoledge, attachment file itself is saved only if the document is posted.
If it is not possible, could the DMS help out us for held migo document case?
Like 0 | Share
Find us on
Newsletter Support
https://blogs.sap.com/2012/10/13/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ 15/15