Long text wtih Justified Alingment

Hi,
I have along text of 1000 characters. I want to place this text into an internal table, whose structure is of 132 characters. And the text should be in Justified alignment and without any word truncations,
I mean..if the 132nd charcater is 'e' in a word 'before', then it should not truncate as 'b' in first line and 'efore' in second line.
Do we have any function module for this requirement
-Priya

HI,
I have written a small program .. here i am spliting the string into 10 character lenth strings.. with out word truncation. you can change this to 132..
REPORT ztest1 .
DATA : lv_string(200) TYPE c.
DATA : BEGIN OF itab OCCURS 0,
       word(20) TYPE c,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
       sentence(10) TYPE c,
       END OF jtab.
DATA : lv_total TYPE i,
       lv_word TYPE i.
DATA : lv_10reached TYPE i.
DATA : lv_10chars(10) TYPE c.
lv_string = 'Hello How are you doing today'.
SPLIT lv_string AT ' '  INTO TABLE itab.
LOOP AT itab.
  lv_total = strlen( lv_10chars ).
  lv_word = strlen( itab-word ).
  lv_10reached = lv_total + lv_word.
  IF lv_10reached >= 10.
    jtab-sentence = lv_10chars.
    APPEND jtab.
    CLEAR : lv_total,
          lv_word,
          lv_10reached,
          lv_10chars.
  CONCATENATE lv_10chars itab-word INTO lv_10chars SEPARATED BY space.
  ELSE.
    CONCATENATE lv_10chars itab-word INTO lv_10chars SEPARATED BY space.
  ENDIF.
ENDLOOP.
if not lv_10chars is initial.
jtab-sentence = lv_10chars.
    APPEND jtab.
endif.
LOOP AT jtab.
  WRITE / jtab-sentence.
ENDLOOP.
Thanks
Mahesh

Similar Messages

  • How format a text with "Justified"?

    Hello!
    I would like to make a photo book (iphoto '08) with lengthy passages of text.
    Does anyone know how I can format a Text in "justified"?
    Siggo

    Create the text in another app - say Pages or TextEdit and set your alingment as you wish. Then copy and paste t the book
    Regards
    TD

  • Formating long text in smartforms

    Hi,
    I am receiving a long text in an internal table of lines.
    But when i do the loop to the table to display the lines, i cant justify this same lines to the cell, even if the paragraph is defined as justify.
    Thanks,
    Bruno Pimenta

    Hi,
    check this...
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
         client                        = sy-mandt
          id                            = 'B01'
          language                      = sy-langu
          name                          = name
          object                        = 'EBANH'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        =
        TABLES
          lines                         = it_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.
      REFRESH c_tab[].
      CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
       EXPORTING
    *     CODEPAGE                = '0000'
         formatwidth             = 72
         language                = sy-langu
         tabletype               = 'ASC'
    *     TAB_SUBSTITUTE          = ' '
    *     LF_SUBSTITUTE           = ' '
         replace_symbols         = 'X'
         replace_sapchars        = 'X'
       IMPORTING
    *     FORMATWIDTH_E           =
    *     X_DATATAB               =
         c_datatab               = c_tab[]
    *     X_SIZE                  =
        TABLES
          itf_lines               = it_lines
    *   EXCEPTIONS
    *     INVALID_TABLETYPE       = 1
    *     OTHERS                  = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT c_tab.
        CONCATENATE text c_tab INTO text  SEPARATED BY space.
      ENDLOOP.
    Arunima

  • How to print long text in scripts

    plzzzzzzzzz answer this qestion
    how to print long text in scripts

    Hi Kranthi,
    You can create Text Id and include that in your script.
    For example:
    /E TEXT
    /: INCLUDE ZTEXT OBJECT TEXT ID ST
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Database Table where modifications to message long text are stored (log)

    Hi,
    As per manual correction mentioned in SAP note 1144291,
    we have changed the long text for message XC092 by modification of the long text.
    This note 1144291 is a pre-requisite for SAP Note 1310808.
    After the notes were implemented, it is noticed that message CURTO1055 has incorrect information in its long text. This is because, the variable in the long text are not correctly defined in the long text.
    Both the messages XC-092 and CURTO1-055 are SAP standard.
    The error for CURTO1-055 can be rectified by modification of the long text and maintenance of the correct variables.
    However, my question is:
    Where do we check the log for document modifcation for a message long text.
    I have found the logs relevant to my modification in table DOKHL and DOKIL.
    But in which table do we get all of the foll. data:
    - Message class
    - Message number
    - Modification name
    - Modification created by
    - Modification done on
    - Last changed by
    - Last changed on
    Kindly help. A <removed by moderator> solution would be really helpful.
    Best Regards,
    Smruthi
    Edited by: Thomas Zloch on May 5, 2011 12:07 PM - urgency reduced

    Hi Smruthi,
    The modification changes would be in the SMODILOG table. Please note this is a core basis table and should not be changed, however to best find your changes search under the TRKORR field with the relevant tp request.
    Best regards,
    Derrick Hurley
    Development Workench

  • Can not see long text description of a characteristics in portal

    Hi experts,
    I designed two queries via Query designer and published them to portal but I can not see the the long text description of "Name" attribute belongs to 0BPARTNER characteristics.
    One of the queries shows only the last name of partner in portal while it is showing full name and last name in Bex Analyzer. The other query shows only the key value in both portal and Bex Analyzer.
    I want to see long text description in both queries.
    For an additional information, I'm extracting data from CRM 5.00 to BW 7.00
    What will be the reason for this and how can I solve it?
    Can anyone help me for this issue, it's a kind of emergency situation.

    Hi,
    we have the same problem.
    We want to change <b>only</b> in the screen variable the hierarchy text (from default to long\medium text) but even if there's a possibility to do this, really it doesn't happen anything - it' s possible when you start query, in the selection screen inside every the variable there's a command "User Settings" in which manage what you want to see (I put display custom, as text, medium text).
    I try to do this also in query analizer, selecting variable (hierarchy) and enter in this (user setting), changing in display custom as text - medium text, but even if I save this settings, really doesn't happen anything.
    It seems the system isn't sensitive to this selection...
    By now, if someone has an answer, please write us!
    Thanks in advance,
    Alessandra Mirone

  • Creating a long text using ABAP code.. fm SAVE_TEXT

    When you create an order via IW31 one of the options is to click on the text button and create a long text. I am basically trying to mimic this action from within my ABAP code.
    The text id details are as follows:
    Text Name       500000015000046  which is (5000000 + order number)
    Language        EN
    Text ID            KOPF         Order header text
    Text Object      AUFK       Order text
    If i manually create the text within the transaction i am then able to view and update it via function modules READ_TEXT and SAVE_TEXT. But if the text has not already been created READ_TEXT obviously returns nothing as it does not exist and SAVE_TEXT does not seem to created it!
    Anyone know how i would go about creating this text using ABAP code?
    Hope this make a bit of sense
    Thanks in advance
    Mart

    I have implemented the code as i think it should be. See below, can any see what is wrong. If i add init_text it makes no difference and adding the commit_text just makes it hang
    DATA: IT_TEXTS type standard table of TLINE,
           wa_texts like line of it_texts,
           wa_txtheader type THEAD.
    wa_txtheader-TDID     = 'KOPF'.
    wa_txtheader-TDSPRAS  = 'EN'.
    wa_txtheader-TDNAME   = '500000015000056'.
    wa_txtheader-TDOBJECT = 'AUFK'.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        CLIENT                = SY-MANDT
        HEADER                = wa_txtheader
        INSERT                = 'X'
       SAVEMODE_DIRECT       = ' '
       OWNER_SPECIFIED       = 'X'
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
      TABLES
        LINES                 = IT_TEXTS
    EXCEPTIONS
       ID                    = 1
       LANGUAGE              = 2
       NAME                  = 3
       OBJECT                = 4
       OTHERS                = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Long text doesn't fit the window exactly

    Hi friends,
    in PO smartforms i have included the header text of PO.
    the problem is the long text doesn't fit to the window exactly i.e.,
    when we enter the text in PO in the header a line can contain only 60 characters approximately where as in my smartforms it can contain more than that.
    so in the display of smart form i get lot of space in the right side and i get the remaining part of text in the next line.
    regards,
    Saravan raj

    hi,
    what u have told is correct but we can't expect the end user to do it each time when they paste the long text.
    is there any option to bring it by default.
    regards,
    saravan raj

  • From which table i can get the long text

    Hi All
    I have created some long text through function module CREATE_TEXT And i am able to see the text in the transaction .
    My requirement is from which table i can get these stored long text???
    Any suggestions please.
    Thanks

    Appreciate your answers.
    I have checked the both the fields stxh as well as stxl but i am not able to find any text fields out there.
    My actual requirement is some third party software needs to b mapped the table fields in order to import it.
    So if i know the table fields that would be easier.
    Can you tell me y we can not read it from the tables?
    Thanks,
    @run.

  • I am trying to upload the purchase order long text in mm01 using BAPI

    Hi All,
    I am trying to upload Purchase Order Long text (which is in chinese Language) and Language field with  ZH(chinese) in MM01 using BAPI_MATERIAL_SAVEDATA.
    It is uploading properly, But in the Language field it is showing Z1(Customer reserve) instead of ZH(Chinese).
    What could be the reason for this and how it can be resolved.
    Thanks in advance,
    Raja

    Hi,
    Which input parametr did you use? See table T002
    LANGU = '1'
    LAISO = 'ZH'
    Rgds,
    JP

  • Blocking long text change if open PR and open PO found for material

    Dear SAP MM Gurus,
    Our client is having one requirement. Their requirement is like this,
    If there is any open PR, PO, contract etc. for a material ,  system should not allow to change the long text of the material.
    Is there any way out. Any user exit or BADi, which will trigger on the long text change of material master then please let me know.
    Thanking you.
    With Regards,
    Mihir

    Dear SAP MM Gurus,
    Our client is having one requirement. Their requirement is like this,
    If there is any open PR, PO, contract etc. for a material ,  system should not allow to change the long text of the material.
    Is there any way out. Any user exit or BADi, which will trigger on the long text change of material master then please let me know.
    Thanking you.
    With Regards,
    Mihir

  • Error for fetching long text in xml tag for xml publisher report

    My requirement is to fetch a large document which is in text format in XML output which can be printed in PDF format by using RTF method to generate PDF.But during XML ouput i got the following error-
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh
    button, or try again later.
    The following tags were not closed: XXBG_EAMWRREP_V1, LIST_G_WO_ACTIVITY_CODE, G_WO_ACTIVITY_CODE, LIST_G_MEDIA_ID1,
    G_MEDIA...
    XXBG_EAMWRREP_V1 is the rdf and LIST_G_WO_ACTIVITY_CODE, G_WO_ACTIVITY_CODE, LIST_G_MEDIA_ID1, G_MEDIA are the groups name. In the group
    G_MEDIA i am fetching long_text from attahcment in application. In Database table the datatype of the text attachment is 'long' and there is a huge text
    data loaded in large data editor of that column. If the text data volume is small enough then there is no problem for fetching the xml output.
    If we change the output format as HTMl then there is no problem for fetching the output for long text but for xml output format we are unable to fetch the data
    in xml tag.
    One thing to mention the oracle report is the copy of Maintenance Work Order Detail Report. The seeded report is HTML format in 11i. The requirement is to make it in xml report.
    Please help.

    Hi,
    Actually clob datatype is not available in oracle report builder datatype lov. Could you pls tell the other ways of converting that to clob in oracle report...

  • How to make single column scrollable in ALV report (for long Text)

    I have a 20 columns which we need to display in ALV grid, including one column for long text. In long text column currently it showing 40 character. I tried to change output length of field catalog but it's not working.
    Can any one help me ....
    Thanks
    Guru
    Message was edited by:
            gurusharan mandal

    hi,
    pls remeove if u give like this in the layout.
    gd_layout-colwidth_optimize = 'X'.
    rgds
    Anver

  • Display a Long Text in ALV report

    Hi,
    I want to display the PO header long text in ALV Report that is 255 character width.
    Please help me out how to do this.
    please it is very urgent
    Thanks and regards
    Krishna

    Use READ_TEXT and concatenate the first lines of the text.
          CALL FUNCTION 'READ_TEXT'
               EXPORTING
                    id       = 'F01'
                    language = sy-langu
                    name     = lv_name " purchase order with leading zeroes
                    object   = 'EKKO'
               TABLES
                    lines    = t_lines
               EXCEPTIONS
                    OTHERS   = 8.
    Regards

  • Bex report on Multi Provider Long Text issue

    Hi All,
    I have a report that running on a multiprovider and I have a field that I use as a selection parameter. I changed the settings for this field's info object settings to "long text" to see long description in the pop up search window. However setting change worked for all the other reports that are running on cubes and DSO s but I still see short description when I run the multiprovider report.
    Is there any settings need to be changed for multiproviders to see long desc. ?
    I apprciate any help with points
    Regards

    Hi,
    Open your query, and select your infoobject and change the display properties-> text view as-> Medium-Length text
    Regards
    Thenmuga Selvan

Maybe you are looking for

  • Download data from cube to excel

    Hello gurus. I need to download data from a cube to excel... but is not possible to download all the data, because excel restrictions. Do you know a way to download all the data? Thanks in advance, Vitor Ramalho

  • Loading in a new runtime-me​nu

    Hello, I was wandering if anyone can help. I am looking for a bit of code or a way in which I can be running a program then on a particualar button press, load in a new run time menu to the program so that all the options are now changed. I am assumi

  • BT Infinity - local Roll Out dates being rolled ba...

    For most of 2011, our exchange (01684) was scheduled to be upgraded to Infinity by 31 Dec 2011, according to the checker on BT's own website. On 21 December 2011 I noted that that date had changed to 31 March 2012, even though today the BT page "See

  • Can anyone explain what consume() actrually does?

    Can anyone explain what consume() actually does as it relates to a KeyEvent? I read about this but I just can't seem to to understand it. Thanks in advance.

  • Distinguishing between IDocs for Delivery, Shipment and Invoice

    Hi Experts, I have a requirement where I am triggering IDocs from SAP for Delivery Document, Shipment and Invoice and sending them to a third-party middleware everytime they are created in SAP, by configuring output types for these documents. I want