List-processing: limitations to 255 chars per line?

Hi,
check the sample code below and if possible, execute it in some of your systems:
start-of-code
REPORT  ZISM_TEST52 LINE-SIZE 300.
DATA:
  line(300) TYPE c.
WRITE '0123456789' TO line+250(10).
WRITE: / 'From variable', /.
WRITE  line.
WRITE: / 'Directly to the list', /.
WRITE AT 251 '0123456789'.
end-of-code
As you can see from the execution, when writing something into the char variable (in this case line), and try to put it into your screen, there is a limitation - only the first 255 characters of the variable take place in the resulted list. But, if you write directly into the list, this limitation is missing.
My question is closely related to this limitation:
Is there a possibility to avoid this limitation while putting something into the variable, and after that writing it to the list?
Situation is: I have quite complex report to rewrite (with several lists, and complex header texts for each list), which uses this technique - write to internal table, after that loop at the table and use simple write statement. I would like to save my effort and time and to use a a possibility to write variables longer than 255 chars to the list - if there is any.
So? Is there such a possibility?
Any help would be highly appreciated.
Many thanks in advance.
Regards,
Ivaylo Mutafchiev

HI Ivaylo
Below is from documenation:
Creates a report with col columns per line.
If the LINE-SIZE specification is missing, the line length corresponds to the current screen width. The system field SY-LINSZ contains the current line size for generating lists. The maximum width of a list is 1023 characters. You should keep lists to the minimum possible size to improve useability and performance (recommendation: LINE-SIZE < 132). For very wide lists (LINE-SIZE > 255), you should consult the notes for using LINE-SIZE
greater than 255.
Notes
The specified LINE-SIZE must not appear in quotation marks.
If the you want the report list (i.e. the output) to be printable, do not define a LINE-SIZE with a value greater than 132 because most printers cannot handle wider lists. <b>You cannot print lists wider than 255 characters at all using the standard print functions.</b> To print the contents of the lists, you need to write a special print routine that arranges the data in shorter lines (for example, using the PRINT ON addition in the NEW-PAGE statement.
At the beginning of a new list level, you can set a fixed line width for the level using the ... LINE SIZE addition to the NEW-PAGE statement.
Maybe the highlighted portion might be one reason for this behaviour.
Kind Regards
Eswar

Similar Messages

  • Send an attachment in email with length more than 255 char per line

    Hi All,
    I have to send an attachment in email with length more than 255 char per line. I dont want to break the line after 255 char and add it in another line.
    Please suggest me any function module which can perform this.
    Thank you all.

    I looked at all threads in the forum, there was about 5 or 6 identical questions, but surprise, nobody knows! It seems that SO_NEW_DOCUMENT_ATT_SEND_API1 function module does not allow more than 255 characters by line.
    It would surprise me a lot if there is no workaround !
    As it is very easy to add any binary attachment which is like a very long line, PDF for example (several kilobytes), via the function module above (lots of examples in the forum), I would advise you to try to use the same way, i.e. use the contents_bin parameter instead of the contents_txt parameter (convert the text into binary) and add the line feeds yourself (okay I know, it's not very smart).
    Last thing, this function module is deprecated, and we should use BCS classes, maybe they work better.

  • Limit number of chars per line

    Hi ,
    how to limit the number of chars per Line in a textArea or RTFEditableText?
    I have to do the following:
    Allow 25 Chars for first line,
    any other line should have max. 28 chars.
    First line should have a bold font.
    Not an easy thing..
    I tried to use a textarea fpr input and put the text into a datagrid in the textarea.change() event.
    This works, but I lose a lot of the standard features of the textarea (hyphenation etc.)
    The idea is to use only the textarea or a RTFEditor for applying the rules mentioned above.
    Thanks
    thorsten

    extend PlainDocument class to restrict the number of characters per line.
    Set this class as model to TextArea.
    Below is a class which does this. May be its useful
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private String max="";
    public FixedNumericDocument(int maxLength) {
    super();
    this.maxLength = maxLength;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    //check if str is numeric only
    int value = Integer.parseInt(str);
    //if we get here then str contains only numbers
    //chk if it is less than 65535 so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • Spool list output truncated after 255 char

    Hi,
       I'm using ALV list(FM: Reuse_alv_list_display) in my report. When it is run in background, the output is sent to spool. The problem is the list is truncated after 255 characters.
    Is there any way to display more than 255 characters in spool? So that it can be downloaded to a spreadsheet from spool.
    Thanks

    Hi,
    in the report-statement you can define the line-size of your list. I expect, you haven set the line-size!
    Try this one:
    REPORT Zxxxxx line-size 300.
    Normaly the program searches the the layout that fits to your selected printer (done by FM 'RSPO_LIST_LAYOUT_FITS').
    Regards,
    Martin

  • Event List - Used to show 1 event per line that I could open and view photos. Where is that feature?

    I was editing photos (iPhoto) and events were shown as 1 Event per line, preceeded by the > triangle, that I could click and open the event to see the photos.
    I was collapsing all the events so I had a nice list by date, and was naming each event.
    Then I hit something, and the 1-line per event went away, and now instead of showing events as a list,
    it shows events as "icons" with the key photo etc.
    How do I get back to listing events as a LIST ??  Like in the Finder window, where you can see
    files as Icons, Lists, Columns, or CoverFlow.
    All I can see now is the "Icons" view, I want the "Lists" view.
    Anyone seen the "Lists" view ?? and how to get back to it?
    Thanks

    I found the answer here:  https://discussions.apple.com/message/17430153#17430153
    Select VIEW menu item, then click "EVENT TITLES"
    To Collapse all the List sub-item details, cursor on one triangle, then ALT-CLICK and they all close up producing a useful listing;.

  • Creating email attachment with 255 char per record

    Hi,
    We want to generate an email with excel attachment through ABAP program. To do the same, we are trying to use FM 'SO_DOCUMENT_SEND_API1'.
    It looks like it only allows 255 characters per record however we want include upto 700 chracters per record. Does anyone know a way out to overcome this problem?
    Note - We do not want to wrap the text to next line.
    Thank you

    Hi:
    I would advice to make the copy of this function module SO_DOCUMENT_SEND_API1 and change the  packing_list-doc_size = '700'..
    Hopefully it would be helpful to solve the problem.
    Regards
    Shashi

  • Dynamic SQL and 255 bytes per line limit

    I would like to create a Dynamic SQL statement that is longer than 255 bytes. What do I need to do to embed a carriage return or something so that the resultant string is broken up into multiple lines?

    Please ignore. This was a stupid question!

  • Spool List output display 255 chars

    Hi,
    I am execuing the my report in back groung.The oupt list has more than 255 chars.
    could u please let me know how Spool List output display > 255 char when the rpt is run in back ground.
    regards,
    Rayeez.

    Hello,
    Try using the printer formatting as X_65_255.
    Please check this [link|Report is truncating in background; for details.
    BR,
    Suhas

  • How to display more than 255 chars in background job with ALV Grid ????

    Hi All,
    I am using ALV grid with OO.
    I have used call screen for ALV grid display. I have to display more than 255 characters in width. While running it, I can see the list perfectly.
    But in background mode, the list is truncated after 255 chars.
    Can anybody help how to send complete list(width more than 255 chars) to spool.
    Thanks and Regards,
    Neha

    Hi SAP fan,
    <b>YES you can run the ALV report in background mode.
    To run the report in background do F9 instead of F8, then give immediate and save.
    Now goto Sm35 goto job overview and view the job listed
    Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.
    To see this the job should be in the finished status.
    How to define Periodic Jobs
    1.Execute transaction SM36
    2.Define Job name, Job class, Target server
    3.Click on 'START CONDITION' button
    4.Click on 'Date/Time' button
    5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
    6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
    7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
    8.Click on 'Job overview' button or execute SM37 transaction.
    9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
    10.You will now see all your scheduled JOBS.
    <b>Case: 2</b>
    You can Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
                    RECEIVING e_offline = off.
        IF off IS INITIAL.
          CREATE OBJECT g_custom_container
                 EXPORTING container_name = g_container.
        ENDIF.
    <b>Case: 3</b>
    if you are using OO ALV.
    Just before creating the custom container check for the following condition.
    Batch or Web Reporting
    IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    CREATE OBJECT o_custcontainer
    EXPORTING
    container_name = lc_custcontrol
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6
    ENDIF.
    You can see the output in Spool in transaction SP01.</b>
    Good Luck and thanks
    AK

  • What is system variable to find the current list line in list processing

    hi
    what is system variable to find the current list line in list processing

    Hi,
    Please find below the system variable related to list processing
    LILLI    INT4     10     Processing lists       List line selected
    LINCT  INT4     10     Creating lists           Page length in a list
    LINNO INT4     10     Creating lists            Current line
    LINSZ  INT4     10     Creating lists          Line width in a list
    LISEL  CHAR     255     Processing lists       Contents of the chosen line
    LISTI    INT4     10     Processing lists       Index of the chosen list
    Thanks,
    Muthu.

  • Spool List output display 255 char when the rpt is run in Background

    Hi Friends,
    I tried executing a program in Background.. The report output has more than 64 columns ( more than 255 char ) ..
    Iam using "REUSE_ALV_GRID_DISPLAY" for displaying the list.
    My Problem:
    1. The spool list is truncated after 255 characters when i run in background.
    2. Th output in Spool List is coming in 2 rows ... not very clear ... becoz of that the grid lines are not getting displayed.
    3. I ve not used any Standard - line size for dislaying ..
    4. In foreground i am able to display all the 64 columns... Y not in Background......
    5. My Printer setting is ..X_255 .... only ...
    Requirement:
    1. What should i do to increase the spool list display to more than 255 characters
    2. Or how to save the background run reports output to an excel sheet as how we 'll take the from the foreground.
    Expecting your answers,
    Thanks in Advance...
    Cheers,
    R.Kripa .........
    Enjoy ABAPing ..........
    new upcoming Abaper ....

    Hello Kripa,
    You need to perform two actions.
    1. set an appropriate format for the printer you are using. As explained from the previous messages you go to: SPAD -> output devives (type the printer you are using) -> from the menu ..-> goto -> device type -> formats. In there create a new format like Z_65_650
    or Z_65_xxxx where xxxx could be up to 1065. This is the length of your report.
    When you give your report in background, do not forget to choose the new format you created.
    2. After the spool request is created, you take its number and use it ar a parameter in the following report.
    Please copy and paste it in a new program, maybe called ZRSPOSHOWSPOOLLIST.
    It should work then.
    roxani
    Display spool list > 255 columns
    This is a SAP utility report to allow display of
    spool request lists with line size more than 255 characters in
    releases 4.6B and 4.6C (4.6D kernel must be used)
    REPORT ZRSPOSHOWLIST LINE-SIZE 80.
    PARAMETERS: RQIDENT LIKE TSP01-RQIDENT,
    FIRSTL TYPE I DEFAULT 0,
    LASTL TYPE I DEFAULT 0.
    global data from LSPOXTOP
    DATA: RC(10) TYPE C,
    ERRMSG(100) TYPE C,
    STATUS LIKE SY-SUBRC,
    DSN_TYPE(8) TYPE C.
    DATA: BEGIN OF DATA_SET_LINE,
    DATA_LENGTH(5),
    PRECOL(1),
    DATA_LINE(1000),
    DATA_LINE(5000), "MODAB
    END OF DATA_SET_LINE,
    DATA_SET_LENGTH(5) TYPE C.
    TABLES: TSP01, TST05, TSPOPTIONS.
    DATA: TEMSE_NAME LIKE TST01-DNAME,
    TEMSE_CLIENT LIKE TST01-DCLIENT,
    TEMSE_HANDLE LIKE RSTSTYPE-HANDLE,
    TEMSE_PART LIKE TST01-DPART,
    TEMSE_OBJTYP LIKE TST01-DTYPE,
    TEMSE_RECTYP LIKE RSTSTYPE-RECTYP,
    TEMSE_CHARCO LIKE TST01-DCHARCOD.
    DATA: IS_OTF.
    global data from LSPOCTOP
    DATA: BEGIN OF SPOC
    , escape
    , prtctrl
    , FIRST_BYTES(4) " collection of the first bytes of the
    " escape sequences, which I am searching for.
    , PRTCTRL_START_LENGTH TYPE I
    , PRTCTRL_TOTAL_LENGTH TYPE I
    , PRTCTRL_START(10)
    , SYMBOL_LOW_START(10)
    , SYMBOL_HGH_START(10)
    , SYMBOL_START_LENGTH TYPE I
    , ICON_START(10)
    , ICON_START_LENGTH TYPE I
    , ICON_SEL TYPE I VALUE 1
    , FRAME_START(10)
    , FRAME_START_LENGTH TYPE I
    , END OF SPOC.
    FIELD-SYMBOLS: <SPOC_PRTCTRL> TYPE C
    , <SPOC_FRAME> TYPE C
    , <SPOC_ICON> TYPE C
    , <SPOC_SYMBOL_LOW> TYPE C
    , <SPOC_SYMBOL_HGH> TYPE C
    copied from RSPO_DISPLAY_ABAP_SPOOLJOB
    DATA: BUFFER LIKE DATA_SET_LINE OCCURS 1000.
    TABLES: TSP02L.
    SELECT SINGLE * FROM TSP01 WHERE RQIDENT = RQIDENT.
    IF SY-SUBRC <> 0.
    WRITE: / 'Spool request does not exist:'(001), RQIDENT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RSPO_CHECK_JOB_PERMISSION'
    EXPORTING
    ACCESS = 'DISP'
    SPOOLREQ = TSP01
    EXCEPTIONS
    NO_PERMISSION = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    WRITE: / 'No authorization to display'(002).
    EXIT.
    ENDIF.
    PERFORM READ_DATA TABLES BUFFER
    USING TSP01 FIRSTL LASTL.
    IF SY-SUBRC <> 0.
    WRITE: / 'Error reading spoolo request'(003).
    EXIT.
    ENDIF.
    IF IS_OTF = 'X'.
    WRITE: / 'This spool request is not an ABAP list'(004).
    EXIT.
    ENDIF.
    PERFORM DISPLAY_DATA TABLES BUFFER USING TSP01-RQPAPER TSP01-RQIDENT.
    FORM GET_SPOOL_LINE.
    DO.
    IF TEMSE_RECTYP+1(1) = 'Y'.
    CALL 'C_RSTS_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'BUFF' FIELD DATA_SET_LINE
    ID 'BUFFLG' FIELD 1006
    ID 'BUFFLG' FIELD 5006 "MODAB
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'SHOWLG' FIELD 'X'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ELSE.
    CALL 'C_RSTS_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'BUFF' FIELD DATA_SET_LINE+1
    ID 'BUFFLG' FIELD 1005
    ID 'BUFFLG' FIELD 5005 "MODAB
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'SHOWLG' FIELD 'X'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    DATA_SET_LINE(5) = DATA_SET_LINE+1(5).
    DATA_SET_LINE-PRECOL = ' '.
    ADD 1 TO DATA_SET_LINE-DATA_LENGTH.
    ENDIF.
    STATUS = SY-SUBRC.
    IF STATUS <> 6. " EOF, error condition, or got data
    EXIT.
    ENDIF.
    end of this part, try to open next part
    ADD 1 TO TEMSE_PART.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = TEMSE_CLIENT "hjl
    NAME = TEMSE_NAME
    PART = TEMSE_PART
    IMPORTING
    CHARCO = TEMSE_CHARCO
    CREATER =
    CREDATE =
    DELDATE =
    MAX_CREDATE =
    MAX_DELDATE =
    NON_UNIQ =
    NOOF_PARTS =
    RECTYP = TEMSE_RECTYP
    SIZE =
    STOTYP =
    type =
    OBJTYPE = TEMSE_OBJTYP
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4
    OTHERS = 5.
    STATUS = SY-SUBRC.
    ENDIF.
    IF STATUS = 0.
    CALL 'C_RSTS_OPEN_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'CLIENT' FIELD TEMSE_CLIENT "hjl
    ID 'NAME' FIELD TEMSE_NAME
    ID 'PART' FIELD TEMSE_PART
    ID 'TYPE' FIELD TEMSE_OBJTYP
    ID 'CONV' FIELD ' '
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'RECTYP' FIELD TEMSE_RECTYP
    ID 'CHARCO' FIELD TEMSE_CHARCO
    ID 'PROM' FIELD 'I'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ENDIF.
    ENDDO.
    IF STATUS = 4.
    STATUS = 12. "EOF
    ENDIF.
    IF STATUS = 8.
    STATUS = 40. "Line too long
    ENDIF.
    DATA_SET_LENGTH = DATA_SET_LINE-DATA_LENGTH.
    ENDFORM.
    FORM READ_DATA TABLES BUFFER
    USING TSP01 LIKE TSP01 VALUE(FIRST) TYPE I
    VALUE(LAST) TYPE I.
    DATA: LINES TYPE I.
    REFRESH BUFFER.
    CLEAR IS_OTF.
    TEMSE_CLIENT = TSP01-RQCLIENT.
    TEMSE_NAME = TSP01-RQO1NAME.
    TEMSE_PART = 1.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    AUTHORITY = 'SP01'
    CLIENT = TEMSE_CLIENT
    NAME = TEMSE_NAME
    PART = TEMSE_PART
    IMPORTING
    CHARCO = TEMSE_CHARCO
    CREATER =
    CREDATE =
    DELDATE =
    MAX_CREDATE =
    MAX_DELDATE =
    NON_UNIQ =
    NOOF_PARTS =
    RECTYP = TEMSE_RECTYP
    SIZE =
    STOTYP =
    type =
    OBJTYPE = TEMSE_OBJTYP
    EXCEPTIONS
    FB_ERROR = 1
    FB_RSTS_OTHER = 2
    NO_OBJECT = 3
    NO_PERMISSION = 4
    OTHERS = 5.
    IF SY-SUBRC = 0.
    IF TEMSE_OBJTYP(3) = 'OTF'.
    IS_OTF = 'X'.
    ENDIF.
    ELSE.
    EXIT.
    ENDIF.
    CLEAR TEMSE_HANDLE.
    CALL 'C_RSTS_OPEN_READ'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'CLIENT' FIELD TEMSE_CLIENT "hjl
    ID 'NAME' FIELD TEMSE_NAME
    ID 'PART' FIELD TEMSE_PART
    ID 'TYPE' FIELD TEMSE_OBJTYP
    ID 'CONV' FIELD ' '
    ID 'ALLINE' FIELD 'X'
    ID 'BINARY' FIELD ' '
    ID 'RECTYP' FIELD TEMSE_RECTYP
    ID 'CHARCO' FIELD TEMSE_CHARCO
    ID 'PROM' FIELD 'I'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
    DO.
    PERFORM GET_SPOOL_LINE.
    IF STATUS <> 0 AND STATUS <> 40 AND STATUS <> 12.
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    IF STATUS <> 12. " 12 = End
    IF NOT ( DATA_SET_LENGTH IS INITIAL ).
    DATA_SET_LINE-DATA_LENGTH = DATA_SET_LENGTH - 1.
    ENDIF.
    ADD 1 TO LINES.
    IF LINES >= FIRST.
    APPEND DATA_SET_LINE TO BUFFER.
    ENDIF.
    IF ( NOT LAST IS INITIAL ) AND ( LINES >= LAST ).
    EXIT.
    ENDIF.
    ELSE.
    IF LINES = 0.
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    IF LINES < FIRST .
    PERFORM CLOSE_JOB.
    EXIT.
    ENDIF.
    EXIT.
    ENDIF.
    ENDDO.
    PERFORM CLOSE_JOB.
    ENDIF.
    ENDFORM.
    FORM CLOSE_JOB *
    FORM CLOSE_JOB.
    IF STATUS <> 0 AND STATUS <> 12.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG RAISING READ_ERROR.
    ENDIF.
    CALL 'C_RSTS_CLOSE'
    ID 'HANDLE' FIELD TEMSE_HANDLE
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS <> 0.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG RAISING READ_ERROR.
    ENDIF.
    ENDFORM.
    FORM DISPLAY_DATA TABLES BUFFER USING RQPAPER LIKE TSP01-RQPAPER
    RQID LIKE TSP01-RQIDENT.
    DATA: LINE_LENGTH TYPE I, GCOL TYPE I, GLINES TYPE I,
    LINE_LENGTH2 LIKE RSTSTYPE-LINELENGTH,
    V, V2.
    CALL FUNCTION 'RSPO_SPOOLDATA_WRITE_INIT'.
    PERFORM SPOOLDATA_WRITE_INIT. "MODAB
    select single * from tspoptions where spoption = 'REALWIDTH'.
    if sy-subrc = 0.
    V = 'X'.
    endif.
    select single * from tspoptions where spoption = 'REALHEIGHT'.
    if sy-subrc = 0.
    V2 = 'X'.
    endif.
    IF NOT V IS INITIAL OR NOT V2 IS INITIAL.
    GCOL = 0.
    GLINES = 0.
    SELECT SINGLE * FROM TSP02L WHERE PJIDENT = RQID
    AND PJNUMMER = 0.
    IF SY-SUBRC = 0.
    GCOL = TSP02L-COLUMNS.
    GLINES = TSP02L-LINES.
    ELSE.
    CALL FUNCTION 'RSPO_GET_SIZE_OF_LAYOUT'
    EXPORTING
    LAYOUT = RQPAPER
    IMPORTING
    ANSWER =
    COLUMNS = GCOL
    LINES = GLINES
    PFORMAT =
    ENDIF.
    ENDIF.
    IF GCOL < 80 OR V IS INITIAL.
    GCOL = 255.
    ENDIF.
    IF GLINES < 5 OR V2 IS INITIAL.
    GLINES = 0.
    ENDIF.
    IF GCOL >= 1024. "MODAB
    GCOL = 1023.
    ENDIF.
    NEW-PAGE NO-HEADING NO-TITLE LINE-SIZE GCOL
    LINE-COUNT GLINES. " make a wide list
    SET BLANK LINES ON.
    LOOP AT BUFFER.
    DATA_SET_LINE = BUFFER.
    IF DATA_SET_LINE-PRECOL = 'P'.
    IF DATA_SET_LINE(1) = ' '. " Echter Vorschub ?"
    NEW-PAGE.
    ENDIF.
    CONTINUE.
    ENDIF.
    Zeilenlange berechnen, falls unbekannt.
    IF DATA_SET_LINE-DATA_LENGTH IS INITIAL.
    LINE_LENGTH = STRLEN( DATA_SET_LINE-DATA_LINE ).
    ELSE.
    LINE_LENGTH = DATA_SET_LINE-DATA_LENGTH.
    ENDIF.
    IF LINE_LENGTH > 0.
    LINE_LENGTH2 = LINE_LENGTH.
    PERFORM SPOOLDATA_WRITE USING DATA_SET_LINE-DATA_LINE "MODAB
    LINE_LENGTH2
    1.
    ELSE.
    " Leerzeile
    SKIP.
    ENDIF.
    ENDLOOP.
    ENDFORM.
    copied from RSPO_SPOOLDATA_WRITE
    FORM SPOOLDATA_WRITE USING VALUE(SPOOL_DATA)
    VALUE(DATA_LENGTH) LIKE RSTSTYPE-LINELENGTH
    VALUE(START_POS) LIKE SY-COLNO.
    function globals
    DATA: LPOS LIKE SY-COLNO
    , REST_LEN TYPE I
    , AREA_LEN TYPE I
    , NEXT_HOT TYPE I " offset of next special character
    , COLS TYPE I " columns used by special character
    , BYTES TYPE I " bytes used by special character
    , HOT2
    , HOT3
    , HOT4
    , HOT5
    , HOT6
    , HOT7
    , BEGIN OF ESCAPE_TRICK
    , X1(1) TYPE X
    , END OF ESCAPE_TRICK
    , THE_PRTCTRL(5) TYPE C
    Because of a problem within the ABAP listprocessing, I shall
    never output the same icon side by side with the same color
    and without a gap.
    As I don't know the data, I will use two different variables
    alternatively.
    , ICON_ID1 LIKE ICONS-L4
    , ICON_ID2 LIKE ICONS-L4.
    FIELD-SYMBOLS: <LDATA>
    , <PLAIN_TEXT>
    , <PRTCTRL>
    , <HOT_PRTCTRL>
    , <HOT_FRAME>
    , <HOT_ICON>
    , <HOT_SYMBOL>
    IF START_POS < 2.
    write at / ' ' no-gap.
    NEW-LINE.
    LPOS = 1.
    ELSE.
    LPOS = START_POS.
    ENDIF.
    REST_LEN = STRLEN( SPOOL_DATA ).
    DESCRIBE FIELD SPOOL_DATA LENGTH AREA_LEN.
    IF DATA_LENGTH = 0.
    " fine.
    ELSEIF DATA_LENGTH <= AREA_LEN.
    REST_LEN = DATA_LENGTH.
    ELSE.
    WRITE: / 'Fehler beim Decodieren der Listendaten'(005).
    STOP.
    ENDIF.
    CHECK REST_LEN > 0.
    ASSIGN SPOOL_DATA(REST_LEN) TO <LDATA>.
    WHILE <LDATA> CA SPOC-FIRST_BYTES.
    NEXT_HOT = SY-FDPOS.
    IF NEXT_HOT > 0.
    ASSIGN <LDATA>(NEXT_HOT) TO <PLAIN_TEXT>.
    MODAB
    PERFORM WRITE_BIGFIELD USING <PLAIN_TEXT>
    NEXT_HOT
    LPOS.
    WRITE AT LPOS <PLAIN_TEXT> NO-GAP.
    ADD NEXT_HOT TO LPOS.
    SUBTRACT NEXT_HOT FROM REST_LEN.
    ASSIGN <LDATA>+NEXT_HOT(REST_LEN) TO <LDATA>.
    ENDIF.
    IF REST_LEN >= SPOC-PRTCTRL_START_LENGTH.
    ASSIGN <LDATA>(SPOC-PRTCTRL_START_LENGTH) TO <HOT_PRTCTRL>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_PRTCTRL>.
    ENDIF.
    IF REST_LEN >= SPOC-FRAME_START_LENGTH.
    ASSIGN <LDATA>(SPOC-FRAME_START_LENGTH) TO <HOT_FRAME>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_FRAME>.
    ENDIF.
    IF REST_LEN >= SPOC-ICON_START_LENGTH.
    ASSIGN <LDATA>(SPOC-ICON_START_LENGTH) TO <HOT_ICON>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_ICON>.
    ENDIF.
    IF REST_LEN >= SPOC-SYMBOL_START_LENGTH.
    ASSIGN <LDATA>(SPOC-SYMBOL_START_LENGTH) TO <HOT_SYMBOL>.
    ELSE.
    ASSIGN 'too_short' TO <HOT_SYMBOL>.
    ENDIF.
    IF REST_LEN > 1.
    HOT2 = <LDATA>+1(1).
    IF REST_LEN > 2.
    HOT3 = <LDATA>+2(1).
    IF REST_LEN > 3.
    HOT4 = <LDATA>+3(1).
    ELSE.
    HOT4 = '?'.
    ENDIF.
    ELSE.
    HOT3 = '?'.
    ENDIF.
    ELSE.
    HOT2 = '?'.
    ENDIF.
    IF <HOT_FRAME> = <SPOC_FRAME>.
    COLS = 1. " in most cases.
    BYTES = 2. " in most cases.
    CASE HOT2.
    WHEN '0'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '1'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '2'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '3'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '4'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '5'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '6'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '7'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '8'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN '9'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN ':'. WRITE AT LPOS HOT2 AS LINE NO-GAP.
    WHEN ';'. " box_drawings_light_left
    WRITE AT LPOS '4' AS LINE NO-GAP.
    WHEN '<'. " box_drawings_light_up
    WRITE AT LPOS '5' AS LINE NO-GAP.
    WHEN '='. " box_drawings_light_right
    WRITE AT LPOS '4' AS LINE NO-GAP.
    WHEN '>'. " box_drawings_light_down
    WRITE AT LPOS '5' AS LINE NO-GAP.
    WHEN '?'. " drawings_checkbox_off
    WRITE AT LPOS ' ' AS CHECKBOX INPUT OFF NO-GAP.
    WHEN '@'. " drawings_checkbox_on
    WRITE AT LPOS 'X' AS CHECKBOX INPUT OFF NO-GAP.
    WHEN OTHERS.
    BYTES = 0.
    ENDCASE.
    ENDIF.
    IF <HOT_SYMBOL> = <SPOC_SYMBOL_LOW>.
    ESCAPE_TRICK = HOT3.
    SUBTRACT 32 FROM ESCAPE_TRICK-X1.
    IF HOT4 = SPACE.
    WRITE AT LPOS(2) ESCAPE_TRICK AS SYMBOL NO-GAP.
    COLS = 2.
    BYTES = 4.
    ELSE.
    WRITE AT LPOS(1) ESCAPE_TRICK AS SYMBOL NO-GAP.
    BYTES = 3.
    ENDIF.
    ENDIF.
    IF <HOT_SYMBOL> = <SPOC_SYMBOL_HGH>.
    ESCAPE_TRICK = HOT3.
    ADD 32 TO ESCAPE_TRICK-X1.
    IF HOT4 = SPACE.
    WRITE AT LPOS(2) ESCAPE_TRICK AS SYMBOL NO-GAP.
    COLS = 2.
    BYTES = 4.
    ELSE.
    WRITE AT LPOS(1) ESCAPE_TRICK AS SYMBOL NO-GAP.
    BYTES = 3.
    ENDIF.
    ENDIF.
    IF <HOT_ICON> = <SPOC_ICON>.
    IF SPOC-ICON_SEL >< 1.
    SPOC-ICON_SEL = 1.
    ICON_ID1 = '@00@'.
    ICON_ID1+1(1) = HOT3.
    ICON_ID1+2(1) = HOT4.
    ELSE.
    SPOC-ICON_SEL = 2.
    ICON_ID2 = '@00@'.
    ICON_ID2+1(1) = HOT3.
    ICON_ID2+2(1) = HOT4.
    ENDIF.
    IF REST_LEN > 4.
    HOT5 = <LDATA>+4(1).
    IF REST_LEN > 5.
    HOT6 = <LDATA>+5(1).
    IF REST_LEN > 6.
    HOT7 = <LDATA>+6(1).
    ELSE.
    HOT7 = '?'.
    ENDIF.
    ELSE.
    HOT6 = '?'.
    ENDIF.
    ELSE.
    HOT5 = '?'.
    ENDIF.
    IF HOT5 = SPACE.
    IF HOT6 = SPACE.
    IF HOT7 = SPACE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(4) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(4) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 4.
    BYTES = 7.
    ELSE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(3) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(3) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 3.
    BYTES = 6.
    ENDIF.
    ELSE.
    IF SPOC-ICON_SEL = 1.
    WRITE AT LPOS(2) ICON_ID1 AS ICON.
    write at lpos icon_id1 as icon no-gap.
    ELSE.
    WRITE AT LPOS(2) ICON_ID2 AS ICON.
    write at lpos icon_id2 as icon no-gap.
    ENDIF.
    COLS = 2.
    BYTES = 5.
    ENDIF.
    ELSE.
    "rite at lpos(1) icon_id as icon.
    WRITE AT LPOS(1) '#' NO-GAP. " Not enough space for any icon.
    COLS = 1.
    BYTES = 4.
    ENDIF.
    ENDIF.
    IF <HOT_PRTCTRL> = <SPOC_PRTCTRL>.
    COLS = 0. " in most cases.
    BYTES = 6. " in most cases.
    IF REST_LEN >= SPOC-PRTCTRL_TOTAL_LENGTH.
    THE_PRTCTRL = <LDATA>+SPOC-PRTCTRL_START_LENGTH(5).
    IF THE_PRTCTRL = 'SABLD'.
    FORMAT INTENSIFIED ON.
    "no 3.0 'SAULN'.
    "no 3.0 FORMAT UNDERSCORED ON.
    ELSEIF THE_PRTCTRL = 'SAOFF'.
    FORMAT INTENSIFIED OFF.
    "no 3.0 FORMAT UNDERSCORED OFF.
    ELSEIF THE_PRTCTRL(3) = 'COL'.
    CASE THE_PRTCTRL+3(1).
    WHEN '0'.
    FORMAT COLOR OFF.
    WHEN '1'.
    FORMAT COLOR 1.
    WHEN '2'.
    FORMAT COLOR 2.
    WHEN '3'.
    FORMAT COLOR 3.
    WHEN '4'.
    FORMAT COLOR 4.
    WHEN '5'.
    FORMAT COLOR 5.
    WHEN '6'.
    FORMAT COLOR 6.
    WHEN '7'.
    FORMAT COLOR 7.
    ENDCASE.
    CASE THE_PRTCTRL+4(1).
    WHEN 'N'.
    FORMAT INTENSIFIED OFF INVERSE OFF.
    WHEN 'H'.
    FORMAT INTENSIFIED ON INVERSE OFF.
    WHEN 'V'.
    FORMAT INTENSIFIED ON INVERSE ON.
    ENDCASE.
    ENDIF. "printcontrol
    ELSE. "??
    ENDIF.
    ENDIF.
    IF BYTES = 0.
    BYTES = 1.
    WRITE AT LPOS(1) '#'.
    COLS = 1.
    ENDIF.
    ADD COLS TO LPOS.
    SUBTRACT BYTES FROM REST_LEN.
    IF REST_LEN > 0.
    ASSIGN <LDATA>+BYTES(REST_LEN) TO <LDATA>.
    ELSE.
    EXIT.
    ENDIF.
    ENDWHILE.
    MODAB
    IF REST_LEN > 0.
    ASSIGN <LDATA>(REST_LEN) TO <PLAIN_TEXT>.
    PERFORM WRITE_BIGFIELD USING <PLAIN_TEXT>
    REST_LEN
    LPOS.
    ENDIF.
    ENDFORM.
    FORM WRITE_BIGFIELD USING VALUE(FIELD) TYPE C
    VALUE(LEN)
    VALUE(POS).
    FIELD-SYMBOLS <P>.
    DATA: CHUNK TYPE I.
    WHILE LEN > 0.
    IF LEN > 255.
    CHUNK = 255.
    ELSE.
    CHUNK = LEN.
    ENDIF.
    WRITE AT POS FIELD(CHUNK) NO-GAP.
    ADD CHUNK TO POS.
    LEN = LEN - CHUNK.
    IF LEN > 0.
    FIELD = FIELD+CHUNK.
    ENDIF.
    ENDWHILE.
    ENDFORM.
    FORM SPOOLDATA_WRITE_INIT.
    DATA: BEGIN OF ESCAPE_TRICK
    , X1(1) TYPE X
    , END OF ESCAPE_TRICK
    FIELD-SYMBOLS: <LDATA>
    , <PLAIN_TEXT>
    , <PRTCTRL>
    ESCAPE_TRICK-X1 = '1C'.
    SPOC-PRTCTRL_START = ESCAPE_TRICK.
    SPOC-PRTCTRL_START_LENGTH = 1.
    SPOC-PRTCTRL_TOTAL_LENGTH = SPOC-PRTCTRL_START_LENGTH + 5.
    ASSIGN SPOC-PRTCTRL_START(SPOC-PRTCTRL_START_LENGTH) TO <SPOC_PRTCTRL>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-FRAME_START = ESCAPE_TRICK.
    SPOC-FRAME_START_LENGTH = 1.
    ASSIGN SPOC-FRAME_START(SPOC-FRAME_START_LENGTH) TO <SPOC_FRAME>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-ICON_START = ESCAPE_TRICK.
    SPOC-ICON_START+1 = ','.
    SPOC-ICON_START_LENGTH = 2.
    ASSIGN SPOC-ICON_START(SPOC-ICON_START_LENGTH) TO <SPOC_ICON>.
    ESCAPE_TRICK-X1 = '1B'.
    SPOC-SYMBOL_LOW_START = ESCAPE_TRICK.
    SPOC-SYMBOL_LOW_START+1 = '('.
    SPOC-SYMBOL_HGH_START = ESCAPE_TRICK.
    SPOC-SYMBOL_HGH_START+1 = ')'.
    SPOC-SYMBOL_START_LENGTH = 2.
    ASSIGN SPOC-SYMBOL_LOW_START(SPOC-SYMBOL_START_LENGTH)
    TO <SPOC_SYMBOL_LOW>.
    ASSIGN SPOC-SYMBOL_HGH_START(SPOC-SYMBOL_START_LENGTH)
    TO <SPOC_SYMBOL_HGH>.
    SPOC-FIRST_BYTES+0(1) = SPOC-PRTCTRL_START(1).
    SPOC-FIRST_BYTES+1(1) = SPOC-FRAME_START(1).
    SPOC-FIRST_BYTES+2(1) = SPOC-ICON_START(1).
    SPOC-FIRST_BYTES+3(1) = SPOC-SYMBOL_LOW_START(1).
    ENDFORM.

  • Is Credit Check Per Line Item in Sales Order  Possible?

    Dear All,
    Hope you all are doing well !!!
    Infact i am currently implementing OPM and SCM modules for a CSD (carbonated soft drinks) industry. They have a specific requirement on Credit Management. Please look at the Requirement Below.
    Credit Management Per Line on SO
    Client Charges Distributors for both Liquids (Finished Product) + [Return Glass Bottles and Shells) for the First Time.
    Subsequently while returning RGB(Return Glass Bottles)'s and Shell's are being given Credit memos.
    CBL gives credit only on Bottles & shells but not on Liquids.
    For Liquids CBL takes the Prepayment & Its Compulsory.
    So the Credit limit needs to be check on the bottles and shells only.
    Oracle E-Business Suite Credit Management does not work per line item for a
    Particular Sales Order. It works on total Sales Order. as this is not a standard Process in Oracle how we can achieve this without customization.
    Please suggest me through any workaround we can achieve this and its a show stopper for us and business critical for my client.Please help me on this regard.
    Thanks & Regards,
    Aditya                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I'd suggest writing your own might be easier. Oracle buckets the exposure as per the list below whereas you are probably only interested in seeing a total order exposure (by line item for bottles/shells) and total AR exposure summary.
    Also the standard report will look at the unit sell * the ordered quantity in calculating transaction amounts on open orders which is your problem. If I've understood your requirement correctly, you only want to consider the shells and bottles in the credit check because you enforce prepayment for liquids so presumably your AR o/s balances are only for money owing on shells and bottles.
    In that case, your only real issue is at the order entry stage (again because Oracle will be considering the total transaction value if you're using the standard automated credit check) which is why I suggested the manual workaround there.
    1     Header uninvoiced orders
    2     Header uninvoiced orders tax
    3     Line uninvoiced orders
    4     Line uninvoiced orders tax
    5     Line uninvoiced freight
    6     Header uninvoiced freight
    7     Header and line freight
    8     Invoices
    9     Payments at risk
    10     Order holds
    11     Line holds
    13     Order tax holds
    14     Line tax holds
    15     Order freight holds
    16     Line freight holds     
    17     Header and line freight holds
    18     External exposure
    21     G_BR_INVOICES
    22     G_BR_PAYMENTS_AT_RISK
    23     G_HEAD_RETURN_UNINV_ORDERS
    24     G_LINE_RETURN_UNINV_ORDERS
    25     G_ORDER_RETURN_HOLDS
    30     G_ORDER_RETURN_HOLDS
    31     G_LINE_RETURN_HOLDS

  • Credit Check Per Line Item in Sales Order is Possible?

    Dear All,
    Hope you all are doing well !!!
    Infact i am currently implementing OPM and SCM modules for a CSD (carbonated soft drinks) industry. They have a specific requirement on Credit Management. Please look at the Requirement Below.
    Credit Management Per Line on SO
    Client Charges Distributors for both Liquids (Finished Product) + [Return Glass Bottles and Shells) for the First Time.
    Subsequently while returning RGB(Return Glass Bottles)'s and Shell's are being given Credit memos.
    CBL gives credit only on Bottles & shells but not on Liquids.
    For Liquids CBL takes the Prepayment & Its Compulsory.
    So the Credit limit needs to be check on the bottles and shells only.
    Oracle E-Business Suite Credit Management does not work per line item for a
    Particular Sales Order. It works on total Sales Order.  as this is not a standard Process in Oracle how we can achieve this without customization.
    Please suggest me through any workaround we can achieve this and its a show stopper for us and business critical for my client.Please help me on this regard.
    Thanks & Regards,
    Aditya                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I'd suggest writing your own might be easier. Oracle buckets the exposure as per the list below whereas you are probably only interested in seeing a total order exposure (by line item for bottles/shells) and total AR exposure summary.
    Also the standard report will look at the unit sell * the ordered quantity in calculating transaction amounts on open orders which is your problem. If I've understood your requirement correctly, you only want to consider the shells and bottles in the credit check because you enforce prepayment for liquids so presumably your AR o/s balances are only for money owing on shells and bottles.
    In that case, your only real issue is at the order entry stage (again because Oracle will be considering the total transaction value if you're using the standard automated credit check) which is why I suggested the manual workaround there.
    1     Header uninvoiced orders
    2     Header uninvoiced orders tax
    3     Line uninvoiced orders
    4     Line uninvoiced orders tax
    5     Line uninvoiced freight
    6     Header uninvoiced freight
    7     Header and line freight
    8     Invoices
    9     Payments at risk
    10     Order holds
    11     Line holds
    13     Order tax holds
    14     Line tax holds
    15     Order freight holds
    16     Line freight holds     
    17     Header and line freight holds
    18     External exposure
    21     G_BR_INVOICES
    22     G_BR_PAYMENTS_AT_RISK
    23     G_HEAD_RETURN_UNINV_ORDERS
    24     G_LINE_RETURN_UNINV_ORDERS
    25     G_ORDER_RETURN_HOLDS
    30     G_ORDER_RETURN_HOLDS
    31     G_LINE_RETURN_HOLDS

  • Compact output of pacman -Qi(e) showing only prog,desc,size 1 per line

    /* ================================================================================================
    REVISED May 14, 2009
    REWRITTEN - to check for buffer overuns
    Dumb utility which takes the output of pacman -Qi(e) and creates a tab delineated text file
    showing the program name, description and file size, one program per line to be read
    with a text editor or spreadsheet.
    compiling -> q++ qi.cpp -o qi
    Program can be run either as:
    qi // which creates:
    pacQi.txt // output of pacman -Qi > pacQi.txt
    pacQi.xls // tab delineated text file of all installed programs.
    or
    pacman -Qie > somefile
    qi somefile // which creates
    somefile.xls // A tab delineated text file of explicitly installed programs
    ==================================================================================================== */
    #include <iostream>
    #include <fstream>
    #include <stdlib.h>
    #include <cstring>
    #include <string>
    using namespace std;
    string formatstr(const string ="", char=' ' , int prec=0, int strlength=0 );
    int findString ( string, string );
    string padString ( string, int,char = ' ') ;
    const int progWidth = 25 ;
    const int descWidth = 60 ;
    const int sizeWidth = 25 ;
    const int cstring_buffer = 100;
    int main(int argc , char * argv[])
    char ch ;
    unsigned int findPos=0, start, len ;
    char sourceFileName[cstring_buffer];
    char targetFileName[cstring_buffer];
    string strLine;
    string progName, progDesc, progSize;
    if (argc == 1 ) // no arguments provided creates pacQi.txt
    strncpy(sourceFileName,"pacQi.txt", 12);
    strncpy (targetFileName, "pacQi.xls",12 );
    system ("pacman -Qi > pacQi.txt");
    else // user supplied name
    len = strlen(argv[1] ) + 6 ;
    if (len > cstring_buffer )
    cout << "\n\nProgram Exiting to Prevent Buffer Overrun\n\n";
    exit (0);
    //cout << endl << argv[1]<< " length is : " << strlen(argv[1]) << endl; // testing
    strncpy (sourceFileName,argv[1], strlen(argv[1]) + 2 ) ;
    strncpy (targetFileName,argv[1], cstring_buffer - 10 ) ;
    strncat (targetFileName,".xls",5);
    ifstream ifile (sourceFileName) ;
    ofstream ofile (targetFileName) ;
    progName ="";
    progDesc = "";
    progSize = "";
    while (ifile.good() )
    getline(ifile,strLine);
    findPos = findString ("Name", strLine); // Find Name Line
    if (findPos > 0 )
    for (start=findPos+2; start < strLine.size();start++)
    ch = strLine[start];
    progName = progName + ch;
    progName = padString(progName,progWidth);
    progDesc=""; // remove remants of progDesc second line
    progSize="";
    findPos = findString ("Size", strLine); // Find Size
    if (findPos > 0 )
    for (start=findPos+2; start < strLine.size();start++) // kill trailing K
    ch = strLine[start];
    if ( ( (ch >= '0') and (ch <= '9') )or (ch == '.') )
    progSize = progSize + ch;
    string temp;
    temp ="";
    progSize = formatstr(progSize, ' ' , 3, 25);
    findPos = findString ("Description", strLine); // Find Description
    if (findPos > 0 )
    for (start=findPos+2; start < strLine.size();start++)
    ch = strLine[start];
    progDesc = progDesc + ch;
    progDesc=padString(progDesc,descWidth);
    if (progName>"" and progDesc>"" and progSize>"")
    ofile << progName << '\t' << progDesc << '\t' << progSize <<endl ; // Print program record
    progName ="";
    progDesc = "";
    progSize = "";
    } // while loop
    ifile.close();
    ofile.close();
    } // E N D M A I N
    //==================================================================================
    int findString ( string source, string target) // if source found returns ":" + 2
    int found;
    string test;
    test = source;
    found = target.find(source);
    if (!found )
    found = target.find(":");
    if (found < 0 )
    found =0;
    return found;
    //========================================================================
    string padString ( string str, int num, char ch)
    string temp;
    int len;
    temp = str;
    len = str.size();
    for (int start = len; start < num; start++)
    temp += ch;
    return temp;
    //===========================================================================
    string formatstr(const string str, char leadchar, int prec, int strlength)
    using namespace std;
    int i1,i2,len;
    int sptr,tptr,wholeDigits=0,fracDigits=0;
    int fracPtr=0;
    int noc,commaptr; //Number Of Comma's
    bool hasDec=false, isNeg =false;
    string temp,temp2,fracStr,wholeStr,s;
    s=str;
    len=s.size(); // Length of String w/o '-' sign
    temp="";
    if (str[0]=='-')
    isNeg=true; // If negative kill minus sign
    for (int i1=1;i1< len ; i1++ ) // Copy rest of string to s
    temp=temp + str[i1];
    s = temp;
    len=s.size();
    for (sptr=0;sptr <len;sptr++) //Find # of digits wholeDigits + in decimal
    if (s[sptr]!='.')
    wholeDigits++;
    else
    fracPtr=sptr;
    hasDec=true;
    wholeDigits=sptr ; // Represents digits before dec since sptr is at dec. don't increment
    fracDigits = (len-(fracPtr)); // Back into # of decimal digits
    break;
    fracStr="";
    if (hasDec)
    for (i1=fracPtr;i1<len;i1++) // Build fracStr
    fracStr=fracStr + s[i1];
    temp = ""; // bugaboo caused by negativity
    for (sptr=wholeDigits-1,tptr=0; sptr>=0 ;sptr--,tptr++ ) //Reverse wholeDigitsing w/o decimal
    temp= temp + s[sptr];
    temp2=""; // commatize reversed string to temp2
    commaptr=0;
    noc = temp.size() / 3 ; // S E E IF W O R K S
    for (sptr=0;sptr<wholeDigits;sptr++)
    if (commaptr==3 && noc)
    temp2=temp2 + ',';
    noc--;
    commaptr=0;
    temp2=temp2 + temp[sptr];
    commaptr++;
    temp=""; // Reverse commatized Reversed String (wtf)
    for (sptr=temp2.size() -1 ; sptr >= 0 ; sptr--)
    temp = temp + temp2[sptr];
    s=temp;
    len =fracStr.size();
    if (prec < 0)
    ; // Put string back
    if (prec == 0 ) // Leave out fractional part
    fracStr="";
    if (prec > 0 )
    temp="";
    if (fracDigits > prec) // Will Truncate decimal not round up
    for (int i1=0;i1<=prec;i1++)
    temp=temp + fracStr[i1] ;
    fracStr=temp;
    if (fracDigits < prec +1 && len >0) //fractDigits include '.'
    for (int i1=1;i1< (prec-len+2);i1++)
    fracStr=fracStr + '0';
    if(len==0)
    fracStr='.';
    for (int i1=1; i1 <= prec; i1++)
    fracStr = fracStr + '0';
    s=s+fracStr;
    temp = " " ;
    temp[0]=leadchar;
    temp= temp + s;
    if (isNeg)
    temp = '(' + temp + ')';
    i1=temp.size();
    temp2="";
    if (strlength > 0 ) // Pad String for strlength
    i2=strlength -i1;
    for (i1=0;i1<i2;i1++)
    temp2=temp2+' ';
    temp = temp2 + temp;
    s = temp;
    return s;
    Last edited by ljshap (2009-05-14 16:53:51)

    Daenyth wrote:If you're using C, why not either use libalpm instead of system(pacman...), or add the functionality to pacman itself (-Qqi)?
    I never heard of libalpm, but I'll look into for my own information.
    If I added the functionality to pacman itself (assuming i knew how), I would have to change the source and recompile every time there was an update.  My program should work with new versions unless there is a major change to the output of pacman -Qi(e).
    My "program" produces the following output format:
    52dec                              liba52 is a free library for decoding ATSC A/52 streams.                          207.860
    aalib                                AAlib is a portable ASCII art GFX library                                                           824.000
    abiword                           A fully-featured word processor                                                                 12,833.000
    abiword-plugins            Various plugins for Abiword                                                                           4,199.000
      It can be read with a regular text editor or a spreadsheet where it can be sorted by size if you want to see whats taking up hardrive space without scrolling through the detailed output of pacman -Qi.
    Obviously, the program has extremely limited usefullness unless you just want to to see installed programs, it description and size in a more compact format either out of curiousity or your planning on reinstalling but want to see the descrition as well as the program name.
    I appologize if this functionality is already available in libalpm or elsewhere, but I figured I'd put it up in case anyone wanted it.
    Thanks for the additional information.

  • How to handle more than 255 char in excel att. in FM SO_DOCUMENT_SEND_API1

    hi all,
    Good morning.
    My requirement is to send a report as an excel attatchment to the respective managers mail box. For this I am using the function module SO_DOCUMENT_SEND_API1 as follows.
    call function 'SO_DOCUMENT_SEND_API1'
    exporting
    document_data =
    put_in_outbox =
    sender_address =
    sender_address_type =
    commit_work =
    tables
    packing_list =
    object_header =
    contents_bin =
    contents_txt =
    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.
    Here the problem is contents_bin is of type SOLISTI1 which takes max 255 characters, As my report columns occupies more than 400 characters, I am unable to get all the column values in excel attachement.
    Can anyone please help me to get all the column values in the excel attachment.
    Thanks in Advance.

    Hi,
    Please check the following extract of a sample program I had executed.It deals with how to handle more that 255 chars in excel att in FM SO_DOCUMENT_SEND_API1
    Hope this helps....
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
               con_tab  TYPE X VALUE '09'.  "OK for non Unicode
    data : Begin of wa_output ,
              BUFFER(1000)  TYPE C,  " data to be written into xls format
           End of wa_output.
    data : gt_output LIKE wa_output OCCURS 0 WITH HEADER LINE.
    data : FIELDNAME_OFFSET TYPE I.
    Attachement contents
    DATA: BEGIN OF wa_att_cont.
            INCLUDE STRUCTURE solisti1.
    DATA: END OF wa_att_cont.
    DATA: lt_att_cont LIKE wa_att_cont OCCURS 0.
    data : begin of zdfies occurs 0.
                 include structure dfies.
    data : end of zdfies.
    data : begin of it_field occurs 0,
                 fldname(40) type c,
           end of it_field.
    data : yfilname like RLGRAP-FILENAME value 'C:\Documents and
    Settings\'.
    data : ok_code TYPE sy-ucomm,
           save_ok TYPE sy-ucomm.
    data : flag type i.
    ********************************Variables*****************************
      DATA: lv_count   TYPE i,                   "  count
            lv_forwarder LIKE soud-usrnam,       " Forwarder.
            lv_lines TYPE i.                     " no of lines
    ********************************Structures****************************
      DATA: w_doc_data LIKE sodocchgi1,
            w_sent_all(1) TYPE c,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ.
    ******Structure for Folder ID
      DATA: BEGIN OF wa_folder_id.
              INCLUDE STRUCTURE soodk.
      DATA: END OF wa_folder_id.
    Folder Contents, change attributes
      DATA: BEGIN OF wa_object_fl_change.
              INCLUDE STRUCTURE sofm1.
      DATA: END OF wa_object_fl_change.
    ******Object definition, change attributes
      DATA: BEGIN OF wa_object_hd_change.
              INCLUDE STRUCTURE sood1.
      DATA: END OF wa_object_hd_change.
    ******Object ID
      DATA: BEGIN OF wa_object_id.
              INCLUDE STRUCTURE soodk.
      DATA: END OF wa_object_id.
    ******Object Defintion.
      DATA: BEGIN OF wa_sood.
              INCLUDE STRUCTURE sood.
      DATA: END OF wa_sood.
    ******User Definition
      DATA: BEGIN OF wa_soud.
              INCLUDE STRUCTURE soud.
      DATA: END OF wa_soud.
    ******Sent to all flag.
      DATA: BEGIN OF wa_sonv.
              INCLUDE STRUCTURE sonv.
      DATA: END OF wa_sonv.
    ******Mail contents
      DATA: BEGIN OF wa_objcont.
              INCLUDE STRUCTURE solisti1.
      DATA: END OF wa_objcont.
    ******Mail header.
      DATA: BEGIN OF wa_objhead.
              INCLUDE STRUCTURE soli.
      DATA: END OF wa_objhead.
    ******Para A
      DATA: BEGIN OF wa_objpara.
              INCLUDE STRUCTURE soparai1.
      DATA: END OF wa_objpara.
    ******Para B
      DATA: BEGIN OF wa_objparb.
              INCLUDE STRUCTURE soparbi1.
      DATA: END OF wa_objparb.
    ******Receivers list
      DATA: BEGIN OF wa_receivers.
              INCLUDE STRUCTURE somlreci1.
      DATA: END OF wa_receivers.
    Pack list
      DATA: BEGIN OF wa_packlist.
              INCLUDE STRUCTURE sopcklsti1.
      DATA: END OF wa_packlist.
      DATA: BEGIN OF wa_att_head.
              INCLUDE STRUCTURE soli.
      DATA: END OF wa_att_head.
    ********************internal tables******************************
      DATA: lt_objcont   LIKE wa_objcont OCCURS 0, "mail contents
            lt_objhead   LIKE wa_objhead OCCURS 0, "mail header
            lt_objpara   LIKE wa_objpara OCCURS 0, "Paragraph A
            lt_objparb   LIKE wa_objparb OCCURS 0, "Paragraph B
            lt_receivers LIKE wa_receivers OCCURS 0," receiver list
            lt_packlist  LIKE wa_packlist OCCURS 0,"Pack list
            lt_att_head  LIKE wa_att_head OCCURS 0."Attachment Header
    **************************Constants***********************************
      CONSTANTS: lc_kreuz LIKE sonv-flag   VALUE 'X', "Outbox flag,
                 lc_colon(1) TYPE c VALUE ':',
                 lc_raw(3) TYPE c VALUE 'RAW',
                 lc_f(1) TYPE c VALUE 'F',
                 lc_u(1) TYPE c VALUE 'U'.
    DATA: w_cnt TYPE i.
    data : wa_edition like t_edition.
    DATA : i_strlen TYPE i,
            i_off TYPE i ,
            i_len TYPE i VALUE 254,
            i_totlen TYPE i,
            lv_fill_space TYPE i,
            lv_split_times TYPE i,
            lv_len TYPE i.
    **>> Populate the attachment contents.*
      LOOP AT gt_output INTO wa_output.
        i_strlen = strlen( wa_output ) .
        IF i_strlen LE 254.
          CONCATENATE con_cret wa_output-buffer
               INTO wa_output-buffer.
          APPEND wa_output-buffer TO lt_att_cont.
        ELSE.               "  i.e the data is more than 255 characters
         DO 4 TIMES.
            i_totlen = i_off + i_len .
            IF i_totlen = 254.
              wa_att_cont = wa_output+i_off(i_len).
              CONCATENATE con_cret wa_att_cont
              INTO wa_att_cont.
              APPEND wa_att_cont TO lt_att_cont.
            ELSE.
          wa_att_cont = wa_output+i_off(i_len). "splitting more than 255
               APPEND wa_att_cont TO lt_att_cont.
            ENDIF.
            IF i_totlen GE i_strlen.
              CLEAR : i_off .
              EXIT.
            ELSE.
              i_off = i_off + 254.
            ENDIF.
          ENDDO.
        ENDIF.
        CLEAR : wa_output.
      ENDLOOP.

Maybe you are looking for

  • Multiple devices with one email address

    I have several devices with skype. I'd like any device to be able to call any other device, but only use a single email address. Basically, Is there any way to do this? How?

  • I cant burn a CD for the life of me.... please help

    when I try to burn a cd 1 of 3 things will happen. 1) it will say that there is too much info for the size of the disk, but the play list is much smaller than the 700mb/80min CD-R that I am using : here is the error code thing. Microsoft Windows XP H

  • IOS4 Fix worked for me

    I tried last night to upgrade to iOS on my 3G iPhone. Failed miserably like everyone else. I tried everything posted. Then I tried this and it worked. from a command prompt go here (replace with your user name on your pc): -go to c:\users\yourUserNam

  • When opening any website the opening page shows the title and ending but nothing inbetween;why?

    when opening a websi8te such as the Met Offi8ce,I get the heading Met Office then a large gap following the endit message.Then I get the information I asked for on a seperate second page.This event repeats itselk on every website i visit.

  • Can't open pdf files from web pages

    I recently upgraded to Adobe Reader 8.1. Now I cannot open pdf files from email attachments. Advises to set Adobe Reader as default in folder options. When I try to do so, it appears to be OK, but still will not open files from emails.