09-02-2015 9:54 AM
Hi all,
I have a requirement to fetch an excel file from AL11 directory and post it to opentext. I also have to convert this file to pdf and post to OT. I have for this purpose, converted the file into xstring after fetching it from the directory and posted it into OT using a custom FM.
Now my requirement is to convert this xstring into pdf and then post this to OT with the help of this custom FM. I have searched in various threads but there are solutions which after converting it to binary table format just download into local machine, but what I need is a copy of this file to be stored in the AL11 directory(same as excel file) and also post it to OT using the custom FM.
For getting path of the AL11 directory im using FILE_GET_NAME_USING_PATH and read into xstring using open dataset.
Kindly provide your valuable suggestions.
09-02-2015 11:07 AM
09-02-2015 11:07 AM
09-03-2015 7:41 AM
I have successfully converted an xstring internal table to pdf using spool job and uploaded to application server as well as opentext. However what I need is to convert excel data to internal table but none of the standard FMs like 'ALSM_EXCEL_TO_INTERNAL_TABLE' or 'KCD_EXCEL_OLE_TO_INT_CONVERT' are available in the current installation. Please suggest a workaround for this.
09-03-2015 9:54 AM
Hi Utsav,
Use FM GUI_UPLOAD for uploading data from excel to Internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_str
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = it_file
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Suneel
09-03-2015 2:32 PM
Hi,
GUI_UPLOAD fetches the file from presentation server for input but my file is in the application server. I tried OPEN DATASET and reading character by character but it throws codepage mismatch exception (obviously). Please suggest any other alternative method.
09-03-2015 5:58 PM
Hi Utsav,
Please refer the below link..for downloading/uploading excel file form application server to internal table.
Check the code Related to PERFORM Application server in the below link.
I hope you it will help you..
Regards,
Suneel.