2009 May 26 10:55 AM
I have a requirement to read a tilda separated file from application server and write a tilda separeted output to application server. Please suggest how to to get data from tilda separated file to internal table ? and also How to create a tilda separated file from internal table to application server.
2009 May 26 11:07 AM
Dear ,
I will suggest when you reading a file from application server with tilda separator, get this into a string and then split it at tilda separator and move this to your internal table.
and for outputing file on application server, loop at internal table and concatenate all fields in the field (type string) with separated by tilda.
Hope this will solve your proble. feel free to ask if you have any doubt.
Regards,
vijay
Dear ,
I will suggest when you reading a file from application server with tilda separator, get this into a string and then split it at tilda separator and move this to your internal table.
and for outputing file on application server, loop at internal table and concatenate all fields in the field (type string) with separated by tilda.
Hope this will solve your proble. feel free to ask if you have any doubt.
Regards,
vijay
2009 May 26 11:07 AM
To Read a tilda file from Application server, you can use the READ DATASET statement.
Read it into a variable e.g. gv_string(1000) TYPE c....
CONSTANTS: c_tilde_sep TYPE x VALUE '152'.
Then split the variable gv_string at hexadecimal 152 into the variables that you want...
2009 May 26 11:07 AM
Dear ,
I will suggest when you reading a file from application server with tilda separator, get this into a string and then split it at tilda separator and move this to your internal table.
and for outputing file on application server, loop at internal table and concatenate all fields in the field (type string) with separated by tilda.
Hope this will solve your proble. feel free to ask if you have any doubt.
Regards,
vijay
2009 May 26 11:10 AM
Ya...as said by Vijay...for generating a tilda file in application server...you can conctenate all the data separated by tilda separator i.e. hexa 152 in the case.
2009 May 26 11:31 AM
Guys thanks for showing some light. It would be very helpfule if you can share some sample code for both reading and writing tilda separated file from internal table.
2009 May 26 11:44 AM
Hi again,
This some sample code for outputing data on application server with tilda separator.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. " MESSAGE msg.
IF sy-subrc <> 0.
message i812(LQ).
LEAVE LIST-PROCESSING.
ENDIF.
LOOP AT gs_input INTO wa_input.
CONCATENATE wa_input-wadat_ist
wa_input-sort2
wa_input-name1
wa_input-street
wa_input-region
wa_input-post_code1
wa_input-zzchep
wa_input-vbeln
wa_input-bstkd
wa_input-zfrom
wa_input-zland
wa_input-zccode
wa_input-zrcvd
wa_input-zfref
wa_input-znorc
wa_input-zsepr
wa_input-zvers
wa_input-zlout
wa_input-zinfo
wa_input-zinco
wa_input-zsqal
wa_input-zscod
wa_input-zrqal
wa_input-zeqal
wa_input-zecod
wa_input-zcust
wa_input-ztran INTO g_path SEPARATED BY '~'.
TRANSFER g_path TO p_file.
CLEAR : g_path, wa_input.
ENDLOOP.
CLOSE DATASET p_file.
Hope this will be helpful for you.
Regards,
Vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |