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

Former Member
0 Kudos

Hi,

I am tring to attach files to a custom program which is to create notifications i have to attach text files to a particular notification number .

Regards,

Himanshu

7 REPLIES 7

Former Member
0 Kudos

Hi Himanshu,

Can u elaborate your requirement.

0 Kudos

Hi,

We have a program from which we create notifications now we also want to be able to make attachments like notepad documents to particular notification numbers that are created from that program. I other words I want to link the file to the notification number carry it to the sap server from windows server so that when again i open that notification number i get the attachement and can read it.

Regards,

Himanshu

0 Kudos

use the bapis for creating documents in SAP Document Management system.

for attaching the files to the notification. Otherwise, in the notification screen you can also call transaction CV01N for attaching the document and transaction CV03N for displaying the document attachment.

0 Kudos

Hi,

I have created an attachemnt like this could some one help me in reading it.

WHEN 'ATTACH'.

data lo_container TYPE REF TO cl_gui_container .

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'P_PATH '

IMPORTING

FILE_NAME = P_PATH

.

ws_borident-OBJKEY = ZMM07-QMNUM.

ws_borident-OBJTYPE = 'NOTI'.

CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'

EXPORTING

  • OWNER = ' '

REGION = 'B'

IMPORTING

FOLDER_ID = folder_id

EXCEPTIONS

COMMUNICATION_FAILURE = 1

OWNER_NOT_EXIST = 2

SYSTEM_FAILURE = 3

X_ERROR = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

w_document-foltp = folder_id-objtp .

w_document-folyr = folder_id-objyr .

w_document-folno = folder_id-objno .

  • append document to documents.

w_document-objdes = p_name .

w_document-objnam = p_name .

data w_h_data like sooD2 ..

data w_fol_data like sofm2.

data w_rec_data like soos6 .

w_h_data-objdes = p_name .

CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'

EXPORTING

METHOD = 'IMPORTFROMPC'

  • OFFICE_USER =

REF_DOCUMENT = W_DOCUMENT

  • NEW_PARENT =

  • IMPORTING

  • AUTHORITY =

  • TABLES

  • OBJCONT =

  • OBJHEAD =

  • OBJPARA =

  • OBJPARB =

  • RECIPIENTS =

ATTACHMENTS = W_ATTACHEMENT

  • REFERENCES =

  • FILES =

CHANGING

DOCUMENT = W_DOCUMENT

HEADER_DATA = W_H_DATA

FOLMEM_DATA = W_FOL_DATA

RECEIVE_DATA = W_REC_DATA

.

if w_document-okcode = 'CREA' or w_document-okcode = 'CHNG'.

w_attachement-objtype = 'MESSAGE'.

w_attachement-objkey = w_document(34).

CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'

EXPORTING

OBJ_ROLEA = WS_BORIDENT

OBJ_ROLEB = W_ATTACHEMENT

RELATIONTYPE = 'ATTA'

  • IMPORTING

  • BINREL =

  • TABLES

  • BINREL_ATTRIB =

  • EXCEPTIONS

  • NO_MODEL = 1

  • INTERNAL_ERROR = 2

  • UNKNOWN = 3

  • OTHERS = 4

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ENDIF.

Regards,

Himanshu

Former Member
0 Kudos

done

0 Kudos

Hi Himanshu,

can you please let me know how you did this? I want to attach a file from application server to a notification.

Thank you.

-Kishore

0 Kudos

Hi Himanshu,

can you please let me know how you did this? I want to attach a file from application server to a notification.

Thank you.

-Kishore