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

Function BAPI_DOCUMENT_CREATE2

Former Member
0 Likes
2,198

Hi,

we created a z program to upload documents using BAPI_DOCUMENT_CREATE2.

When we click on a custom field system open a popup asking the path from which import the document.

After this an error message compares saying that dms object has not been created.

Now my question is: "Is there any max number of chars for the directory?" I know in windows is 260 but in my case the directory and the file has less than 260 chars.

The file has a number of chars equals to 62 (this number doesn't include the extension i.e.: .pdf)

Thanks

Best regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,092

Are you actually trying to upload from a PDF?

Neal

11 REPLIES 11
Read only

Former Member
0 Likes
2,095

Are you actually trying to upload from a PDF?

Neal

Read only

0 Likes
2,092

Yes it's a pdf

The network path is:

Z:\Supply Chain\_Acquisti\Contratti in essere\Fornitori Commerciali\2013

In the folder 2013 there is a document, the name of this file is: "Contratto d'Acquisto - Parti Commerciali - 20130130 da firmare.pdf"

If I upload it from a local path (i.e. my PC) or If I rename the document into "Prova.pdf" uploading works correctly.

Read only

0 Likes
2,092

Hi AA,

Is your Network Folder is Share able ? if (y)

LT_FILES-DOCFILE " \\your source IP Address \ your share able folder name \ file name .pdf "

Example : \\ 192 .168.0.1 \ Share_Folder_Name \ File_Name.pdf

Regard's

Smruti

Read only

0 Likes
2,092

And you have a reasonable capability to parse the pdf into your fields for your BAPI?

Neal

PS:  What function are you using to read the file?  This probably gets more at the question that you asked about.

Read only

0 Likes
2,092

I renamed the document from "Contratto d'Acquisto - Parti Commerciali - 20130130 da firmare.pdf"

to Prova.txt and I tried to upload again the file from the network path "Contratto d'Acquisto - Parti Commerciali - 20130130 da firmare.pdf" and it works.

I think that is related to the lenght of the path but I don't know how many chars is the max limit

Read only

0 Likes
2,092

I click F1 in the popup with the path, then I get the name of the structure: RLGRAP-FILENAME

Double click on it and then I get the following:

FILENAME LOCALFILE CHAR 128 0 File locale per upload/download

Read only

0 Likes
2,092

Is it a z program that you are doing this in?

Read only

Former Member
0 Likes
2,092

Check the program after reading the document path it would be storing in a variable before passing to fm check the variable length it might be truncating.

Regards

Read only

Former Member
0 Likes
2,092

You do know that by having chosen a correct answer that you will tend to get no more responses?

Read only

0 Likes
2,092

Yes I know that thanks,

I verified the structure RLGRAP-FILENAME and I can see a limit of 128 chars for the path

Read only

0 Likes
2,092

Glad you are done.