Skip to Content
avatar image
Former Member

Attachment

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 17, 2007 at 05:49 AM

    Hi Himanshu,

    Can u elaborate your requirement.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    Aug 20, 2007 at 11:04 AM

    done

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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