2008 May 23 6:37 AM
Hello All,
I have ouput in HIERARCHIAL LIST. Im displaying Header table G_T_VBAK and Item table G_T_VBAP.
I want to save this output in application server. Can any one help?
My code is as follows.
OPEN DATASET g_f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE e899(mm) WITH 'not possible' space space space.
EXIT.
ELSE.
LOOP AT g_t_vbak.
TRANSFER g_t_vbak TO g_f_file.
LOOP AT g_t_vbap.
TRANSFER g_t_vbap TO g_f_file.
ENDLOOP.
ENDLOOP.
ENDIF.
It is giving dump at the line TRANSFER g_t_vbap TO g_f_file. (second loop statement).
Good answers will be appriciated with points.
Thanks in advance.
Best Regards,
Sasidhar Reddy Matli.
2008 May 23 6:52 AM
Hi,
use
OPEN DATASET FNAME FOR OUTPUT IN BINARY MODE since If you read from or write to a file that is open in binary mode, the data is transferred byte by byte.
The system does not interpret the contents of the file while it is being transferred.
If you read from or write to a file that is open in text mode, the data is transferred line by line. The
system assumes that the file has a line structure
Shruthi
Hello All,
I have ouput in HIERARCHIAL LIST. Im displaying Header table G_T_VBAK and Item table G_T_VBAP.
I want to save this output in application server. Can any one help?
My code is as follows.
OPEN DATASET g_f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE e899(mm) WITH 'not possible' space space space.
EXIT.
ELSE.
LOOP AT g_t_vbak.
TRANSFER g_t_vbak TO g_f_file.
LOOP AT g_t_vbap.
TRANSFER g_t_vbap TO g_f_file.
ENDLOOP.
ENDLOOP.
ENDIF.
It is giving dump at the line TRANSFER g_t_vbap TO g_f_file. (second loop statement).
Good answers will be appriciated with points.
Thanks in advance.
Best Regards,
Sasidhar Reddy Matli.
2008 May 23 6:42 AM
2008 May 23 6:48 AM
Hello Kris,
The dump message is as follows:
What happened?
Error in ABAP application program.
The current ABAP program "ZSSR_ORDER_DETAILS_HIER1" had to be terminated
because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Error analysis
Only character-type data objects are supported at the argument
position "f" for the statement
"TRANSFER f TO ...".
In this case, the operand "f" has the non-character-type "u". The
current program is flagged as a Unicode program. In the Unicode context,
type X fields are seen as non-character-type, as are structures that
contain non-character-type components.
Source code extract
002370 FORM download_to_application_server .
002380
002390 OPEN DATASET g_f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
002400
002410 IF sy-subrc NE 0.
002420
002430 MESSAGE e899(mm) WITH 'not possible' space space space.
002440 EXIT.
002450
002460 ELSE.
002470
002480 LOOP AT g_t_vbak.
002490
002500 TRANSFER g_t_vbak TO g_f_file.
002510
002520 LOOP AT g_t_vbap.
> TRANSFER g_t_vbap TO g_f_file.
002540 ENDLOOP.
002550
002560 ENDLOOP.
002570
002580 ENDIF.
002590
002600 ENDFORM. " download_to_application_server
Best Regards,
Sasidhar Reddy Matli.
2008 May 23 6:53 AM
Hello,
The problem should get solved by moving your entire header line g_t_vbap to a string or character type variable and then transferring that variable to your file
If it doesn't work directly, then use concatenate to move it to the string and specify the names of all the fields of your header line
Edited by: Kris Donald on May 23, 2008 11:23 AM
2008 May 23 6:52 AM
Hi,
use
OPEN DATASET FNAME FOR OUTPUT IN BINARY MODE since If you read from or write to a file that is open in binary mode, the data is transferred byte by byte.
The system does not interpret the contents of the file while it is being transferred.
If you read from or write to a file that is open in text mode, the data is transferred line by line. The
system assumes that the file has a line structure
Shruthi
2008 May 23 6:59 AM
Hello,
Thank you.
Thank you very Much.
Best Regards,
Sasidhar Reddy Matli.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |