Function Module - to download the Unix file to frontend
I need one function module which will dwon load unix file to frontend.
If anyone knows the Function module plz tell me.
FORM popup_from_server .
* call a function to get the physical name of the directory from the server
* using the given logical name FILE_GET_NAME
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
* CLIENT = SY-MANDT
logical_filename = p_logi "ZHOME
operating_system = sy-opsys
eleminate_blanks = 'X'
IMPORTING
file_name = v_file_name.
v_dirname = v_file_name.
* call a function to get the list of the files
* into an internal table from the given directory
CALL FUNCTION 'SUBST_GET_FILE_LIST'
EXPORTING
dirname = v_dirname
filenm = '*'
pattern = '*.txt'
TABLES
file_list = i_file_list
EXCEPTIONS
access_error = 1
OTHERS = 2.
v_unixfield = 'P_UNIX'.
v_dynpprog = sy-repid.
v_dynpnr = sy-dynnr.
* now call F4 help function, and populate the file list into its value table
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME'
dynpprog = v_dynpprog
dynpnr = v_dynpnr
dynprofield = v_unixfield
value_org = 'S'
TABLES
value_tab = i_file_list .
ENDFORM. " popup_from_server
Similar Messages
-
Remote function module to download the text file
Hi Experts,
I have a requirement of text file should be downloaded from RFC connection by which function module.Can you please tell me whether this method is used to download text file (CALL METHOD cl_gui_frontend_services=>gui_upload).Hi Jaswanth,
FM used to upload the data from the non sap system to the SAP sytem is the GUI_UPLOAD ans GUI_DOWLOAD is downloading the data from SAP to the presentation server .This file can be xls,tab or space deliminatior ettxt fiel.
I think this was your requirement.
Pooja -
Wht are the function modules for download upload excel files in bdc.
hi all,
this question seems to be silly but i had open office excel files i am getting problems to upload or down loading. can you tell which function modules can upload or down load open office excel files.
another dought this is not need full but i need to get some of graphics which are in se78 .
how can we dowload them from sap.
thanq,
rajesh.kHi,
use : CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
REPORT YKC_XL_UPLOAD.
TYPE-POOLS TRUXS.
TABLES : ZMARA.
* Selection screen
PARAMETER P_FILE TYPE RLGRAP-FILENAME DEFAULT
'C:\Kris\TEST_UPLOAD.xls'.
TYPES: BEGIN OF T_TAB,
MATNR LIKE ZMARA-MATNR,
ERSDA LIKE ZMARA-ERSDA,
ERNAM LIKE ZMARA-ERNAM,
END OF T_TAB.
DATA : T_UPLOAD TYPE STANDARD TABLE OF T_TAB WITH HEADER LINE ,
WA_UPLOAD TYPE T_TAB,
IT_RAW TYPE TRUXS_T_TEXT_DATA. "work table internal table
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE '
IMPORTING
FILE_NAME = P_FILE.
START-OF-SELECTION.
* Uploading the data in the file into internal table
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
* I_LINE_HEADER = 'X'
I_TAB_RAW_DATA = IT_RAW
I_FILENAME = P_FILE
TABLES
I_TAB_CONVERTED_DATA = T_UPLOAD[]
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID
TYPE SY-MSGTY
NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END-OF-SELECTION.
* Uploading the data into the database table
LOOP AT T_UPLOAD INTO T_UPLOAD.
ZMARA-MATNR = T_UPLOAD-MATNR.
ZMARA-ERSDA = T_UPLOAD-ERSDA.
ZMARA-ERNAM = T_UPLOAD-ERNAM.
INSERT ZMARA.
Endloop.
Tks,
Krishna -
Function module to download using file browser
FUNCTION MODULE TO download the data to a file by choosing the path using file browser.
In your selection screen use this below logic. Then on the screen a pop up file browser wud appear where you can select the path to download the file.
PS: If this solves your problem please reward points and mark this question answered.
Regards.
SELECT-OPTIONS AND PARAMETERS *
Local File path
SELECTION-SCREEN BEGIN OF BLOCK file_info WITH FRAME TITLE text-001.
PARAMETER : p_file TYPE ibipparms-path .
SELECTION-SCREEN END OF BLOCK file_info.
AT SELECTION-SCREEN EVENTS - validate user input *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*Pop up screen to select the local file from PC
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file. -
Function Module to Download Internal table in EXCEL
Hi All,
I need a Function Module to download the Internal table to Excel File.
I Have used SAP_CONVERT_TO_XLS_FORMAT,
but this function modules are using GUI_Download indirectly.
I dont want to use GUI_DOWNLOAD as i am going to call this Function Module in Portal.
So pls anybody has this type of function module.
Thanks & Regards,
Dhruv ShahHello Dhruv.
In Agreement with Deniz.
It is required to Export the query as an excel file.
[SAP HELP Library - Standard Reference - Exporting as a CSV File / MS Excel 2000 File|http://help.sap.com/saphelp_nw04/helpdata/en/d2/11a28fc26d4042a6d230a9783152f2/content.htm]
[SDN - Reference - Error in "Export to Microsoft Excel" from Portal|Error in "Export to Microsoft Excel" from Portal;
Hope this works out well.
Good Luck & Regards.
Harsh Dave -
Function module to download into excel sheet in crm
Hi,
Needed the Function module to download the data from internal table into the excel sheet in the CRM
<b></b>use
FM :- GUI_DOWNLOAD
Example Code.
lv_file_name = 'c:abcd.xls'
*----Load Detail Report Data to Excel File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file_name
filetype = 'DAT'
write_field_separator = 'X'
codepage = '4103'
TABLES
data_tab = lt_det_report
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
ENDIF.
IF sy-subrc <> 0.
* 202 : Error Occurred while writing data to the file.
MESSAGE e202(zusm_gen) .
EXIT.
ELSE.
WRITE :/ text-042 , lv_file_name.
ENDIF.
:- lt_det_report---> is table for storing data .
it can be any type
<b>Please Reward Points & Mark Helpful Answers</b>
To mark Helpful Answers ;click radio Button next to the post.
RadioButtons
<b>o</b> Helpful Answer
<b>o</b> Very helpful Answer
<b>o</b> Problem Solved.
Click any of the above button next to the post; as per the anwers
<b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b> -
Function module to download to excel sheet
what is the function module to download the report into excel sheet??..
Thanks
Srihi,
use the alv list or alv grid for the report output then that functionality will be provided by default....
In general Gui_download is used and the final internal table which is used for displaying the output of the report is passed to the FM.
Regards,
Rohan. -
BDC : Function Module to Upload Unicode text file
Hi Friends,
Can anyone tell me how to upload data to internal table by taking it from unicode text file ?
at present i'm using FM - GUI_UPLOAD which do not support Unicode text file.
SonalHi,
U Have to use CodePage Parameter to upload the data.
Check the Description
Character Representation for Output
Description
Use parameter CODEPAGE to specify the desired source codepage. If this parameter is not set, the codepage of the SAP GUI is used as the source codepage.
Value range
4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME provides the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP provides the respective non-Unicode frontend codepage for a language.
The desired codepage can be determined interactively, if the parameter with_encoding of method file_open_dialog is set by cl_gui_frontend_services.
If the specified codepage is not suited for the Byte Order Mark of the file, an exception is triggered.
SPACE: Codepage of the frontend operating system
Default
SPACE -
Function module to choose the file for download and upload
what is the function module to choose the file for download and upload for presentation server.
give me with examplePlease search in SCN.
This has been discussed so many times. -
Function module to download data into excel file
Hi Friends,
Please tell me the function module name which popsup a popup box to specify a filename and the location and when clicking on the OK button, the file should be downloaded to the specified location.
I need it ASAP.
Thanks,
Jaffer Ali.SHi Shamshudeen,
You have to use two funtion modules to acheive this.
1. To get the file path from user.
2. To download the excel sheet in prescribed path.
For 1 use following code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
IMPORTING
file_name = p_fpath .
The file path will be stored in p_fpath.
Now use GUI_DOWNLOAD function module and pass the file name p_fpath to it along with filetype as .xls
Hope this helps you.
Thanks,
Arun -
Is there any function module to download pdf file
is there any function module to download pdf file
WITH OUT GUI_DOWNLOAD FUNCTION MODULE.
THANKS IN ADVANCED.Dear Laxman,
Tryout the following Function Modules:
(1) CONVERT_ABAPSPOOLJOB_2_PDF --> convert abap spool output to PDF
(2) CONVERT_OTF --> Convert SAP documents (SAPScript) to other types.
Example:
CALL FUNCTION "CONVERT_OTF"
EXPORTING FORMAT = "PDF"
IMPORTING BIN_FILESIZE = FILE_LEN
TABLES OTF = OTFDATA
LINES = PDFDATA
EXCEPTIONS ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
Regards,
Abir
Don't forget to award Points * -
Function Module that gives the names of the file in the Application Server.
Hi Experts,
Please give me a Function Module that gives the names of the file in the Application Server.
Thanks,
Debi.Hi,
see these links
http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
http://abaplovers.blogspot.com/2008/05/function-module-sap-logged-in-users-to.html
http://www.saptechies.com/abap-function-modules/
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/function-module-to-get-data-and-time-of-file-576751
thanks
karthik -
Function Module to determine the number of pages in a pdf file
Hi All,
Is there any standard function module to determine the number of pages in a pdf file?
Thanks,
SaiHi unk2,
There's no functionality in the Acrobat.com online services to do a character count. But, you could use ExportPDF to convert your PDF file to Word format, and then do your character count in Word.
Please let us know if you need additional assistance.
Best,
Sara -
Function Module to download Raw data as a PDF file
Hi,
Is there any function module which will allow to convert raw data to pdf and download in the local system.
The requirement is to download a payslip as a pdf format.
Function Module 'CONVERT_PAYSLIP_TO_PDF' converts the data into a raw format. The output of this FM is of type XSTRING.
Can this be downloaded as a pdf.Hi
Please below coding
REPORT ZSAP_PDF_VIEWER.
DATA: LT_PDF TYPE TABLE OF TLINE,
LS_PDF LIKE LINE OF LT_PDF,
LV_URL TYPE CHAR255,
PDF_FSIZE TYPE I,
LV_CONTENT TYPE XSTRING,
LT_DATA TYPE STANDARD TABLE OF X255.
DATA : L_JOB_OUTPUT_INFO TYPE SSFCRESCL.
DATA : LS_CONTROL_PARAM TYPE SSFCTRLOP.
DATA : G_HTML_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_HTML_CONTROL TYPE REF TO CL_GUI_HTML_VIEWER.
DATA: LO_DIALOG_CONTAINER TYPE REF TO CL_GUI_DIALOGBOX_CONTAINER.
DATA: LO_DOCKING_CONTAINER TYPE REF TO CL_GUI_DOCKING_CONTAINER.
DATA : P_VBELN TYPE VBELN_VL.
FIELD-SYMBOLS <FS_X> TYPE X.
INITIALIZATION.
LS_CONTROL_PARAM-GETOTF = 'X'.
LS_CONTROL_PARAM-NO_DIALOG = 'X'.
START-OF-SELECTION.
CALL FUNCTION '/1BCDWB/SF00000034'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = LS_CONTROL_PARAM
P_VBELN = P_VBELN
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO = L_DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = L_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = L_JOB_ OUTPUT_OPTIONS
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = PDF_FSIZE
TABLES
OTF = L_JOB_OUTPUT_INFO-OTFDATA
LINES = LT_PDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
convert pdf to xstring string
LOOP AT LT_PDF INTO LS_PDF.
ASSIGN LS_PDF TO <FS_X> CASTING.
CONCATENATE LV_CONTENT <FS_X> INTO LV_CONTENT IN BYTE MODE.
ENDLOOP.
CALL SCREEN 100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '100'.
**CREATE OBJECT LO_DOCKING_CONTAINER
EXPORTING
REPID = SY-REPID
DYNNR = '100'"SY-DYNNR
SIDE = LO_DOCKING_CONTAINER->DOCK_AT_LEFT
EXTENSION = 1200.
CREATE OBJECT g_html_container
EXPORTING
container_name = 'HTML'.
*CREATE OBJECT G_HTML_CONTROL
EXPORTING
PARENT = LO_DOCKING_CONTAINER.
CREATE OBJECT G_HTML_CONTAINER
EXPORTING
CONTAINER_NAME = 'HTML'.
CREATE OBJECT G_HTML_CONTROL
EXPORTING
PARENT = G_HTML_CONTAINER.
Convert xstring to binary table to pass to the LOAD_DATA method
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = LV_CONTENT
TABLES
BINARY_TAB = LT_DATA.
*application/
Load the HTML
CALL METHOD G_HTML_CONTROL->LOAD_DATA(
EXPORTING
TYPE = 'application'
SUBTYPE = 'pdf' "
IMPORTING
ASSIGNED_URL = LV_URL
CHANGING
DATA_TABLE = LT_DATA
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
OTHERS = 4 ).
CALL METHOD G_HTML_CONTROL->show_url
EXPORTING url = lv_url
in_place = 'X'
EXCEPTIONS cntl_error = 1.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT.
DATA ok_code LIKE sy-ucomm.
MOVE sy-ucomm TO ok_code.
CASE ok_code.
WHEN 'BACK' OR 'EXIT'.
CALL METHOD LO_DOCKING_CONTAINER->free.
CALL METHOD g_html_control->free.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " USE -
Function module for displaying the location
Hi,
Could anyone tell the Function module for displaying the location in our system without a file name while downloading, when the user press f4.
thanks* read the default pathname on application server
call function 'FILE_GET_NAME'
exporting
* CLIENT = SY-MANDT
logical_filename = lc_logical_filename_ftappl
operating_system = sy-opsys
* parameter_1 = ' '
* PARAMETER_2 = ' '
* USE_PRESENTATION_SERVER = ' '
* WITH_FILE_EXTENSION = ' '
* USE_BUFFER = ' '
importing
emergency_flag = l_emergency_flag
file_format = l_file_format
file_name = l_file_name_ftappl
exceptions
file_not_found = 1
others = 2.
Maybe you are looking for
-
Is there a way to create cd covers that i can print to put on my cds?
i thought i saw somewhere that you could do something like this. where you can tell itunes to take the album artwork and info from all your songs and make an hard copy album cover that you can print out and use on, say, a cd case... anyone else heard
-
Word breaks incorrect when wrapping Greek text
Hi, I'm trying to use Greek in Illustrator, but I'm getting line breaks in the middle of words. This sort of problem also applies to other languages. Does anyone know how this problem might be resolved? Note that this is NOT the same thing as turning
-
Inspection lot 08 with reference to a process order
Hi Dear gurus: I need to create a special lot class 08 (stock transfer), with reference to an order process. Any good idea would be apreciated.
-
Urgent!!!!!!! Error 200 in Web Service execution
Hi: I created a simple helloWorld WebService (one method that receive a string and return a string) using Jdeveloper 10.1.3. This was created successfully, but when I click on URL generated I got this error in browser : Error instantiating web-applic
-
My app is not fully embedding, being denied permission
Hi. So I am making a Firefox OS webapp. I'm using the <iframe> function to display a web page. The problem is that only about a 3rd of the screen is displaying the web space. Here is a screenshot: http://i.imgur.com/POJU3lL.png Here are the 2 errors