CSV conversion problem

Hello,
I'm looking for help solving the following problem. For my research I'm using a program that crawls the web, looking for particular information. The input for this program are CSV files, in which each keyword is enclosed in ' '. In Numbers this isn't problematic if I set up the Text option for the cells. When I convert it to CSV however, the first ' disappears, so that the web program is fed with the wrong information and doesn't work.
Can anyone help me please?

In fact it seems that two problems strike.
(1) if the cell is not defined as text, the first single quote is dropped
(2) if cells are defined as text, the single straight quotes are replaced by smart curly single quotes which aren't what your other program requires.
This script takes care of that.
As I don't know if you need double quotes, I inserted a property allowing you to enclose values with double quotes or not.
--[SCRIPT clipboard2CSVfileWithQuotes]
Enregistrer le script en tant que Script, Application ou Progiciel :clipboard2CSVfileWithQuotes.xxx
déplacer le fichier créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Copiez le bloc de cellules à exporter dans le Presse-papiers.
menu Scripts > Numbers > clipboard2CSVfileWithQuotes
Des apostrophes seront ajoutées si nécessaire.
Le script créera un fichier CSV dans lequel toutes les valeurs sont encadrées par des guillemets.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
+++++++
Save the script as a Script, an Application or an Application Bundle:clipboard2CSVfileWithQuotes.xxx
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Coopy the range of cells to export into the clipboard
menu Scripts > Numbers > clipboard2CSVfileWithQuotes
Straight quotes will be inserted if required.
The script will create a CSV file in which every cell value is enclosed between double quotes.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
+++++++
Yvan KOENIG (Vallauris FRANCE)
21 juillet 2009
property curlyOpen : "‘" (* the 'smart' single opening quote used by Numbers *)
property curlyClose : "’" (* the 'smart' single closing quote used by Numbers *)
property doubleQuotesRequired : false
(* true = enclose every value with double quotes
false = doesn't enclose every value with double quotes *)
on run
try
set enTexte to the clipboard as text
set fName to (do shell script "date " & quote & "+_%Y%m%d-%H%M%S" & quote) & "." & "csv"
set p2d to path to desktop
tell application "System Events" to make new file at end of p2d with properties {name:fName}
set enListe to paragraphs of enTexte
repeat with r from 1 to count of enListe
set rowR to item r of enListe
set listeR to my decoupe(rowR, tab)
repeat with c from 1 to count of listeR
set itmRC to item c of listeR
if itmRC ends with curlyClose then set itmRC to (text 1 thru -2 of itmRC) & "'"
if itmRC starts with curlyOpen then set itmRC to "'" & (text 2 thru -1 of itmRC)
if (itmRC ends with "'") and itmRC does not start with "'" then set itmRC to ("'" & itmRC)
set item c of listeR to itmRC
end repeat
set item r of enListe to my recolle(listeR, tab)
end repeat
if doubleQuotesRequired then
set enTexte to my recolle(enListe, quote & return & quote)
set enTexte to my remplace(enTexte, tab, quote & "," & quote)
if enTexte does not start with quote then set enTexte to quote & enTexte
if enTexte does not end with quote then set enTexte to enTexte & quote
else
set enTexte to my recolle(enListe, return)
set enTexte to my remplace(enTexte, tab, ",")
end if
write enTexte to file ((p2d as text) & fName)
on error
if my parleAnglais() then
error "The clipboard doesn’t contain text data. Maybe you selected a Numbers sheet !"
else
error "Le presse-papiers ne contient pas de données texte. Vous avez peut-être copié une feuille de Numbers !"
end if
end try
end run
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on recolle(l, d)
local t
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to ""
return t
end recolle
--=====
replaces every occurences of d1 by d2 in the text t
on remplace(t, d1, d2)
local l
set AppleScript's text item delimiters to d1
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to ""
return t
end remplace
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE mardi 21 juillet 2009 18:12:43)

