Application Development 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: 

Downloading to apps server, Upgradation from 4.6b to ECC 6.0

Former Member
0 Kudos
76

Hi Experts,

We are undergoing upgrade from 4.6b to ECC6.0,

OPEN DATASET APPL_FILE FOR OUTPUT IN TEXT MODE.

This statement is written in 4.6b version, the ouput is perfect.

In ECC 6.0 the statement is

OPEN DATASET APPL_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

In database we have charater as # in the address field, but this is making a new line character while downloading file from ECC,

Please adivce...

Thanks in Advance..

Regards,

IFF

1 ACCEPTED SOLUTION

Former Member
0 Kudos
59

hi,

Check this code: you will find the solution:

Using the Static Attribute CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

Example:

This is the Simple way you can download the ITAB with Tab delimiter:

DATA : V_REC(200).

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB INTO WA.

Concatenate WA-FIELD1 WA-FIELD2

INTO V_REC

SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

TRANSFER V_REC TO P_FILE.

ENDLOOP.

CLOSE DATASET P_FILE.

Note: if there are any Numeric fields ( Type I, P, F) In your ITAB then before CONCATENATE you have to Move them to Char fields ..

Example:

DATA: V_RECORD(200).

OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC 0.

EXIT.

ENDIF.

DO.

READ DATASET P_FILE INTO V_RECORD.

IF SY-SUBRC NE 0.

EXIT.

ENDIF.

SPLIT V_Record at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

INTO WA-FIELD1 WA-FIELD2.

APPEND WA TO ITAB.

Regards,

Santosh

ENDDO.

2 REPLIES 2

Former Member
0 Kudos
60

hi,

Check this code: you will find the solution:

Using the Static Attribute CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

Example:

This is the Simple way you can download the ITAB with Tab delimiter:

DATA : V_REC(200).

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB INTO WA.

Concatenate WA-FIELD1 WA-FIELD2

INTO V_REC

SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

TRANSFER V_REC TO P_FILE.

ENDLOOP.

CLOSE DATASET P_FILE.

Note: if there are any Numeric fields ( Type I, P, F) In your ITAB then before CONCATENATE you have to Move them to Char fields ..

Example:

DATA: V_RECORD(200).

OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC 0.

EXIT.

ENDIF.

DO.

READ DATASET P_FILE INTO V_RECORD.

IF SY-SUBRC NE 0.

EXIT.

ENDIF.

SPLIT V_Record at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

INTO WA-FIELD1 WA-FIELD2.

APPEND WA TO ITAB.

Regards,

Santosh

ENDDO.

Former Member
0 Kudos
59

ANSWERED BY EXPERTS