on 2015 Aug 16 2:32 PM
Dear all,
I'm using Program exit to attach adobe forms PDF file to Mail step in workflow. I can see the file generated, but can't able to open it. Seems like somewhere I'm missing the extension ".PDF". But not sure where exactly. Can some one guide me please?
if lv_qmnum is not initial.
"Get Adobe Form
me->get_pdf_xstring(
exporting
iv_event = im_event_name " Field length 18
iv_qmnum = lv_qmnum " Notification No
importing
ev_pdf_solix = it_solix_tab " GBT: SOLIX as Table Type
).
* Identify the folder id
call function 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = 'B'
IMPORTING
folder_id = lv_folder_id_1.
* convert the field format acceptable by function module SO_DOCUMENT_INSERT_API1
lv_folder_id_2 = lv_folder_id_1.
* Prepare object header
lv_soxobjcont-objtype = 'ZBUS2038'.
lv_soxobjcont-objkey = lv_qmnum.
append lv_soxobjcont to lv_object_header.
*Prepare document data- contain description and sensitivity
lv_document_data-OBJ_NAME = 'INITIAL'.
lv_document_data-SENSITIVTY = 'P'.
Concatenate 'Notification:' lv_qmnum into lv_document_data-obj_descr separated by space.
CALL FUNCTION 'SO_DOCUMENT_INSERT_API1'
EXPORTING
FOLDER_ID = lv_folder_id_2
DOCUMENT_DATA = lv_document_data
DOCUMENT_TYPE = 'PDF'
IMPORTING
DOCUMENT_INFO = lv_doc_info
TABLES
OBJECT_HEADER = lv_object_header
contents_hex = it_solix_tab
EXCEPTIONS
FOLDER_NOT_EXIST = 1
DOCUMENT_TYPE_NOT_EXIST = 2
OPERATION_NO_AUTHORIZATION = 3
PARAMETER_ERROR = 4
X_ERROR = 5
ENQUEUE_ERROR = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Populate object type and object key for create an instance
lv_objtype = 'SOFM'.
lv_objkey = lv_doc_info-doc_id.
* Create an instance
CALL FUNCTION 'SWO_CREATE'
EXPORTING
OBJTYPE = lv_objtype
OBJKEY = lv_objkey
IMPORTING
OBJECT = lv_sofm
RETURN = lv_SWOTRETURN
EXCEPTIONS
NO_REMOTE_OBJECTS = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Prepare for attaching the object to container
lv_OBJ_RECORD-HEADER = 'OBJH'.
lv_OBJ_RECORD-TYPE = 'SWO '.
lv_OBJ_RECORD-HANDLE = lv_sofm.
call method lv_taks_container->set
EXPORTING
Name = '_ATTACH_OBJECTS'
Value = lv_obj_record.
*Commit the changes
CALL METHOD im_workitem_context->do_commit_work.
endif.
Attachment
Error
Just an update, I got the SOFM Object ID and executed it in SOFM BOR and got the below result.
If I execute the method just like that, I can able to see my PDF file.
If I have ENJOY parameter as 'X' and execute it, then I'm getting the below error. This is the same error which I get when I try to see it from SBWP. Why it's happening like this?
Thank you,
Justin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Modak,
Thank you so much. I could able to open up the files from SBWP, the extension is not coming up, but I'll get on to that later. But the process itself is failing while sending the attachment from mail step. Appreciate your time. Can you point me out, what mistake I'm doing here?
Error:
Thank you,
Justin
Try an open a new thread for this issue as it is the second one for this thread. First one is resolved; you can close this thread. Also provide full details and screen shot over there. Try to test with uploading a new attachment via the SBWP work item and remove the PDF attachment part for the test. See what happens.
Regards,
Modak
Hello Modak,
Thank you so much for all your help! I could able to get it work. I'll update the tickets with what I have done.
Thank you,
Justin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.