Printing into multiples columns on several pages

Hi,
I am looking for a way to print a list in TWO columns using SAPscript.
Here is the SAPScript :
/E   POS_ITEMS                                   
L                                                      
L    &itemno1&  &itemno2&
a list that looks like this :
apricot
banana
chick peas
dill pickle
egg
french fries
grapes
would be processed to look like this with lines per page = 4 :
apricot__________egg
banana_________ french fries
chick peas______grapes
dill pickle
and would be processed to look like this, with lines per page = 2 :
apricot_________chick peas
banana_________dill pickle
egg____________grapes
french fries
Thanks!

Maybe not pretty, but it works.
It's an example with four columns.
nb_col     = 4.
nb_rangees = 6.
DESCRIBE TABLE it_table LINES nb_lignes.
nb_tableaux = ( nb_lignes DIV ( nb_rangees * nb_col ) ) + 1.
IF nb_lignes < nb_rangees.
  nb_rangees = nb_lignes.
ENDIF.
pos = 1.
DO nb_tableaux TIMES.
  DO nb_rangees TIMES.
  1re colonne
    index_col = pos.
    PERFORM lire_valeur USING index_col CHANGING chaine.
    WRITE:/ chaine.
  2e colonne
    index_col = pos + ( nb_rangees ).
    PERFORM lire_valeur USING index_col CHANGING chaine.
    WRITE: chaine.
  3e colonne
    index_col = pos + ( 2 * nb_rangees ).
    PERFORM lire_valeur USING index_col CHANGING chaine.
    WRITE: chaine.
  4e colonne
    index_col = pos + ( 3 * nb_rangees ).
    PERFORM lire_valeur USING index_col CHANGING chaine.
    WRITE: chaine.
    pos = pos + 1.
  ENDDO.
  pos = pos + ( ( nb_col - 1 ) * nb_rangees ).
ENDDO.
WRITE:/ 'FIN'.
      FORM lire_valeur                                              *
FORM lire_valeur USING p_index
                 CHANGING p_valeur.
  CLEAR p_valeur.
  IF p_index <= nb_lignes.
    READ TABLE it_table INDEX p_index.
    p_valeur = it_table-nom.
  ENDIF.