Similar Messages

  • CSV conversion problems in File adapter

    Hi,
    Hi,
    We had a problem with CSV conversions in file adapter.Our scenario is: IDOC>Xi>FTP(csv)
    Our target file should be show as when I open in notepad:
    "Active","1234","fdsfs","fsdfsdfs"
    "","","fsdfda"","Fsdfsfsdfsdf""12202003"
    Is this possible for put  "Double quotes" for each and every field.
    currently my conversion  file is coming like this:
    Active,1234,fdsfs,fsdfsdfs
    ,,fsdfda,Fsdfsfsdfsdf,12202003
    when I open this file in excel ..some fields data occupying next or before cells...it means mismatching the data between cells.
    probably if I put "double quotes" for each and every field then i could aviod this mismatch data presentation in different cells in excel?
    Thanks,
    PILearn

    Hi,
    When you try to open such files in Excel...if there is no space between two field even it is comma....it will take it as whole string...
    if you have fixed length...excel gives you the option either with delimiters or with fixed lengths.
    Regards.
    Akshay.
    Reward points if find useful.

  • To CSV conversion problem

    hi all,
    could you fix this problem in the File Adapter :-
    Initialization error: Conversion initialization failed with java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
    Parameter '.fieldFixedLengths' or '.fieldSeparator' is missing
    while trying to write XML to a CSV file.
    i've configured the FCC as:
    Structure = structs ( with 6 columns)
    struct.fieldFixedLengths 20,10,10,10,10,10
    struct.fieldSeparator ,
    struct.endSeparator 'nl'
      thanks in advance
    nikhil
    null

    I think the problem is a spelling error: you named your structure "structs" and then you refer to it as "struct".
    You have to choose one between the two (or a better one if you can find it).
    About File content conversion I suggest you to see the following links:
    Content Conversion (Pattern/Random content in input file)
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    File Content Conversion for Unequal Number of Columns
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    How to send a flat file with fixed lengths to XI 3.0 using a Central File Adapter
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    Content Conversion ( The Key Field Problem )
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    Solution to the problem encountered using Variable Substitution with XI-SP12
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    I hope this will be helpfull.
    Regards,
    Salvatore

  • Conversion problem in PURCHASE ORDER

    Hi all,
       wrong conversion was done in Quantities/Weights tab of item overview during creation of Purchase Order,instead of putting order unit  " 1 tonne  = 1000kg" it was wrongly fix as "5 tonne = 4536kg",  the order has been receive and issue , but during stock taking this conversion problem is giving wrong Quantity for the material in MB5B . Pls what can i do to resolve this.

    Hi
    If stock exists  then kindly do the reverse process as below
    1.Cancel material docuemt---MBST (Material document no and fiscial year)
    2.Delete the P.O line items --Me22n
    3.Enter the fresh line items in the same P.O
    If partial stock Exists then do the Physical inventory process to adjust the Stock
    Regards
    Damu

  • How to debug file content conversion problems?

    Hi,
    I'm trying to debug a file content conversion problem.  I'm mapping a few nodes in an IDOC to a file of fixed length fields.  I'm using the "<Node A>.fieldFixedLengths", "<Node B>.fieldFixedLengths", "<Node C>.fieldFixedLengths", etc. parameters to specify the fixed length records.
    However, a certain node (for e.g. Node B) is causing a problem and if it is present in the IDOC, the output file does not get created.  Upon checking the XI monitor, I notice that the file gets mapped correctly and thus the problem lies when the file adapter does the file content conversion.  How do I debug this because there is no descriptive error in the XI log?  If this node is not present, the file gets generated fine.
    Thanks,
    Basant Gupta

    Hi,
    If your SXMB_MONI shows, success status, then go to RWB->Message Monitoring->Message display tool and then check Audit log for the analysis,
    So it wil help you debug the situation.
    If there is no error, then check RWB->Component Monitoring->Adapter Monitoring for you file communciation channel..
    /people/michal.krawczyk2/blog/2005/01/02/simple-adapter-and-message-monitoring
    Regards,
    Moorthy

  • Oracle to Mysql character set conversion problem!!! PLZ IGNORE

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    I have another post in Heterogeneous Connectivity forum
    Re: Oracle to Mysql character set conversion problem!!! PLZ HELP
    Kindly update your comments there,
    @@@@@@@@@@@@@@2
    Appreciate your help,
    regards
    Edited by: user10243788 on Apr 21, 2010 3:25 AM

    It is OK to post a globalization-related question in this forum in addition to the forum pertaining to the main technology. Not all experts follow all possible forums on OTN. Of course, you should cross-link the posts to let people merge the answers.
    Regarding the problem itself, make sure that SQL*Plus has the right NLS_LANG setting in the environment. On Windows, in the Command Prompt:
    C:\> set NLS_LANG=.WE8PC850
    C:\> sqlplus ...On Unix:
    $ setenv NLS_LANG .WE8ISO8859P1   (or NLS_LANG=.WE8ISO8859P1; export NLS_LANG)
    $ sqlplus ...-- Sergiusz

  • Codepage conversion problem

    Hello,
      In a DB to DB scenario, I am getting this error "Error: Unexpected error converting database resultset to XML, codepage conversion problem?" on the side of the sender adapter. I am not able to see any messages or trace in IE-Monitoring. Is there any log wherein I can find out the problem as to where it is occuring?
    Regards,
    Sanjay

    Hi Sanjay,
    The JDBC sender adapter returns the rows selected from the database in the follwoing format.
    <resultset>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    </resultset>
    This error occurs , when the source datatype you have created for the JDBC adapter does not match with this format. I would suggest that you check the source format along with the occurence of your field.
    Regards,
    Bhavesh

  • Raw conversion problem

    I have Photoshop Elements 6 (Camera Raw 4.2) and a Nikon D7000 (Camera Raw 6.3 minimum).  I am using DNG converter 8.1 to create DNG files, but these still will not open in Elements.  I am selecting compatibility of Camera Raw 4.1 in the conversion program.  What else can I do?

    Sorry it took me a long time to reply.  If I send to dropbox (which I can), can I restrict the images to specific email addresses, or will it be accessible to anyone?  Not that I care about the image particularly, as it was only a test.
    Once I have an idea of this, I will do a final test & send the data to dropbox.
    Date: Wed, 19 Mar 2014 15:12:51 -0700
    From: [email protected]
    To: [email protected]
    Subject: Raw conversion problem
        Re: Raw conversion problem
        created by ssprengel in Photoshop Elements - View the full discussion
    It seems like you're doing everything that you're supposed to be doing, and it is not working.  I don't have an explanation why that is, but can you share an original NEF and its DNG via www.dropbox.com or similar and others can test with a newer version of ACR to make sure there isn't something corrupted wtih the files.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6225513#6225513
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6225513#6225513
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6225513#6225513. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Photoshop Elements at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Journals conversion problem.

    Hello,
    We have a currency conversion problem with the journals table.
    Steps:
    1.- We insert a journal in Local Currency (LC) with the journals functionality. Both convert at average rate (for example), so when we run currency conversion rules the value is converted in Legalapp application, but not in Journal Table. So if the users or auditors need to see all the journals in EUR is not possible to extract with the journals reports.
    2.- Also we have the problem when we apply the carry forward rules for the next year, and the RE-Open functionality. Example, the flow of the year N applies at average rate, when we make the carry forward rule it goes to Opening Balance flow, and this opening balance doesn´t have currency conversion rule (AS-IS)(we cannot use an OPEAVG rule because we need the historical value in the opening balance flow). So we lose the EUR position value because we don´t have a journal to apply the RE-OPEN functionality.
    3.- We have the possibility of inserting the Journal in LC and EUR (Group Currency) also, but here you are obligating to the users to manually convert the values of each account of each journal, and can be mistakes of the value that the user insert in the Journal Entry, with the values of the application (converted with the currency conversion functionality).
    Do you know how can we solve this error?
    Regards,

    Hi,
    1. Journal tables contains just values for LC and only the posted journals are converted.
    The Corrency conversion will be applied just for journal posted not for all journals.
    You can see the value reflected into application just checking the the reports for special Data Source used by journal.
    Journal module is used for adjustment which means the auditors can see the adjustment into local cuurency and just the final value posted. The rest of journal not posted has no importance because they don't have any impact for database values.
    2. I don't think I understand the point which means I will leave other people to help ou with this poin
    3. I don't understand why you have to run Currency Conversion manually.
    When you input the journal you will execute default logic or you can execute journal.lgx logic.
    In any of these module if you place currency translation you will have your figures automat converted.
    Regards
    Sorin Radulescu
    Edited by: Sorin Radulescu on Dec 2, 2009 3:35 PM

  • Dreamweaver cc html entity conversion problem in mac -NO utf-8 related answer please

    I probably am fighting against a bug existing in DW for a while, and i'm really on the edge of bursting out! 
    Here are the specifications:
    Dreamweaver CC from creative cloud (also tested w/ CS5.5 too) installed on mac, OS and DW user interfaces are english, and on mac turkish keyboard layout is also installed.
    I have been using DW for maybe 15 years, since it was macromedia.. But was always on windows. This is the first time I use it on mac. Here is my problem step by step:
    1- Dreamweaver > Pereferences > New Document > Default Encoding: Western (ISO Latin 1) (NOT UTF-8 PLEASE, IT KEEPS THE CHARS UNCHANGED, ISO LATIN1 IS IMPORTANT)
    2- Go to Design View,
    3- There are 6 special characters in Turkish (times 2 for the caps versions of course), type:
    ĞÜŞİÖÇğüşıöç
    4- Go back to code view, what i should have seen was:
    &#286;&Uuml;&#350;&#304;&Ouml;&Ccedil;&#287;&uuml;&#351;&#305;&ouml;&ccedil;
    But I see:
    Ğ&Uuml;Şİ&Ouml;&Ccedil;ğ&uuml;şı&ouml;&ccedil;
    There are 3 chars (and capital versions) NOT converted to html entity at all. Which were: ĞŞİğşı
    But I should have seen them as: &#286;&#350;&#304;&#287;&#351;&#305;
    Any help would be appreciated, I do not want to leave my old friend DW just because of a weird conversion problem...

    Ok, when you look at the code view, what do you see exactly?
    do you see unconverted
    ĞÜŞİÖÇğüşıöç
    or converted
    &#286;&Uuml;&#350;&#304;&Ouml;&Ccedil;&#287;&uuml;&#351;&#305;&ouml;&ccedil;
    Here is one of my reasons:
    I sometimes create newsletters in turkish for my customers, and the html files i prepare are sent to customers attached as inline through various versions of outlook or thunderbird, or through i completely different email sender company (none is sent by me, i only create the html file). And most of the time the headers and some coding are cut off from the code when used to send as newsletter, and i have no control at all on it. so i have to create absolute correct viewed/rendered html files since i have no control at all on which sending method will be used or which os or browser or mail system will be used to open it...

  • PDF Conversion problem

    Hi ABAPers
    While sending smartform as a mail attachment(PDF Format) i am facing problem.
    While opening the PDF attachment in SOST (T-code), It shows a error pop up.(I.e., Conversion Problem in PDF). Some pages are getting opened as a blank page and some are not getting opened.
    What may be the prolem.
    Please help Me out ............
    But it works properly in IDES version.
    In IDES i have ADOBE 5.0 Version, In Live server it is ADOBE 6.0 ,7.0.

    Hi,
    Thanks for your feedback
    There is no problem in the coding , is there any thing we have to do in configuration level regarding PDF ?????
    *& Report  ZVNPAML
    REPORT  zvnpaml.
    TABLES: somlrec90.
    DATA: it_zvnpa  TYPE TABLE OF zvnpa,
          it_zvnpa1 TYPE TABLE OF zvnpa,
          wa_zvnpa  TYPE zvnpa,
          it_head   TYPE TABLE OF zvnpa,
          it_head1  TYPE TABLE OF zvnpa,
          wa_head   TYPE zvnpa,
          wa_head1  TYPE zvnpa,
          fmname    TYPE rs38l_fnam,
          tot       TYPE zvnpa-wrshb,
          otfout    TYPE ssfcrescl,
         outopt   type SSFCRESOP,
          pdftab    TYPE TABLE OF tline WITH HEADER LINE,
          datab     TYPE TABLE OF itcoo WITH HEADER LINE,
          conpar    TYPE ssfctrlop,
          mailrec   TYPE swotobjid,
          outopt    TYPE ssfcompop,
          jobopt    TYPE ssfcresop,
          jobout    TYPE ssfcrescl,
          w_return  TYPE ssfcrescl,
          it_otf    TYPE itcoo OCCURS 0 WITH HEADER LINE,
          binsz     LIKE sood-objlen,
          i_tline   TYPE TABLE OF tline WITH HEADER LINE,
          wa_buffer TYPE string,"To convert from 132 to 255
          i_record  LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA: wa_doc_data   TYPE sodocchgi1,
          it_pack       TYPE TABLE OF sopcklsti1,
          wa_pack       TYPE sopcklsti1,
          it_mailhead   TYPE TABLE OF solisti1,   " OCCURS 1 WITH HEADER LINE,
          wa_mailhead   TYPE solisti1,
          it_mailbody   TYPE TABLE OF solisti1,      "  OCCURS 0 WITH HEADER LINE,
          wa_mailbody   TYPE solisti1,
          it_receiverid TYPE TABLE OF somlrec90,  " OCCURS 10 WITH HEADER LINE.
          wa_receiverid TYPE somlrec90,
          it_attach     LIKE solisti1 OCCURS 0 WITH HEADER LINE,
         wa_attach     TYPE solisti1,
          lncnt         TYPE i.
    DATA: lv_spool TYPE tsp01-rqident,
          wa_line  TYPE tsp01-rqident,
          it_pdf_output TYPE TABLE OF tline.
    SELECTION-SCREEN BEGIN OF BLOCK vendor WITH FRAME TITLE text-w03.
    *PARAMETERS: pa_lifnr TYPE lfa1-lifnr,
               pa_bukrs TYPE zvnpa-bukrs,
    PARAMETERS:     pa_augdt TYPE zvnpa-augdt.
    SELECT-OPTIONS: pa_mail FOR somlrec90-receiver NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK vendor.
    SELECT * FROM zvnpa INTO CORRESPONDING FIELDS OF TABLE it_zvnpa1
                        WHERE augdt =  pa_augdt
                        AND   bukrs =  '2000'
                        AND   flag  <> 'X'.
                                                 konto = pa_lifnr AND
                                                 bukrs = pa_bukrs AND
    IF it_zvnpa1 IS NOT INITIAL.
      SORT it_zvnpa1 BY konto.
      LOOP AT it_zvnpa1 INTO wa_zvnpa.
        APPEND wa_zvnpa TO it_zvnpa.
        CLEAR: wa_zvnpa.
        AT END OF konto.
          SORT it_zvnpa BY ttref augbl wrshb shkzg.
    *it_head[] = it_zvnpa[].
          LOOP AT it_zvnpa INTO wa_zvnpa WHERE shkzg = 'S'.
            APPEND wa_zvnpa TO it_head1.
            CLEAR: wa_zvnpa.
          ENDLOOP.
    *delete adjacent duplicates from it_head comparing ttref.
          SORT it_head1 BY ttref augbl wrshb shkzg.
           LOOP AT it_head1 INTO wa_head1.
            tot = tot + wa_head1-wrshb.
            wa_head = wa_head1.
            AT END OF ttref.
              wa_head-wrshb = tot.
              APPEND wa_head TO it_head.
              CLEAR: wa_head,tot.
            ENDAT.
            CLEAR: wa_head1.
          ENDLOOP.
          SORT it_head BY ttref augbl wrshb shkzg.
          CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
              formname = 'ZVNPASF'
            IMPORTING
              fm_name  = fmname.
          conpar-no_dialog = 'X'.
          conpar-getotf    = 'X'.
          outopt-tddest    = 'LOCL'.
          outopt-urlcall   = fmname.
          outopt-tdnoprev  = 'X'.
         outopt-tdnewid   = 'X'.
          CALL FUNCTION fmname
           EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
              control_parameters         = conpar
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
              output_options             = outopt
              user_settings              = ' '
            IMPORTING
      DOCUMENT_OUTPUT_INFO       =
              job_output_info            = w_return
      JOB_OUTPUT_OPTIONS         =
            TABLES
              it_zvnpa                   = it_zvnpa
              it_head                    = it_head.
         READ TABLE w_return-spoolids INTO wa_line INDEX 1.
         IF sy-subrc = 0.
           lv_spool = wa_line.
           CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
             EXPORTING
               src_spoolid              = lv_spool
               no_dialog                = ' '
               dst_device               = 'LOCL'
             TABLES
               pdf                      = it_pdf_output
             EXCEPTIONS
               err_no_otf_spooljob      = 1
               err_no_spooljob          = 2
               err_no_permission        = 3
               err_conv_not_possible    = 4
               err_bad_dstdevice        = 5
               user_cancelled           = 6
               err_spoolerror           = 7
               err_temseerror           = 8
               err_btcjob_open_failed   = 9
               err_btcjob_submit_failed = 10
               err_btcjob_close_failed  = 11.
          it_otf[] = w_return-otfdata[].
          IF it_otf[] IS NOT INITIAL.
            CALL FUNCTION 'CONVERT_OTF'
              EXPORTING
                format        = 'PDF'
                max_linewidth = 132
              IMPORTING
                bin_filesize  = binsz
              TABLES
                otf           = it_otf
                lines         = i_tline.
            LOOP AT i_tline.
              TRANSLATE i_tline USING ' ~'.
              CONCATENATE wa_buffer i_tline INTO wa_buffer.
            ENDLOOP.
            TRANSLATE wa_buffer USING '~ '.
            DO.
              i_record = wa_buffer.
              APPEND i_record.
              SHIFT wa_buffer LEFT BY 255 PLACES.
              IF wa_buffer IS INITIAL.
                EXIT.
              ENDIF.
            ENDDO.
          ENDIF.
          IF i_record[] IS NOT INITIAL.
            it_attach[] = i_record[].
           CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
            EXPORTING
              LINE_WIDTH_SRC                    = '132'
              LINE_WIDTH_DST                    = '255'
              TRANSFER_BIN                      = ' '
             TABLES
               content_in                        = i_tline[]
               content_out                       = IT_ATTACH[]
            EXCEPTIONS
              ERR_LINE_WIDTH_SRC_TOO_LONG       = 1
              ERR_LINE_WIDTH_DST_TOO_LONG       = 2
              ERR_CONV_FAILED                   = 3
              OTHERS                            = 4
           IF sy-subrc <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.
           it_attach[] = w_return-otfdata[].
           IF it_pdf_output[] IS NOT INITIAL.
             it_attach[] = it_pdf_output[].
            wa_mailbody-line = 'Dear Sir / Madam,'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Please be informed that we have remitted the payment towards your outstanding bills as per the attachment:'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = ' '.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = ' '.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Best Regards,'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Mary. G '.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Finance department'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Intimate Fashions (I) Pvt Ltd'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = ' '.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'Please do not print this email unless it is absolutely necessary.  Become environment friendly.'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'E-MAIL DISCLAIMER.'.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'If you are not the addressee of this mail, please delete this. Intimate Fashions does not accept any liability on the improper usage of this mail. It may also be legally '.
            APPEND wa_mailbody TO it_mailbody.
            wa_mailbody-line = 'privileged. Internet communications cannot be guaranteed to be timely, secure or virus free'.
            APPEND wa_mailbody TO it_mailbody.
            DESCRIBE  TABLE it_mailbody LINES lncnt.
            wa_doc_data-obj_descr  = 'Remittance details - Brunet'.
            wa_doc_data-expiry_dat = sy-datum + 10.
            wa_doc_data-obj_name   = 'TRIAL'.
            wa_doc_data-sensitivty = 'F'.
            wa_doc_data-doc_size   = lncnt * 255.
            CLEAR wa_pack.
            CLEAR wa_pack-transf_bin.
            wa_pack-doc_type   = 'RAW'.
             wa_pack-transf_bin = ' '.
            wa_pack-head_start = 1.
            wa_pack-head_num   = 0.
            wa_pack-body_start = 1.
            wa_pack-body_num   = lncnt.
             wa_pack-doc_size   = lncnt * 255.
            APPEND wa_pack TO it_pack.
            CLEAR: lncnt,wa_pack.
            DESCRIBE  TABLE it_attach LINES lncnt.
            wa_pack-transf_bin = 'X'.
            wa_pack-head_start = 1.
            wa_pack-head_num   = 1.
            wa_pack-body_start = 1.
            wa_pack-body_num   = lncnt.
            wa_pack-doc_type   = 'PDF'.
            wa_pack-obj_name   = 'VNPA'.
            CONCATENATE 'Vendor Payment Advice' '.PDF' INTO wa_pack-obj_descr.
             wa_pack-obj_descr  = 'Vendor Payment Advice'.
            READ TABLE it_attach INDEX lncnt.      "INTO WA_ATTACH
             wa_pack-doc_size   = ( lncnt - 1 ) * 255 + STRLEN( it_attach ).
            wa_pack-doc_size   = lncnt * 255.
            APPEND wa_pack TO it_pack.
            CLEAR: lncnt,wa_pack.
            wa_mailhead = 'Vendor Payment Advice'.
            APPEND wa_mailhead TO it_mailhead.
            CLEAR: wa_mailhead.
            LOOP AT pa_mail.
              wa_receiverid-receiver = pa_mail-low.
              wa_receiverid-rec_type = 'U'.
              APPEND wa_receiverid TO it_receiverid.
              CLEAR:wa_receiverid.
            ENDLOOP.
           wa_receiverid-receiver = 'xxxxx'.    "(I have given mail id here )
           wa_receiverid-rec_type = 'U'.
           APPEND wa_receiverid TO it_receiverid.
           wa_receiverid-receiver = 'xxxxx'.    "(I have given mail id here )
           wa_receiverid-rec_type = 'U'.
           APPEND wa_receiverid TO it_receiverid.
           wa_receiverid-receiver = 'xxxxx'.    "(I have given mail id here )
           wa_receiverid-rec_type = 'U'.
           APPEND wa_receiverid TO it_receiverid.
           CLEAR:wa_receiverid,lncnt.
            CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
              EXPORTING
                document_data                    = wa_doc_data
                put_in_outbox                    = 'X'
                commit_work                      = 'X'
           IMPORTING
              SENT_TO_ALL                      =
              NEW_OBJECT_ID                    =
              TABLES
                packing_list                     = it_pack
                object_header                    = it_mailhead
                contents_bin                     = it_attach[]
                contents_txt                     = it_mailbody
                 CONTENTS_HEX                     = it_attach
              OBJECT_PARA                      =
              OBJECT_PARB                      =
                receivers                        = it_receiverid
             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.
              LOOP AT it_zvnpa INTO wa_zvnpa.
                wa_zvnpa-flag = 'X'.
                MODIFY it_zvnpa FROM wa_zvnpa TRANSPORTING flag.
              ENDLOOP.
              MODIFY zvnpa FROM TABLE it_zvnpa.
            ENDIF.
          ENDIF.
          CLEAR: wa_zvnpa,it_zvnpa,it_otf,it_otf[],w_return,lncnt,
                 wa_doc_data,
                 wa_head,it_head,it_head1,
                 i_record,i_record[],
                 i_tline,i_tline[],
                 it_pack,
                 wa_pack,
                 it_mailhead,
                 wa_mailhead,
                 it_mailbody,
                 wa_mailbody,
                 it_receiverid,
                 wa_receiverid,
                 it_attach.
        ENDAT.
      ENDLOOP.
    ENDIF.

  • File adapter:  Receiver File Content Conversion problem.. XML to CSV..!!

    Hi,
    I am facing some problem in FCC for Receiver adapter. It has to convert from XML to CSV File.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:PaymentFull_Target xmlns:ns0="http://sdn.com/Payment">
    - <RECORDSET>
    - <Header>
      <LineItem>1</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    - <Header>
      <LineItem>2</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    - <Header>
      <LineItem>3</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    </RECORDSET>
    </ns0:PaymentFull_Target>
    Output File is coming only with lineitem values , remaining fields are not coming.
    *1,2,3*
    FCC Used...
    RecordSet Structure -- Header
    Header.fieldNames -
    LineItem,SaleNumber,TransNumber,Store,variant,TransType,Adjustm_Type
    Header.fieldSeparator-----   ,
    Header.endSeparator-----    'nl'
    Did I miss anything.. any idea whats going wrong?
    Thanks
    Deepthi

    Hi Deepthi,
    Mention the occurrence of header in Recordset
    You specify like this:
    Recordset: Header, *
    Header.fieldSeparator : u2018Field Separatoru2019
    -->For FCC on Receiver side you donu2019t have to mention the field names.
    -->The u2018endSeparatoru2019 parameter needs to given for substructure only
    Check this links:
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    Rgds,
    Akhila

  • File adaptor Content conversion problem

    Hi all,
    I have a client proxy > pi> CSV file scenario which im working on currently - everything is fine apart from 1 really annoying thing.
    The problem is this that when data is extracted from SAP it should put in 6 fields within the file produced e.g:
    field1,field2,field3,field4,field5,field6
    Which is fine however if one of the fields is blank there should still be the blank space which should appear instead of what it is curently doing which is ignoring the blank and shifting everything else left by 1 so:
    if out of 6 fields only 5 come out currently its doing this:
    field1,field2,field4,field5,field6      (Notice field3 is missing and there is no blank space in its place)
    What it should be doing is this:
    field1,field2,,field4,field5,field6       (Notice the blank space)
    I have gone through all the content conversion parameters I know for receiver file adaptors none have worked so if you know any which will do this please let me know!!
    Also if you know of other ways your ideas will be greatly appreciated.
    Many thanks in advance
    Edited by: Saqib Karim on Mar 5, 2009 5:45 PM

    >
    Saqib Karim wrote:
    > Hi Chirag,
    >
    > Does this mean that there is nothing in the file adaptor to cater for this and the only way is through mapping?
    >
    > I was hoping for an easier more straight forward solution along the lines of content conversion since this means that it has to apply to ALL FIELDS in the mapping!!??
    >
    > Thanks
    you solution is to alter the mapping in a simple way.
    If you are using graphical mapping then use this logic;
    Source field -> if EXISTS -> Target
                          else -> Pass an empty constant -> Target
    This will make sure an empty tag is created a the target and FCC will work fine.

  • Output CSV file problem

    Hi Guru,
    I encounted 1 problem where my output csv file content incorrect. Source is from SAP Proxy.
    Example my csv file should have Material code, material description and date. However when i open the csv file, it is only have material code in one line and the rest of fields are not display in the csv file.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_PRD_MASTER_SND xmlns:ns0="http://com.starhub/sapprdcat">
       <RECORDSET>    1:1
          <RECORD>       1:unbounded
             <MATNR/>
             <MAKTX/>
             <DATE_ADD/>
          </RECORD>
       </RECORDSET>
    </ns0:MT_PRD_MASTER_SND>
    My source and target are same.
    CC Receiver setting:
    Transport Protocal : File System NFS
    Message Protocal : File Content Conversion
    Adapter Engine : Integration Server
    Recordset Structure : RECORD
    RECORD.fiedlNames : MATNR,MAKTX,DATE_ADD
    RECORD.endSeparator :  'nl'
    RECORD.fieldSeparator : ,
    RECORD.processFieldNames: fromConfiguration
    RECORD.addHeaderLine: 0
    The INCORRECT result only display MATNR in one line only.
    HNOK0000102     HNOK0000108     C032S31384A     C032S3XDATA     CFGSC300300     CRAWC300001
    Expected Result should be :
    HNOK0000102,Material test 1,01/01/2007
    HNOK0000108,Material test 2,01/02/2007
    C032S31384A,Material test 3,01/01/2007
    C032S3XDATA,Material test 4,01/01/2007
    CFGSC300300,Material test 5,01/01/2007
    CRAWC300001,Material test 6,01/01/2007
    Thank you very much for help.
    Regards,

    hi,
    check this parameter:
    Recordset Structure : RECORD  [wrong]
    Recordset Structure : RECORDSET,RECORD [right]
    and the other parameters will be like this:
    RECORD.fiedlNames : MATNR,MAKTX,DATE_ADD
    RECORD.endSeparator : 'nl'
    RECORD.fieldSeparator : ,
    RECORD.processFieldNames: fromConfiguration
    RECORD.addHeaderLine: 0
    <b>RECORDSET.fieldSeparator: 'nl'</b>
    Sachin
    Message was edited by:
            Sachin Dhingra

  • Import CSV conversations into Whatsapp

    Is there any app that will import conversations from a CSV file, into Whatsapp?
    Thanks for helping

    Hi
    yes you could use powershell to do it
    http://www.sharepointdiary.com/2013/04/import-from-csv-file-to-sharepoint-list-using-powershell.html
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

