Skip to Content
0

send a PDF as attachment in Decision Step

Jul 15, 2017 at 03:25 PM

122

avatar image

Dears ,

i was trying to send a pdf file with workitem and i found this post :

Creating attachment to workitem or user decisions

Former Member

i made all steps but there is a problem when i try to execute the workitem of the user decision step

Unable to instantiate object '_ATTACH_OBJECTS'

program :

method :
method.png

binding :

workitem in inbox ;

program.png (141.1 kB)
method.png (48.0 kB)
binding-task.png (45.6 kB)
workitem.png (8.6 kB)
error.png (4.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mike Pokraka Jul 15, 2017 at 05:32 PM
1

Couple of things:

Firstly, please use the standard Workflow mechanisms or API (SAP_WAPI* functions). Starting the WF directly like this is usually a bad idea unless you have a very specific reason.

Secondly, you are attaching it twice. Once in a step as binding, and inside the method using the SAP_WAPI_CREATE_ATTACHMENT. Choose one method and work on that. If the attachment comes from a WF step then it's best to use binding. If it's from external then use the API or events. But, just glancing through your code, I don't see you generating a SOFM object anywhere, so this will result in the error you are seeing.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

someone changed the standard task of decision step by adding BUS2030 in its container so i tried the same solution in another server and it is work perfectly .

thanks for your help , but i want to know how i am attaching it twice ?? i just attached it in the method by fm SAP_WAPI_ATTACHMENT_ADD only and using binding to transfer the values !

0

1. Inside the method you're calling the API to attach it 'from the outside'. This is a bit roundabout, but produces the link that presumably works.

2. In your binding you're sending a SOFM object back to WF. But instead of an instance you're just putting an ID where the object reference should be. SWC_SET_ELEMENT ... 'SOFM'... <-- here you should fill in an object reference, not an ID.

0
Aditya Varrier Jul 24, 2017 at 10:19 AM
0

Hi Ismail,

binding thing is one way, I created a program exit to do this and attached that program exit in the user decision step.

On creation of workitem of UserDecision Step, program exit will use the FM's to send mail and the attachment.

Hope it helps.

Aditya V

Share
10 |10000 characters needed characters left characters exceeded