2016 Aug 30 10:11 AM
Hello
I am using bapi BAPI_DOCUMENT_CREATE2 to upload document in CV01N. for the mass upload we created a prgrm that uses bapi
BAPI_DOCUMENT_CREATE2.
while using a bapi we passed file path in lt_files-docfile that is the path of file we need to upload.
presently we are mentioning file type like PDF ,JPG ,xls in excel file and building file path like
concateNATE 'D:\' wa_data-belnr '.' WA_DATA-DOKAR into file(wa_dat-dokar contains .pdf or .doc based on excell input) .
lt_files-docfile = file .
APPEND lt_files.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_doc
IMPORTING
documenttype = lf_doctype
documentnumber = lf_docnumber
documentpart = lf_docpart
documentversion = lf_docversion
return = ls_return
TABLES
documentdescriptions = lt_drat
objectlinks = lt_drad
documentfiles = lt_files.
My client dont want to mention type of file in excel now , but i am wonder hoe can i determine type of file we want to upload in cv01n.
will you please let me knoe hoe can i achieve it.simply i dont want to mention .pdf or .doc in file path but system shuld upload what ever the file exist with that name.
2016 Aug 31 4:53 PM
Hi Krishna,
Maby, you can try the nexto one:
Use a constant table(If doenst exist, build one!), put herem all types of file that working on process, I.E.:
NAME NUMBER VALUE1 VALUE2
FIELD 1 .PDF
FIELD 2 .XLS
FIELD 3 .JPG
FIELD 4 .DOC
Now, in your program you can read all those values with NAME = 'FIELD' and then, you can build your path without mentioned on file.
Regards,