Renaming PDFs by first line in pdftotext output

Dear Arch community,
I would like to rename PDFs with cryptic names into their titles, which are in the first line of the files
pdftotext sw-b-13-0094.pdf
head -n 1 sw-b-13-0094.txt > title
mv sw-b-13-0094.pdf $(title)
But I can't figure out how to do this exactly.

You're just about there.  The problem is your second line creates a file called title, then the third line tries to execute that file to get the new name.  You could add "cat" to the third line as follows.  This should work, but it would not be my recommended approach:
pdftotext sw-b-13-0094.pdf
head -n 1 sw-b-13-0094.txt > title
mv sw-b-13-0094.pdf $(cat title)
Instead, it'd be much cleaner to just use a shell variable:
pdftotext sw-b-13-0094.pdf
title=$(head -n 1 sw-b-13-0094.txt)
mv sw-b-13-0094.pdf $title
But this can be further improved by not littering all these text files all over - instead use a pipeline rather than actually creating a txt file:
mv sw-b-13-0094.pdf "$(pdftotext sw-b-13-0094.pdf | head -n 1).pdf"
Now, hopefully it should be clear how you can even replace the current pdf filename (sw-b-13...) with a parameter ($1) for a script or shell function - or have this loop through all pdf files in a directory.  If you want help with that too, let us know.
EDIT: be careful to ensure that the first line of pdftotext actually has something meaningful.  If all the pdfs were created in the same way, this might be known.  But it is common for some whitespace or formatting character to be the first line.

