‎2007 Oct 12 11:05 AM
Hi,
How to get tab delimeter between fields while transfering file to application server.
Thanks in advance.
Suresh
‎2007 Oct 12 11:08 AM
use Tab with value '09' of type hexadecimal. otherwise tab won't appear in the file reated on application server.
constants: wc_tab type X value '09'.
Concatenate f1 wc_tab f2....... " populating workarea to be transferred on application server
Reward if useful
‎2007 Oct 12 11:08 AM
use Tab with value '09' of type hexadecimal. otherwise tab won't appear in the file reated on application server.
constants: wc_tab type X value '09'.
Concatenate f1 wc_tab f2....... " populating workarea to be transferred on application server
Reward if useful
‎2007 Oct 12 11:08 AM
Hi,
You can try using the constant HORIZONTAL_TAB of the class CL_ABAP_CHAR_UTILITIES.
you can concatenate this constant as we concatenate char fields.
For eg.
concatenate var1 var2 into var3 separated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
or
try:
DATA: BEGIN OF tabulator,
x(1) TYPE x VALUE '09',
END OF tabulator.
DATA: tabulator_c(1) TYPE c.
CALL FUNCTION 'SYSTEM_CODEPAGE'
IMPORTING
codepage = c_to.
tabulator_c = tabulator.
TRANSLATE tabulator_c FROM CODE PAGE c_from TO CODE PAGE c_to.
do.
assign component sy-index of structure str <f>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
concatenate string <f> tabulator_c into string.
enddo.
OR
try this
REPORT ZREDDYDEMO2 .
data : var1 value 'c'.
data : var2 value 'd'.
data : var3(10).
constants : var4 type x value '09'.
data : begin of itab occurs 1,
one(10),
end of itab.
CONCATENATE var1 var2 into var3 SEPARATED by VAR4.
*CONCATENATE var1 VAR4 var2 into var3.
write : var3.
itab-one = var3.
append itab.
OPEN DATASET 'MY_TEST1' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER ITAB TO 'MY_TEST1'.
CLOSE DATASET 'MY_TEST1'.
OR try this
1. Declare a constant to store the tab
CONSTANTS: c_split TYPE c
VALUE cl_abap_char_utilities=>horizontal_tab,
Suppose you are in 4.6C or earlier you will need the hex value
CONSTANTS: c_split TYPE x VALUE '09'.
2. Write the field content into one long line which you are using for upload
e.g CONCATENATE p_direct p_obj sy-datum text-037 INTO wa_error SEPARATED BY c_split.
3. Transfer to Application server
TRANSFER wa_error TO p_f2.
Reward points if useful