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

output to application server.

Former Member
0 Likes
755

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

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.

5 REPLIES 5
Read only

former_member189059
Active Contributor
0 Likes
732

Could you please copy the dump message here

Read only

0 Likes
732

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.

Read only

0 Likes
732

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

Read only

Former Member
0 Likes
733

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

Read only

0 Likes
732

Hello,

Thank you.

Thank you very Much.

Best Regards,

Sasidhar Reddy Matli.