Similar Messages

  • Total of numeric fields in the first line of ALV output

    Hi All,
    i have a problem it is like i have created ALV list display and total is dipalyed of numeric column  for each page. my requirement is total should be diaplyed at the end of page plus toal should be diaplyed on the first line of second page also .
    please suggest me some solution .
    thanks
    praveen

    Hi
    one thing you can do is capture the totals into variables and display then in each top-of-page except first page.
    it will work as SORT and all dont have effect on top-of-page data. If you append that to internal table once we hit SORT data will chnage and it will give errorneous effects.

  • Line art problem outputting to pdf

    I have a problem with exporting pages of a magazine going to print as pdf, relating to line art placed on the page as a bitmap tiff (typically at 1200 ppi). At present I have a workaround for an annoying problem that really needs clearing up ...
    I'm using CS4 InDesign and Acrobat (files prepared in Photoshop). So, high-res bitmap tiff containing line art sized (that is, just placed - no resizing in Indesign) and placed in Indesign, looks fine on the page. Output to pdf using 'export' and the resulting file, when viewed on screen, has a thin line down the right-hand edge of any and all bitmap files.
    To ensure no misunderstanding, the 'bitmap' reference is what Photoshop calls it - a bilevel file with black lines in it, which enables me easily to overlay other files such as a photo (because the file is black/transparent) and assign a colour or tint to the bitmap, or even a drop shadow etc. I've used this workflow for years, from Photoshop through Indesign, but the latter always gives me this line on the right edge, in the pdf. It did this in CS3 Indesign/Acrobat as well (but never in Pagemaker).
    My workaround is to lay a white-filled box over the edge of the file, thus masking it. But of course, that also limits me to where I can place the file - not easily on a graded tint background, not on a photo and so on. So I'd like to solve this.
    Any ideas? OS is Win XP Pro (all updates applied to this and the CS programs - I don't believe they make a difference to this problem, as it has existed through several iterations of both OS and CS).
    Anyone else seen this effect? Or is it just me? And has anyone a potential solution?
    Chris

    I think by reason of not knowing what else I can do, I'm heading to the same conclusion - put up with it! I'll certainly try sending a line to print and see if it appears, but for on-screen stuff, I think I have to stick with the safe workaround I use and accept the layout limitations. (Or resort to Pagemaker for the pages that I just cannot do otherwise.)
    Seems to me, if people have reported this for years, Adobe might have tried sorting it out. On screen or not, it still must be due to *something* in the file and/or Acrobat/Distiller to allow it to appear. If I create a white greyscale tiff with the same resolution etc, and place it on a page, there's no line down the edge on output - just a white page with a white (invisible) box. If I do this with an 'empty' bitmap file, a line appears ... Both files created in Adobe programs, so it's not me as a user ...
    Just me whinging! I'm really coming from the angle that if this is indeed a display problem, it can only be a display problem if there is something in the file for the display to react to (badly phrased that!).
    Thanks everyone for your support and ideas - I think that's me finished for now; I have files to upload and then sleep.

  • PDF showing only first line of Table?

    Hi @,
    I am showing an input table to PDF using adobe Int Form and in the Adobe screen it is displaying only the first line of the table.
    I am using CE 7.1 SR5.
    Regards

    Hi,
    When the XML interface is generated for the context, for every node that has cardinality 0..n or 1..n, a node named DATA is generated in the XML.
    So if your Webdynpro context has foll structure...
    Node1 ... 1..1
      Node2 ... 0..n
        Attrib1
        Attrib2
    The corresponding XML would be
    Node1
      Node2
        DATA
          Attrib1
          Attrib2
    Regards,
    Reema.

  • How do I set a PDF Export Preset to force a minimum line weight on output?

    How do I set a PDF Export Preset to force a minimum line weight on output?  I'm currently using one that came from a printer that works great - but I can't seem to find the option when creating one myself.  I have some placed Illustrator line art that is built with .25 line thickness and when I have it placed at 20% scale the lines are too thin to see in the PDF output.

    There is absolutely no way to force minimum line widths within InDesign itself, certainly not as part of the PDF export process!! And even one writes a script to go through every object within an InDesign document and both validate and fix line widths less than some particular threshold, such a script would be useless against placed artwork, the contents of which are not available for manual or programmatic inspection within InDesign.
    Note that one should be exceptionally careful in “fixing” hairlines, especially if you are placing vector artwork at very low magnification. It may actually be OK to let certain lines drop out. After a fixup on some content, you could end up with a messy mass of lines.
              - Dov

  • Trying to omit first line of CSV file (the header)

    Hello everybody,
    Newbie here havin a lil problem. I have this program below that reads in a CSV file. My test CSV file has the follow structure:
    ID, LastName, FirstName, Phone, Email,
    2345, Yez, Wei do, 456-789-0123, [email protected],
    2744, Avanto, Aldo, 562-593-6500, [email protected],
    1212, Dewy, Cheatem, 123-456-7890, [email protected],
    1234, No, Wei Foo, 123-456-7890, [email protected],
    The first line is my header. (here is the heart of my problem)
    I have the program reading in the file and the it sorts it. The problem i have is that the first line, my header gets sorted with everything else. Here is my feable attempt with resulting error:
    import java.io.*;
    import java.util.*;
    public class File2Array {
        public static void main(String[] args)
            File file = new File("person_test1.csv"); //File to read in
            ArrayList persons = (ArrayList) getPersons(file); //call to arraylist
            Collections.sort(persons);
            for (Iterator i = persons.iterator(); i.hasNext(); )
                System.out.println(i.next());
        public static List getPersons(File file)
    //NEW PIECE OF CODE        boolean first = true;
            ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                while (buf.ready()) {
                    String line = buf.readLine();
    //NEW PIECE OF CODE
         while( ( line = buf.readLine() ) != null )
              if( first )
                   first = false;    continue;
    //ORIGINAL IF
         //   if (!line.equals("") )
    //NEW IF
                    if (line != null && !line.equals("") )
    //END OF NEW CODE
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
            } catch (IOException ioe)
                System.err.println(ioe);
            return persons;
    class Person implements Comparable
        private String ID;
        private String LastName;
        private String FirstName;
        private String Phone;
        private String Email;
        public Person(
            String ID,
            String LastName,
            String FirstName,
            String Phone,
            String Email)
            if (FirstName==null || LastName==null)
                throw new NullPointerException();
            this.ID = ID;
            this.LastName = LastName;
            this.FirstName = FirstName;
            this.Phone = Phone;
            this.Email = Email;
        public String toString()
            StringBuffer sb = new StringBuffer ();
            sb.append( ID );
            sb.append(" ");
            sb.append( LastName );
            sb.append(" ");
            sb.append( FirstName );
            sb.append(" ");
            sb.append( Phone );
            sb.append(" ");
            sb.append( Email );
            sb.append(" ");
            return sb.toString();
        public boolean equals(Object o)
            if (!(o instanceof Person))
                return false;
            Person p = (Person)o;
            return p.FirstName.equals(FirstName) &&
                   p.LastName.equals(LastName);
        public int hashCode()
            return 31*FirstName.hashCode() + LastName.hashCode();
        public int compareTo(Object o)
            Person p = (Person)o;
            int lastCmp = LastName.compareTo(p.LastName);
            return (lastCmp!=0 ? lastCmp :
                    FirstName.compareTo(p.FirstName));
    this code compiles and runs but does not produce any output and I don't understand why.
    Question: What is the proper way to have the code omit the first line of a CSV file??
    By the way I do have another file called person.java that goes with this but I didn't think I had to post it.
    Also am I posting correctly? Am I putting in too much code??
    Than you!!

    Hot diggity! jverd,
    I got it to work!! here's what I did all thanks to you :-)
    ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                //read through file and populate array
                //while (buf.ready()) {
                    String firstline = buf.readLine();  //gets header, renamed line to firstline
                    String line;                  //added this line     
                    System.out.println(firstline);     //added this to print out firstline     
         //try this
              while( ( line = buf.readLine() ) != null )
              /*{                    //commented out this portion
              if( first )
                   first = false;    continue;
              //end try this                
                    //if (line != null && !line.equals("") )     //down to here
                    if (!line.equals("") )          //added this
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
                      }                       

  • Printing to Adobe - missing or wrong formatted first line

    I open a PDF file. Then I select a part of the content that I want to print into another PDF.
    I choose Adobe PDF print.
    When the result show up, I see only half of the first line. And sometimes even half of the last line.
    We are using Windows 7 and acrobat pro 9.
    Anyone has an idea what's going wrong?
    Thanks in advance
    Greetings
    Lainkes

    Hi Lainkes,
    How are you printing the selected part of the PDF content?
    I tried by selecting an area using "Snapshot Tool" and then File-->Print. From the "Print" dialog box, selected the "Selected Graphic" radio button.
    The output was as desired.
    Are your steps different than mentioned above? Does your PDF contains Text or Images or Both?
    Regards,
    Shashi

  • ALV-Need to display total in top/first line!!!

    Hi,
      i have 3 numerical fields in my ALV output. I need to display the total in top/first line in output and download the same in excel into local system.if possible send me the sample code to how to do it.
    Regards,
    Nandha.

    TABLES : BSEG , BKPF.
    TABLES: SSCRFIELDS.
    TABLES: ITCPO.
    DATA :FLAG TYPE I, MAINTAIN TYPE I,
          FLAG1 TYPE I,
          FLAG2 TYPE I,
          FLAG3 TYPE I.
    DATA :BEGIN OF ITAB_BKPF OCCURS 0,
          BUKRS LIKE BKPF-BUKRS,
          GJAHR LIKE BKPF-GJAHR,
          BELNR LIKE BKPF-BELNR,
          BLART LIKE BKPF-BLART,
          BUDAT LIKE BKPF-BUDAT,
    END OF ITAB_BKPF.
    DATA :BEGIN OF ITAB_BSEG OCCURS 0,
          BUKRS LIKE BSEG-BUKRS,
          GJAHR LIKE BSEG-GJAHR,
          BELNR LIKE BSEG-BELNR,
          BUZEI LIKE BSEG-BUZEI,
          BSCHL LIKE BSEG-BSCHL,
          HKONT LIKE BSEG-HKONT,
          DMBTR LIKE BSEG-DMBTR,
          MWSKZ LIKE BSEG-MWSKZ,
          ZUONR LIKE BSEG-ZUONR,
          KOSTL LIKE BSEG-KOSTL,
          FISTL LIKE BSEG-FISTL,
          FIPOS LIKE BSEG-FIPOS,
          SGTXT LIKE BSEG-SGTXT,
    END OF ITAB_BSEG.
    DATA BEGIN OF ITAB_BKPF_BSEG OCCURS 0.
      INCLUDE STRUCTURE ZBKPF_BSEG.
    DATA END OF ITAB_BKPF_BSEG.
    *DATA ITAB_BKPF_BSEG LIKE TABLE OF ZITAB_BKPF_BSEG WITH HEADER LINE.
    DATA i_print LIKE TABLE OF ITCPO WITH HEADER LINE.
    TYPE-POOLS : SLIS , kkblo.
    DATA:TEXT2(30) VALUE 'Voucher Print',
         GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
         CT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
         IT_SORT TYPE SLIS_T_SORTINFO_ALV,
         WA_SORT TYPE SLIS_SORTINFO_ALV,
         WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
         WA_I_EVENT TYPE SLIS_ALV_EVENT,
         TEMP_CAT TYPE SLIS_FIELDCAT_ALV
    DATA : TEXT2538(16) VALUE 'Voucher Printing'.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_BUKRS LIKE BKPF-BUKRS OBLIGATORY.
    "Company code
    SELECT-OPTIONS : S_BELNR FOR BKPF-BELNR MODIF ID M01.
    "Accounting Doc No
    PARAMETERS: P_GJAHR LIKE BKPF-GJAHR MODIF ID M02.
    "Fiscal year
    SELECT-OPTIONS:  S_BLART FOR BKPF-BLART MODIF ID M03,
                                              "Document type
                     S_BUDAT FOR BKPF-BUDAT MODIF ID M04.
    "Posting date
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      IF S_BELNR IS NOT INITIAL.
        FLAG = 1.
      ENDIF.
      IF S_BLART IS NOT INITIAL.
        FLAG1 = 1.
      ENDIF.
      IF P_GJAHR IS NOT INITIAL.
        FLAG2 = 1.
      ENDIF.
      IF S_BUDAT IS NOT INITIAL.
        FLAG3 = 1.
      ENDIF.
      SELECT
          BUKRS
          GJAHR
          BELNR
        INTO CORRESPONDING FIELDS OF TABLE ITAB_BKPF
        FROM BKPF
        WHERE BUKRS EQ P_BUKRS
      IF SY-SUBRC NE 0.
        MESSAGE E000(ZPROJ).
      ENDIF.
      IF FLAG NE 0.
        DELETE ITAB_BKPF WHERE
        NOT ( BELNR IN S_BELNR AND GJAHR EQ P_GJAHR )
      ENDIF.
      IF FLAG1 NE 0.
        DELETE ITAB_BKPF WHERE
        NOT ( BLART IN S_BLART AND BUDAT IN S_BUDAT )
      ENDIF.
      IF FLAG2 NE 0.
        DELETE ITAB_BKPF WHERE
        NOT ( GJAHR EQ P_GJAHR )
      ENDIF.
      IF FLAG3 NE 0.
        DELETE ITAB_BKPF WHERE
        NOT ( BUDAT IN S_BUDAT )
      ENDIF.
      SELECT
            BUKRS
            GJAHR
            BELNR
            BUZEI
            BSCHL
            HKONT
            DMBTR
            MWSKZ
            ZUONR
            KOSTL
            FISTL
            FIPOS
            SGTXT
         FROM BSEG
         INTO TABLE ITAB_BSEG
         FOR ALL ENTRIES IN ITAB_BKPF
           WHERE
              BUKRS EQ P_BUKRS AND
              BELNR EQ ITAB_BKPF-BELNR AND
              GJAHR EQ ITAB_BKPF-GJAHR
      LOOP AT ITAB_BKPF.
        LOOP AT ITAB_BSEG WHERE BUKRS EQ ITAB_BKPF-BUKRS AND
                              BELNR EQ ITAB_BKPF-BELNR AND
                              GJAHR EQ ITAB_BKPF-GJAHR.
          MOVE-CORRESPONDING ITAB_BSEG TO ITAB_BKPF_BSEG.
    *    MOVE-CORRESPONDING ITAB_BKPF TO ITAB_BKPF_BSEG.
          APPEND ITAB_BKPF_BSEG.
        ENDLOOP.
      ENDLOOP.
    LOOP AT ITAB_BKPF_BSEG.
      ITAB_BKPF_BSEG-ZMENG = ITAB_BKPF_BSEG-DMBTR.
      MODIFY ITAB_BKPF_BSEG TRANSPORTING zmeng.
    ENDLOOP.
      PERFORM CHANGE_CATALOG.
      PERFORM ALV_DISPLAY.
    FORM CHANGE_CATALOG .
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'BUKRS'.
      TEMP_CAT-SELTEXT_L = 'Company Code'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 30.
      TEMP_CAT-HOTSPOT = 'X'.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'BELNR'.
      TEMP_CAT-SELTEXT_L = 'Document No.'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-HOTSPOT = 'X'.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'GJAHR'.
      TEMP_CAT-SELTEXT_L = 'Fiscal Year'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      TEMP_CAT-HOTSPOT = 'X'.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'BUZEI'.
      TEMP_CAT-SELTEXT_L = 'Item'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 5.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'BSCHL'.
      TEMP_CAT-SELTEXT_L = 'Posting Key'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'HKONT'.
      TEMP_CAT-SELTEXT_L = 'Account'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'DMBTR'.
      TEMP_CAT-SELTEXT_L = 'Amount'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      TEMP_CAT-DO_SUM = 'X'.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'MWSKZ'.
      TEMP_CAT-SELTEXT_L = 'Tax'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'ZUONR'.
      TEMP_CAT-SELTEXT_L = 'Assignment'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'KOSTL'.
      TEMP_CAT-SELTEXT_L = 'Cost Center'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'FISTL'.
      TEMP_CAT-SELTEXT_L = 'Fund Center'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'FIPOS'.
      TEMP_CAT-SELTEXT_L = 'Commitment Item'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      CLEAR TEMP_CAT.
      TEMP_CAT-FIELDNAME  = 'SGTXT'.
      TEMP_CAT-SELTEXT_L = 'Text'.
      TEMP_CAT-TABNAME = 'ITAB_BKPF_BSEG'.
      TEMP_CAT-DDICTXT = 'L'.
      TEMP_CAT-OUTPUTLEN = 15.
      APPEND TEMP_CAT TO CT_FIELDCAT.
      GS_LAYOUT-ZEBRA = 'X'.
    <b>GS_LAYOUT-TOTALS_BEFORE_ITEMS = 'X'.</b>
    data : text like slis_ev_subtotal_text value 'total'.
    gs_layout-subtotals_text = text.
    *gs_layout-totals_only = 'X'.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'BUKRS'.
      WA_SORT-SPOS      = 1.
      WA_SORT-UP = 'X'.
    *wa_sort-group = '*'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'BELNR'.
      WA_SORT-SPOS      = 2.
      WA_SORT-SUBTOT = 'X'.
      WA_SORT-UP = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'GJAHR'.
      WA_SORT-SPOS      = 3.
      WA_SORT-SUBTOT = 'X'.
      WA_SORT-UP = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'DMBTR'.
      WA_SORT-SPOS      = 4.
      APPEND WA_SORT TO IT_SORT.
      gs_layout-subtotals_text = 'total'.
    ENDFORM.
    FORM ALV_DISPLAY.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK              = ' '
    *   I_BYPASSING_BUFFER             =
    *   I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
    *   I_CALLBACK_PF_STATUS_SET       = ' '
        I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
    *   I_STRUCTURE_NAME               =
         IS_LAYOUT                      = GS_LAYOUT
         IT_FIELDCAT                    = CT_FIELDCAT
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
         IT_SORT                        = IT_SORT[]
    *   IT_FILTER                      =
    *   IS_SEL_HIDE                    =
    *   I_DEFAULT                      = 'X'
         I_SAVE                         = 'A'
    *   IS_VARIANT                     =
    *   IT_EVENTS                      =
    *   IT_EVENT_EXIT                  =
    *   IS_PRINT                       =
    *   IS_REPREP_ID                   =
    *   I_SCREEN_START_COLUMN          = 0
    *   I_SCREEN_START_LINE         0   = 0
    *   I_SCREEN_END_COLUMN            = 0
    *   I_SCREEN_END_LINE              = 0
    *   IR_SALV_LIST_ADAPTER           =
    *   IT_EXCEPT_QINFO                =
    *   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER        =
    *   ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = ITAB_BKPF_BSEG
    * EXCEPTIONS
    *   PROGRAM_ERROR                  = 1
    *   OTHERS                         = 2
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "ALV_DISPLAY
    *i_calLback_user_command = 'USER_COMMAND'.
    FORM USER_COMMAND
      USING UCOMM LIKE SY-UCOMM
      SELFIELD TYPE SLIS_SELFIELD.
      DATA wa LIKE LINE OF ITAB_BKPF_BSEG.
      DATA itab LIKE TABLE OF ITAB_BKPF_BSEG WITH HEADER LINE.
      READ TABLE ITAB_BKPF_BSEG index SELFIELD-TABINDEX INTO wa.
      APPEND ITAB_BKPF_BSEG TO ITAB.
        ENDLOOP.
    CALL FUNCTION '/1BCDWB/SF00000204'
    * EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         = i_ctrl
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             = i_print
    *   USER_SETTINGS              = 'X'
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
      TABLES
        ITAB_BKPF_BSEG             = ITAB
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    "user_command

  • Removing first line in text file... Memory and HD concern

    Hello all,
    I want to remove the first line of a text file. This is easy... One way
    to do it, is to find the first "end of line" caracter, strip the string
    and re-write the sting in file with the "strip to sreadsheet" VI.
    Since the file can be quite large (about 120000 lines), is this a good
    way to do it. Will it re-write all the line or just moving the "begin
    of file" pointer to the second line? If it re-write the whole file,
    this option is not very good since I could have to do this operation
    quite often. (I want the file to be a kind of circular buffer / backup).
    What do you think is the best way to do this?
    Thanks!
    Vincent

    I think you would have to read in all the data and write it to a new file, you could either keep the data in RAM or simply write to another file then delete the original, and then rename the temp one.  So obviously that is a lot of data and memory.
    My main question is are you trying to use a text file as a circular buffer?  If so can you tell us more about the data, ie is it strings of a constant length?  Does a user ever need to read the file or could we head binary?
    A solution would be to truly make the file a binary file, so you could actually seek through the file easier, and maybe make the first data chunk the location of the most recent write.  The obvious danger is then writing over existing data.  This solution is still risky because of the data writes.
    You may want to look at some of the other file formats like HWS which maintains a hierarchy of data for you so you can simply add and remove data from it.  However, a user will not be able to easily read it.

  • Email attachment with .txt file (first line blank in the file)

    Hi all ,
    Iam trying attach .txt file to email , the file that iam accessing from server  . But first line blank (extra) even though i dont have blank line in original file .Can any help me out to resolve this issue?
    <u>Example</u> original file
    12345     aa    pq
    <u>Email attachment file</u>
                                        -> This line
    12345     aa    pq
    This is my code:
    REPORT  ZTEST_FILE  .
    DATA:BEGIN OF t_upload occurs 0,
           matnr LIKE zwplcsmev-matnr,
           zwgehrrg LIKE zwplcsmev-zwgehrrg,
           zwgehrct LIKE zwplcsmev-zwgehrct,
           zwgbev LIKE   zwplcsmev-zwgbev,
           zwpldt LIKE zwplcsmev-zwpldt,
           zwacdt LIKE zwplcsmev-zwacdt,
         END OF t_upload.
    *DATA:  maildata type sodocchgi1.
    *DATA:  mailtxt type table of solisti1 with header line.
    *DATA:  mailrec type table of somlrec90 with header line.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:REC(80) TYPE C.
    DATA g_mask(20) TYPE c VALUE ',., ..'.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:P_ERROR(3).
    DATA:P_REFO(3).
    DATA:   gd_error TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1.
    selection-screen begin of block b1 with frame title text-001.
    parameters:p_file type localfile.
    parameter:p_email type ad_smtpadr.
    selection-screen end of block b1.
    --At Selection-Screen- -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'TB_LIMIT_WS_FILENAME_GET'
          EXPORTING
            def_filename     = p_file
            mask             = g_mask
         mode             = 'S'
            title            = 'INPUT FILE'
          IMPORTING
            filename         = p_file
          EXCEPTIONS
            selection_cancel = 1
            selection_error  = 2
            OTHERS           = 3.
      IF sy-subrc <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    START-OF-SELECTION.
      PERFORM process_file.
      if p_error = 'X' AND P_REFO <> 'X'.
      PERFORM populate_message_body.
      ENDIF.
      IF P_REFO = 'X' AND P_ERROR <> 'X'.
      it_message = 'Please find Attached file'.
      APPEND it_message.
      PERFORM send_attachment tables it_message
                                 it_attach
                          using  p_email
                         'Crest to Plc Data'
                                          'TXT'
                                          p_file
                                 changing gd_error
                                          gd_reciever.
      ENDIF.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
    PERFORM initiate_mail_execute_program.
    END-OF-SELECTION.
    *&      Form  process_file
          text
    FORM process_file.
    *CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                con_tab TYPE x VALUE '09'.   "OK for non Unicode
      DATA :l_path TYPE  string.
      l_path = p_file.
    CONSTANTS:  con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB
      con_cret type c value cl_abap_char_utilities=>newline.
    OPEN DATASET P_FILE  FOR INPUT IN TEXT MODE encoding default.
    if sy-subrc = 0.
    do.
    read dataset p_file into IT_ATTACH.
    IF SY-SUBRC  NE 0 .
    EXIT.
    ELSE.
    T_UPLOAD = IT_ATTACH.
    CONCATENATE con_cret it_attach  INTO it_attach .
    append it_attach.
    clear it_attach.
    P_REFO = 'X'.
    APPEND T_UPLOAD .
    clear t_upload.
    ENDIF.
    ENDDO.
    else.
    p_error = 'X'.
    ENDIF.
    ENDFORM.                    "process_file
    *&      Form  populate_message_body
          text
    FORM populate_message_body.
    w_doc_data-obj_name = 'TEST'.
      w_doc_data-obj_descr = 'Crest to Plc Data'.
      w_doc_data-obj_langu = sy-langu.
      it_message = 'File Not Found'.
      APPEND it_message.
    t_receivers-receiver = p_email.
      t_receivers-rec_type = 'U'.
      append t_receivers.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_data              = w_doc_data
                document_type              = 'RAW'
                put_in_outbox              = 'X'
           tables
                object_header              = it_message
                object_content             = it_message
                receivers                  = t_receivers
           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.
      commit work.
        SUBMIT rsconn01 USING SELECTION-SET 'SAP&CONNECTINT' AND RETURN.
      else.
        MESSAGE s027(vv) WITH 'E-mail not sent'.
      endif.
    ENDFORM.                    "populate_message_body
    *&      Form  send_attachment
          text
    FORM send_attachment tables pit_message
                                pit_attach
                         using  p_email
                                p_mtitle
                                p_format
                                p_filename
                                p_attdescription
                                p_sender_address
                                p_sender_addres_type
                       changing p_error
                                p_reciever.
      DATA:   ld_error    TYPE sy-subrc,
              ld_reciever TYPE sy-subrc,
              ld_mtitle LIKE sodocchgi1-obj_descr,
              ld_email LIKE  somlreci1-receiver,
              ld_format TYPE  so_obj_tp ,
              ld_attdescription TYPE  so_obj_nam ,
              ld_attfilename TYPE  so_obj_des ,
              ld_sender_address LIKE  soextreci1-receiver,
              ld_sender_address_type LIKE  soextreci1-adr_typ,
              ld_receiver LIKE  sy-subrc.
      ld_email  = p_email.
      ld_mtitle = p_mtitle.
      ld_format = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
      w_doc_data-doc_size = 1.
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
      clear t_attachment.
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = w_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = w_sent_all
        TABLES
          packing_list               = t_packing_list
          contents_bin               = t_attachment
          contents_txt               = it_message
          receivers                  = t_receivers
        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.
        commit work.
        SUBMIT rsconn01 USING SELECTION-SET 'SAP&CONNECTINT' AND RETURN.
      else.
        MESSAGE s027(vv) WITH 'E-mail not sent'.
      endif.
    Populate error return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    "send_attachment

    Just copy the code below and execute . I just checked and found the exact values on attachment with no blank lines. This is more simple than the one u have written , just include ur data upload logic . For ITAB values to be attached i have written a simple logic to retrive from EKPO. Just copy this code and execute. u will understand then.
    I understand that ur initial requirement was to attach the file directly and not to upload and attach. If u still want to go for the old requirement then check out the code(2nd program of the two that i have sent) that i have sent u on ur previous post.
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
      Retrieve sample data from table ekpo
      PERFORM data_retrieval.
      Populate table with detaisl to be entered into .xls file
      PERFORM build_TXT_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .TXT speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .TXT documnet attachment'
                                          'TXT'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_TXT_DATA_TABLE
          Build data table for .txt document
    FORM build_txt_data_table.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
       con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach  SEPARATED BY SPACE . "con_tab.
    CONCATENATE con_cret it_attach  INTO it_attach." Use this if req.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY SPACE ."con_tab.
       CONCATENATE con_cret it_attach  INTO it_attach." Use this if req.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_txt_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY
    execute this code and i hope that will help u.
    regards,
    Barath.

  • I tried to import a PDF of a line drawing into Photoshop Elements. The thumbnail looks fine, but when imported the file is empty. This used to work in the past. What is wrong and how do I solve this?

    I tried to import a PDF of a line drawing into Photoshop Elements. The thumbnail looks fine, but when imported the file is empty. This used to work in the past. What is wrong and how do I solve this?

    Hi
    The value of the Channel Strip volume etc is not stored within the C Strip setting, as you have discovered.
    If you really wanted, you could add a Gain plug to the strip, with it set to give the correct output level with the Fader set to 0
    (Or just set the fader manually in MS)
    CCT

  • PO Box printed on first line in Smartform

    Hi,
    I have used Address node in the Smartform to display the address.
    I have passsed Address Number, Type = Organization Address, Output Starts with Paragrah = SA, Number of lines to be used = 5, Use PO Box
    While, printing the PO box is getting printed on the first lines followed by name1 name2 on the second line.
    Can somebody tell me why this is happening and how can to print the PO below
    Thanks!

    It depends on priority also. Please check below mentioned link before making any changes.
    [http://help.sap.com/saphelp_nw70/helpdata/en/d2/69a151cd8b11d3b563006094192fe3/content.htm]
    Nabheet

  • SAPSCRIPT to Web(pdf) has different line spacing than in SAP?

    When we issue to output the order in SAP it looks fine. When we open it in the web, using PDF, the lines are spaced differently.
    We have never had an issue before, but now we added a lot of text to a final page of the sapscript.
    Any suggestion how to adjust the PDF line spacing for output via our SAP Function Modules that create OTF to PDF?
      Thanks,

    Hi,
    The SAPscript must generate an OTF output and then you convert the OTF into PDF format.
    There are 2 possibilities :
    1.Without generating any spool :
    2.When calling OPEN_FORM function module, export parameter OPTIONS-TDGETOTF = 'X', and when calling CLOSE_FORM function module, use returned parameter OTFDATA
    call CONVERT_OTF function module to convert the OTF to PDF. Returned parameters are BIN_FILE (the PDF binary) and BIN_FILESIZE (the length of the PDF binary). See below how to save a PDF binary to a file.
    If an OTF spool has been generated, you may convert it using CONVERT_OTFSPOOLJOB_2_PDF function module. Returned parameters are PDF table (the PDF binary) and PDF_BYTECOUNT (the length of the PDF binary).
    Thanks

  • Summary field printing on the first line when it supposed to prin last page

    i have created manual report. in the end of the report i have summay columns. wheni run in oracle reports it perfectly shows the grand totle. when i generate to file (PDF) thegrand total print on the first line. can some one tell me wht is it printig on the first line when it supposed to print on the last page. i tried print object on Last Page. it is still same.

    You may have hit this side effect of page protect (all copied from the Help):
    Description The Page Protect property indicates whether to try to keep the entire object and its contents on the same logical page. Setting Page Protect to Yes means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page.
    Note: Using Page Protect may cause objects below the page protected object(s) to appear above the page protected object(s).
    Solution:
    If Page Protect causes an object to be moved to the next logical page when formatting, an object alongside the page protected object may or may not be moved as well. If the object alongside the page protected object is not anchored (implicitly or explicitly) to the page protected object, and that object can fit in the space where the page protected object could not fit, the object will print on that logical page. Otherwise, the object will be moved along with the page protected object to the next logical page.
    (To say it simply: anchor the summary field explicitly).

  • How to add line breaks to output fixed width flat file

    0
    I need to create a Flat file without column headers, no comma separated values but each column will have a fixed starting position and a fixed length in the text file. For example, below is the text file to be created with six columns
    Column1  Column2   Column3     Column4  Column5      Column6
    abc          1             New emp      xxxx         xxxx           
    xxx
    Fixed starting position and a fixed lenth values for these columns as are below;
    Column1 : Starting Position -1, Fixed Length -4
    Column2 : Starting Position - 8, Fixed Length - 2
    Column3 : Starting Postion - 11, Fixed Length - 10
    Column4 : Starting Position -1, Fixed Length -5
    Column5 : Starting Position - 10, Fixed Length - 2
    Column6 : Starting Postion - 15, Fixed Length - 5
    The out put file each line have only 20 characters length.First 3 columns comes in first line and 4-6 columns comes in 2nd line.
    OUTPUT FILE:
    1234   89  11121314151617181920
    12345    1011          151617181920

    BOL says that:
    The Fixed width with row delimiters option is not available in the Flat File Connection Manager Editor.
    If necessary, you can emulate this option in the editor. To emulate this option, on the General page of the Flat File Connection Manager
    Editor, for Format, select Ragged right. Then on the Advanced page
    of the editor, add a new dummy column as the final column of data.
    More details steps:
    http://www.coderewind.com/2012/08/ssis-how-to-include-rowdelimiter-with-destination-flat-files/
    Below blog should make things clear:
    SSIS Flat File Export - "Fixed Width" vs "Ragged Right"
    -Vaibhav Chaudhari

Maybe you are looking for

  • HP Pavilion DV5-1140TX Notebook - Windows XP Anyone?

    Hi there, Intend on removing the default operating system (Windows Vista), that came with this type of notebook, and installing Windows XP instead.  Any advice in this regard?  Please advise. Thanks & Kind Regards, Julz 

  • Oracle.forms.webutil.file Transfer.File Transfer bean not found

    I've followed tons of instructions for 2 days to install and configure webutil and I finally have success with the demo. However, when I add this to my own form and use the CLIENT_IMAGE.READ_FILE_IMAGE I end up with error oracle.forms.webutil.file Tr

  • AWT/Swing in JSP

    Can we use Abstract Window Toolkit(AWT) or Swing classes in JSP? If is it so, is it preferable to use those in jsp? Details are welcome. Thanks

  • IWeb Browser Caches Huge Headache!

    I have (finally) successfully designed my website and for the most part, it's working well.  The issue I'm having at the moment is that when I update the website, I have to clear my browser caches each and every time in order to see the changes.  I h

  • My iPhone 5c sound/speaker only works with the headphones in and when I'm trying to change a ringtone in settings..

    my iPhone 5c sound/speaker only works with the headphones in and when I'm trying to change a ringtone in settings.. why is this?! its not on airplane mode, its not on silent, ive tried turning it on and off, software is up-to-date etc. just no sound