Calling long text in script

Hi everyone,
can any one say the function module used to call the long text in scripts.

Hi
You can use read_text function module
Important thing to notice while using READ_TEXT is that
TEXT-ID field needs to be properly created based on Order number, Item no, Slaes Org, Distribution channel etc.
Most of the time You will find that Sales organization field is of 4 characters lenght, (Say 0001) in this case Since SAP discards first 3 zeroes of the number to blank spaces, you need to append zeroes to the final text-id field making it of required 20 characters key field (Say).
Therefore, you need to take care of append zeroes, shift spaces, concatenate command, etc. which depends on your scenario.
you have to check the following parameters
ID: this textid
language:language u maintained the text,this also important
name: The no in which text-id is maintained
Usually we make mistake here,the no is combination of purchase order no and item no.
Example:420000210000010(Puchase orderno:4200002100 item no:00010)
Object:it change based on the text-id so u can check it the document no.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = p_var
language = g_f_langu
name = g_f_tdname
object = g_f_obj
TABLES
lines = g_t_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.
Hope this definitely help.
Regards
- Atul

Similar Messages

  • How to call "long text" of master inspection characteristic in ALV

    Dear All,
    we have created customized QM report in ALV which shows Result, Valuation and Short text for each MIC against each inspection lot. Can we call long text also in the ALV.
    Please guide how to call it in ALV?

    just implement some function on the ALV toolbar, read the long with FM READ_TEXT and show it to the user e.g. using CATSXT_SIMPLE_TEXT_EDITOR.

  • 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

  • Calling SO10 text into script

    hi experts,
                  i have created a text in SO10 with
    text name : ZTEST
    LANGUAGE : EN
    TEXT ID : ST
    TEXT OBJECT : TEXT
    USER NEED A EDITABLE TEXT IOPTION AND I HAV CREATED IT .
    NOW I AM CALLING IT IN THE SCRIPT BY USING THE SYNTAX
    INCLUDE TEXTNAME ZTEST OBJECT TEXT ID ST LANGUAGE EN
    BUT IT IS NOT PRINTING ,...WHAT IS THE PBLM ....

    Hi,
    You can insert standard text(Transaction SO10) in SAPscript as following:
    Go to editor of SAPscript form 
    Select menu Insert -> Text -> Standard
    Input text object.
    Select  when you already input text object detail. System will automatically insert statement for including text object to SAPscript form.

  • Calling standard text to script

    Hi,
    I created standard text using so10. How can I call this text to my script program??
    Is there any other way to acheive this??
    Thanks,
    Ravindra

    Hi Ravindra,
    By using INCLUDE command you can insert the standard text in script editor.
    please go throught the help command for include command and it will explain you in detail.
    One more thing regarding that,when you have to transport your request to QA system,  you have to include the standard text in your request otherwise your standard text will not be visible in the QA.
    To include your standard text to your request in DEU, run  program RSTXTRAN.
    Regards,
    Tarun

  • Long Text printing in SAP SCRIPT

    Hi Experts,
    I have a requirement of printing long text in sapscript.
    There are 15 condition types for each item in sales order and one long text for each condition record.
    Each long text has multiple lines i.e. for one long text it may have 2 lines and other may have 1 or 3 lines or etc.
    My trials :
    I used read_text() function mudule in a routine which is being called from the sap script to get the whole long text which has 5 lines and is stored in an internal table.
    Now is there a way to transfer the whole internal_table data as a whole into the script i.e. is there a way to transfer the table from the routine to the sapscript.
    Thanks in advance.
    kalikonda.

    Hi
    In addition of my include solution.
    you ofcourse can use a perform statement if you havea maximum of lines which is possible.
    like (if you have a maximum of 5 lines
    define &line_1& := ' '
    define &line_2& := ' '
    define &line_3& := ' '
    define &line_4& := ' '
    define &line_5& := ' '
    Perform getsomedate in program abcxyz
    using orderno
    using itemno
    changing &line_1&
    changing &line_2&
    changing &line_3&
    changing &line_4&
    changing &line_5&
    Endperform
    when printing the data
    /: if &line_1& NE ' '
    IL &line_1&
    /: endif
    /: if &line_2& NE ' '
    IL &line_2&
    /: endif
    /: if &line_3& NE ' '
    IL &line_3&
    /: endif
    /: if &line_4& NE ' '
    IL &line_4&
    /: endif
    /: if &line_5& NE ' '
    IL &line_5&
    /: endif
    Gr., Frank

  • Long text problem in sap script

    Hi Experts,
    I have craeted sap script for payment print progrem.. in my sap script one window is text window... client want more then 300 char for that window. for that i use read_text function module... its working fine... but problem is it retrive only one line from long text editor. only 70 char i got.
    below is my coding......
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = '0001'
        LANGUAGE                      = sy-langu
        NAME                          = NAME
        OBJECT                        = 'DOC_ITEM'
      TABLES
        LINES                         = LINES          .
    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 LINES.
      n = 0.
      l = 132.
      text+n(l) = lines-tdline.
      n = n + 132.
      l = l + 132.
    ENDLOOP.
    in sap script i have direct pass lines-tdline
    *&lines-tdline&
    Please suggest me which point i missing?
    Thanks
    Jigar

    Hi All,
    The standard text will be stored in 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.
    Requirement :
    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.
    This is logic in the layout:
    /: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:
    Logic 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
    I
    MPORTING 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 '_'.
    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 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.
    But still its not getting printed .Plz tell me where i am going wrong.
    Thanks,
    Suman

  • 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

  • Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?

    Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?
    During a two weeks process, little by little I notice my phoe doesn't ring when I get a phone call.  So Far I have missed 22 calls that I am aware of.  Moreover, the phone does not alert me when I get a text message.  Sometimes I receive notice the next day that I received a call or a text message. 

    Follow the basic troubleshooting steps outlined in the user guide... reset, restore from backup, restore as new.

  • Issue with Capturing Long text using CALL METHOD EDITOR- GET_TEXT_AS_STREAM

    HI Experts,
    Standard Long text is capturing using CALL METHOD EDITOR->GET_TEXT_AS_STREAM
         but not working for Custom Long text – Only changes
    Here is the Issue:
    1)      Created Custom Long text in TAB. --> Good
    2)      Entered few lines in custom Long text  --> Good
             Click on Standard Tab , Leaving Custom tab and Custom Long text-->Good
    4)      In PAI of Custom Tab – Changes captured using CALL METHOD 1 ( See below Code 1)--> Good
    5)      Entered few lines in Standard Long text in Standard Tab -->Good
    6)      Click another Standard Tab
    7)      In PAI of Standard Tab – Changes captured using CALL MEHTOD 2 ( See Below Code 2)-->Good
    8)      Come back to Standard Tab / Standard Long Text , Enter few more lines.
    9)      Change the Tab , IN PAI of Standard Tab/Standard Text , Changes Captured using CALL METHOD2 ( See Below CODE 3) --> Good
    10)   Go to Custom Tab , Custom Long text , Entered few more lines--> Good
    11)   Click on any other tab, Triggered again PAI of Custom tab / Custom Long text using Call Method1 ( See Below Code 4) -->Good triggered PAI same CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM.
    12)   But additional lines are not captured , saying ZERO LINES in Internal Table and IF_MODIFIED = NO  -->Issues lies here.
    CODE1 ( Custom Long text entry capturing – First Few Lines )
    Custom Long text Entries are stored in LS_OUTTAB-TEXT first time when entered few lines and LV_MOD is 1.
    PAI of Custom tab
    CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
            EXPORTING
              ONLY_WHEN_MODIFIED     = CL_GUI_TEXTEDIT=>TRUE
            IMPORTING
              TEXT                                       = LS_OUTTAB-TEXT ( FIlled with Lines entered in custom long text )
              IS_MODIFIED            = LV_MOD ( Value 1 , Modified )
            EXCEPTIONS
              ERROR_DP               = 1
              ERROR_CNTL_CALL_METHOD = 2
              OTHERS                 = 3
    CODE2 ( Standard Long Text Entry Capturing – First Few Lines )
    Standard Long text Entries are stored in SELECTED_TEXT first time when entered few lines and FLAG_MODIFIED is 1.
    PAI of Standard tab
       CALL METHOD EDITOR->GET_TEXT_AS_STREAM
          EXPORTING
            ONLY_WHEN_MODIFIED = YTRUE ( Value 1 , Modified )
          IMPORTING
            TEXT                               = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
            IS_MODIFIED        = FLAG_MODIFIED.
    CODE 3 ( Standard Long Text Entry Capturing – Second time Few Lines )
    Standard Long text Entries are stored in SELECTED_TEXT  second  time when entered few lines and FLAG_MODIFIED is 1.
    PAI of Standard tab
       CALL METHOD EDITOR->GET_TEXT_AS_STREAM
          EXPORTING
            ONLY_WHEN_MODIFIED = YTRUE
          IMPORTING
            TEXT                               = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
            IS_MODIFIED        = FLAG_MODIFIED. ( Value 1 , Modified )
    CODE4 ( Custom Long text entry capturing – Second Time Few Lines )
    Custom Long text Entries are not stored in LS_OUTTAB-TEXT Second Time when entered few lines and LV_MOD is 0.
    PAI of Custom tab
    CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
            EXPORTING
              ONLY_WHEN_MODIFIED     = CL_GUI_TEXTEDIT=>TRUE
            IMPORTING
              TEXT                                       = LS_OUTTAB-TEXT  ( ZERO ENTRIES )
              IS_MODIFIED            = LV_MOD   ( NOT MODIFIED Flag )
            EXCEPTIONS
              ERROR_DP               = 1
              ERROR_CNTL_CALL_METHOD = 2
              OTHERS                 = 3
    Can anyone help me out of this.
    With Regards,
    Bala M

    Excellent Eitan,
    Here is what I am trying to Achieve.
    In Create Notification IW21 , They need 5 Long Text in Custom Tab ( Say Tab Name is MBR ).
    TAB1 NOTIFICATION Standard Information , TAB2 REFERENCE OBJ , TAB 3 MalFunction , Breakdown Standard one...... TAB 7 ( Custom Tab ).
    In Custom Tab , I added 5 LONG TEXT ( its 5 WHY Concept ).
    When the User enters data in 5 Long text , it should store long text along with Notification number when save.
    But Notification number will be generated @ the time of SAVE , but before that its just shows as
    %0000000001 ( and Number will be generated 1000065479) at Save.
    How to achive this .
    I did this:
    Added 5 Custom Container. and In PBO / PAI
      PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    IN PBO
       CREATE OBJECT TEXT_EDITOR1 ,    CREATE OBJECT TEXT_EDITOR2,    CREATE OBJECT TEXT_EDITOR3 like wise 5
       CALL METHOD TEXT_EDITOR1->SET_TEXT_AS_R3TABLE ,    CALL METHOD TEXT_EDITOR2->SET_TEXT_AS_R3TABLE .. Like wise 5 , So when the user Click on Custom Tab ( MBR ).
    It give 5 Long text.
    When he click tab1 or tab2 or tab3 .. and again tab MBR , still data is available.
    How to store this data for future retrival ( IW22 or IW23 ) ?
    Its working fine when I enter first time and goes here and there and finall save .
    IN SAVE BADI , I imported the Long text and created Standard Text SO10 with Notification Number with LONG1 , LONG2 .. means 1000065479LONG1 as standard text.
    But not working when I entered first time and go to tab1 and tab2 and then to MBR tab and added few more lines , its not exporting full lines and in IMPORT ( SAVE BADI ) giving ZERO Lines.
    Please help and thanks for your quick response.

  • Problem in long text in SAP script editor

    Hi ,
    i am maintaining long text in SAP script editor , when i am trying to change the long text in SAP script that changes are not reflected in print preview ,for example when i am giving tabs in the script then in print preview of the PO these tabs are displayed as , , ( comma) , and underlines are not appearing in print preview.please help me on this.
    Thanks and regards.
    Rajeshwar.

    hi
    you have to install the correct printer which supports the displaying the drawings and objects/

  • How to pass variables to a program called from long text of an error msg ?

    Hi,
    The aim is the following: in the long text of an error message, there should be a link; this link must call a program or a transaction and pass to this program or transaction the four variables of the error message. Is it possible to insert such a link with parameters in the long text of the error message ? If yes, what is the syntax for this ?
    (I searched in the forum and found the way to insert a link to a transaction, but I found nothing about parameters).

    Thank you for the answer.
    Unfortunately, this solution is not applicable in my case. I'm using the application log and the scenario is the following:
    - the user displays the application log in transaction SLG1
    - he sees a lot of error and succes messages
    - by dubble-clicking on these messages, he displays the long text of the messages
    - I want a link in these long texts to a transaction using the variables of the messages. I tried inserting a link to a transaction, and the transaction is well called, but with a breakpoint I checked variables SY-MSGV1 to MSGV4 and they are empty.

  • PO for item of service Level short and long text using sap script

    Please let me know how to do the PO for item of service Level short and long text using sap script.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on May 5, 2009 10:25 AM

    Hi ,
          In the transaction related to PO select the path goto->header texts and then details of the texts like ID,objectname,language,name.Pass all theses details to 'READ_TEXT '   FM. Then you will get text lines described for a perticular Po ,similarly for item also.
    Thanks,
    Suma.

  • Long text  editor called  from report

    Hi All,
    I  have a requirement of displaying long text editor(like the one used for sap script) for maintaining the details for each PO in report column.A similar example is transaction SO10.I will be thankful  if anybody can help in this regard.
    Thanks,
    Sanjay.

    Hi,
    You will have to use the FM: READ_TEXT, EDIT_TEXT, SAVE_TEXT to achieve this functionality.
    This will basically open the text editor as a pop up box ( size will be as sap script editor) for entering some comments against a Purchase Order.
    For this FMs, you 'll require Text id, text name, text object and language as parameters to be passed.
    thead-tdname = 'Purchase Order No'. " Name
    thead-tdid = 'ZQH1'.               " Text ID - E.g. To be created in your system
    thead-tdobject = 'VBBK'.   " Texts: application object
    thead-tdspras = sy-langu.       " Language Key
    Hope this helps.
    Regards,
    JLN

  • How to Add Long Text from CA10 on SAP Script

    Hi Friends,
    I got a requirement to add a long text from CA10 on to the SAP Script.
    How to do this ?
    Is it using INCLUDE ?
    Please give me some solution
    Thanks in Adv.

    Hi Bhupal,
    Could you tell me how did u add the long text from CA10.  I have the same requirement.
    Thanks in advance.
    Manisha

