Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in BAPI_DOCUMENT_CREATE2

Former Member
0 Likes
2,224

My objective is to transfer a file from Application layer to DMS. So i used the function module called 'BAPI_DOCUMENT_CREATE2'. But i get the error

"Error while checking and storing : /sapia/iface/in/comm/sapmas/WFDOC.PDF"

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,846

Hi,

were you able to solve this problem ...

cheers

Santosh

6 REPLIES 6
Read only

Former Member
0 Likes
1,847

Hi,

were you able to solve this problem ...

cheers

Santosh

Read only

0 Likes
1,846

Hi,

I solved it by myself.

The problem may be because of the following reason.

1.) File name is not present in the folder.

2.) File donot have necessary authorization.

3.) WSapplication field may be wrong or empty.

4.) Storage category is missing

5.) KPro server connection problem.

6.) HTTP or FTP destination missing.

In my case,I miss the 6th point. After adding the HTTP export parameter as shown below,my Bapi creates the document with the attachment.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

EXPORTING

documentdata = wa_docdata

pf_http_dest = 'SAPHTTPA'

pf_ftp_dest = 'SAPFTPA'

...........

Thanks and Regards

Senthil Kumar Anantham

Read only

0 Likes
1,846

Hi,

I am getting an error "An error occured while creating the original attribute for PDF"

I tried with out file attachment, it works as you know it is simple....

I tried with various types of attachments like .TXT and .WRD (changed both wsapplication and docfile parameters), however i get the same error. I tried both from presentation and application server (by providing pf_ftp_dest = 'SAPFTPA' pf_http_dest = 'SAPHTTPA' )

Any idea on how to solve this?

All i need is create a DMS document with a PDF attachment from application server. Are there any other ways to solve this issue?

ws_docdata-documenttype = 'ARE'.

ws_docdata-description = 'BAPI DMS'.

ws_docdata-statusextern = 'CR'.

ws_file-storagecategory = 'DMS_C1_ST'.

ws_file-wsapplication = 'PDF'.

ws_file-description = 'Job output'.

ws_file-docfile = 'C:\CAD Integ BAPIS_46.pdf'.

append ws_file to it_files.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

EXPORTING

documentdata = ws_docdata

IMPORTING

return = v_ret

TABLES

documentfiles = it_files .

BREAK-POINT.

IF v_ret-type CA 'EA'.

ROLLBACK WORK.

WRITE : v_Ret-message.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = '5'.

ENDIF.

Thanks

Pavan

Read only

0 Likes
1,846

Hi,

I am getting an error "An error occured while creating the original attribute for PDF"

I tried with out file attachment, it works as you know it is simple....

I tried with various types of attachments like .TXT and .WRD (changed both wsapplication and docfile parameters), however i get the same error. I tried both from presentation and application server (by providing pf_ftp_dest = 'SAPFTPA' pf_http_dest = 'SAPHTTPA' )

Any idea on how to solve this?

All i need is create a DMS document with a PDF attachment from application server. Are there any other ways to solve this issue?

ws_docdata-documenttype = 'ARE'.

ws_docdata-description = 'BAPI DMS'.

ws_docdata-statusextern = 'CR'.

ws_file-storagecategory = 'DMS_C1_ST'.

ws_file-wsapplication = 'PDF'.

ws_file-description = 'Job output'.

ws_file-docfile = 'C:\CAD Integ BAPIS_46.pdf'.

append ws_file to it_files.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'

EXPORTING

documentdata = ws_docdata

IMPORTING

return = v_ret

TABLES

documentfiles = it_files .

BREAK-POINT.

IF v_ret-type CA 'EA'.

ROLLBACK WORK.

WRITE : v_Ret-message.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = '5'.

ENDIF.

Thanks

Pavan

Read only

0 Likes
1,846

This message was moderated.

Read only

bruno_esperanca
Contributor
0 Likes
1,846

Hi,

I'm trying to achieve the same as the original poster but I'm having trouble with it.

I get the error "Original has already been checked in and stored".

Could you kindly post your code, please?

Thank you.

Best regards,

Bruno