cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter to attach binary file

Former Member
0 Kudos

Hi

Following is the code . i called the ADOBE form in my Z program . and then call the FM to convert it to binary. now i wanted to pass that binary file to FM

Call Function SO_NEW_DOCUMENT_ATT_SEND_API1

kindly tell me that to which parameter of above FM i pass this binary file

Code is as below

i_fpname = 'ZHR_AF_TRV_REQUEST_FORM'.
i_plan-REINR = 139.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name                     =  i_fpname

 IMPORTING
   e_funcname                 =   fm_name

          .

CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams       = fp_outputparams
 EXCEPTIONS
   CANCEL                = 1
   USAGE_ERROR           = 2
   SYSTEM_ERROR          = 3
   INTERNAL_ERROR        = 4
   OTHERS                = 5
          .


CALL FUNCTION fm_name
 EXPORTING
   /1BCDWB/DOCPARAMS          = fp_docparams
    plan                       =  i_plan
 IMPORTING
   /1BCDWB/FORMOUTPUT          = fp_formoutput
          .

CALL FUNCTION 'FP_JOB_CLOSE'
 EXCEPTIONS
   USAGE_ERROR          = 1
   SYSTEM_ERROR         = 2
   INTERNAL_ERROR       = 3
   OTHERS               = 4
          .

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
  EXPORTING
    buffer                = fp_formoutput-pdf
*   APPEND_TO_TABLE       = ' '
 IMPORTING
   OUTPUT_LENGTH         =  ZVAR1
  tables
    binary_tab            = IT_SOLIX_TAB
          .

Call Function SO_NEW_DOCUMENT_ATT_SEND_API1

Edited by: Mike Pokraka on Jan 17, 2011 10:40 AM - fixed code formatting

Accepted Solutions (0)

Answers (1)

Answers (1)

marcos_suarezhulet
Participant
0 Kudos

Format and pass it to CONTENTS_BIN.



DATA: wa_solix_tab TYPE LINE OF it_solix_tab,
         it_contents_bin TYPE TABLE OF solisti1,
        wa_contents_bin TYPE solisti1.

LOOP AT it_solix_tab INTO wa_solix_tab.
  MOVE wa_solix_tab TO wa_contents_bin-line.
  APPEND wa_contents_bin TO it_contents_bin.
ENDLOOP.

Former Member
0 Kudos

Hi

I succeeded in generating mail from above code and i have added the xstring code to that as well . when i see the container in log it have that xstring data but unable to see an attachment

Regards

Ammad