cancel
Showing results for 
Search instead for 
Did you mean: 

Create GOS attachment of BUS2012 in workflow

Former Member
0 Kudos

Hi all,

I've developped an workflow for approval of purchase order. When the approver has rejected the purchase order I create a document from template to describe the the reason for rejection. Now I want to attach in the workflow this document with rejection reason to the GOS of the purchase order (BUS2012). I've an container operation to assign the document to the adhoc_attach / adhoc_object, but this is only for the workflow instance. I want that if somebody else outside the workflow displays the purchase order can see the document with rejection reason by using the GOS attachmentlist. How can I assign the document with rejection reason to the GOS of BUS2012 in the workflow?

Regards Patricia

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Please use the following FM

CALL FUNCTION 'SO_OBJECT_INSERT'

EXPORTING

folder_id = ls_fol_id "system folder ID

object_type = 'EXT' "external

object_hd_change = ls_obj_data "file name and extension

IMPORTING

object_id = ls_obj_id "system ID for the file

TABLES

objhead = it_objhead

objcont = it_content

EXCEPTIONS

active_user_not_exist = 35

folder_not_exist = 6

object_type_not_exist = 17

owner_not_exist = 22

parameter_error = 23

OTHERS = 1000.

*finally link file (object) to master data

CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'

EXPORTING

obj_rolea = ls_object

obj_roleb = ls_note

relationtype = 'ATTA'

EXCEPTIONS

OTHERS = 1.

ENDIF.

Thanks

Arghadip

Former Member
0 Kudos

Hi Arghadip,

thanks for your answer, but I've the following problem:

my document with rejection reasion is not saved local on a device. I create inside the workflow the docment using the task "create document from template", I've a generated document name inside the workflow in a container field.

How can I attach it to BUS2012 so that the users outside the workflowcan see the document with GOS -> attachmentlist when the document is only stored in the workflow container?

Any ideas?

Regards Patricia

Former Member
0 Kudos

Hi all,

My problem is still unsolved.

I create within the workflow by task "document from template" a document for rejection reason. This document should be linked inside the workflow to BUS2012 GOS so that everyone outside the workflow can see the rejection reason by using the transaction for display purchase order -> object services -> attachmentlist. The document isn't stored locally, but is linked to Adhoc attachement inside the workflow.

Regards Patricia

Former Member
0 Kudos

Hi,

So, you just need to find out a way to save an attachment programmatically? Have you debugged what happens when you save the attachment directly in the GOS attachment menu? Probably you could find the function that SAP uses for storing the attachment. If I remember correctly, this wasn't that difficult to do. Maybe there is other functions in the same function group of the function that Arghadip mentioned that will do the job (=function takes the attachment as XSTRING or whatever instead of the file name)?

Regards,

Karri

keohanster
Active Contributor
0 Kudos

Hi Patricia,

I have used the function SWL_WI_NOTE_CREATE in the past - inside of a workflow method.

That means whenever your users pull up the workflows associated with an object thru the GOS menu, the attachment will display in the lower right hand pane (under the object link).

Regards,

Sue

Former Member
0 Kudos

Hi Sue,

thanks foryou answer, but 've still the attachm nide te workflow in te right lower window. What I need is the linkage to the GOS of BUS2012, that users outside theworkflow can see why the PO was rejected when they display the PO and the go to General Object Servces -> Attachmentlist.

I get also an answer from Arghadip, but it also doesn't give me the solution because my document with rejection reasion is not saved local on a device.

I create inside the workflow the docment using the task "create document from template", I've a generated document name inside the workflow in a container field.

Any ideas?

Regards Patricia