Formating the output using SO_NEW_DOCUMENT_SEND_API1

Hi ,
I am using the FM 'SO_NEW_DOCUMENT_SEND_API1' for sending data in an internal table as an email . I am wondering whether it will be possible to to send it in the table format with the field names intact. Currently i am able to send the mail but without the table field names . Please help
Regards,
Tashi

hello gurus,
please check this below program.
TABLES : ADR6.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : SPOOLNO TYPE TSP01-RQIDENT OBLIGATORY.
SELECT-OPTIONS :  MAILS FOR ADR6-SMTP_ADDR DEFAULT 'xyz.com' OBLIGATORY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK B1.
DATA SEND_REQUEST  TYPE REF TO CL_BCS.
DATA DOCUMENT      TYPE REF TO CL_DOCUMENT_BCS.
DATA RECIPIENT     TYPE REF TO IF_RECIPIENT_BCS.
DATA BCS_EXCEPTION TYPE REF TO CX_BCS.
DATA SENT_TO_ALL   TYPE OS_BOOLEAN.
DATA PDF_SIZE      TYPE SO_OBJ_LEN.
DATA PDF_CONTENT   TYPE SOLIX_TAB.
DATA PDF_XSTRING   TYPE XSTRING.
DATA MAILTO TYPE AD_SMTPADR.
START-OF-SELECTION.
  PERFORM CREATE_PDF.
  PERFORM SEND.
*&      Form  send
FORM SEND.
  TRY.
    -------- create persistent send request ------------------------
      SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
    -------- create and set document -------------------------------
      PDF_CONTENT = CL_DOCUMENT_BCS=>XSTRING_TO_SOLIX( PDF_XSTRING ).
      DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
            I_TYPE    = 'PDF'
            I_HEX     = PDF_CONTENT
            I_LENGTH  = PDF_SIZE
            I_SUBJECT = 'sending pdf as email' ).           "#EC NOTEXT
    add document object to send request
      SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
    LOOP AT MAILS. " for sending multiple mails we can use this logic
        MAILTO = MAILS-LOW.
    --------- add recipient (e-mail address) -----------------------
    create recipient object
        RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( MAILTO ).
    add recipient object to send request
      SEND_REQUEST->ADD_RECIPIENT( RECIPIENT ).
  ENDLOOP.
    ---------- send document ---------------------------------------
      SENT_TO_ALL = SEND_REQUEST->SEND( I_WITH_ERROR_SCREEN = 'X' ).
      COMMIT WORK.
      IF SENT_TO_ALL IS INITIAL.
        MESSAGE I500(SBCOMS) WITH MAILTO.
      ELSE.
        MESSAGE S022(SO).
      ENDIF.
  ------------ exception handling ----------------------------------
  replace this rudimentary exception handling with your own one !!!
    CATCH CX_BCS INTO BCS_EXCEPTION.
      MESSAGE I865(SO) WITH BCS_EXCEPTION->ERROR_TYPE.
  ENDTRY.
