01-07-2008 7:47 AM
Hi friends,
Here's a simple code I wrote.
The problem is , I get an error message saying the " literal extending into next line not allowed";
when I am giving the path for my file which is on the desktop.
Here's the code......
REPORT ZFUNCMOD .
PARAMETERS:
P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\Documents and
Settings\Administrator\Desktop\TEST.xls'. " -> as u can see ,
"it has extended into the next line.i have tried to adjust ...but
DATA: T100 TYPE STANDARD TABLE OF T001 WITH DEFAULT KEY.
SELECT * FROM T001 INTO TABLE T100.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
I_FILENAME = P_FILE
I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = T100
CHANGING
I_TAB_CONVERTED_DATA =
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
please let me know how to adjust that..
I TRIED THE FOLLOWING;AVOIDED GIVING THE DEFAULT FILENAME PATH AND IT DID WORK....
REPORT ZFUNCMOD.
PARAMETERS:
P_FILE LIKE RLGRAP-FILENAME. " DEFAULT 'C:\Documents and
"Settings\Administrator\Desktop\TEST.xls'.
at selection-screen on value-request for P_FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,..'
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = P_FILE
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 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.
DATA: T100 TYPE STANDARD TABLE OF T001 WITH DEFAULT KEY.
SELECT * FROM T001 INTO TABLE T100.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
I_FILENAME = P_FILE
I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = T100
CHANGING
I_TAB_CONVERTED_DATA =
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanking you all in advance,
Hari Kiran.
01-07-2008 8:09 AM
Split the code just before your text literal
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME DEFAULT
'C:\Documents and Settings\Administrator\Desktop\TEST.xls'.
01-07-2008 7:53 AM
Try to use
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME DEFAULT TEXT-001.
Then define text symbol 001 with 'C:\Documents and settings\Administrator\Desktop\TEST.xls'
Regards
01-07-2008 8:00 AM
Hi Raymond,
Have a look at my code.
I have used RLGRAP and it did work for me.
thats not the question.
i want to give a default file name for the data to get downloded to.how do i adjust that...
please have a look at it again..
Regards,
Hari Kiran
PS: Thanks for replying
01-07-2008 8:04 AM
hi,
have u limited source code width to 72 characters?
if it is there, remove and then try again pls
hope this helps.
pls reward if useful
regards,
Preeti
01-07-2008 8:07 AM
Hi,
You can extend the line as shown below.
PARAMETERS:
P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\Documents and' &
'Settings\Administrator\Desktop\TEST.xls'.
Regards,
Naga Raju GV.
01-07-2008 8:08 AM
Hi,
In the INTIALIZATION event u can assign the same.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
INTIALIZATION.
P_FILE = 'C:\Documents and Settings\Administrator\Desktop\TEST.xls'.
Regards,
Srinivas
01-07-2008 8:09 AM
Split the code just before your text literal
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME DEFAULT
'C:\Documents and Settings\Administrator\Desktop\TEST.xls'.
01-07-2008 8:11 AM
Hi,
I m not sure which version u r using.
Try this in the setting of ABAP editor.
Go to Utilities->Settings->ABAP Editor->Editor-> uncheck Downwards-Comp Line Lngth(72) checkbox.
Regards
Vadi
01-07-2008 8:33 AM
friends,
i have checked out the following----written by Naga Raju GV..
It's not showing any error ..no syntax error...
but when I am executing it.... data is not being transferred to the file.
let me check out the other suggestions too.
And I will get back to u all.
I am on version 4.7 by the way.
Thanking you all for your replies.
Regards,
Hari Kiran
Hi,
You can extend the line as shown below.
PARAMETERS:
P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\Documents and' &
'Settings\Administrator\Desktop\TEST.xls'.
Regards,
Naga Raju GV.
01-07-2008 8:39 AM
when you use the '&' symbol, you need to make sure SAP puts the spaces in the right places
enter debug mode after the variable is initialized and check its contents properly
It may be 'C:\Documents andSettings\Administrator\Desktop\TEST.xls'
01-07-2008 8:40 AM
Hi,
all the replies mean that the default value that u r passing for your filename needs to be in one line.
either you urself type the default value in the next line or remove the tick in the checkbox for 'Downward Compatibility < 72'. it will have the same maening.
try doing it once.
Regards,
Preeti
01-07-2008 8:55 AM
Hi Friends,
I tried out the following two and it worked---
1.
Split the code just before your text literal
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME DEFAULT
'C:\Documents and Settings\Administrator\Desktop\TEST.xls'.
2.
Hi,
I m not sure which version u r using.
Try this in the setting of ABAP editor.
Go to Utilities->Settings->ABAP Editor->Editor-> uncheck Downwards-Comp Line Lngth(72) checkbox.
Regards
Vadi
Friends its working now
DATA IS BEING PLACED IN THE EXCEL FILE.
Thanking you all once again.
Regards,
Hari Kiran.
PS: Preethi, what you have said is right. It's workin now
01-07-2008 8:52 AM
hi Hari,
as Kris said, '&' supresses the space between the words.
but you can make it as shown below.
PARAMETERS:
P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\Documents and Settings\' &
'Administrator\Desktop\TEST.xls'.
Regards,
NagaRaju GV.