cancel
Showing results for 
Search instead for 
Did you mean: 

How to link object in BAPI

former_member224809
Active Participant
0 Kudos

Hi friends,

1. Our requirement is to attach a document in Z - Program and this document should linked with equipment master.

2. Came to know BAPI_DOCUMENT_CREATE2 will be helpfull for this

3. How to provide the object in this BAPI

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Varun

First create z-document type with internal number range in DC10 i.e in SPRO. Then in your Z-program give the option of attaching a file from P.C./Desktop. Write a code in your Z-program in such way that once user attach a file/s & saves his entries (Also user need to Enter Equipment number in this program to make the object link to EQUI) DMS/DIR will be created in background with the number range defined in SPRO. So that users can see the documents/files from CV04N as well as from u r Z-program.

All above can be achieve by using the BAPI functions.

I have used the same functionality in QM module & it works fine.

Let me know if u have any queries.

Thanks

Pravin

former_member224809
Active Participant
0 Kudos

Hi Pravin,

Thanks for your response. I've few queries,

1. At present we are uploading document in DMS through CV01N using a document type. Can we use the same for Z-Program?

2. And how to provide the storage path?

Former Member
0 Kudos

Hi Varun,

You can use Z-program instead of using CV01N if you want to create & uploads DMS/DIR in mass.

If there are more than 01 storage categories (like ZHTTPPRD1 & ZHTTPPRD2) then you can give the field value option on selection screen for storage category.

For Storage path you can use the function "F_BROWSE" to upload file through u r Z-program so that all files stored on P.C./Laptop at specific location can be picked to upload in DMS.

For this also u have to give the option of "File Path" on selection screen. Remaining data like DMS description, Lab office, Authorization group etc. can be maintained in excel sheet. This excel sheet will be used to upload the DMS through u r Z-program.

Take the help of ABAP'er ...this can be achievable.

Thanks

pravin

former_member224809
Active Participant
0 Kudos

Hi Pravin,

Thanks for your reply,

1. Now using the attachment we are able to attach one document, how we can achieve multiple attachment in a single document creation?

2. We are using storage category in BAPI to store the attached document in desired location. But how to perform this check in original to change the document from unlock to locked?

Former Member
0 Kudos

Hi Varun,

It's good to hear that you succeed to create DIR through Z-program. Now you can apply the logic for your multiple files as below.

Mandatory data like Doc Description, Lab Office, Authorization Group & object link will be maintained in the excel sheet & uploaded through this tool.

  Files which are required to be attached in the DMS will be saved on desktop or “D” drive. All files will be maintained in subfolders with some naming convention like “DMS01, DMS02, and DMS03 etc. or Test1, Test2, Test3 etc.…

    

All these subfolders will be saved in main folder with some naming convention like DMS or DMS UPLOAD etc…

This "MAIN FOLDER" name should be maintain in Excel file in which you have maintain other uploading data.

    

On the selection screen following fields should be available.

Upload file path: (Excel sheet will be uploaded from here)

  1. DMS Server Category: ZHTTPPRD, ZHTTPPRD1
  2. Main Folder Path: (Files which need to attached in the
    DMS)
  3. Layout:

Make sure you maintain "WAIT TIME" for file attachment between 02 files as file sizes may be different & system is taking some more time to upload the file on DMS server.

Regarding "Check in" requirement, there is BAPI for document check in (Don't remember now exactly) which you can use it with the help of ABAP'er.

Let me know if you have any doubts.

Thanks

Pravin

Former Member
0 Kudos

One clarification here.

In the excel sheet "Sub-folders" name should be maintain & not "MAIN FOLDER" name.

Answers (2)

Answers (2)

former_member224809
Active Participant
0 Kudos

Hi Praveen & Christo...

Thanks a lot for your inputs done with development.

Regards

Varun.M

former_member224809
Active Participant
0 Kudos

Hi pravin,

I'm facing a problem after attaching document while saving i'm receiving following error,

christoph_hopf
Advisor
Advisor
0 Kudos

Hi Mohan,

as this is a permission error message I think that the authorization trace in transaction ST01 could be useful for you to get further information.

You can activate the trace in ST01 and then simulate the behavior. Afterwards stop the trace and evaluate. In the result you should see the failing permission check and object.

Best regards,
Christoph

Former Member
0 Kudos

Hi Varun,

Plz check the authorization object C_DRAW_TCS & C_DRAW_DOK & field value "52". You should have these authorization to access the document.

Add this value in the role assigned to you from PFCG. This should resolve your issue.

Thanks

Pravin