Convert work area data into comma separator format ( CSV format )
the function moudule sap_convert_to_csv_format is not available in my system . it is a not released fm as of now. so i cant use it.
My requirement is to send the details to app server in a comma separated format.
For each work area , which i transfer to application server, i hv to separte each field by a comma separtaor.
TRANSFER wa to VA_FILENAME LENGTH 256 ENF OF LINE.
Suppose my work area has fields wa-f1 wa-f2 wa-f3, it should write in app server as value1, value2, value3 like wise....
Suggest me if there is any alternative function module to acheiver this like when we pass wa to fm, the fields should be comma separator,
Any other useful suggestions are welcome.
Thanks
Hi,
here is the piece of code to transfer data from internal table to applivcation server as a comma seperated file..
FORM comma_sep_file .
DATA: l_cost_center_str TYPE type_cost_center.
IF it_cost_center[] IS NOT INITIAL.
**Concatenate file path and file name
CONCATENATE p_cpath p_cfile INTO v_cost_cen_output.
OPEN DATASET v_cost_cen_output FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
If Network file could not be opened, give a message.
IF sy-subrc <> 0.
WRITE : / text-030 , v_cost_cen_output .
MESSAGE s000(zp) WITH text-015 .
CLEAR : v_cost_cen_output,
p_cpath .
ELSE.
LOOP AT it_cost_center INTO l_cost_center_str.
CONCATENATE l_cost_center_str-co_cen_code
l_cost_center_str-co_cen_name
l_cost_center_str-fld3
l_cost_center_str-fld4
l_cost_center_str-set_true INTO wa_csvdata
SEPARATED BY c_const_sep.
TRANSFER wa_csvdata TO v_cost_cen_output.
CLEAR wa_csvdata.
ENDLOOP.
ENDIF."IF sy-subrc <> 0.
CLOSE DATASET v_cost_cen_output.
ENDIF.
ENDFORM. "
i hope this will help you...
Thanks & Regards
Ashu Singh
Similar Messages
-
How to Convert internal table data into text output and send mail in ABAP
Hi All,
Good Morning.
Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
But thought of doing it without excel.
I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!. Instead I want to send this output to User's mails as Normal mail body with No attachments.
Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
Best Regards
Dileep VThere's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
notice we use gt_text as "mail body"
TRY.
* -------- create persistent send request ------------------------
gv_send_request = cl_bcs=>create_persistent( ).
* -------- create and set document -------------------------------
* create text to be sent
wa_line = text-001.
APPEND wa_line TO gt_text.
CLEAR wa_line.
APPEND wa_line TO gt_text.
LOOP AT gt_fail ASSIGNING <fs_fail>.
MOVE <fs_fail>-retry_count TO gv_count.
CONCATENATE text-002
<fs_fail>-setting_id
text-003
gv_count
INTO wa_line SEPARATED BY space.
APPEND wa_line TO gt_text.
CLEAR wa_line.
ENDLOOP.
APPEND wa_line TO gt_text.
wa_line = text-007.
APPEND wa_line TO gt_text.
* create actual document
gv_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = gt_text
i_length = '12'
i_subject = 'Failed Precalculation Settings!' ).
* add document to send request
CALL METHOD gv_send_request->set_document( gv_document ).
* --------- set sender -------------------------------------------
gv_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD gv_send_request->set_sender
EXPORTING
i_sender = gv_sender.
* --------- add recipient (e-mail address) -----------------------
LOOP AT s_email INTO wa_email.
MOVE wa_email-low TO gv_email.
gv_recipient = cl_cam_address_bcs=>create_internet_address(
gv_email ).
CALL METHOD gv_send_request->add_recipient
EXPORTING
i_recipient = gv_recipient
i_express = 'X'.
ENDLOOP.
* ---------- set to send immediately -----------------------------
CALL METHOD gv_send_request->set_send_immediately( 'X' ).
* ---------- send document ---------------------------------------
CALL METHOD gv_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE text-004.
ENDIF.
COMMIT WORK.
* exception handling
CATCH cx_bcs INTO gv_bcs_exception.
WRITE: text-005.
WRITE: text-006, gv_bcs_exception->error_type.
EXIT.
ENDTRY.
with the following declarations
* TABLES *
TABLES:
adr6,
rsr_prec_sett.
* INTERNAL TABLES & WORK AREAS *
DATA:
gt_fail TYPE SORTED TABLE OF rsr_prec_sett
WITH UNIQUE KEY setting_id run_date,
gt_text TYPE bcsy_text,
wa_fail LIKE LINE OF gt_fail,
wa_line(90) TYPE c.
FIELD-SYMBOLS:
<fs_fail> LIKE LINE OF gt_fail.
* VARIABLES *
DATA:
gv_count(4) TYPE n,
gv_send_request TYPE REF TO cl_bcs,
gv_document TYPE REF TO cl_document_bcs,
gv_sender TYPE REF TO cl_sapuser_bcs,
gv_recipient TYPE REF TO if_recipient_bcs,
gv_email TYPE adr6-smtp_addr,
gv_bcs_exception TYPE REF TO cx_bcs,
gv_sent_to_all TYPE os_boolean.
* SELECTION-SCREEN *
SELECT-OPTIONS:
s_email FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
DATA:
wa_email LIKE LINE OF s_email. -
How to Convert internal table data into xml and xml data into internal tab
Hi Guys,
I have a requirement that i have to convert the internal table data into xml format and viceversa . for my requirement i came to know that i have to use Transformations concept. i done the converting the data from internal table into xml data by using standard Tranformations. My Question is
1) Can i use same Transformation to convert the xml data into abap internal table. if it is possible then how ???
2) Is it possible using the standard Transformation or I have to go for XSLT approach
Please help me out from this guys,
Thanks and Regards
KotiHi Koti,
This is possible. There is a link. With the help of this link you can convert ABAP data to XML and vice versa.
Link: http://www.heidoc.net/joomla/index.php?option=com_content&view=article&id=15:sapxslt&catid=22:sap-xslt&Itemid=31 -
Put list of data into comma separeted
Hi,
I need to put list of datas into comma seperated one. I want ot put our defined logic.
SQL> select firstname from enterpriseuser;
Firstname
Thomas
Kathleen
Ken
Tony
Raj
Calvin
Barb
Rhonda
Rajesh but I want the data like
Thomas, Kathleen, Ken, Tony, Raj, Calvin, Barb, Rhonda, Rajesh Thanx..Hi,
For me it didn't work for this version on WINDOWS.
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
SQL> WITH t AS (SELECT 'Thomas' str FROM DUAL UNION ALL
2 SELECT 'Kathleen' FROM DUAL UNION ALL
3 SELECT 'KenTony' FROM DUAL UNION ALL
4 SELECT 'Raj' FROM DUAL UNION ALL
5 SELECT 'Calvin' FROM DUAL UNION ALL
6 SELECT 'Barb' FROM DUAL UNION ALL
7 SELECT 'Rhonda' FROM DUAL UNION ALL
8 SELECT 'Rajesh' FROM DUAL)
9 SELECT MAX(SYS_CONNECT_BY_PATH(str,',')) FROM (
10 SELECT str, ROWNUM RN FROM T )
11 CONNECT BY ROWNUM = RN - 1
12 /
MAX(SYS_CONNECT_BY_PATH(STR,',
,Thomas,KenTony,Raj,Calvin,Barb,Rhonda,Rajesh
SQL> Regards -
Adobe forms: Displaying work area data in different windows
Hi,
I have a requirement of showing work area data in different windows i.e work area which has sent from program needs to come in different windows of the form. I have created a smartform which will perfectly doing the above logic. The above work area also contains amount fields. I am also passing language 'English' or 'French', based on this i am displaying some texts also.
But Client wants to see the same requirement in Adobe forms. Ao i am new to Adobe forms, I need some help for performing the above scenario. I am doing my research on this. But i want to know the steps which will not reduce the performance.
In smartform, first window contains personnel no from work area and the second window contains address from work area. Then i have created a template with employee premium amount column, company premium amount column and total of that, all these from work area. So work area will contain only one row which i have to show in different window and on template.
In Adobe forms, How can i do the same this which i have done in smart forms.
Please suggest me any one in doing this. I appreciate your answers.
Thanks,
s.vikgneshHi,
Yes as Santoosh said there is no such wiondow option in Adobe forms.
But if you use webdynpro java/Abap we can acheive this.
think something like this below, if it works.
have 2 views 1st for the adobe form, 2nd view in a new window for the work area screen.
in the adobe view have a button for the work area and respective event handler.
in the event handler call this window, and then reload the same adobe form.
if from the work area form if you need value to be passed to this adobe form. have a event handler for this.
when purpose is done, close that window and set value to the required context field on the form. and reload that adobe form.
this is a fuzzy process and time consuming, unless business has no other option we dont go this approach.
but for sure this works, we did the same for a EHS process.
Cheers,
Sai -
Rows into comma separated values
DB version : 11.2
I would like get rows into comma separated values
expected output
rowvalue1,<space>rowvalue2,<space>rowvalue3,<space>rowvalue4,.....Example:
create table test1 (name1 varchar2(10));
insert into test1 values ('JOHN');
insert into test1 values ('YING');
insert into test1 values ('KAREN');
insert into test1 values ('PEDRO');
commit;
SQL> select * from test1;
NAME1
JOHN
YING
KAREN
PEDROHow can I get this to printed as
JOHN, YING, KAREN, PEDROAssuming you want them in no particular order
SQL> select listagg(name1, ',') within group (order by rowid) from test1;
LISTAGG(NAME1,',')WITHINGROUP(
JOHN,YING,KAREN,PEDRO -
Here is my dilemma. I am an archivist at an arts organization and we are in the process of digitizing many of our materials to post them on the web and make them available to internet users. One of the principle components of our collection is a large trove of photographs. We have been in the process of digitizing these images and embedding metadata (in the Caption/Description, Author/Photographer and Copyright fields) via PhotoShops File Info command.
Now I am at a crossroads. We need to extract this metadata and transfer it into a comma separated value form, like an Excel spreadsheet or a FileMakerPro database. I have been told that it is not possible to do this through PhotoShop, that I must run a script through Acrobat or Bridge. I have no clue how to do this. I have been directed to a couple of links.
First I was directed to this (now dead) link: http://www.barredrocksoftware.com/products.html
The BSExportMetadata script allegedly exports the metadata from files selected in Adobe's Bridge into a comma separated value (CSV) file suitable for import into Excel, Access and most database programs. It installs as a Bridge menu item making it simple to use. The the Export Metadata script provides you with an easy to use wizard allowing you to select associated information about a set of images that you can then export. This script requires Creative Suite 2 (CS2). This script sounds like it does exactly what I want to do, but unfortunately, it no longer exists.
Then I found this:
Arnold Dubin, "Script to Export and Import Keywords and Metadata" #13, 8 Aug 2005 7:23 am
I tried this procedure, but nothing seemed to happen. I also tried to copy the script into the JAVASCRIPT action option in Acrobat, but I received a message that the script had an error. It also seems to me that this script does not set up a dumping point, that is, a file into which this information will be exported to.
I am a novice, not a code writer or a programmer/developer. I need a step-by-step explanation of how to implement this filtering of information. We have about 2000 jpeg and tiff files, so I would rather not go through each file and copy and paste this information elsewhere. I need to find out how to create a batch process that will do this procedure for me. Can anyone help?Hello -
Is anyone aware of a tool that will do the above that is available for mac? Everything I've found so far seems to be PC only.
Any help is appreciated, thanks! -
The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file.
I guess your question is, "what's wrong with the file?"
You're going to have to figure that out yourself, as we cannot see the file.
Importing into Address book requires either a tab-delimited or a comma-delimited file. You can export out of most spreadsheets into a csv file. However, you need to make sure you clean up the file first. If you have a field that has commas in the field, they will create new fields at the comma. So, some lines will have more fields than the others, causing issues like the error you saw. -
Enable comma separated values (CSV) output
I am trying to figure out how to (Enable comma separated values (CSV) output ) for a report. Do you have an example or info on how to do that?
Can you provide an example on how you completed the setup? I am in the same boat but can't find an example to this subject
-
How to convert internal table data into excel format?
Hi all,
I want to convert internal table data in excel format and then
send it as email attachment in workflow.
Please tell me how do i perform this.
Regards,
Arpita.Hi Arpita,
Try this sample code::
Send mail
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
loop at htmllines.
mailtxt = htmllines.
append mailtxt.
endloop.
mailrec-receiver = 'your receiver mail id'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'EXL'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Hope it will help you.
Regards,
NIkita -
Moving internal table work area data to string
Hi, I am running a program with unicode enable.I am moving data from work area to string where i am getting a error like String & work area are not mutually convertable in Uni code program.
Can any one help me how to resolve this problem.
Thanks & Regards,
Pratap.Hi Pratap kumar,
sorry, need to do some redesign:
You could poiibly concatenate the components of the structure into a string - if they are all character-like. And you will loose leading and trailing spaces.
Non-character-componets must be converted (WRITE TO) into character-like fields.
If you need the exact position in your string, you have to place all values at calculatzed offset in a (big enough) character field like CHAR1024.
Altogether it might be easier to re-think and re-build according to results required. As you did not mention where you have this question, I have no special idea on how to solve.
Regards,
Clemens -
Need to convert the binary data in blob field to readable format
Hi,
We need to convert the Binary data in the BLOB field to readable format and need to display it in Oracle Apps Environment,does anybody come across the similar requirement.
please advise, thanks in advance.
Regards,
Babu.You could use standard Attachments functionality here ... if the blob is not in FND_LOBS, insert into FND_LOBS, fnd_attached_documents etc to enable viewing via "Attachments" to the entity the blob is related to.
Gareth -
How to convert digital array data into analog signal
i want help to convert digital data array into analog signal
shubham62 wrote:
We are implimenting real time audio trans-receiver. We have converted input audio data(analog form) into digital data. At the receiver side we received digital data which is in the form of digital data array.But we are unable to recover back our original input data. So please help us to sort out the problem.
Still no useful information. How was the data converted to digital in the first place? What conversion parameters did you use? As was said, you just need to do the math backwards to get it back into the analog.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Converting Flat File data into XML
Hi Experts,
Consider the message type of the SENDER system and flat file data
<dt_sender>
<root>
<header1> 0..1
<f1>
<f2>
<f3>
<header2> 0..1
<f4>
<f5>
<f6>
<item> 1..unbounded
<f7>
<f8>
<f9>
<f10>
<f11>
<f12>
</item>
abc def ghi jkl mno pqr
123 123 123 123 123 123
456 456 456 456 456 456
how to convert the flat file data into following XML data. please note that each field value is separated by TAB delimeter...wht parameters shld b used
<root>
<Header1>
<f1>abc</f1>
<f2>def</f2>
<f3>ghi</f3>
</Header1>
<Header2>
<f4>jkl</f4>
<f5>mno</f5>
<f6>pqr</f6>
</Header1>
<item>
<f7>123</f7>
<f8>123</f8>
<f9>123</f9>
<f10>123</f10>
<f11>123</f11>
<f12>123</f12>
<f7>456</f7>
<f8>456</f8>
<f9>456</f9>
<f10>456</f10>
<f11>456</f11>
<f12>456</f12>
</item>
points will be given to the correct answers
Thanks in advance.
FAisal
Edited by: Abdul Faisal on Feb 29, 2008 5:53 AMFaisal,
When you read the multiple recordset strucutre file then each record in txt file should have an header from which you can identiy which segment it should go.. and you identiy it by using the keyfiledValue in file adapter
<root>
<header1> 0..1
<f1>
<f2>
<f3>
<header2> 0..1
<f4>
<f5>
<f6>
<item> 1..unbounded
<f7>
<f8>
<f9>
<f10>
<f11>
<f12>
</item>
for this input file
abc def ghi jkl mno pqr
123 123 123 123 123 123
456 456 456 456 456 456
abc def ghi can be read using the file adater to header 1 usinfg key field value, but using the same file adapter you cannt put GHI into header2.
else you should read whole row abc def ghi jkl mno pqr in single filed and write an UDF to split data to header1 and Header 2
similarly you have to take care for item records also
if your inout file is something like this
abc def ghi
jkl mno pqr
123 123 123 123 123 123
456 456 456 456 456 456
abc identifies to Header 1
JKL for Header 2 so on...
read the whole line in single field and write UDF to Split to header 1 and header 2 similary for item. -
Convert reqular | delimeted data into XMLtype
How do we hold data
How do I convert/store regular data (coming from | delimeted .dat file) into Oracle XMLtype.
there will 400+ columns on each record and the file will be having about 50 millions records,
I have requirement to use the XMLtype, any help would be greatly appreciated.
In some cases the incoming file has more columns on day2 from day1. If table is predefined the no. of columns, Then this case I will loose that additional column's values. The main stuff is even if receive different no. of columns if need to capture without altering the table?
Is there any option, without altering the table, can I capture the additional columns in Oracle?
Also is there any advantage or disadvantage of this process, please!
Thanks,Hi,
You can declare the column as XMLType and the storage as CLOB.
1 SELECT SYS_XMLGen('T')
2 FROM user_tables
3* WHERE rownum = 1
sql> /
SYS_XMLGEN('T')
<ROW>T</ROW>
sql> create table t2 (
2 x xmlType)
3 XMLType x STORE AS CLOB;
Table created.
sql> insert into t2
2 SELECT SYS_XMLGen('T')
3 FROM user_tables
4 WHERE rownum = 1;
1 row created.
sql> commit;
Commit complete.Thanks,
Rajesh.
Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
Always try to provide create table and insert statements to help the forum members help you better.
Maybe you are looking for
-
I get the message "Your Apple ID has been disabled." when I try to download to my iPad a subscription paid magazine (The Economist) from the App Store. For what it's worth, the same Apple ID was accepted when I joined this Discussion Group. What mus
-
I am having trouble installing any version of ITunes 10.5 or later on my Windows 2003 Server PC. I receive the following error every time I try to install it... "Apple Mobile Device Support requires that your computer is running Windows XP SP2 or new
-
Adobe Acrobat Pro 9 (CS5 Suite) -Deployment Silent Install
Hello! Has anyone managed to get Adobe Acrobat Pro 9.0 for Mac to deploy with any level of reliability through tools such as Apple Remote Desktop?
-
Hi All, A newbie quesion. I have Oracle 8i in my laptop, I want to install Oracle 10g Express edition, can i have both together ? Regards Ravi Kumar
-
Uploading and Downloading files in an Applicaiton
I was able to successfully upload and download files stored in the database through Application Express by following the how to instructions at --> http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CJAHDJDA QUESTION