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: 

Attaching PDF file to sales order at header level!

Former Member
0 Kudos

Hi All,

I want to know if we can attach a pdf file to sales order at header level and the file when attached should not be stored in SAP database instead get stored on document vault (similar functionality as it does through DMS document creation and attaching pdf file) .

SAP has given a facility to first create a DMS document and attach PDF file at sales order item level in the DMS document.( This PDF file is not stored on SAP database ) Later this document can be linked in VA02 at sales order line item level. But user doesn't want to do that way. They want to attach PDF file directly in sales order and at header level instead of attaching at line item level.

I found the small icon "Services for Object" in VA02, clicking on "Create attachment" we can attach PDF file but this file content will be stored in SAP database. As the number of attachments increase storage on SAP database keeps increase so Basis do not want this way instead they are preferring the PDF file getting stored in document vault (similar way as in CV01N transaction creation ) .

Does anyone know any way to solve this issue??? Please let me know if there needs to be any configuration or ABAP code to be written.

Thanks in advance!

Sonali.

11 REPLIES 11

Former Member
0 Kudos

Sonali,

In the "Save" userexit of VA01/VA02, why not just FTP the PDF document to the target server (the vault)? In this way, SAP just passes the document thru to the target.

0 Kudos

Hi John,

Thanks for the response but ...

Since Users attach the required PDF in VA02 . I cannot hard code the PDF file name and location in "SAVE" user exit inorder to FTP to target.

If you know any other way just let me know.

Sonali.

0 Kudos

Call a pop-up window in SAVE UE and have the user locate the PDF for you.

0 Kudos

Upload the file into an internal table and FTP the internal tab to your target.

0 Kudos

Something like this:

Form GetFile.

data: strMask(60).

if Local_FileName is initial.

strMask = '.xls,.xls.'.

else.

move ',*.xls.' to strMask.

endif.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

DEF_FILENAME = Text1

DEF_PATH = 'c:\'

MASK = strMask "'.xls,.xls.'

MODE = 'O'

TITLE =

'Select the Excel spreadsheet which contains the trade spend actuals '

IMPORTING

FILENAME = Local_FileName

  • RC =

EXCEPTIONS

INV_WINSYS = 01

NO_BATCH = 02

SELECTION_CANCEL = 03

SELECTION_ERROR = 04.

if sy-subrc <> 0.

IF SY-SUBRC = 3.

exit.

else.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.

Text1 = Local_FileName.

EndForm.

0 Kudos

Then use WS_UPLOAD (or the OO class) and upload into int tab and send it off.

0 Kudos

Hi John,

User want to see the PDF file again in VA02/VA03 later so inorder to use your idea of user exit I need to design a screen with options to attach PDF or display PDF files if the user had already attached to the sales order. This programming is some what time consuming.

If there is any alternate quick solution please suggest me.

Thanks,

Sonali.

0 Kudos

Hi Sonali,

=== Sorry I didn't read your comments properly...you wrote you don't want this option.=====

One option is to use Generic Object Services. I did the same for similar requirement. Check these Weblogs:

/people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background

/people/rammanohar.tiwari/blog/2006/03/25/generic-object-services-gos--in-background--part-ii

Sridhar

Message was edited by:

Sridhar Kannepalli

Message was edited by:

Sridhar Kannepalli

0 Kudos

Sonali,

Not sure about your coding experience.

Actually, this is a pretty straightforward and simple request for an advanced/expert ABAPer.

Less than a day for sure... 2 hours, probably.

0 Kudos

Hi

The reason it is stored in the SAP Database and not in a defined Content repository, is due to a default KPRO table entry, which uses a default Content repository/category. Create a new Content Repository (or use the same one that the original files from DMS are using) and change the KPRO table entry to point to the your new Repository.

The only problem is that Ive forgotten what the table name is...

John

0 Kudos

Hi

Note 530792 tells you how to re-configure storage for Business Docs.

Standard DMS config only provides the object linkage to order line and not header, I believe you can add your own screen, with a little bit of ABAP help, if you want header object linkage.

John