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

Regarding text file open

Former Member
0 Likes
721

Hi ,

I can able to save comma delimited TEXT file in specified path but at the same time i want to open that automatically. For XCEL sheet I able to do using following function modules but not for TEX file.

Please help me...thanks in advance.

CALL FUNCTION 'REGISTRY_GET'

EXPORTING

key = 'protocol\StdFileEditing\Server'

section = 'ExcelWorkSheet'

IMPORTING

value = excel_command.

dw_file1 = file path.

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

commandline = dw_file1

program = excel_command

EXCEPTIONS

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

OTHERS = 5.

Hi ,

I can able to save comma delimited TEXT file in specified path but at the same time i want to open that automatically. For XCEL sheet I able to do using following function modules but not for TEX file.

Please help me...thanks in advance.

CALL FUNCTION 'REGISTRY_GET'

EXPORTING

key = 'protocol\StdFileEditing\Server'

section = 'ExcelWorkSheet'

IMPORTING

value = excel_command.

dw_file1 = file path.

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

commandline = dw_file1

program = excel_command

EXCEPTIONS

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

OTHERS = 5.

5 REPLIES 5
Read only

Former Member
0 Likes
688

IN WS_EXECUTE,

pass the filepath in CommandLine and pass "EXCEL" to program. It will do the trick for you.

Read only

Former Member
0 Likes
688

Hi Rama,

try this:

*

DATA: <b>DATEI TYPE STRING</b> value 'C:\TEST.XLS'.

*

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

DOCUMENT = DATEI.

Take your on value for DATEI.

Regards, Dieter

Read only

0 Likes
688

Hi ...I want to open TXT format file ....I used following FM's to open Xcel sheet...but i don't know what are the values should pass for "key" and "section"

in the FM "REGISTRY_GET" to open TXT format file.

CALL FUNCTION 'REGISTRY_GET'

EXPORTING

key = 'protocol\StdFileEditing\Server'

section = 'ExcelSheet'

IMPORTING

value = excel_command.

CONCATENATE '"' dw_file1 '"' INTO dw_file1.

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

commandline = dw_file1

program = excel_command

EXCEPTIONS

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

OTHERS = 5.

Please help me how to open TXT format file

Read only

Former Member
0 Likes
688

Hi rama,

1. Eg. there is a file

d:\abc.txt

and now u want to open directly with excel.

2. Just copy paste

3.

REPORT ABC.

CALL FUNCTION 'GUI_RUN'

EXPORTING

<b> COMMAND = 'EXCEL'

PARAMETER = 'D:\ABC.TXT'</b>

  • CD =

  • IMPORTING

  • RETURNCODE =

.

.

regards,

amit m.

Read only

Former Member
0 Likes
688

Hi ...I want to open TXT format file ....I used following FM's to open Xcel sheet...but i don't know what are the values should pass for "key" and "section"

in the FM "REGISTRY_GET" to open TXT format file.

CALL FUNCTION 'REGISTRY_GET'

EXPORTING

key = 'protocol\StdFileEditing\Server'

section = 'ExcelSheet'

IMPORTING

value = excel_command.

CONCATENATE '"' dw_file1 '"' INTO dw_file1.

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

commandline = dw_file1

program = excel_command

EXCEPTIONS

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

OTHERS = 5.

Please help me how to open TXT format file.