ENDFORM.                    "send
*&      Form  create_pdf
Create PDF Content
1) get attributes of spool request
2) convert spool request to PDF dependent on document type
FORM CREATE_PDF.
  DATA RQ       TYPE TSP01.
  DATA BIN_SIZE TYPE I.
  DATA DUMMY    TYPE TABLE OF RSPOATTR.
  ------------ get attributes of spool request ---------------------
  CALL FUNCTION 'RSPO_GET_ATTRIBUTES_SPOOLJOB'
    EXPORTING
      RQIDENT     = SPOOLNO
    IMPORTING
      RQ          = RQ
    TABLES
      ATTRIBUTES  = DUMMY
    EXCEPTIONS
      NO_SUCH_JOB = 1
      OTHERS      = 2.
  IF SY-SUBRC <> 0.
    MESSAGE E126(PO) WITH SPOOLNO.
  ENDIF.
  --- convert spool request into PDF, dependent on document type ---
  IF RQ-RQDOCTYPE = 'OTF' OR RQ-RQDOCTYPE = 'SMART'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
        SRC_SPOOLID              = SPOOLNO
        NO_DIALOG                = 'X'
        PDF_DESTINATION          = 'X'
        NO_BACKGROUND            = 'X'
      IMPORTING
        PDF_BYTECOUNT            = BIN_SIZE
        BIN_FILE                 = PDF_XSTRING
      EXCEPTIONS
        ERR_NO_OTF_SPOOLJOB      = 1
        ERR_NO_SPOOLJOB          = 2
        ERR_NO_PERMISSION        = 3
        ERR_CONV_NOT_POSSIBLE    = 4
        ERR_BAD_DSTDEVICE        = 5
        USER_CANCELLED           = 6
        ERR_SPOOLERROR           = 7
        ERR_TEMSEERROR           = 8
        ERR_BTCJOB_OPEN_FAILED   = 9
        ERR_BTCJOB_SUBMIT_FAILED = 10
        ERR_BTCJOB_CLOSE_FAILED  = 11
        OTHERS                   = 12.
    IF SY-SUBRC <> 0.
      MESSAGE E712(PO) WITH SY-SUBRC 'CONVERT_OTFSPOOLJOB_2_PDF'.
    ENDIF.
  ELSEIF RQ-RQDOCTYPE = 'LIST'.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        SRC_SPOOLID              = SPOOLNO
        NO_DIALOG                = 'X'
        PDF_DESTINATION          = 'X'
        NO_BACKGROUND            = 'X'
      IMPORTING
        PDF_BYTECOUNT            = BIN_SIZE
        BIN_FILE                 = PDF_XSTRING
      EXCEPTIONS
        ERR_NO_ABAP_SPOOLJOB     = 1
        ERR_NO_SPOOLJOB          = 2
        ERR_NO_PERMISSION        = 3
        ERR_CONV_NOT_POSSIBLE    = 4
        ERR_BAD_DESTDEVICE       = 5
        USER_CANCELLED           = 6
        ERR_SPOOLERROR           = 7
        ERR_TEMSEERROR           = 8
        ERR_BTCJOB_OPEN_FAILED   = 9
        ERR_BTCJOB_SUBMIT_FAILED = 10
        ERR_BTCJOB_CLOSE_FAILED  = 11
        OTHERS                   = 12.
    IF SY-SUBRC <> 0.
      MESSAGE E712(PO) WITH SY-SUBRC 'CONVERT_ABAPSPOOLJOB_2_PDF'.
    ENDIF.
  ELSE.
    MESSAGE E789(PO) WITH RQ-RQDOCTYPE.
  ENDIF.
  PDF_SIZE = BIN_SIZE.
ENDFORM.                    "create_pdf

