2013 Feb 21 3:06 PM
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
2013 Feb 21 3:17 PM
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.
2013 Feb 21 3:17 PM
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.
2013 Feb 21 5:00 PM
Hello,
Thanks for your reply. So it is not the case of unicode or non-unicode?
2013 Feb 22 4:13 AM
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..
2013 Feb 22 8:50 AM
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.
2013 Feb 21 7:01 PM
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
2022 Jun 17 1:13 PM
Thank you so much Sabyasachi ........ Very easy to understand
2013 Feb 21 8:36 PM
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
2013 Feb 22 9:50 AM
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
2013 Feb 22 11:08 AM
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
2013 Feb 22 12:12 PM
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?
2013 Feb 22 12:16 PM
Dear Prem,
Yes it was due to Unicode check active.
Regards,
Vignesh Yeram
2013 Feb 22 9:57 PM
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
2013 Feb 23 12:12 PM
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
2013 Feb 23 11:39 AM
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
2013 Feb 24 4:09 PM