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

TAB delimeter between fields while transfering file to application server

suresh_kumar53
Participant
0 Likes
405

Hi,

How to get tab delimeter between fields while transfering file to application server.

Thanks in advance.

Suresh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
378

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

2 REPLIES 2
Read only

Former Member
0 Likes
379

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

Read only

Former Member
0 Likes
378

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