Similar Messages

  • HT3775 Is the Codec listed adjacent to the file format the Codec used with that file format?

    Is the Codec listed adjacent to the file format the Codec used with that file format?

    Is the Codec listed adjacent to the file format the Codec used with that file format?

  • Formatting the output (currency with decimals)

    hi all,
          i want to format the output of the currency field. Right now it displays the exact value like say 23 or 43.5 etc. But my requirement is i need it to display in a standard format as 23.00 , 43.50 , 565.00 etc. i,e if there is no decimals then it should be filled with zero's.
    I have gone through some of the threads which speaks of formatting the output if it is a value node. But here i have directly bounded the table to a model node.
    Domian level datatype of the field is Currency in R/3. After model import in dictionary it is showing as decimal.
    How can i achieve this?I Appreciate if someone can help me on this.
    Regards,
    G Nid

    hi,
    Go thru this link it might helps you.
    column heading -refer to the webdynpro tutorial 34
    Change the currency data type char and specify the length.
    Thanks,
    Lohi.

  • Formatting the output

    Hi everyone in the forum,
    I do not know if i should post this question here, but i think is the best place. Sorry if i were wrong.
    just a question because i have no idea how to format the output i need.
    I have a REAL or FLOAT and the output restrictions shows that it should be:
    1.0000 D-08 if the value is less than 1
    1.0000 if the value is [1,9]
    1.0000 D+03 is value bigger than 9
    and the other problem is whith other variable (type String) which represents integers, e.g, 0.000000 1.0000000 2.000000; and i have to return only 0 1 2 .
    Any suggestion about how to format the output?
    Thanks

    DecimalFormat

  • Sqlplus set statement:format the output without specifying every col length

    Hi ppl,
    i am writing below query inside a shell script. Is there any way to format the output of sqlplus without providing the name of all the columns that we are going to output. for example, in below code i have specified the column width of the columns i want to output. but if the number of columns is large (or when we want to do a select * from...) then it becomes tedious to write all of them. Is there any way i can define display length all the columns to be of same size.. or at least all the number columns of one size, char columns of one size etc...
    sqlplus -sa/passwd@db_name << EOF
    SET ECHO ON;
    SET HEADING ON;
    COLUMN USERNAME FORMAT A20;
    COLUMN USER_ID FORMAT A20;
    COLUMN PASSWORD FORMAT A20;
    spool filename.txt
    some qry... ;
    exit
    EOFThanks
    Edited by: KnockTurnAll on 25 Oct, 2010 10:41 PM
    Edited by: KnockTurnAll on 26-Oct-2010 04:25

    My SQL*Plus is a bit rusty, but I don't think you can for characters. You can set NUMWIDTH for a default size for numeric columns.
    You could write a small bit of SQL to generate the required column definitions. You could even hit ALL_TAB_COLUMNS to generate a generic 'set every column width' file and run it as a separate sql script in your main script. Not sure if there is an upper limit on the number of Columns you can define.
    Back in the day when we did everything with SQL*Plus scripts, we had a standard columns file that we called in all our scripts, just for this purpose.
    Carl

  • Common-net telnet formatting the output ?

    Hi, I am using the code below to establish a telnet connection with a windows XP system. The code connects and successfully issues commands, however the output contains a lot of junk characters which i would like to exclude from the output. Does anyone have any experience with commons-net telnet and if so is there a way to tell the system that i am connecting to a winXP telnet server so that the output is formatted accordingly.Thanks
    Sorry tried to post my code with the appropiate tags but it would not display correctly!

    Hello Saugat K.C,
    This forum is about .NET Framework Setup, it is not related to dev. To help you get a direction, I would recommend you consider WCF forum or Web service forum, they are related to your case.
    Since you haven't choosed the technology, I will move your case to off-topic. Please consider post this question to the forum I mentioned.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Formatting the output in file out

    Hi,
    I have 5 fields in the internal table. I have used GUI_DOWNLOAD for downloading the file.
    The down loaded file looks like this.
    Field1      Field2  field3                      filed4              field5
    ABC     1234     20080131/405FED     161.65          161.65
    ABC     1234     20080131/560          7883.76          7883.76
    ABC     1234     20080131/701FED     6184.77          6184.77
    But I want the output like this:
    1. Spacing between columns 1 and 2 should be 3 spaces from after the last digit in column 1 to the first digit in column 2.
    2. Spacing between columns 2 and 3 should be 5 spaces from after the last digit in column 2 to the first digit in column 3.
    3. Spacing between columns 3 and 4 should be 8 spaces from after the last digit in column 3 to directly after the last digit in column 4.
    4. Spacing between columns 4 and 5 should be 10 spaces from after the last digit in column 4 to directly after the last digit in column 5.
    Please help how to procedure.
    Thanks,
    Sham.

    I just tried this piece of code and it seems to work fine:-
    TYPES : BEGIN OF ty_1,
            f1 TYPE char15,
            f2 TYPE char15,
            f3 TYPE char15,
           END OF ty_1,
           BEGIN OF ty_2,
             text TYPE char100,
           END OF ty_2.
    DATA : lt_1 TYPE TABLE OF ty_1, lt_2 TYPE TABLE OF ty_2,lc_ct TYPE i,lc_star TYPE char10,
           ls_1 TYPE ty_1,ls_2 TYPE ty_2,ls_3 TYPE ty_2.
    FIELD-SYMBOLS <fs> TYPE ANY.
    ls_1-f1 = 'A'.ls_1-f2 = 'AA'.ls_1-f3 = 'AAA'.APPEND ls_1 TO lt_1.
    ls_1-f1 = 'B'.ls_1-f2 = 'BB'.ls_1-f3 = 'BBB'.APPEND ls_1 TO lt_1.
    ls_1-f1 = 'C'.ls_1-f2 = 'CC'.ls_1-f3 = 'CCC'.APPEND ls_1 TO lt_1.
    ls_1-f1 = 'D'.ls_1-f2 = 'DD'.ls_1-f3 = 'DDD'.APPEND ls_1 TO lt_1.
    ls_1-f1 = 'E'.ls_1-f2 = 'EE'.ls_1-f3 = 'EEE'.APPEND ls_1 TO lt_1.
    LOOP AT lt_1 INTO ls_1.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE ls_1 TO <fs>.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        CASE sy-index.
          WHEN 1.
            DO.
              lc_ct = lc_ct + 1.
              IF lc_ct > 3.
                CONCATENATE <fs> lc_star INTO ls_2.
                EXIT.
              ENDIF.
              CONCATENATE lc_star '*' INTO lc_star.
            ENDDO.
          WHEN 2.
            DO.
              lc_ct = lc_ct + 1.
              IF lc_ct > 5.
                CONCATENATE <fs> lc_star INTO ls_2.
                EXIT.
              ENDIF.
              CONCATENATE lc_star '*' INTO lc_star.
            ENDDO.
          WHEN 3.
            DO.
              lc_ct = lc_ct + 1.
              IF lc_ct > 8.
                CONCATENATE <fs> lc_star INTO ls_2.
                EXIT.
              ENDIF.
              CONCATENATE lc_star '*' INTO lc_star.
            ENDDO.
        ENDCASE.
        CONCATENATE ls_3 ls_2 INTO ls_3.
        CLEAR: ls_2, lc_star,lc_ct.
      ENDDO.
      TRANSLATE ls_3 USING '* '.
      APPEND ls_3 TO lt_2.
      CLEAR : ls_3,ls_1.
    ENDLOOP.
    Result:-
    A   AA     AAA
    B   BB     BBB
    C   CC     CCC
    D   DD     DDD
    -- Dedeepya

  • Dymanic viewing of the Output using Transform.

    Hello,
    I am testing out 'Transform','StreamSource','Templates' using 1.5.
    I have a test XML document which has an associated XSL
    This XSL displays the result of the above XML in HTML.
    I am fetching the associated xsl for the above xml and dynamically converting into HTML.
    The result of this transformation is stored in an 'ByteArrayOutputStream'.
    My query is:
    Is there a way to view the xsl output?
    Or can I store the output in some HTML file and view this to see
    if this is the correct output?
    Thanks,
    // Return the associated XSL for NewOrder.Single.
    Templates order_transformtemplate =  m_templates.getTransformTemplate("Order.Single");
    // Now create a Transformer
    Transformer transformer = order_transformtemplate.newTransformer();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    //Transforms the XML Source to a Result.The 'orderDocument' is the XML document being transformed.
    transformer.transform(new DOMSource(orderDocument), new StreamResult(out));
                       

    All done.
    Works as required.
    Thanks

  • Issues while generating the output(using VF02- header- output)

    Hi Group,
    I have issues while generating output using the tcode VF02.
    the issue is that, I have got an output type which is configured for the medium "Special Function" and the o/p program generates PDF depending on certain criteria.
    now, when I try to "repeat output" option to generate output again, I was getting errors. it works sometimes by choosing the option "Successfully processed" then selecting the record and then saving it. if I do the same thing again, the output make be running into error or success, it is varying everytime.
    I am not able to understand why the process is not working correctly, when doing the "Repeat output" option on the "Successfully processed" record, the system is giving error instead of a Successful message. it is succeeding once and sometimes not.
    Kindly let me know your inputs if you have encountered same kind of issue.
    Regards,
    Vishnu.

    hi Group,
    when I checked the configuration part of the o/p type I am currently processing, I could see that, in customizing part of this o/p type, there was a checkbox for Multiple Issuing - which is not checked.
    when it is not checked, it should not be possible to run the o/ps for multiple times, but when I tried to generate o/ps again and again, in a few attempts I could to generate the PDFs and in some cases not. I don't know why there is no relevance for this check box Multiple Issuing.
    Could you please let me know why this issuing of o/p is working in some occassions and not working work sometimes, which is  having the configuration of checkbox Multiple Issuing - not being checked.
    thanks for your help in advance.
    Regards,
    Vishnu.

  • Formatting the Output of a Table

    Quite simply I am trying to format the laytout of a VC tabe so that
    a)I can display the columnj header on 2 lines(narrower column)
    and
    b) I want to sort in descending order by a Key Figure
    Is such things possiblw with the VC.
    I have tried my book but no details on it.
    Thanks

    John
    Displaying column header text over multiple lines is not possible.
    Sorting is possible. Use the sort operator between data service and table. Unfortunately you have to reconfigure the table because you cannot add the operator without dragging new lines between objects.
    Henning

  • How to format the output of Today() ⨍(x)  when used in a formula

    This table should explain what I'm asking to do. Have the Wed, Nov 2, 2011 applied to a date when I use the Today() function. Without the workaround of refernencing another cell to pickup formatting like I do in the final row.
    Formula
    Cell Format
    Result
    =CONCATENATE("Today is ",TODAY())"
    Date: Mon,Jan 5, 2009 Time: None
    Today is 02/11/2011
    =TODAY()
    Date: Mon,Jan 5, 2009 Time: None
    Wed, Nov 2, 2011
    = CONCATENATE("Today is ",C3)
    Date: Mon,Jan 5, 2009 Time: None
    Today is Wed, Nov 2, 2011

    Hi Barry
    I just discover this thread.
    The main problem here is that as we aren't allowed to define the format used by TODAY() in the described formula, we have to use a formula which is localization dependant which is really annoying.
    For my own use, I will just use two columns :
    In the first one the formula would be :
    =IF(MID(""&1/2,2,1)=".","Nous sommes le","Today is")
    In the second one it would be :
    =TODAY()
    The vertical border between the two columns is set to white.
    But I think that the most efficient answer would be that Apple give us the ability to pass a parameter to TODAY() and/or NOW().
    This parameter would define the format which would remain the current one when the parameter is omitted.
    Yvan KOENIG (VALLAURIS, France)  07 /11 /2011 17:38:15
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Problem while placing a button in the Output using ALV OOPs

    Hi,
    I am using ALV OOPs to display  report output.
    In the toolbar i have to palce an update button  and if i click on that update it should then call the selection screen 500 .
    So,please  help me to achieve this using ALV OOPs.
    THANKS & REGARDS,
    Kiranmai.

    Hi,
    you can use set pf-status statement with the OOPs' concept where in you will have to give this in the events table and pass it to the method to display the alv ...
    Regards,
    Siddarth

  • Need help to format the output of the query.

    First of all i would like to say I m newbi in oracle query
    and of course thanks to read the thread.
    I have a problem formatting a query output.
    Actually the query is like the following :
    select a1
    ,b1
    ,c1
    from table
    where id.table=1
    UNION
    select a2
    ,b2
    ,c2
    from table2
    where id.table2=1
    order by 1;
    exit;
    my actual output
    a1 b1 c1
    a2 b2 c2
    a1 b1 c1
    a2 b2 c2
    my desired output
    a1 b1 c1
    a2 b2 c2
    a1 b1 c1
    a2 b2 c2
    So what i need is an empy row between the groups of results
    and to shift the union query.
    thanks in advance

    SQL>select * from t1;
            C1         C2         C3
             1          2          3
             2          3          4
             3          4          5
    SQL>select * from t2;
            C1         C2         C3
            30         40         50
            20         30         40
            10         20         30
    SQL>select c1,c2,c3
      2  from( select c1,c2,c3,1 flg
      3           from t1
      4           union all
      5           select c1,c2,c3,2
      6           from t2
      7           union all
      8           select null,null,null,1
      9           from dual)
    10  order by flg,c1,c2,c3 nulls last;
            C1         C2         C3
             1          2          3
             2          3          4
             3          4          5
    <br>
            10         20         30
            20         30         40
            30         40         50
    7 rows selected.
    Funny.......                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Format the output file by command spool

    Hi,
    I use sqplus in oracle to output the command output to text file .
    I use below set environment varialble.
    SQL> set echo off;
    SQL> set linesize 3999;
    SQL> set feedback off;
    SQL> set feedback off;
    SQL> set termout off;
    SQL> set pagesize 0;
    SQL> spool mapping.txt
    select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
    In ouput file , it look like
    SQL> select C_SIM_MSISDN,C_SIM_IMSI from RCA_SMART_CARD order by C_SIM_MSISDN;
    060010007 10007
    SQL> spool off;
    any setting or command that allow me to remove
    the first sql command line" SQL>select XXXX"
    and the last command "SQL>spool off" after start up the "spool mapping.txt"

    Hi,
    Don't type those commands (at least the ones between SPOOL and SPOOL OFF, inclusive) directly into SQL*Plus. Instead, put them in a script, run the script.
    For example, if you create a file called d:\foo\bar\smart_card.sql, that looks like this:
    set echo off;
    set linesize 3999;
    set feedback off;
    set feedback off;
    set termout off;
    set pagesize 0;
    spool mapping.txt
    select        C_SIM_MSISDN
    ,       C_SIM_IMSI
    from        RCA_SMART_CARD
    order by  C_SIM_MSISDN;
    spool offThen all you type at the SQL> prompt is
    @c:\foo\bar\smart_card

  • Keep getting error occurred while formatting the disk using boot camp with usb

    So I keep getting the above error when trying to use boot camp with a USB drive. I have tried with more than one flash drive, all formatted to FAT32, multiple isos, both ripped right from a windows 7 ultimate dvd and downloaded, and I have made sure the iso was unmounted. I have also tried all different combinations of checking the options in the boot camp assistant menu. Any ideas on how to get this to work?

    I was mistakenly thinking of the Fat16 limit. That is my mistake.
    When bootcamp assistant failed to create the USB from my iso disk (with no explanation), I decided to experiment a little with the dd and cp utilities. dd failed, and cp told me the install file was too big.
    The install.wim on my iso is 4,351,019,025 bytes. So even if 4GB is the file size limit, it is too big. 4GB is 4,294,967,296 bytes if I recall.
    If I am still right about the file size, smaller editions of windows 7 would be able to fit on the flash drive, or people can have an actual DVD with windows 7 and install from there.

Maybe you are looking for