‎2007 Jan 05 7:31 PM
Hello,
I am not sure what is happening with my program. I have a table
<b> DATA: begin of header_line occurs 0,
line(50) type c,
end of header_line.</b>
I have code
<b>header_line-line = 'Customer '.
append header_line.
header_line-line = 'Company code '.
append header_line.
header_line-line = 'Sales organization '.
append header_line.
header_line-line = 'Distribution channel'.
append header_line.
.
.
.</b>
I fill the header line and append 214 times. when I look at my tab delimited file, It only creates 213 columns. I am not sure why the last column is not printing. I have commented out one of the lines in the middle of the group and the last line prints. I am not sure if there is a limit of columns that can be created or if I need to increase my table. If anyone knows how to correct this, can you please let me know.
thanks in advance for the help.
‎2007 Jan 05 7:34 PM
This might be a logic error in the code you have written for putting it in the file. Can you post the code you have used?
- Guru
‎2007 Jan 05 7:34 PM
This might be a logic error in the code you have written for putting it in the file. Can you post the code you have used?
- Guru
‎2007 Jan 05 7:36 PM
it is 1366 lines. do you want me to post the entire program or just a certain section
‎2007 Jan 05 7:39 PM
just the section where you are copying the table to the file.
- Guru
‎2007 Jan 05 7:42 PM
Hi,
Try increasing the table size....but it would b better if u could paste atleast some part of the code.
Regards,
Mukul
‎2007 Jan 05 7:44 PM
Guru,
sorry for the confusion but I am still not sure what you are asking for. I have a section when I do the append 214 times. I then call
ALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_path
write_field_separator = 'X'
TABLES
<b>fieldnames = header_line</b> data_tab = it_extract_data
I am getting all of the data but just not the headings
‎2007 Jan 05 7:46 PM
Mukul,
How do you increase the table size. what do I have to add to the table
DATA: begin of header_line occurs 0,
line(50) type c,
end of header_line.
‎2007 Jan 05 7:51 PM
Got your problem. You are not usign the FM correctly.
1. For heading , First you use GUI_DOWNLOAD and pass only the internal table header_line( IT having the header)
2. Then again use GUI_DOWNLOAD for the internal table it_extract_data.
This will work.
- Guru
Reward points for helpful answers
‎2007 Jan 05 7:52 PM
Hi Timothy,
Did you check your header_line internal table in debugging before calling the FM 'GUI_DOWNLOAD'? otherwise, comment out fielnames and just use data_tab and check like
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_path
write_field_separator = 'X'
TABLES
data_tab = header_line
<b>*fieldnames = header_line</b>
Vivek
‎2007 Jan 05 7:55 PM
again sorry for the confusion
my code is
ALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_path
write_field_separator = 'X'
TABLES
fieldnames = header_line
data_tab = it_extract_data
whenI bolded the line, I must have screwed up.
should I still call the GUI_DOWNLOAD twice?
‎2007 Jan 05 7:57 PM
yes.
First
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_path
write_field_separator = 'X'
TABLES
data_tab = header_line.
Second
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_path
write_field_separator = 'X'
TABLES
data_tab = it_extract_data.
- Guru
‎2007 Jan 05 8:12 PM
I changed my program to call it twice. I did not get any header line at all.
‎2007 Jan 05 8:17 PM
Ok do the following check.
1. Have you used the same FM as I mentioned above.
2. If so. Comment out the second FM and execute your program to make sure that the header is downloaed. You can check the file after execution. You should see the header alone. The data will not appear as the code for this is commented.
3. Comment the first Fm and uncomment the second. you shoudl see teh data alone without header.
4. If all the steps above are workign fine then make sure that you are calling the second FM in append mode rather than in overwrite mode.
Perform all these and let me know.
- Guru
‎2007 Jan 05 8:23 PM
I think you are calling the function correctly. Do you have 214 columns in it_extract_data?
Rob
‎2007 Jan 05 8:25 PM
I commented out the second FM and only processed the header line. I do not have the second FM setup for append. I will check on how to set that up. when the FM processed the header line, it did not put the column headings on one line but instead put in one column. so I have all 214 lines of data. I don't know if this is because we did not use the "fieldnames" parameter.
‎2007 Jan 05 8:35 PM
I believe this to be your problem. I ran:
DATA: BEGIN OF itab OCCURS 0,
f1(10),
f2(10),
* f3(10),
END OF itab.
DATA: BEGIN OF names OCCURS 0,
f1(50),
END OF names.
names-f1 = '1'.
APPEND names.
names-f1 = '2'.
APPEND names.
names-f1 = '3'.
APPEND names.
itab-f1 = 'A'.
itab-f2 = 'B'.
APPEND itab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:temptestn.dbf'
write_field_separator = 'X'
TABLES
data_tab = itab
fieldnames = names.
And got two columns, but when I uncommented f3 in itab, I got them all.
Rob
‎2007 Jan 05 8:42 PM
All,
I looked thru the code again and found that I had a column heading in the middle of the group that should not have been coded. since there were 213 columns of data it must only print 213 column headings. that is why the last one was not printing. I have remove the heading that is in error and everything is working correctly.
I am very sorry for wasting everyone's time on this.
I want to thank all of you for trying to help me figure this out.
‎2007 Jan 05 8:44 PM