cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment to Service Notification - Create (IW51) from OData Service

Former Member
0 Kudos

I have created an OData service to create service notification in SAP system.

In the SAP t-code for create service notification (IW51), there is an option to attach files using generic object services.

I would like to know whether I can add this attachment functionality into the Odata service and consume this service from front-end.

(I have already created an OData service to attach files to a custom table. It works fine.)

Now, I want to attach this to the service notification.

Accepted Solutions (0)

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Tech,

Referring this will help you accomplishing your scenario.

You are good to go if you know which part of the logic is to be called inside Create_Stream method to save your attachment in back-end in an appropriate format.

Regards,

Ashwin

Former Member
0 Kudos

Thanks Ashwin for the response.

I am fine uploading and downloading the file via OData service.

My problem is to add this uploaded file as an attachment while creating the service notification in SAP (IW51). The current OData service is doing the create part, and I want to know the attachment part.

How to add a file as attachment in IW51 transaction via OData service.

Former Member
0 Kudos

Hello Tech,

Do you have SAP DMS or Content server in your Landscape ?

thanks

Sri

AshwinDutt
Active Contributor
0 Kudos

Hello Tech,

Sorry i can try helping in modelling your service to handle media content but do not know which part of logic of IW51 t-code has to be called inside Create_Stream method

Regards,

Ashwin

Former Member
0 Kudos

Hi Gajula.. I am told it's there in the SAP landscape

Former Member
0 Kudos

Thanks Ashwin.

Former Member
0 Kudos

Hello Tech,

can you let us know if you have SAP DMS in your landscape or content server ,based on your inputs i can provide you the flow and what BAPI's to be used

i understand that your requirement is when you  upload an image against a service notification you should be able to see the document number or any reference  in the transaction also ?

Thanks

Sri

Former Member
0 Kudos

Thanks Sri. We have SAP DMS.

I want to upload a file without using the generic object services in the toolbar of IW51 tcode.

Instead I want to upload a file during notification creation from outside SAP via OData service. Is there any BAPI for that?

Can you please explain the steps to be followed and the BAPI's to be used.

Former Member
0 Kudos

Hi Tech,

Below are the steps which you need to follow if you want to create a document from O-data service using SAP DMS

  1. First Store the File into Application server (T.code AL11)
  2. Check Media Type whether JPG/TIFF/MP4/PDF and then send back to the WSAPPLICATION to BAPI.
  3. Split the SLUG values where ‘,’ (Comma) and placed the values to lv_not_no lv_description lv_objtype.
  4. Concatenate with application file path and extension of file.
  5. Call FM SCMS_XSTRING_TO_BINARYfor convert XSTRING to BINARY.
  6. Save the File into Application server using OPEN DATASET,READ DATASET,CLOSE DATASET.
  7. Once fill required input vales for Document call BAPI for create document BAPI_DOCUMENT_CREATE2.
  8. Upon bapi execution is successful it will create document in Backend.
  9. Call the bapi for database update using BAPI_DOCUMENT_CREATE2.
  10. Map the respected document number to Model document number for response body.
  11. Delete the File from Application server.
  12. If any error messages from BAPI will return back through Technical exceptions.

i.e a Image/video/document  against a Service Notification .


Please let me know in case of any more queries


Thanks

Sri

Former Member
0 Kudos

Hello Sri..

Thank you so much for your detailed reply.

I have a few questions.

Currently I have stored the uploaded file in a Z table as shown below

1. Can use this data from the Ztable to upload the file using BAPI_DOCUMENT_CREATE2 fn module?

2. Where do i specify that I want to attach the files to the tcode: IW51? Is that in the table parameter of the fn module - OBJECTLINKS? If yes, then what should I give for Object Type and Object Key for this create service notification transaction?

Thank you so much for your answers..