2010 Apr 15 4:33 AM
Dear ALL
I have a requirement in which I need to create Excel file on SAP
Application Server using OPEN DATASET command. As I have to run the program and create the file in background mode, I can't use 'WS_DOWNLOAD' or 'DOWNLOAD' functions. When I can create the file with .xls addition on the application server,
all the fields in the file appear in the same column. How can place them in different columns as one field in one Excel cell?
Dear ALL
I have a requirement in which I need to create Excel file on SAP
Application Server using OPEN DATASET command. As I have to run the program and create the file in background mode, I can't use 'WS_DOWNLOAD' or 'DOWNLOAD' functions. When I can create the file with .xls addition on the application server,
all the fields in the file appear in the same column. How can place them in different columns as one field in one Excel cell?
2010 Apr 15 6:11 AM
Hello,
Did you try separating the internal table fields with CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB before using the TRANSFER statement?
Vikranth
2010 Apr 15 6:25 AM
Hi,
Yes you can try doing like,
DATA: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_ret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
itab1-f1 = 'AA'. itab1-f2 = '01'. APPEND itab1.
itab1-f1 = 'BB'. itab1-f2 = '02'. APPEND itab1.
itab1-f1 = 'CC'. itab1-f2 = '03'. APPEND itab1.
itab2-f1 = 'ZZ'. itab2-f2 = '26'. APPEND itab2.
itab2-f1 = 'YY'. itab2-f2 = '25'. APPEND itab2.
LOOP AT itab1.
CONCATENATE itab1-f1 itab1-f2 INTO objbin1 separated BY c_tab.
CONCATENATE c_ret objbin1 INTO objbin1.
APPEND objbin1.
ENDLOOP.
LOOP AT itab2.
CONCATENATE itab2-f1 itab2-f2 INTO objbin2 separated BY c_tab.
CONCATENATE c_ret objbin2 INTO objbin2.
APPEND objbin2.
ENDLOOP.
LOOP AT objbin1.
MOVE objbin1-line TO objbin_final-line.
APPEND objbin_final.
ENDLOOP.
And then you can use open dataset and transfer statements to download internal table data in AS.
Hope it helps
Regards
Mansi
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |