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

Dump in Transfer statement

former_member182337
Participant
4,287

Hello,

I am trying to place a file containing vendor and other information into application server. There is a dump occuring in the transfer statement

The error statement is

For the statement

   "TRANSFER f TO ..."

only character-type data objects are supported at the argument position

"f".

The work area has many non character fields and i guess from the error  message that is the reason for the same.

My question is, is the program dumping because it is a unicode program or even for non-unicode program if non character fields are used in the work area for TRANSFER statement the program will go for dump.

Regards,

Prem

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,529

Hi Prem,

If your transferring whole work area at once then this error will occur.

Hence transfer one element of work area at once.

The code will be something like:

OPEN DATASET file_name FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

   IF sy-subrc = 0.

     LOOP AT itab INTO work_area.

       TRANSFER work_area-field1 TO file_name LENGTH len NO END OF LINE.

       TRANSFER work_area-field2 TO file_name LENGTH len NO END OF LINE.

       TRANSFER work_area-field3 TO file_name LENGTH len NO END OF LINE.

        and so on....

        last field of work area should transferred without 'NO END OF LINE'.

     ENDLOOP.                          

     CLOSE DATASET p_app.

   endif.

15 REPLIES 15
Read only

Former Member
0 Likes
2,530

Hi Prem,

If your transferring whole work area at once then this error will occur.

Hence transfer one element of work area at once.

The code will be something like:

OPEN DATASET file_name FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

   IF sy-subrc = 0.

     LOOP AT itab INTO work_area.

       TRANSFER work_area-field1 TO file_name LENGTH len NO END OF LINE.

       TRANSFER work_area-field2 TO file_name LENGTH len NO END OF LINE.

       TRANSFER work_area-field3 TO file_name LENGTH len NO END OF LINE.

        and so on....

        last field of work area should transferred without 'NO END OF LINE'.

     ENDLOOP.                          

     CLOSE DATASET p_app.

   endif.

Read only

0 Likes
2,529

Hello,

Thanks for your reply. So it is not the case of unicode or non-unicode?

Read only

0 Likes
2,529

hello Bharatilal,

even you transfer the whole workarea to a file workarea its not a problem..it will transfer . will u please give me the coding i vl check it..

Read only

0 Likes
2,529

Hi Pavan,

I have already mentioned the code in my earlier reply.

You can have a look at that, and definitely share your thought about it.

Read only

Former Member
0 Likes
2,529

Hello prem,

this program is used for internal table to application server.

TYPES : BEGINOF ST_DEMO,
REG_NO(
10) TYPEC,
NAME(
20) TYPEC,
ADDR(
20) TYPEC,                     
ENDOF ST_DEMO.

DATA : WA_DEMO TYPE st_demo,

                                       
IT_DEMO
TYPE TABLE OF ST_DEMO,
L_FNAME
TYPE STRING .

PARAMETERS: P_FNAME(128) TYPECDEFAULT'D:\usr\sap\DEV\SYS\SRC\SABYA1.txt'   OBLIGATORY.

L_FNAME = P_FNAME.

WA_DEMO-REG_NO = '10'.
WA_DEMO-NAME =
'ANAND'.
WA_DEMO-ADDR =
'NAGARKOVIL'.
APPEND WA_DEMO TO IT_DEMO.

WA_DEMO-REG_NO =
'11'.
WA_DEMO-NAME =
'VIKRAM'.
WA_DEMO-ADDR =
'CHENNAI'.
APPEND WA_DEMO TO IT_DEMO.

OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
WRITE :5 'REG NUM',16 'NAME',37 'ADDRESS' .
LOOP AT IT_DEMO INTO WA_DEMO.
IF SY-SUBRC = 0.
TRANSFER WA_DEMO TO L_FNAME.
WRITE :/5 WA_DEMO-REG_NO,16 WA_DEMO-NAME,37 WA_DEMO-ADDR.
ENDIF.
ENDLOOP.
CLOSE DATASET L_FNAME.

Thanks

Sabyasachi

Read only

0 Likes
2,529

Thank you so much Sabyasachi ........ Very easy to understand

Read only

edgar_nagasaki
Contributor
0 Likes
2,529

Hi Kumar,

Pay attention to your OPEN statement, it needs to have IN TEXT MODE ENCODING DEFAULT option.

If it fixes your problem then yes, it's Unicode related.

Edgar

Read only

0 Likes
2,529

Hello,

Thanks to all for your replies.

My program already has IN TEXT MODE ENCODING DEFAULT for the OPEN statement. The program still dumps and i get the dump that there are non-character fields. I remember once that i have used non-character fields as well for transferring data(Not sure,though). Hence, i was wondering whether the dump has something got to do with Unicode or non-unicode.

Thanks,

Prem

Read only

0 Likes
2,529

Dear Prem,

Your Work area's fields should be all character type. first u can move ur data to work areas which has all the fields character type then you can transfer the work area.

Regards,

Vignesh Yeram

Read only

0 Likes
2,529

I have already corrected the dump. My question was differet? Why did the dump occur at the first place? Is it because of the unicode issue?

Read only

0 Likes
2,529

Dear Prem,

Yes it was due to Unicode check active.

Regards,

Vignesh Yeram

Read only

0 Likes
2,529

Hi Prem,

Char type and non-char type in Unicode and non-Unicode differ in length, most probably you solved issue by replacing all non-char fields by char, right? And yes, it was Unicode related.

Edgar

Read only

0 Likes
2,529

Hello,

follow my code............copy and execute my code..........compare with your code.....debug my code and your code also......try to find your mistake......

Thanks

Sabyasachi

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,529

In Unicode system, you are restricted to character-like area if dataset open in TEXT mode (but not  with option LEGACY) So you could try BINARY MODE or LEGACY TEXT MODE or converting and mapping your structure in a structure with only char-like fields.

Just read a recent version of TRANSFER statement online help.

Regards,

Raymond

Read only

former_member182337
Participant
0 Likes
2,529

Thanks to all of you.