Xml file with Attachment-- File Adapter

HI, I have a zip file which has an XML and a corresponding pdf file, with these files I need to create a target xml structure which is the original XML+ Additional tag containing the <bas64> of the pdf. I intend to write a module which could parse the xml and also convert the pdf to base64 into one single xml, do you guys think this is achievable, any other suggestions would be of much help.
Thanks

> I intend to write a module which could parse the xml and also convert the pdf to base64 into one single xml, do you guys think this is achievable,...
Yes, this is the best way. In PI 7.1 you can also do this with a Java mapping.

Similar Messages

  • Issue with attachment file name

    Hi All,
    This is about an issue with attachment file name:
    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    Regards
    kiran

    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    - <SAP:Payload xlink:href="cid:payload-4CED452F17C601BDE10080000A492050---sap.com">
      <SAP:Name>1 .Header1.txt</SAP:Name>
    Error we are getting is
    Cannot cast 'Header' to boolean] in class com.sap.aii.mappingtool.flib7.NodeFunctions method createIf[Header, com.sap.aii.mappingtool.tf7.rt.Context---27a73bfa]
    So we have to change the File name Header1.txt to something which we can cast to creatif....(we cannot tell the sendr to change the file name as its is set already)
    Thanks for interste and assisting
    Regards
    Kiran

  • Send mail with attached file without using Repository

    Hello,
    I want to know if have a way to Send mail with attached file without using Repository.
    Regards
    Elad

    Elad,
    Check this article where a image has been picked by the file adapter and sent as an attachment to the mail adapter.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816">Sending an Image File Through XI in a File-to-Mail Scenario</a>
    For how to proceed without integration repository content look into this blog,
    <a href="/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository">How to send any data (even binary) through XI, without using the Integration Repository</a>
    Combining these 2 you have the solution.
    Regards
    Bhavesh

  • Send a mail with attached file .xls but i got file without

    i tried to send a mail with attached file .xls. but i am able to send the file , we recived the file without file name. please do the same
    thnaks in advance.
    END-OF-SELECTION.
    Populate message body text
    PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    Send file by email as .xls speadsheet
    PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
    TABLES IT_MESSAGE
    IT_ATTACH
    USING P_EMAIL
    'Example .xls documnet attachment'
    'XLS'
    'filename'
    CHANGING GD_ERROR
    GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
    PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    FORM DATA_RETRIEVAL.
    SELECT EBELN EBELP AEDAT MATNR
    UP TO 10 ROWS
    FROM EKPO
    INTO TABLE IT_EKPO.
    ENDFORM. " DATA_RETRIEVAL
    *& Form BUILD_XLS_DATA_TABLE
    Build data table for .xls document
    FORM BUILD_XLS_DATA_TABLE.
    CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
    CON_TAB TYPE X VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
    CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
    INTO IT_ATTACH SEPARATED BY ''.
    CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
    APPEND IT_ATTACH.
    LOOP AT IT_EKPO INTO WA_CHAREKPO.
    CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
    WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
    INTO IT_ATTACH SEPARATED BY ''.
    CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
    APPEND IT_ATTACH.
    ENDLOOP.
    ENDFORM. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
    DATA: LD_ERROR TYPE SY-SUBRC,
    LD_RECIEVER TYPE SY-SUBRC,
    LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
    LD_EMAIL LIKE SOMLRECI1-RECEIVER,
    LD_FORMAT TYPE SO_OBJ_TP ,
    LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
    LD_ATTFILENAME TYPE SO_OBJ_DES ,
    LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
    LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
    LD_RECEIVER LIKE SY-SUBRC.
    LD_EMAIL = P_EMAIL.
    LD_MTITLE = P_MTITLE.
    LD_FORMAT = P_FORMAT.
    LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
    LD_ATTFILENAME = P_FILENAME.
    LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
    LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
    W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
    W_DOC_DATA-OBJ_LANGU = SY-LANGU.
    W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
    W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
    W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
    CLEAR W_DOC_DATA.
    READ TABLE IT_ATTACH INDEX W_CNT.
    W_DOC_DATA-DOC_SIZE =
    ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
    W_DOC_DATA-OBJ_LANGU = SY-LANGU.
    W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
    W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
    W_DOC_DATA-SENSITIVTY = 'F'.
    CLEAR T_ATTACHMENT.
    REFRESH T_ATTACHMENT.
    T_ATTACHMENT[] = PIT_ATTACH[].
    Describe the body of the message
    CLEAR T_PACKING_LIST.
    REFRESH T_PACKING_LIST.
    T_PACKING_LIST-TRANSF_BIN = SPACE.
    T_PACKING_LIST-HEAD_START = 1.
    T_PACKING_LIST-HEAD_NUM = 0.
    T_PACKING_LIST-BODY_START = 1.
    DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
    T_PACKING_LIST-DOC_TYPE = 'RAW'.
    APPEND T_PACKING_LIST.
    Create attachment notification
    T_PACKING_LIST-TRANSF_BIN = 'X'.
    T_PACKING_LIST-HEAD_START = 1.
    T_PACKING_LIST-HEAD_NUM = 1.
    T_PACKING_LIST-BODY_START = 1.
    DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
    T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
    T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
    APPEND T_PACKING_LIST.
    Add the recipients email address
    CLEAR T_RECEIVERS.
    REFRESH T_RECEIVERS.
    T_RECEIVERS-RECEIVER = LD_EMAIL.
    T_RECEIVERS-REC_TYPE = 'U'.
    T_RECEIVERS-COM_TYPE = 'INT'.
    T_RECEIVERS-NOTIF_DEL = 'X'.
    T_RECEIVERS-NOTIF_NDEL = 'X'.
    APPEND T_RECEIVERS.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = W_DOC_DATA
    PUT_IN_OUTBOX = 'X'
    SENDER_ADDRESS = LD_SENDER_ADDRESS
    SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
    COMMIT_WORK = 'X'
    IMPORTING
    SENT_TO_ALL = W_SENT_ALL
    TABLES
    PACKING_LIST = T_PACKING_LIST
    CONTENTS_BIN = T_ATTACHMENT
    CONTENTS_TXT = IT_MESSAGE
    RECEIVERS = T_RECEIVERS
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    DOCUMENT_TYPE_NOT_EXIST = 3
    OPERATION_NO_AUTHORIZATION = 4
    PARAMETER_ERROR = 5
    X_ERROR = 6
    ENQUEUE_ERROR = 7
    OTHERS = 8.
    Populate zerror return code
    LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
    LOOP AT T_RECEIVERS.
    LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
    ENDLOOP.
    ENDFORM.
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    FORM INITIATE_MAIL_EXECUTE_PROGRAM.
    WAIT UP TO 2 SECONDS.
    SUBMIT RSCONN01 WITH MODE = 'INT'
    WITH OUTPUT = 'X'
    AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    Populate message body text
    FORM POPULATE_EMAIL_MESSAGE_BODY.
    REFRESH IT_MESSAGE.
    IT_MESSAGE = 'Please find attached a list test ekpo records'.
    APPEND IT_MESSAGE.
    ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY

    PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
      TABLES IT_MESSAGE
      IT_ATTACH
      USING P_EMAIL
      'Failed IDOC Analysis report'(020)
      'xls'(021)
      'IDOC_REP'(022)
      CHANGING GD_ERROR
      GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
    ENDFORM.                    " F_MAIL
    *& Form BUILD_XLS_DATA_TABLE
    Build data table for .xls document
    FORM BUILD_XLS_DATA_TABLE.
    *CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
    *CON_TAB TYPE X VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
      constants:
       con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE text-040 text-041 text-042 text-043 text-044 text-045 text-046 text-047 text-048 text-049
      INTO IT_ATTACH SEPARATED BY con_tab.
      CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
      APPEND IT_ATTACH.
      clear IT_ATTACH.
      loop at i_final_t into w_final.
        CONCATENATE
        w_final-mestyp w_final-docnum  w_final-statxt w_final-msgno w_final-rvplant w_final-kunnr w_final-vbeln w_final-credat
                w_final-cretim w_final-flag INTO IT_ATTACH SEPARATED BY con_tab.
        CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
        APPEND IT_ATTACH.
        clear IT_attach.
      endloop.
    ENDFORM. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
      DATA: LD_ERROR TYPE SY-SUBRC,
      LD_RECIEVER TYPE SY-SUBRC,
      LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
      LD_EMAIL LIKE SOMLRECI1-RECEIVER,
      LD_FORMAT TYPE SO_OBJ_TP ,
      LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
      LD_ATTFILENAME TYPE SO_OBJ_DES ,
      LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
      LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
      LD_RECEIVER LIKE SY-SUBRC.
      LD_EMAIL = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT = P_FORMAT.
      LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
      LD_ATTFILENAME = P_FILENAME.
      LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PIT_ATTACH[].
    Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
    Populate zerror return code
      LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    "SEND_FILE_AS_EMAIL_ATTACHMENT
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    FORM INITIATE_MAIL_EXECUTE_PROGRAM.
      WAIT UP TO 2 SECONDS.
      SUBMIT RSCONN01 WITH MODE = 'INT'
      WITH OUTPUT = 'X'
      AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    Populate message body text
    FORM POPULATE_EMAIL_MESSAGE_BODY.
      data: l1(99)    type c,
             l2(15)    type c,
             lt_message         type standard table of solisti1,
             ls_message      like line of lt_message.
      clear ls_message.
      l1 = 'Dear'(007).
      l2 =  'Sir/Madam'(008).
      concatenate l1 l2 ',' into
      ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
    *Assign Message text
      clear ls_message.
      concatenate text-011
                  text-012
                  into ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
    *Assign Message text
      clear ls_message.
      concatenate text-013
                  text-014
                  text-015
                  into ls_message-line separated by space.
      append ls_message to lt_message.
      concatenate text-016
                  text-017
                  into ls_message-line separated by space.
      append ls_message to lt_message.
    *insert Blank Line
      clear ls_message.
      ls_message-line = space.
      append ls_message to lt_message.
      ls_message-line = text-018.
      append ls_message to lt_message.
      ls_message-line = text-019.
      append ls_message to lt_message.
      clear: ls_message.
      REFRESH IT_MESSAGE.
      it_message[] = lt_message[].
      APPEND IT_MESSAGE.
    ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY

  • Convert Screen(spool) to PDF file sending mail with attach file

    Hi :
    I'd like convert spool list to pdf and sending file...
    so, I read thread about spool convert to PDF before,
    and know how to convert Spool to PDF file and send mail with attach file.
    but I have a problem.
    my solution as:
    step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
    step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
    then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
    I want to showing word is wider that 255.
    and then I find a manual method as:
    After program finished.
    Function Menu -> system -> List -> Send
    use Prog: "Create Document and Send"
    I use this prog sending mail and attached file ,
    PDF file do <b>NOT</b> have 255 word limit !
    finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
    which Function I have to use?...
    Please help me, Thanks!

    Hi,
    Check this sample code of sending spool as attachment to an email address..
    Parameters.
    PARAMETERS: p_email(50) LOWER CASE.
    PARAMETERS: p_spool LIKE tsp01-rqident.
    Data declarations.
    DATA: plist         LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: document_data LIKE sodocchgi1.
    DATA: so_ali        LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA: real_type     LIKE soodk-objtp.
    DATA: sp_lang       LIKE tst01-dlang.
    DATA: line_size     TYPE i VALUE 255.
    DATA: v_name        LIKE soextreci1-receiver.
    DATA rec_tab        LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    Get the spool data.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
         EXPORTING
              rqident              = p_spool
              first_line           = 1
              last_line            = 0
              desired_type         = '   '
         IMPORTING
              real_type            = real_type
              sp_lang              = sp_lang
         TABLES
              buffer               = so_ali
         EXCEPTIONS
              no_such_job          = 1
              job_contains_no_data = 2
              selection_empty      = 3
              no_permission        = 4
              can_not_access       = 5
              read_error           = 6
              type_no_match        = 7
              OTHERS               = 8.
    IF sy-subrc <> 0.
      MESSAGE s208(00) WITH 'Error'.
      LEAVE LIST-PROCESSING.
    ENDIF.
    Prepare the data.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 0.
    plist-body_num = 0.
    plist-doc_type = 'RAW'.
    plist-obj_descr = 'Test ALV'.
    APPEND plist.
    plist-transf_bin = 'X'.
    plist-head_start = 0.
    plist-head_num = 0.
    plist-body_start = 1.
    DESCRIBE TABLE so_ali LINES plist-body_num.
    plist-doc_type = real_type.
    Get the size.
    READ TABLE so_ali INDEX plist-body_num.
    plist-doc_size = ( plist-body_num - 1 ) * line_size
                     + STRLEN( so_ali ).
    APPEND plist.
    Move the receiver address.
    MOVE: p_email  TO rec_tab-receiver,
          'U'      TO rec_tab-rec_type.
    APPEND rec_tab.
    IF NOT sp_lang IS INITIAL.
      document_data-obj_langu = sp_lang.
    ELSE.
      document_data-obj_langu = sy-langu.
    ENDIF.
    v_name = sy-uname.
    Send the email.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = document_data
              sender_address             = v_name
              sender_address_type        = 'B'
         TABLES
              packing_list               = plist
              contents_bin               = so_ali
              receivers                  = rec_tab
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
    IF sy-subrc <> 0.
      MESSAGE e208(00) WITH 'Error'.
    ENDIF.
    COMMIT WORK.
    Send the email immediately.
    SUBMIT rsconn01
    WITH mode = 'INT'
    AND RETURN.
    Thanks,
    Naren

  • Can SAP send e-mail to external mail with attached file?

    Hi ABAP Guru.
    Can SAP send the E-Mail to external mail server? (e.g. Hotmail, Yahoo and so on.)
    And Can the E-Mail sent with attached file?
    And How to do that?
    Please give me your advice.
    Thank you and Best Regard,
    Nattapash C.

    Thank you very much! Amit Gujargoud.
    And I'm so sorry for my question that not clear for you and everyone.
    What I need to know is How to do with ABAP Code.
    I found the Function Module
    'SO_DOCUMENT_REPOSITORY_MANAGER' with method 'SEND' is being used for my case.
    but I don't know what field of structure RECIPIENTS (Table parameter of this Func. Module) that used for define recipient's E-Mail Address.
    Does anyone know the field or Have any method to solved my case?
    Please give me your advice.
    Thank you and Best regard.
    Nattapash C.

  • Regarding mail with attached file

    hi experts,
              i am doing on a report where mail with attached file should fire everyday at 9am. when i am doing it in background,mail is sent to everyone with attached file but when i schedule it in background,mail is firing but attached file is missing.how can i solve this problem?
    thanks.

    try to place ur file onn application server when u run BC.
    Thanks
    Kiran

  • Using subtitle SRT files with FLV files

    Pretty much the way the summary states. Needs to embed srt
    files with flv files in actionscript. Anyone know how?

    Ouw-wee! Photoshop 2 on System 6?
    Do you have the files transferred to newer media or are they still on the System 6 Mac?
    If they are still on the old Mac your options are limited, only diskettes worked on the old machines and SCSI hasn't been available on Macs in years..
    Since Photoshop didn't have layers until PS 3.0, even if you get them open, they are single layers only.
    Do you happen to know the file format they were saved as?
    Good Luck!

  • Need to generate multiple error files with rule file names during parallel data load

    Hi,
    Is there a way that MAXL could generate multiple error files during parallel data load?
    import database AsoSamp.Sample data
      connect as TBC identified by 'password'
      using multiple rules_file 'rule1' , 'rule2'
      to load_buffer_block starting with buffer_id 100
      on error write to "error.txt";
    I want to get error files as this -  rule1.err, rule2.err (Error files with rule file name included). Is this possible in MAXL? 
    I even faced a situation , If i hard code the error file name like above, its giving me error file names as error1.err and error2.err. Is there any solution for this?
    Thanks,
    DS

    Are you saying that if you specify the error file as "error.txt" Essbase actually produces multiple error files and appends a number?
    Tim. 
    Yes its appending the way i said.
    Out of interest, though - why do you want to do this?  The load rules must be set up to select different 'chunks' of input data; is it impossible to tell which rule an error record came from if they are all in the same file?
    I have like 6 - 7 rule files using which the data will be pulled from SQL and loaded into Essbase. I dont say its impossible to track the error record.
    Regardless, the only way I can think of to have total control of the error file name is to use the 'manual' parallel load approach.  Set up a script to call multiple instances of MaxL, each performing a single load to a different buffer.  Then commit them all together.  This gives you most of the parallel load benefit, albeit with more complex scripting.
    Even i had the same thought of calling multiple instances of a Maxl using a shell script.  Could you please elaborate on this process? What sort of complexity is involved in this approach.? Did anyone tried it before?
    Thanks,
    DS

  • How Merge Temp File With Photoshop File

    Hi Friends,
    I Deleted Temp File, And Now get A Error when open photoshop file " Could Not Complet ... is not a valid photoshop format " and my file size is 60mb
    and i have temp file that size is 2.50GB but How Merge Temp File With Photoshop File?
    Thank you So Much

    You can search for recovery programs  but most likely if it a temp file is not an image file.  You could also try renaming the file to have an image file type and try to open with Photoshop. Again its most likely not an image file. Photoshop only supports some image files formats.

  • We are trying to close caption our telecasts. We get the captioning files done out of house, pull them back into Premiere, and then embed them. The TV station requires .mxf files with the file embedded as a 708 stream, to play on their Grass Valley K2 vid

    We are trying to close caption our telecasts. We get the captioning files done out of house, pull them back into Premiere, and then embed them. The TV station requires .mxf files with the file embedded as a 708 stream, to play on their Grass Valley K2 video servers. We have tried multiple scenarios and cannot get the captions to display.
    Whenever I export, it becomes a 608 stream, and will not play on their servers.

    Hello there,
    I'm sorry to hear you are having a problem. Thank you for taking the time to post here.
    Here are some questions:
    1. What version of PPRO are you using? MAC or WIN?
    2. Is the caption data you are embedding a 708 caption stream?
    3. When you re-import the MXF with captioning embedded back into PPRO, does it show 708 closed captions in PPRO?
    PPRO will embed 708 caption streams to MXF -- I just did this, re-imported the embedded MXF to PPRO, and I see the captions in the MXF.
    If you could share one of your files with me, I could take a look.
    Take care and thanks again,
    CM

  • Pull a zip file with multiple files unzip it, and finally load one of the f

    Hi Aill,
    I have following query.
    Could we do the following with XI: pull a zip file with multiple files from a vendor which resides outside of XI server network, unzip it, and finally load one of the files to SAP?
    Regards
    Rohan S

    Hi Varadharajan,
    I have 10 text files in some ZIP file on one server which is out side of network. We can reach that file through Proxy only to read ZIP file.
    I need to extract the file and on the bases of some condition one of the file i need to upload data to SAP.
    Is it possible. If possible then How?
    Regards

  • How to create multiple files with Receiver File Adapter in SAP PI 7.31 Java Stack

    Dear Friends,
    I am using Sender JDBC Adapter and Receiver File Adapter in Integration Flow in SAP PI 7.3 EHP 1 SP08 Java Stack environment. The requirement is that we need to create multiple files based on the row count in jdbc resultset. If there are 5 rows in resultset, we need to create 5 XML files with one row elements in one file. Similarly if there are 10 rows, we need to create 10 XML files.
    So how can we create multiple files in this scenario. I tried placing a for loop in the Java Mapping as below in the transform method:
    DynamicConfiguration conf = arg0.getDynamicConfiguration();
    StringBuffer sbFileData = new StringBuffer();
    for (int i =0; i < record.size(); i++ {
         . // Create XML for each row and Marshal the object into to the String Buffer
         String strFileName = "DC_" + new SimpleDateFormat("ddMMyyyyHHmm").format(new java.util.Date())+"_"+i+".xml";
         conf.put(KEY_FILENAME, strFileName);
         arg1.getOutputPayload().getOutputStream().write(sbFileData.toString().getBytes("UTF-8"));
         arg1.getOutputPayload().getOutputStream().flush();
    So here I'm flushing the OutputStream for each record. But it's not creating the multiple file, instead it creates only one file will all record XMLs appended to each other.
    Please let me know if I missing something or need to do some thing else.
    Regards,
    Shreyansh Shah

    Hi
    You can easily achieve this using graphical mapping.  Create your target message type like below
    MT_Target
      Details  0 to 1
          Data  0 to 1
    Source sample structure
    <resultset>
    <row>
    <column-name>column-value</ column-name>
    </row>
    Then do the message mapping like below
    map <row> with  MT_Target
    contant ----> Deatils
    column-name ------>Data
    In the signature tab of message mapping, choose the occurrence of your target message type as
    0 to unbounded.
    This will generate multiple files from multiple rows.
    Let me know if you have any doubt.

  • System error when send file with Sender File Adapter

    Hi all,
    I have configured a "File To ABAP Proxy" scenario. After configuring, i executed a "Test Configuration" in Integration Directory and it's all OK. But this file unable to reach into ABAP Proxy Target. In the Runtime WorkBench\Message Monitoring,  I get an error message in below:
    Engine: Adapter Engine     
    Status: *System Error     *
    Start: 15.08.2008 14:04:01     
    End: 15.08.2008 14:19:01           
    Sender Service: BS_XI_SERVER     
    Interface Servic: urn://FILE_TO_PROXY
    MI_EMPLOYEE_OB
    In this case, I don't know why my Sender File Adapter is error and why status is "System Error" and why it can't reach into Target System. Can it concern a role user?
    ( For more clearly: I configured the source file and the path correctly. And i used the xml file with the content and the document name correctly. In general, the Sender Adapter File don't convert the sender file and its content is same as the Payload in the "Test Configuration", i think it is all OK.)
    Could anyone please help me to resolve this problem, anyone can explain this error, how can i resolve this error?
    Thanks a lot in advance,
    Vinh Vo

    Hi Chirag,
    1.I source structure is very simple as below:
    <ns0:MT_MATERIAL xmlns:ns0="urn://FILE_TO_PROXY">
       <MATERIAL>
          <WERKS>1000</WERKS>
          <MATNR>MAT00001</MATNR>
          <MAKTX>Chemical Material</MAKTX>
       </MATERIAL>
    </ns0:MT_MATERIAL>
    2. the Communication Channel Monitoring in Runtim WorkBench\Adapter Engine is OK for my Sender File Communication Channel, it's in Blue Light.
    However, i don't know what's FCC?
    Thanks and best regards,
    Vinh Vo

  • Problem with attaching file to Sales Order

    Hello,
    In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
    These files are added by the GUI user, this works fine.
    Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
    I found a helpful link ( /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background )
    This program creates URL links with no problem, but the file generation is not implemented yet.
    I tried to add the file functions to his sample report but still have one problem. The file is uploaded, but not reported as a PDF file in sap. If I select the created attachment SAP allows only the saving of the attachment. After saving the created file is a good PDF file, it opens with PDF-viewers.
    Why does SAP not know this is a PDF file and report it as such (and open the pdf viewer when selected).
    Thanks, Frank.
    source-code:
    REPORT  zzfb_brc                                .
    * Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
    * Written By : Ram Manohar Tiwari
    * Function   : We need to maintain links between Business Object and
    *              the attachment.Attachment document is basiclally a
    *              business object of type 'MESSAGE'.In order to maintain
    *              links, first the attachment will be crated as Business
    *              Object of type 'MESSAGE' using Message.Create method.
    *              Need to check if we can also use FM
    *              'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
    *              than using Message.Create method.
    * I took this program and removed all the parts for adding URL's and
    * notes.
    * Include for BO macros
    INCLUDE : <cntn01>.
    * Load class.
    CLASS cl_binary_relation DEFINITION LOAD.
    CLASS cl_obl_object      DEFINITION LOAD.
    PARAMETERS:
    *  Object_a
       p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032',    "SO
       p_bo_id  LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
    *  Object_b
       p_docty  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
       p_msgtyp LIKE sofm-doctp        DEFAULT 'EXT'     NO-DISPLAY,
    *  Relationship
       p_reltyp  LIKE mdoblrel-reltype DEFAULT 'ATTA'.
    TYPES: BEGIN OF ty_message_key,
            foltp     TYPE so_fol_tp,
            folyr     TYPE so_fol_yr,
            folno     TYPE so_fol_no,
            doctp     TYPE so_doc_tp,
            docyr     TYPE so_doc_yr,
            docno     TYPE so_doc_no,
            fortp     TYPE so_for_tp,
            foryr     TYPE so_for_yr,
            forno     TYPE so_for_no,
           END OF ty_message_key.
    DATA : lv_message_key TYPE ty_message_key.
    DATA : lo_message TYPE swc_object.
    DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
           ls_doc_content TYPE soli-line.
    * Create an initial instance of BO 'MESSAGE' - to call the
    * instance-independent method 'Create'.
    swc_create_object lo_message 'MESSAGE' lv_message_key.
    * Upload the pdf file, for now from the frontend, in the future from
    * the server.
    DATA:
    *  dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
    l_lines TYPE i. "filelenght
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename   = 'c:t1.pdf'
        filetype   = 'BIN'
      IMPORTING
        filelength = l_lines
      TABLES
        data_tab   = lt_doc_content.
    * no exceptions, the file is there in this example
    break brouwersf.
    ** the coding for the server input, for later
    *OPEN DATASET dsn FOR INPUT IN BINARY MODE.
    *IF sy-subrc <> 0.
    *  EXIT.
    *ENDIF.
    *READ DATASET dsn INTO ls_doc_content.
    *WHILE sy-subrc EQ 0.
    *  APPEND ls_doc_content TO lt_doc_content.
    *  READ DATASET dsn INTO ls_doc_content.
    *ENDWHILE.
    *CLEAR ls_doc_content.
    *CLOSE DATASET dsn.
    * define container to pass the parameter values to the method call
    * in next step.
    swc_container lt_message_container.
    * Populate container with parameters for method
    swc_set_element lt_message_container 'DOCUMENTTITLE' 'Title'.
    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    swc_set_element lt_message_container 'NO_DIALOG'     'X'.
    swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    swc_set_element lt_message_container 'DocumentSize'    l_lines.
    swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
    swc_call_method lo_message 'CREATE' lt_message_container.
    * Refresh to get the reference of create 'MESSAGE' object for attachment
    swc_refresh_object lo_message.
    * Get Key of new object
    swc_get_object_key lo_message lv_message_key.
    * Now we have attachment as a business object instance. We can now
    * attach it to our main business object instance.
    * Create main BO object_a
    DATA: lo_is_object_a TYPE sibflporb.
    lo_is_object_a-instid = p_bo_id.
    lo_is_object_a-typeid = p_botype.
    lo_is_object_a-catid  = 'BO'.
    * Create attachment BO object_b
    DATA: lo_is_object_b TYPE sibflporb.
    lo_is_object_b-instid = lv_message_key.
    lo_is_object_b-typeid = p_docty.
    lo_is_object_b-catid  = 'BO'.
    *TRY.
    CALL METHOD cl_binary_relation=>create_link
      EXPORTING
        is_object_a = lo_is_object_a
        is_object_b = lo_is_object_b
        ip_reltype  = p_reltyp.
    * Check if everything OK...who cares!!
    COMMIT WORK.

    Hi,
    Welcome to the SDN Forums!!!
    You need to supply the PC file extension in the container element 'DOCUMENTTYPE'.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    In your case change the above statement as below:
    swc_set_element lt_message_container 'DOCUMENTTYPE' 'pdf'.
    <b>OR</b> change the default value of p_msgtyp to 'PDF'.
    Cheers,
    Ramki Maley.
    Please reward points if the answer is helpful.
    For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    Message was edited by: Ramki Maley

Maybe you are looking for