Maybe you are looking for

  • How to perform an activity from an external link using PAPI?

    Hi, The question is: I've got an external web application that lists all the instances of a user's inbox. On every item of the list, I've got a hyperlink. Through this link, I just want to perform the very interactive activity this instance requires.

  • Reference-Problem in RFC-Function Module

    Hello, I am new to ABAP. As an introduction I read the book "ABAP Objects" from SAP Press. I need a web service which returns a before uncertain number of objects. First I have written a class representing my object. Then I added a new table type to

  • FRM-40735 when Button Pressed Trigger Raised Unhandled Exception ORA-03113

    Hi all, We are using oracle 9.2.0.4 on SUSE 10.When user try to insert record second time they are getting the error FRM-40735 when Button Pressed Trigger Raised Unhandled Exception ORA-03113And we are also getting ORa-0600 [12333]-[253]-[1]-[253] Pl

  • Syncing with gCal but NOT Google Contacts

    Everything I've found so far offers instruction on how to sync all of your Google account with your iphone but I only want to sync my gCal. Can't figure it out. Is this possible?

  • InDesign CS3 installing problem

    Hi, I know this is an old version of ID but my son has to use it for his online summer school course and I'm having trouble installing it. I'm able to run setup but then nothing else happens. The only Icon that it gives me is Adobe Bridge CS3. I does