2010 Jul 01 6:53 PM
Hi ABAP Experts,
I need to upload files (all types) from Presentation Server.. I cannot use CL_GUI_FRONTEND_SERVICES->GUI_UPLOAD since it gives the data in the form of table. I need the file content in STRING OR XSTRING format directly depending on the type of files. How can I directly upload the content in such formats. I could upload in table & then convert table content into string. When I do that, I lose the actual formatting of data in the file.
Please advise.
Thanks,
Geetha
Hi ABAP Experts,
I need to upload files (all types) from Presentation Server.. I cannot use CL_GUI_FRONTEND_SERVICES->GUI_UPLOAD since it gives the data in the form of table. I need the file content in STRING OR XSTRING format directly depending on the type of files. How can I directly upload the content in such formats. I could upload in table & then convert table content into string. When I do that, I lose the actual formatting of data in the file.
Please advise.
Thanks,
Geetha
2010 Jul 01 7:03 PM
Hi,
Get the input file in the form of a table and then use func module: CONVERT_TABLE_TO_STRING or LXE_COMMON_TABLE_TO_XSTRING to convert the table to string or xstring.
Regards,
Subbu
2010 Jul 01 7:25 PM
Hi Subbu
I did that by converting table into string using CONVERT_TABLE_TO_STRING. But when I do this, formatting gets disturbed when the attachment is rendered finally. Thats why I'm looking for a way to achieve this without losing the formatting.
Appreciate your response. Please let me know if you have better ideas.
Thanks
Geetha
2010 Jul 02 8:05 AM
You can upload the content in binary format using GUI_UPLOAD and convert the binary content to XSTRING using FM SCMS_BINARY_TO_XSTRING. I think it will work....
2010 Jul 02 7:32 AM
Hi,
Just check ther below link if it helps.
http://help.sap.com/saphelp_470/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/frameset.htm
Thanks.
2010 Jul 02 8:10 AM
Hi Geetha,
Pass the table entries in to string variable as shown below
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS : c_tab(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab " For tab
, c_cret(1) TYPE c VALUE cl_abap_char_utilities=>cr_lf " for enter
.
DATA : w_str TYPE string
, w_wa TYPE string
, w_xstr TYPE xstring
.
loop at it_tab into e_data_pb.
CONCATENATE e_data_pb-mmbelnr
e_data_pb-inv_item
e_data_pb-inv_type
e_data_pb-vendor
e_data_pb-ekgrp
e_data_pb-plant
e_data_pb-xblnr
e_data_pb-zduedate
e_data_pb-dis_due
e_data_pb-matnr
e_data_pb-amount
e_data_pb-zstatus
e_data_pb-stat_desc
e_data_pb-stat_age
e_data_pb-pb_age
e_data_pb-wi_agent
e_data_pb-agent_name
e_data_pb-cpo_grp_cod
e_data_pb-cpo_recom
e_data_pb-cpo_comments
INTO w_wa SEPARATED BY c_tab.
CONCATENATE w_str w_wa INTO w_str SEPARATED BY c_cret.
endloop.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = w_str
IMPORTING
buffer = w_xstr
EXCEPTIONS
failed = 1.
I hope this will solve your problem... Have a try....
Thanks and Regards,
Senthil Kumar Annatham.
2010 Jul 02 6:03 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |