Sap script-standard text in order confirmation

Hi Experts,
Can anybody solve my problem.I f my problem is solved they will definetely be rewarded with points.
The standard text will be stored as Name = ORDCONF_TEXT_(sales org)_(distributionchannel)_(division)
Text ID = ZSD
Examples: ORDCONF_TEXT_4000_01_01 ,
ORDCONF_TEXT_4000_01_80 , ORDCONF_TEXT_1000_01_01
The print program /form will need to pick up the
appropriate standard text based on the Sales Area
(combination of Sales Org / Distribution Center /
Division) of the sales order [VBAK-VKORG /
VTWEG / SPART], provided a standard text has been
created for that Sales Area. Itu2019s not required
that every sales area have a standard text, so if one
is not found, this step should be skipped and
the rest of the print program executed.
The new text should print after 2 blank lines after
the Printable Notes text (which is after the
line items and the Total Net Price prints).
The font should be the same size as the Printable
Notes, but bolded rather than italicized
The text should print in the same columns as the
Printable Notes currently print in (Material
Description / Scheduled Ship Date / Quantity)
So the logic i have used is this below code:
I used a subroutine in the layout of the main window becoz i need to print it in the main window below after 2 blank lines of line items.
PERFORM GET_OBJECT IN PROGRAM ZSDRP001_ORD_CONF_IRE
USING &VBDKA-VBELN&
CHANGING &ORDCONF_TEXT&
ENDFORM
INCLUDE &ORDCONF_TEXT& OBJECT TEXT ID ZSD PARAGRAPH A1
I called this subroutine in the print program:
FORM GET_OBJECT TABLES INPUT_TAB STRUCTURE ITCSY
                       OUTPUT_TAB STRUCTURE ITCSY.
DATA : TMP_VBELN LIKE vbdka-VBELN,
       TMP_VKORG LIKE  VBAK-VKORG,
       TMP_VTWEG LIKE VBAK-VTWEG,
       TMP_SPART LIKE VBAK-SPART,
       TMP_TXNAM1(40) TYPE C VALUE 'ORDCONF_TEXT_',
       TMP_TXNAM2(100) TYPE C.
DATA: v_text LIKE tline-tdline.
DATA : P_V_TEXT LIKE tline-tdline.
CLEAR : TMP_TXNAM1, TMP_TXNAM2, TMP_VBELN, TMP_VKORG, TMP_VTWEG, TMP_SPART.
READ TABLE INPUT_TAB WITH KEY NAME = 'vbdka-VBELN'.
IF SY-SUBRC = 0.
  tmp_vbeln = input_tab-value.
  ENDIF.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT         = TMP_VBELN
   IMPORTING
     OUTPUT        = TMP_VBELN
  CLEAR VBAK.
  SELECT SINGLE VKORG VTWEG SPART
    INTO (TMP_VKORG, TMP_VTWEG, TMP_SPART)
    FROM VBAK
    WHERE VBELN EQ TMP_VBELN.
   IF NOT  TMP_VKORG IS INITIAL AND
     NOT   TMP_VTWEG IS INITIAL AND
     NOT TMP_SPART IS INITIAL.
CONCATENATE TMP_TXNAM1 TMP_VKORG tmp_vtweg tmp_spart into TMP_TXNAM2 SEPARATED BY '_'.
   CONCATENATE TMP_VKORG TMP_VTWEG TMP_SPART into TMP_TXNAM SEPARATED BY '_'.
     endif.
     CONDENSE TMP_TXNAM2 NO-GAPS.
   PERFORM read_order_text  USING TMP_TXNAM2 CHANGING v_text.
READ TABLE output_tab WITH KEY NAME = 'ORDCONF_TEXT'.
     IF SY-SUBRC = 0.
     output_tab-value = P_V_TEXT.
     MODIFY output_tab index sy-tabix.
     endif.
     endform.
*&      Form  READ_ORDER_TEXT
      text
     -->P_TMP_TXNAM2  text
     <--P_V_TEXT  text
FORM READ_ORDER_TEXT  USING    P_TMP_TXNAM2
                      CHANGING P_V_TEXT LIKE tline-tdline.
    DATA: ztdid  LIKE     thead-tdid,
        zlang  LIKE     thead-tdspras,
        zobj   LIKE     thead-tdobject,
        zname  LIKE     thead-tdname.
  DATA: tlines TYPE STANDARD TABLE OF tline WITH HEADER LINE,
        thead  LIKE thead.
  CLEAR P_V_TEXT.
  ztdid = 'ZSD'.
  zlang = 'E'.
  zobj  = 'TEXT'.
  zname  = P_TMP_TXNAM2.
  CLEAR   tlines.
  REFRESH tlines.
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      object                  = zobj
      name                    = zname
      id                      = ztdid
      language                = zlang
    IMPORTING
      header                  = thead
    TABLES
      lines                   = tlines
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
  LOOP AT tlines WHERE NOT tdline IS INITIAL.
    MOVE tlines-tdline TO P_V_TEXT.
  ENDLOOP.
ENDFORM.                    " READ_ORDER_TEXT
But still its not getting printed .Plz tell me where i am going wrong.
Thanks,
Sirishaa
Moderator message - Cross thread locked
Edited by: Rob Burbank on Nov 10, 2009 9:51 AM

You do not need to use the subroutine READ_ORDER_TEXT to get another text name because you already have it: TMP_TXNAM2 .
Pass this value back to your SAPscript, and it is okay.
Or you can even check the text object is empty or not, if no text is found, print 2 empty lines:
still use your subroutine to read the text, if no line is found, set TMP_TXNAM2  to empty, otherwise, no change,
In SAPscript, check the value is empty or not, then print 2 empty line or the text object...

Similar Messages

  • How to convert a Word Document to SAP SCript standard text.

    Hi team,
    Does any one know how to convert a word document or text in Word format to standard text.
    So that we can use that standard text in Script output.
    This might be very useful if we need to convert a lot of text into standard text.

    Hi,
    Create the name of the standard text you want in SO10.
    When the editor is called up, select Text -> Upload and then browse for your file(s). Must be saved in RTF format in Word remember.
    Cheers
    Colin.

  • Standard smartforms for order confirmation

    Hi all
    i search the standard smartforms for order confirmation. What's the name for this form....
    i have only find for invoice LB_BIL_INVOICE and for Delivery LE_SHP_DELNOTE, but not for oder confirmation....
    thx abap_begin....

    Hi,
    For the printing of the order confirmation there is a standard script RVORDER01. You can find this in transaction NACE by choosing application as V1 then output type as BA00 and then Processing routines.
    Regards
    Dillip Sahoo

  • Mail text in order confirmation output

    Hi, SD gurus:
    In our SAP system, order confirmation output is currently sent to customer via email with PDF attachement, works perfectly.  Email has proper title (order number), order confirmation PDF attachment, but without any content in the mail body.
    User has requested to including a following text in the mail content body - "For terms and conditions, please visit our website.....".
    I did following: In IMG config -> maintain output type, under output types, folder "maintain title and text", i maintained the above text.  However when the order confirmation is sent, it still only has the mail subject, and PDF attachment, the text that i maintained is not appeariing in the mail content body.
    Please advise whether i missed anything?
    Many thanks,
    Hailan.

    Hi, Sai:
    Thanks for your reply.  I will try this function module.  But before that, is there a way to achieve this through standard config?  I thought there is a way to do it in config.  Would you know whether what i did was wrong? 
    i went to IMG -> xxxxxx -> maintain output type -> go to the order confirmation output type, and then double click "mail title and tex",  then click green arrow back, and has the screen to maintain the language, text and document title, i add text "fof terms and conditions, please visit xxx" in the text field.  I though this text field is where the mail body text comes from.    Is there anything i did wrong?
    Many thanks again!
    Hailan.

  • SAP SCRIPT Header text and Item text not printing in customized PO

    Hello Experts,
                          I have copied the standard MEDRUCK to ZMEDRUCK and customized the form according to the requirement.
    I want to print the header text and Item text in my form.
    For Header text I have used :
    /: INCLUDE &EKKO-EBELN& OBJECT EKKO ID F01
    Problem 1: The text what I enter in header text is flowing only when I hit on print preview without saving the form. Once I save the SAP SCRIPT  and click on print preview the field is appearing blank. I also tried to print the form, but the field is appearing blank even on the print out.
    Problem 2: For item text the field is concatenation of  EBELN & EBELP. Can anyone suggest me how to concatenate and fetch the text in item text.

    Hi,
        Im getting an error in my subroutine pool for i_xtline which is to fetch ITEM TEXT., It says its not a in any internal table nor defined as data. How can I proceed further. I have pasted my code below. Please check and revert ASAP
    PROGRAM  ZMEDRUCK_SUBP1.
    TABLES: EKPO, EKKO.
    FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
    data xname like THEAD-TDNAME.
    data i_xtline like xtline.
    clear i_xtline.
    refresh i_xtline.
    CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
    MOVE v_item_text to ITEMTXT.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            = F01
        language                      = EN
        name                          = ITEMTXT
        object                        = EKPO
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         = i_xtline
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.

  • Reg sap script long text

    Hi experts,
    I have one problemin bseg-sgtxt field. i develop sap script for payment print prog, In my script my field is bseg-sgtxt(item text). and this field lenght is 50 char. i want more then 50 char through this field in my script. for that i use long text button... this long text stored in EENO_DYNP and field name is ZEILE , but it is a structure...so my question is
    1) How can i retrive this long text field in my script
    2) Can u give me example with this coding..
    3) How can i concate bseg-sgtxt with EENO_DYNP-ZEILE
    I need code example for that....
    Pl help me its urgent
    zeni

    hi,
    the long text of a document are stored into the standard text table and u can read it with the function READ_TEXT.
    call this function in this way
    >CONCATENATE bseg-bukrs bseg-belnr bseg-buzei INTO name.
    >CALL FUNCTION 'READ_TEXT'
    >  EXPORTING
    >    id                      = '0001'
    >    language                = sy-langu
    >    name                    = name
    >    object                  = 'DOC_ITEM'  " identified FI document
    >  TABLES
    >    lines                   = t_line
    >  EXCEPTIONS
    >    id                      = 1
    >    language                = 2
    >    name                    = 3
    >    not_found               = 4
    >    object                  = 5
    >    reference_check         = 6
    >    wrong_access_to_archive = 7
    >    OTHERS                  = 8.
    the id of the text you can find in SPRO transaction under
    Financial accounting->Financial accounting Global Settings ->Document->line Item-> Define Text Identifications for Line Items
    here you can find all ID of the standard text that are configurated in your system.
    now you can concatenate BSEG-SGTXT with the standard text of the document item .
    bye
    Marco

  • SAP Script: Include text in MAIN window prints outside MAIN window margins

    Hi,
    We're facing a peculiar issue. We call a text element in the MAIN window of an SAP Script form using FM WRITE_FORM.
    The element has 2 includes.
    The problem is that when the content of any of the 2 includes is large enough, the include text prints overflows outside the MAIN window margins on the first page and into the area of the footer window of the same page. It does not automatically flow to the next page MAIN window.
    We have checked that the MAIN window and FOOTER window margins do not overlap. Infact they are quite far from each other.
    We have tried stuff like using a forced PROTECT, change the para format etc, but nothing solves the problem.
    Does anyone have any idea?

    You do not need to use the subroutine READ_ORDER_TEXT to get another text name because you already have it: TMP_TXNAM2 .
    Pass this value back to your SAPscript, and it is okay.
    Or you can even check the text object is empty or not, if no text is found, print 2 empty lines:
    still use your subroutine to read the text, if no line is found, set TMP_TXNAM2  to empty, otherwise, no change,
    In SAPscript, check the value is empty or not, then print 2 empty line or the text object...

  • SAP Script absolute text positions

    HI everyone,
    I am kind of new to SAP Script and I have some trouble defining correct positions of text.
    The point is the following:
    I got a lot of boxes, frames and so on with fixed positions.
    Every of these boxes and frames create a kind of table with a fixed amount of lines (for instance 5 lines each table).
    For instance
    Box1
    Customer
    cust1
    cust2
    Box2
    discount
    dis1
    dis2
    I create the boxes by using variable windows fix on the page. The text needs to be written at the main window as I do not know the exact amount of lines (max 5, but can be less). For example, if I can only receive 1 instead of 5 customers, the text for discounts will not be placed at the dicount table correctly. How can I solve this problem? I can not write multiple lines of text in variable windows by using a loop. If I am writing the text at the main window the start of these texts will not be static and absolute?
    Greetings from Berlin
    Robert
    Edited by: RQuade on Nov 29, 2010 11:13 PM

    You can both write text lines and draw boxes within the MAIN window processing.  Check the help files for the BOX and POSITION commands for the box positioning.  You may want to google the SAPScript Made Easy Guide and download it as well.

  • Sap Script - Printing text

    Hi Experts,
    In a classical ABAP report we make use of
    write:/20 'Text'.
    to print text from the 20th column. Can we do something similar in a SAP Script Page Window. I have a box and lines drawn. Now I want the text to start exactly after the vertical line(column). Is there a way to do in SAP Script.
    Regards
    Abdullah.

    Hi
    You can do one thing. you can straight away write the field
    &BSEG-SGTXT&
    in two lines straight with offset.
    in the first line T1 &BSEG-SGTXT+0(25)&
    In second line T1 &BSEG-SGTXT+25(25)&
    first write like this and see, is it printing or not.
    Reward all helpfull answers
    Regards
    Pavan

  • SAP SCRIPT: Header text not printing - Custom Purchase Order.

    Hello Experts,
    I have used the standard MEDRUCK and copied to ZMEDRUCK. I want the PO header text to print in my form.
    I have used subroutine-pool and called it in the form.
    Here is my subroutine
    FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
      TABLES EKKO.
      DATA: BEGIN OF header OCCURS 0,
              ld_txt1(163),
              ld_txt2(163),
              ld_txt3(163),
            END OF header.
      DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
            ID like THEAD-TDID,
            TNAME LIKE THEAD-TDNAME,
            TDOBJECT like THEAD-TDOBJECT.
      DATA  HTEXT LIKE EKKO-EBELN.
    *  HTEXT = EKKO-EBELN.
      READ TABLE in_tab WITH KEY EKKO-EBELN.
      if sy-subrc = 0.
      TNAME = in_tab-value.
      ENDIF.
    TNAME = EKKO-EBELN.
    *CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
    *MOVE v_head_text to HNAME.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        id                            = 'F01'
        language                      = 'E'
        name                          = TNAME
        object                        = 'EKKO'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        = TNAME
      tables
        lines                         = li_lines
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
    *   WRONG_ACCESS_TO_ARCHIVE       = 7
    *   OTHERS                        = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR out_tab.
    out_tab-VALUE = TNAME.
    CONDENSE out_tab-VALUE.
    MODIFY out_tab TRANSPORTING VALUE WHERE NAME = 'TNAME'.
    ENDFORM.
    And my script in the form is
    PERFORM FETCH_TABLE_DATA IN PROGRAM ZMEDRUCK_SUBP2
    USING &EKKO-EBELN&
    CHANGING &TNAME&
    ENDPERFORMpar RECEIVED FROM M/S     &TNAME&
    The header text is still not flowing in my form.
    What mistake i'm I doing here ?
    How can I resolve this ?
    Pls help !

    Hi,
    Data is li_lines internal table. 1st you have to read the text form the internal table line by sy-tabix.
    At last you have to concatenate these variable into the out tab value.
    you can use the following code
    ORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
      TABLES EKKO.
      DATA: BEGIN OF header OCCURS 0,
              ld_txt1(163),
              ld_txt2(163),
              ld_txt3(163),
            END OF header.
      DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
            ID like THEAD-TDID,
            TNAME LIKE THEAD-TDNAME,
            TDOBJECT like THEAD-TDOBJECT.
      DATA  HTEXT LIKE EKKO-EBELN.
    READ TABLE in_tab WITH KEY EKKO-EBELN.
      if sy-subrc = 0.
      TNAME = in_tab-value.
      ENDIF.
    ALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            = 'F01'
        language                      = 'E'
        name                          = TNAME
        object                        = 'EKKO'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         = li_lines
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    data : f_lines TYPE i,
    DESCRIBE TABLE li_lines LINES f_lines.
    data: lstr type String,
          lstr1 type string,
          lstr2 type string,
          lstr3 type string,
          lstr4 type string.
    read table li_lines index 1.
    lstr = li_lines
    condense lstr.
    clear li_lines
    read table li_lines index 2.
    lstr1 = li_lines
    condense lstr.
    clear li_lines
    read table li_lines index 3.
    lstr2 = li_lines
    condense lstr.
    clear li_lines
    if f_lines GT 3.
    ead table li_lines index 4.
    lstr3 = li_lines
    condense lstr.
    clear li_lines
    ead table li_lines index 5.
    lstr4 = li_lines
    condense lstr.
    clear li_lines
    endif.
    data : v_text type text.
    concatenate  lstr1 lstr2 lstr3 lstr4 into v_text separate by ' '.
    CLEAR out_tab.
    READ TABLE out_tab WITH KEY name = 'TNAME'.
    out_tab-value = v_text
    MODIFY out_tab INDEX sy-tabix.
    Regards
    Nayan Kumar

  • Box in  Sap Script and text within

    Hi,
    I want to create a box at the end of the main window and text within it.
    The main window can end at 1st page itself or it can be extended to second page based on the articles. So the box should appear at the end of the last article in the main window.
    and also i would like to know, how do we write text in a box.
    Could any1 help me out on this.
    Thanks

    You can create a variable window in the main window.
    You can restrict the last item of the main window by varying the size of main window. In your wite-form ,
    CALL FUNCTION 'WRITE_FORM'
          EXPORTING
             element                  = 'ITEM'
          function                 = 'SET'
          type                     = 'BODY'
          window                   = 'MAIN'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        IF sy-subrc <> 0.
    DO this. in the bottom of the main window, create a variable window.
    you can add your text in the variable window inside main window.
    it will be displayed just after the item ends.
    Reagrds,
    Pritha.
    Message was edited by:
            Pritha Agrawal

  • Smartform/Sap script output to Text file/PDF/WORD

    Hi,
    I need to download/transfer the output of smartforms/sap script to text file/pdf file or word file.How do i do that?
    Do I need to create a new output device?
    thnx in advance
    chirantan

    Hi,
    Go through the following Code
    Mail a sapscript
    SAPscript: Autotmatically e-mail as PDF
    How to convert sapscript(Purchage order) inot pdf format & send in  mail
    Check the following Code
    REPORT ZRICH_0003.
    DATA: ITCPO LIKE ITCPO,
          TAB_LINES LIKE SY-TABIX.
    Variables for EMAIL functionality
    DATA: MAILDATA   LIKE SODOCCHGI1.
    DATA: MAILPACK   LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: MAILHEAD   LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
    DATA: MAILBIN    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILREC    LIKE SOMLREC90 OCCURS 0  WITH HEADER LINE.
    DATA: SOLISTI1   LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
    PERFORM SEND_FORM_VIA_EMAIL.
          FORM  SEND_FORM_VIA_EMAIL                                      *
    FORM  SEND_FORM_VIA_EMAIL.
      CLEAR:    MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
      REFRESH:  MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
    Creation of the document to be sent File Name
      MAILDATA-OBJ_NAME = 'TEST'.
    Mail Subject
      MAILDATA-OBJ_DESCR = 'Subject'.
    Mail Contents
      MAILTXT-LINE = 'Here is your file'.
      APPEND MAILTXT.
    Prepare Packing List
      PERFORM PREPARE_PACKING_LIST.
    Set recipient - email address here!!!
      MAILREC-RECEIVER = '[email protected]'.
      MAILREC-REC_TYPE  = 'U'.
      APPEND MAILREC.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = MAILDATA
                PUT_IN_OUTBOX              = ' '
           TABLES
                PACKING_LIST               = MAILPACK
                OBJECT_HEADER              = MAILHEAD
                CONTENTS_BIN               = MAILBIN
                CONTENTS_TXT               = MAILTXT
                RECEIVERS                  = MAILREC
           EXCEPTIONS
                TOO_MANY_RECEIVERS         = 1
                DOCUMENT_NOT_SENT          = 2
                OPERATION_NO_AUTHORIZATION = 4
                OTHERS                     = 99.
    ENDFORM.
         Form  PREPARE_PACKING_LIST
    FORM PREPARE_PACKING_LIST.
      CLEAR:    MAILPACK, MAILBIN, MAILHEAD.
      REFRESH:  MAILPACK, MAILBIN, MAILHEAD.
      DESCRIBE TABLE MAILTXT LINES TAB_LINES.
      READ TABLE MAILTXT INDEX TAB_LINES.
      MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
    Creation of the entry for the compressed document
      CLEAR MAILPACK-TRANSF_BIN.
      MAILPACK-HEAD_START = 1.
      MAILPACK-HEAD_NUM = 0.
      MAILPACK-BODY_START = 1.
      MAILPACK-BODY_NUM = TAB_LINES.
      MAILPACK-DOC_TYPE = 'RAW'.
      APPEND MAILPACK.
    Creation of the document attachment
    This form gets the OTF code from the SAPscript form.
    If you already have your OTF code, I believe that you may
    be able to skip this form.  just do the following code, looping thru
    your SOLISTI1 and updating MAILBIN.
      PERFORM GET_OTF_CODE.
      LOOP AT SOLISTI1.
        MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
        APPEND MAILBIN.
      ENDLOOP.
      DESCRIBE TABLE MAILBIN LINES TAB_LINES.
      MAILHEAD = 'TEST.OTF'.
      APPEND MAILHEAD.
    Creation of the entry for the compressed attachment
      MAILPACK-TRANSF_BIN = 'X'.
      MAILPACK-HEAD_START = 1.
      MAILPACK-HEAD_NUM = 1.
      MAILPACK-BODY_START = 1.
      MAILPACK-BODY_NUM = TAB_LINES.
      MAILPACK-DOC_TYPE = 'OTF'.
      MAILPACK-OBJ_NAME = 'TEST'.
      MAILPACK-OBJ_DESCR = 'Subject'.
      MAILPACK-DOC_SIZE = TAB_LINES * 255.
      APPEND MAILPACK.
    ENDFORM.
         Form  GET_OTF_CODE
    FORM  GET_OTF_CODE.
      DATA: BEGIN OF OTF OCCURS 0.
              INCLUDE STRUCTURE ITCOO .
      DATA: END OF OTF.
      DATA: ITCPO LIKE ITCPO.
      DATA: ITCPP LIKE ITCPP.
      CLEAR ITCPO.
      ITCPO-TDGETOTF = 'X'.
    Start writing OTF code
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                FORM     = 'ZTEST_FORM'
                LANGUAGE = SY-LANGU
                OPTIONS  = ITCPO
                DIALOG   = ' '
           EXCEPTIONS
                OTHERS   = 1.
      CALL FUNCTION 'START_FORM'
           EXCEPTIONS
                ERROR_MESSAGE = 01
                OTHERS        = 02.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                WINDOW        = 'MAIN'
           EXCEPTIONS
                ERROR_MESSAGE = 01
                OTHERS        = 02.
    Close up Form and get OTF code
      CALL FUNCTION 'END_FORM'
           EXCEPTIONS
                ERROR_MESSAGE = 01
                OTHERS        = 02.
      MOVE-CORRESPONDING ITCPO TO ITCPP.
      CALL FUNCTION 'CLOSE_FORM'
           IMPORTING
                RESULT  = ITCPP
           TABLES
                OTFDATA = OTF
           EXCEPTIONS
                OTHERS  = 1.
    Move OTF code to structure SOLI form email
      CLEAR SOLISTI1. REFRESH SOLISTI1.
      LOOP AT OTF.
        SOLISTI1-LINE = OTF.
        APPEND SOLISTI1.
      ENDLOOP.
    ENDFORM.
    Regards
    Sreeni

  • Tiff file edit in Sap Script

    Hi,
    I am changing PO script, some body uploaded standard text contained tiff file into sap.
    That tiff file contains some text, Now i want to edit some text in that file.
    Now i don't have that original file, how can i find out that file in SAP?
    thanks,
    fractal

    When you uploaded the Tiff file using the Program into SAP, you would have saved that Tiff file as a STandard text into SAP.
    Unless you change the SAP proposed Standard text name,
    Standard text name would start with "ZHEX-MACRO-*", with Text ID 'ST'.
    Now try looking for standard text of that Name.
    I know this is a convoluted process. But no other way seems to there.
    Hope this helps
    Vinodh Balakrishnan

  • Sap Script To OTF

    Hi Experts,
    I am trying to convert a script to pdf data.
    In the open_form I set getotf = 'X' and in the close form , i get the OTf data.
    I convert this otf to pdf data.
    In the pdf output, I only have the static fields and no data.Though the number of pages generated are same in the PDF output and the script.
    Please help me to figure it out

    try this
    Here is some sample code for achieving manual conversion to the OTF format.
    In case of more than 10 pages:
    - Check the spool request
    - Click Edit -> OTF display -> No. of OTF pages
    Convert SAP Script to text:
    - Display the spool request
    - Then click Goto -> List display
    Automatic conversion to the OTF format:
    tables: tline.
    data:   begin of int_tline1 occurs 100.
                 include structure tline.
    data:   end of int_tline1.
    call function 'OPEN_FORM'
                     device         = 'OTF_MEM'
    after CLOSE_FORM
    call function 'CONVERT_OTF_MEMORY'
         exporting
              format                = 'ASCII'
              max_linewidth         = 132
         tables
               lines                 = int_tline1
         exceptions
              err_max_linewidth        = 1
              err_format                    = 2
              err_conv_not_possible = 3
              others                          = 4.
    write the text file to spool
    loop at int_tline1.
       if int_tline1-tdline = space.
          skip.
       else.
          write:/ int_tline1-tdline.
       endif.
    endloop.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Printing Footer in Sap script

    Hi,
    though seems very simple but I am stick:(
    I want to add a a table in a existing sapscript which shold always print on the last page.
    I am not very good in sap script and text element so all the text elements are defined with right form I defined mine.
    but when I am executing the form getting the error Element 705 window FOOTER is not defined for form ...
    one weird thing when I am changing something to window othe text element go negative i.e. 700 becomes -700 and next time another error...
    Anybody any Idea??

    Might be printing from which written like this fasion:
    INCLUDE 'SD_RVADIN01' OBJECT TEXT ID SDVD PARAGRAPH ZB.
    Search it and see text in SO10

Maybe you are looking for