Maybe you are looking for

  • IPhone 5 voice call quality fade in and out. Noise Cancellation interference?

    I've been having this huge problem with the iPhone5. The evidence i've collected seems to indicate this is a problem with all iPhone5's. On calls in certain places both indoors and outdoors, the callers voices over the iPhone5 fade in and out. Their

  • 20 days old Macbook Pro in big trouble!!!!

    I have been a PC user since I was born however I had heard very high about the credibility of MAC and really wanted to possess it. I was first exposed to the Apple world with iPhone 4 and was really excited after standing in a long queue in rain to p

  • Google Map Integration with Map Viewer is not working

    Hi Team, My MapViewer Version: Ver11_1_1_7_B130111 I have created a Google Map (with Type of Map Source as "Google Maps") in Oracle Map Viewer and i could see google map in Oracle Map Viewer(using "show Map"). I wanted to show a village map theme ove

  • Can I transfer books from a PC to an ipad

    I don't have an ipad now but I am thinking about getting an ipad mini. I have a lot of books on my PC. Is it possible to transfer the books that are on my PC to my new ipad (if I get one) ?

  • Problem In R/3 Installation : Dispatcher not coming up

    Hi,      I'm trying to install SAP R/3 Enterprise ABAP on Windows:Oracle. While creating the Database Instance I chose a Database Schema Name. Further, while creating a Dialog Instance the Database schema name what I gave doesn't match with the previ