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: 

Attachment to Sales order Item Text

Former Member
0 Kudos
144

Dear All,

I have two questions.

1. In a salesorder --> Item line text --> Say, Material Sales text, using the "Load Local File" icon , is it possible to add attachment? When we have a text file, and use this ICON, it copies the contents of the text file. But I have a excel and I want to add this as an attachment/copy the contents of the excel to the material sales text. Is this possible? When I try to do this, it copies some junk characters but not the actual contents.

2. In the Salesorder --> Item line text --> Material Sales text, I will have a default text. But if I try to change the contents of the text, I should throw a warning message. As this is a text field, CDHDR /CDPOS tables will not be populated for this. Any idea how I can achieve this?

Any pointers are highly appreciated. Thanks for your help.

Regards,

Suganya

3 REPLIES 3

Former Member
0 Kudos
59

Hi,

1) Load local file will work only for text files, because the text area is like an editor, so it interpretes only text files.

2) Try user exit MV45AFZZ, and under

    FORM USEREXIT_SAVE_DOCUMENT_PREPARE

Use FM READ_TEXT and validate if the text is the same default text that you have saved. If not issue an warning message.

This USER EXIT is called just before sales order is saved. So it will work for sure.

Regards,

Amit

0 Kudos
59

Hi,

Thanks for your reply.

Actually I am supposed to display an error message if the text in the Material Sales text is same as the default text. This part I coded in USEREXIT_SAVE_DOCUMENT_PREARE and it is working fine. But the problem is after encountering the error message, I change the text in the Material Sales text. So now the text is not same as the default text and I should not get the error message. But the new changed text is not available in the userexit. Only after saving the salesorder, I guess the new text will be available as I am using READ_TEXT. Any other alternative?

Also, regarding the first point, I misunderstood the requirement. The requirement is that they want to attach a document to the sales order like how we do it in VF02 transaction. Is this attachment icon be made available using some customization?

Thanks for your answer.

Regards,

Suganya

0 Kudos
59

Hi,

For your 1st question,

1) load local file can only load text files for a .txt file, you wont be able to import data from excel there.

2) after using FM READ_TEXT in the user exit, once the text is saved after changing the sales order try using FM SAVE_TEXT in the same userexit under FORM USEREXIT_MOVE_TO_VBAP. I am not sure if this works, but you may give it a try.

Also check this thread.

Sorry for late reply.

All the best.

Regards,

Amit

Edited by: Amit Iyer on Sep 12, 2009 2:35 PM