Skip to Content
0
Mar 24, 2014 at 07:22 AM

Attaching PDF document to workflow container using SWC* macros

510 Views

Hello,

I need to attach the quality notification printout (PDF) along with other other details through action box. For this QM06_FM_TASK_SEND_PAPER_ATTACH configured. This function module a pdf as per the configuration with below code.

SWC_CLEAR_CONTAINER CONTAINDER1.

SWC_SET_ELEMENT CONTAINER1 'DOCUMENTTITLE' CONTENT_HEADER1.

SWC_SET_ELEMENT CONTAINER1 'DOCUMENTNAME' TEXT-201.

SWC_SET_ELEMENT CONTAINER1 'DOCUMENTTYPE' 'SCR'.

SWC_SET_TABLE CONTAINER1 'DOCUMENTCONTENT' CONTENT1.

SWC_SET_ELEMENT CONTAINER1 'NO_DIALOG' 'X'.

Now for the same email I need to attach notification printout in the form of PDF. For this I put enhacement point starting of this FM and got OTF data from print program. This OTF data I have tried to attach to email as below.

SWC_CLEAR_CONTAINER CONTAINER1.

SWC_SET_ELEMENT CONTAINER1 'ATTACHMENT' 'MESSAGE1'.

SWC_SET_ELEMENT CONTAINER1 'ATTACHMENTTITLE' 'PRINT'.

SWC_SET_ELEMENT CONTAINER1 'ATTACHEMENTTYPE' 'PDF'.

SWC_SET_ELEMENT CONTAINER1 'DOCUMENTSIZE' G_FILESIZE.

SWC_SET_TABLE CONTAINER1 'CONTENT_HEX' BINDATA[].

SWC_SET_TABLE CONTAINER1 'DOCUMENTCONTENT' CONTENT2.

SWC_CALL_METHOD MESSAGE1 'ATTACH' CONTAINER1.

I tried by converting OTF to binary () or PDF . I could able to attach but that PDF is corrupted. Please suggest me. I have attached enhacement code.