2008 Mar 18 4:23 AM
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
2008 Mar 18 4:29 AM
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.
2008 Mar 18 4:29 AM
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.
2008 Dec 16 2:01 PM