cancel
Showing results for 
Search instead for 
Did you mean: 

UPLOAD_FILE check in Documents in the Document Managment System

Former Member
0 Kudos

Dear Experts,

i must upload a different File in the Document Managment System.

For Example .doc, .xls, .pdf.......

Have somebody a symple for me

Thanks

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You might be asking in the wrong forum. From Web Dynpro ABAP there is not particular to uploading documents into the DMS. You only have the fileUpload UI element. What you do with the content after uploaded to ABAP memory is up to you and has nothing to do with Web Dynpro. If you are looking for the correct BAPIs for interacting with the Documement Mangement System in ERP, you would better be servered asking in another forum.

Former Member
0 Kudos

How can i transfer the data from the loaded file in the interface format for the BAPI BAPI_DOCUMENT_CREATE

I have this code

INPUT = WD_CONTEXT->GET_CHILD_NODE( name = wd_this->wdctx_upload_info ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'FILECONTENT' IMPORTING VALUE = XCONTENT ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'FILENAME' IMPORTING VALUE = NAME ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'MIMETYPE' IMPORTING VALUE = MIME_1 ).

CONV = CL_ABAP_CONV_IN_CE=>CREATE( INPUT = XCONTENT ).

CONV->READ( IMPORTING DATA = CONTENT ).

Greetings Frank

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

BAPI_DOCUMENT_CREATE is ERP specific, so I don't have access to a system that has that function module to see the interface. What is the extact problem mapping to the interface? Is the document content expected as an table instead of string (common with older function modules and BAPIs). If so consider using the function modules in the SCMS_CONV function group to convert the XSTRING to the format needed by the interface.

Former Member
0 Kudos

Hi Frank,

If you used File upload UI element means the read contents should be in Xstring format.

For convert the Xstring to string have a look on following code :

CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
input = item_filecontent
encoding = 'UTF-8'
replacement = '?'
ignore_cerr = abap_true
RECEIVING
conv = loc_conv.

*Read the file contents

TRY.
CALL METHOD loc_conv->read
IMPORTING
data = var_string.
CATCH cx_sy_conversion_codepage.

Here item_filecontent is the type of xstring and var_string is the type of string.

Thanks.

Former Member
0 Kudos

Dear all Experts,

can i find a sample in the SAP System who a document will beloaded from the client about WebDynpro into the DMS

Thank you all