Similar Messages

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • When printing an e-mail, it prints in narrow column - not full page width!

    when printing an e-mail, it prints in narrow column - not full page width!
    Spacing is also erratic

    check the default paper size for your printer on the printers folder in Windows.

  • To display comma separted value into multiple column

    Hi,
    I want to display value into multiple column like below
    data is like this
    col1
    res_menaHome:MenaHome
    res_menaHomeEmp:MenaHome Employee
    res_MDSpecialSer:MD Special Services
    res_Smart:Smart
    now i want to display like
    col1 col2
    res_menaHome MenaHome
    res_menaHomeEmp MenaHome Employee
    res_MDSpecialSer MD Special Services
    res_Smart Smart
    Thanks in advance.

    You mean like this?
    with q as (select 'res_menaHome:MenaHome' myString from dual)
    select substr(myString, 1, instr(myString, ':') - 1) col1,
    substr(myString, instr(myString, ':') + 1) col2
    from q
    COL1,COL2
    res_menaHome,MenaHome

  • Split one column  value and insert into multiple columns

    hi
    am new to plsql .
    i want to split a characters from one column and insert into multiple columns
    i tried used substr function the symbol ',' vary his place dynamically ,so i can't apply substr function.
    for eg:  before split
    col1 :
    col2 :
    col3 :
    col4 :
    colu5: adsdf,fgrty,erfth,oiunth,okujt
    after split
    col1 :adsd
    col2 :fgrty
    col3 :erfth
    col4 :oiunth
    col5 : adsdf,fgrty,erfth,oiunth,okujt
    can anyone help me
    thanks
    Edited by: 800324 on Dec 23, 2010 8:28 AM
    Edited by: 800324 on Dec 23, 2010 8:36 AM

    How about:
    SQL> create table t
      2  (col1 varchar2(30)
      3  ,col2 varchar2(30)
      4  ,col3 varchar2(30)
      5  ,col4 varchar2(30)
      6  ,col5 varchar2(30)
      7  );
    Table created.
    SQL> insert into t (col5) values ('adsdf,fgrty,erfth,oiunth,okujt');
    1 row created.
    SQL> insert into t (col5) values ('x,y');
    1 row created.
    SQL> insert into t (col5) values ('a,b,c,d');
    1 row created.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
                                                                                                                                adsdf,fgrty,erfth,oiunth,okujt
                                                                                                                                x,y
                                                                                                                                a,b,c,d
    3 rows selected.
    SQL>
    SQL> merge into t a
      2  using ( with t1 as ( select col5||',' col5
      3                       from   t
      4                     )
      5          select substr(col5, 1, instr(col5, ',', 1, 1)-1) col1
      6          ,      substr(col5, instr(col5, ',', 1, 1)+1, instr(col5, ',', 1, 2)- instr(col5, ',', 1, 1)-1) col2
      7          ,      substr(col5, instr(col5, ',', 1, 2)+1, instr(col5, ',', 1, 3)- instr(col5, ',', 1, 2)-1) col3
      8          ,      substr(col5, instr(col5, ',', 1, 3)+1, instr(col5, ',', 1, 4)- instr(col5, ',', 1, 3)-1) col4
      9          ,      rtrim(col5, ',') col5
    10          from   t1
    11        ) b
    12  on ( a.col5 = b.col5 )
    13  when matched then update set a.col1 = b.col1
    14                             , a.col2 = b.col2
    15                             , a.col3 = b.col3
    16                             , a.col4 = b.col4
    17  when not matched then insert (a.col1) values (null);
    3 rows merged.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
    adsdf                          fgrty                          erfth                          oiunth                         adsdf,fgrty,erfth,oiunth,okujt
    x                              y                                                                                            x,y
    a                              b                              c                              d                              a,b,c,d
    3 rows selected.
    SQL> Assuming you're on 9i...

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Displaying single value (Record) into multiple columns

    Hi All,
    I want to display the single record into multiple columns. Please let me know How to achieve this..
    Record:
    Lvl Activity Acre
    6 Week 4 (Same value to be displayed into 3 columns.)
    REquired output:
    lvl Activity PH1 PH2 PH3
    6 Week 4 4 4
    Thanks
    Kavi

    user533671 wrote:
    Hi,
    Thanks for immediate reply.
    PH1, PH2, PH3, ... will go more columns based on parameter , what we are passing.An single SQL statement cannot have a dynamic number of columns based on the data itself. The projection (columns returned) have to be known before any data is fetched... and that includes some 'parameter' value.
    {thread:id=2309172}
    You can build a query dynamically, based on a parameter or even on the data, but 99 times out 100 people use dynamic queries where they are not needed.
    Perhaps explain to us what you are really trying to achieve and why, and we could suggest some better way.

  • How do i print multiple columns on 1 page in numbers

    I think I am over thinking this but I have confused myself. I am using Numbers to create a spreadsheet of family names with their corresponding number. I would like to print multiple columns of names on one page to save paper but I can't figure how to do it. Will someone please help me???

    Hi BestMommy,
    Here is one way. Don't mess with your database. Create a new table for printing.
    Database with a Header Row (named Table 1 as an example) might look like this:
    Name
    1
    Name 1
    2
    Name 2
    3
    Name 3
    4
    Name 4
    5
    Name 5
    6
    Name 6
    7
    Name 7
    8
    Name 8
    9
    Name 9
    10
    Name 10
    11
    Name 11
    12
    Name 12
    13
    Name 13
    14
    Name 14
    15
    Name 15
    New table for printing:
    Name
    Name
    1
    Name 1
    8
    Name 8
    2
    Name 2
    9
    Name 9
    3
    Name 3
    10
    Name 10
    4
    Name 4
    11
    Name 11
    5
    Name 5
    12
    Name 12
    6
    Name 6
    13
    Name 13
    7
    Name 7
    14
    Name 14
    Formula in A2
    =Table 1::A2
    Formula in B2
    =Table 1::B2
    Formula in C2
    =Table 1::A9
    Formula in D2
    =Table 1::B9
    So it loops back from the bottom of a page to start a new column.
    I made this example small for the pics, but obviously you could have more rows and columns per page.
    Having created your table for printing, select it, Cut, add a new sheet and Paste. Print just that sheet.
    Have a look at 'More Like This' at the bottom of this page. Trying to format page to print table in two columns Jerry suggests using Pages instead of Numbers.
    Regards,
    Ian.
    Edit: Having created your table for printing, select it, Cut, add a new sheet and Paste. Print just that sheet. Ian.

  • Page caption text won't flow into multiple columns : LR4 book module

    Hi,
    I'm in process of creating a photobook using LR4's Book Module. Whenever I create a multiple columns page or photo caption, the text won't flow from the 1st column into the suceeding column... does this happen to anybody else. The multiple columns feature however does work for normal text placeholders.

    Dorin,
    You guess right but that's not very useful to me because sometimes I just want to have a few lines of text at the bottom or at the top of the photo but in 2 or 3 columns for easier reading. I can do that with text placeholders like the one below and the ability to do that with page or photo caption would be desirable too.

  • Cross-Tab in multiple columns on same page rather than on multiple pages

    I have a report that shows temperature readings and the date/time of the reading in a cross tab as a part of a report.  The amount of readings causes the cross-tab to take up multiple pages.  What I would like to do is set the cross tab to appear three or four times on the same page before going to the next page to reduce the number of pages in my report.  Any ideas on how I can do this?
    This is what I have:
    Page 1:
    Date/Time1  |  Temp1
    Date/Time2  |  Temp2
    Date/Time3  |  Temp3
    Date/Time4  |  Temp4
    Page 2:
    Date/Time5  |  Temp5
    Date/Time6  |  Temp6
    Date/Time7  |  Temp7
    Date/Time8  |  Temp8
    What I want is:
    Page 1
    Date/Time1  |  Temp1..............Date/Time5  |  Temp5..............Date/Time9   |  Temp9
    Date/Time2  |  Temp2..............Date/Time6  |  Temp6..............Date/Time10  |  Temp10
    Date/Time3  |  Temp3..............Date/Time7  |  Temp7..............Date/Time11  |  Temp11
    Date/Time4  |  Temp4..............Date/Time8  |  Temp8..............Date/Time12  |  Temp12    
    Page 2
    Date/Time13  |  Temp17............Date/Time21  |  Temp21............Date/Time25  |  Temp25
    Date/Time14  |  Temp18............Date/Time22  |  Temp22............Date/Time26  |  Temp26
    Date/Time15  |  Temp19............Date/Time23  |  Temp23............Date/Time27  |  Temp27
    Date/Time16  |  Temp20............Date/Time24  |  Temp24............Date/Time28  |  Temp28        

    hello,
    Don's suggestion of creating a "mock cross tab" is a good one.
    you can also try this Multiple Columns formatting idea if you wish:
    1) create a new report
    2) create a group on your date field
    3) put a summary on your Temp field and move it into the group header of the group
    4) suppress the details section and the group footer
    5) right click on the details section header in the design mode and choose Section Expert
    6) in the Common tab, choose Format With Multiple Columns
    7) in the Layout tab, choose a Width of about 2.66"
    8) choose Down Then Across for Printing Directions
    9) choose Format Groups With Multiple Columns
    10) bring this new report into your existing report as a subreport
    jamie

  • Span fields into multiple columns

    Hello all,
    I have a field that has multiple lines. Can I have it print into a different column once the number of lines is greater than 5 lines? I was thinking if I could enclose the field in a frame, set the horizontal elasticity to fixed and vertical to expand and make the frame size equal to 5 lines, then it would go to a different column within the frame but not. I am on an old Report Builder 6.0.8.22.0. Any guidance would be appreciated. Thank you.

    I've seem to come across Column Mode in the Repeating frame but no matter what print direction I use for the repeating frame it says column mode not allowed on repeating frame.

  • Duplex printing of multiple copies of single page

    I really like that the settings for printing are retained so you can leave it set to duplex rather than having to select it each time. Although I do get caught with not resetting the number of copies on occasion. I do a lot of printing and like to conserve paper.
    The problem is when duplex is set and I print multiple copies of a single page, it prints on both sides of the paper. When printing two copies I get one page printed on two sides instead of two pages printed on one side.
    I know the easy answer is reset the duplex setting. But it should print correctly regardless. Has anyone had this problem and found how to deal with it other than resetting duplex?

    If these settings are in the printer driver (which they most likely are) then you'd have to contact the driver manufacturer. Perhaps there are multiple "double-sided" settings. For instance, if there is "duplex" as one option and "two-sided" as another option in the driver, then perhaps one indicates all copies will be printed double-sided even on the same page (as you're experiencing), whereas the other would print multiple two-sided copies. This, however, is very driver-dependent behavior. I'd recommend checking to see if there's an update available for your printer driver that might either clear the problem or provide a clearer option setting for the print jobs.

  • Multiple columns on same page?

    I'm looking for a way to have a two column page layout, with three columns each that flows from page 1 column 1, to page 1 column 2, then to page 2 column 1 to page 2 column 2, etc. It's for a karaoke list and the columns are Song, Artist, and Song #, and I want to save paper by having two columns per page.
    In Excel I have to copy the spreadsheet into a two column word document, and it really slows down. An example of my layout is here... http://karaoke.seanphafer.com/page4/files/KaraokeUpdates27Dec06.pdf

    I'd almost do a Word "Mail Merge" from Excel. I've done program fliers this way and only takes a few seconds to do the merge (1000s of items.) Not quite a Numbers solution...
    Regards,

  • Split one row into multiple columns

    Hi,
    Data in one CLOB column in a table storing with delimiter, ##~~##. Ex. ##~~##abc##~~##defgh##~~##ijklm##~~##nopqr (data starts with delimiter). Please help me to split the data into multiple rows like below and it should be in the same order.
    abc
    defgh
    ijklm
    nopqr
    I am using Oracle 11g.
    Thanks.

    Thanks Hoek for your response. Before posting my question in the forum, I tried similar query. It is working with one character as delimiter.
    with test as (select 'ABC,DEF,GHI,JKL,MNO' str from dual )
    select regexp_substr (str, '[^,]+', 1, rownum) split
    from test
    connect by level <= length (regexp_replace (str, '[^,]+')) + 1;
    Above query is giving correct result by fetching 5 rows. I have modified the query like below...
    with test as (select 'ABC,,,DEF,,,GHI,,,JKL,,,MNO' str from dual )
    select regexp_substr (str, '[^,,,]+', 1, rownum) split
    from test
    connect by level <= length (regexp_replace (str, '[^,,,]+')) + 1;
    Above query resulting 13 rows and last 8 rows are nulls. Number of null rows are increasing, if I increase number of characters in delimiter. Could you please tell me how to avoid those null rows.
    Thanks.

  • Groups into Multiple Columns

    Post Author: Donamese
    CA Forum: General
    I am trying to create a report that is split between 3 companies and all states using a distinct count of individuals (as there are duplicates in the data pool).  I would like the report to look like:
    State             Company 1                Company 2                 Company 3
    AL                       0                                 16                           5
    AR                      3                                  9                             4
    AZ                       5                                 0                              7
    Currently I can only get it to list vertical like:
    Company 1
    AL       0
    AR      3
    AZ       5
    Company 2
    AL     16
    etc....
    I am unable to get the formating of multiple columns with the grouping.  Is it possible?  And if

    Post Author: rookie10
    CA Forum: General
    Try inserting a Cross Tab in the Report or page header. Its pretty much like a pivot table.
    Use State as the Row, Company as the Column, Individuals as Summarized field using Distinct Count as the summary type.
    In customized style part of the cross tab you can hide some of the totals and such to get pretty close to the report above - supress subtotals and such.
    Hope this works for you. I was pretty excited when I found this feature in Crystal.
    Rookie10

Maybe you are looking for