How to Print Header text in PO SAPScript

Hi Gurus,
I am working on PO Script (MEDRUCK). I copied the Standard to a Z form. ZMM_MEDRUCK, Now I need to print the the Header text at the end of MAIN window. I created a a perform and call it from the Script and read the heder text by using FM Read_text
DEFINE &TEXT1& = ' '
PERFORM GET_TERMS IN PROGRAM ZMM_MEDRUCK_ROUTINE
USING &EKKO-EBELN&
CHANGING &TEXT1&
ENDPERFORM
PROTECT
&TEXT1&
ENDPROTECT
but while returning I am getting only one line. Can any body suggest me how I can read the Header text in PO script. Please provide the sample Code.
Regards
Sony

Hi,
Use this Function module 'READ_TEXT'
T_lines contains the header text, you can loop it and display it in sap script
Function module to read the header text
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = 'F01'
      language                = sy-langu
      name                    = ekko-ebeln
      object                  =  ekko
    TABLES
      lines                   = t_lines
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
Regards
Krishna

Similar Messages

  • Help required. How to print Header Text in customized PO ?

    Hi experts,
    Please help me go forward with this.
    I'm using a ZMEDRUCK & standard printing program.
    I have put my code here. Pls go through it and help me what has to be corrected here.
    PROGRAM  ZMEDRUCK_SUBP2.
    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.
      DATA f_lines TYPE P.
    *  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 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = TNAME
    IMPORTING
       OUTPUT        = TNAME
    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.
    READ TABLE li_lines INDEX 1.
      IF sy-subrc = 0.
        header-ld_txt1 = li_lines-tdline.
      ENDIF.
    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.
        read table li_lines index 4.
        lstr3 = li_lines.
        condense lstr.
        clear li_lines.
      read 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 separated by ' '.
          CLEAR out_tab.
      READ TABLE out_tab WITH KEY name = 'TNAME'.
        out_tab-value = v_text.
        MODIFY out_tab INDEX sy-tabix.
    ENDFORM.
    And my script is :
    /:PERFORM FETCH_TABLE_DATA IN PROGRAM ZMEDRUCK_SUBP2
    /:USING &EKKO-EBELN&
    /:CHANGING &TNAME&
    /: ENDPERFORM
    IL RECEIVED FROM M/S     &TNAME&

    Hi,
    Use this Function module 'READ_TEXT'
    T_lines contains the header text, you can loop it and display it in sap script
    Function module to read the header text
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          client                  = sy-mandt
          id                      = 'F01'
          language                = sy-langu
          name                    = ekko-ebeln
          object                  =  ekko
        TABLES
          lines                   = t_lines
        EXCEPTIONS
          id                      = 1
          language                = 2
          name                    = 3
          not_found               = 4
          object                  = 5
          reference_check         = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
    Regards
    Krishna

  • How to print the text in only last but one page in sapscripts

    hiiiiiiiiiii,
             explian how to print the text in only last but one page in sapscripts? wher to write the code? plz if possible explain in detail with an example?

    Hello,
    The total no pages is given by &SAPSCRIPT-FORMPAGES& command.
    So u can handle the situation in ur form like this
    /: if &PAGE&  = &SAPSCRIPT-FORMPAGES&
    p1 TEXT
    /: endif
    Try in this way it may help u.
    Regards

  • How to print header in first and last  page only in SAPSCRIPT

    Hi!
    How to print header in first and last  page only in SAPSCRIPT,
    in between pages,  I need to print all line items in MAIN window only .
    Thanks in anticipation!
    Aki.

    Hi All,
    Thanks for your early update...but my requirement here is
    I have two pages (FIRST , NEXT ) First is having Header, Main and Footer
    NEXT is having Main and Footer ..I am printing PO here..let us think that my PO is having 20lines items , let us assume that it takes five pages...
    Now how application is printing is ..first set of data is printing in FIRST page and remainiang data distributed to 4 pages printing in NEXT page ..but what my requirement is , I need fifth page print on FIRST page, instead of NEXT page... Ultimately I need last set of data always print in FIRST ie out of 5 pages 1st print on FIRST 2nd 3rd 4th print on NEXT and 5th print again on FIRST .
    hope you this will clear you.
    Thanks!

  • How to use Read_text in Smart Forms for printing Header Texts

    Dear ALL,
    I want to print Header Texts in SmartForms, For that
    I am using T/Code VL02N .. and choosed  Header ..
    got this details...  from Text Header.
    Text Name       :0080000441
    Language         :EN
    Text ID             :Z002
    Text Object       :VBBK.
    So in Smart forms Under Template i have created a text and Program Code .
    Inside that I have used this below code .
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    *CLIENT= SY-MANDT
    ID = 'Z002'
    LANGUAGE =  SY-LANGU
    NAME = NAME
    OBJECT = 'VBBK'
    TABLES
    LINES = IT_TLINE
    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.
    CLEAR IT_TLINE.
    ENDIF.
    Kindly suggest me, Where  to declare the variables and loops for using this Read_Text Syntax in Smartforms .
    Response to this will be highly appreciated........  
    Regards ,
    Vinoth.

    hi
    good
    please check this code
    CONSTANTS:
    *For text reading like in LCNMMFTX / FORM SET_CONTROL_TEXT
               text_id  like thead-tdid     value 'MATK',
               text_obj like thead-tdobject value 'AUFK  '.
    data tlines like tline occurs 0 with header line.
    data tdname like thead-tdname.
    data tdheader like thead.
    if not it_proj-ltxsp is initial.
    refresh tlines.
            tdname = sy-mandt.
            tdname+3 = it_proj-rsnum.
            tdname+13 = it_proj-rspos.
            tdname+17 = it_proj-rsart.
            call function 'READ_TEXT'
                 exporting
                    id        = text_id
                    language  = it_proj-ltxsp
                    name      = tdname
                    object    = text_obj
                 importing
                    header    = tdheader
                 tables
                    lines     = tlines.
                exceptions
                   not_found = 01.
    thanks
    mrutyun^

  • Printing header text

    hi,
    when i went through smart form code ,i found the following code for printing texts for items(me23n-->item--
    >texts)
    in TEXT  node in smartform   (for printing item text):
    TYPE: INCLUDE TEXT
    TEXT NAME : &G_TEXT_KEY&
    TEXT OBJECT: EKPO
    TEXT ID: F01
    LANGUAGE: &SY-LANGU&
    How to create text name,text object,text id?
    when i gave text name & text id in SO10 &then display it's giving message Text Id F01 for Text Object  TEXT does not exist.
    how to create text object EKPO instead of  TEXT.where can i see this TEXT OBJECT option.
    how can i print header texts in ME23N?
    please help?

    hi mustafa,
      1. If you want to create text name, text object, text id.. you have to create functionally in spro settings....
       spro
    > mm
    > purchasing
    > messages
    > texts for messages
    > define texts for purchase order
        here you can define header texts or item text functionally
    If you want to create in you po then go to header text tab and create with respective  text
    2.  if you want to print header texts simply pass only
         po number in text_name,
         text_object : ekko
         text_id : depends up on ur text check i header text tab
        language key u know as usual
    Don't forget to reward points
    praveen

  • Adobe Forms: Printing Header Text - Background as Dark

    Hi,
    We are upgrading our ECC system to Enahncement Pack 5.
    We have Adobe forms for Sales Order, Delivery Notes,... In Border Palatte, we have set 'Solid' as a background fill for our header texts
    After applying patches, Adobe forms started printing header texts background very Dark.We are not able to read the texts. If I view the document in the spool then they are displayed correctly. If I save spool document on the desktop and print it then also output is printed as we want. Only when we print it directly through VA01, VA02 ( directly from SAP ) then it gives this error.
    I removed the background fill then it prints text correctly but then I loose the separation between header and content.
    I will appreciate any help in this regard
    Jitendra Pongurlekar
    Moderator message: wrong forum, please have a look in the forum for "Adobe Interactive Forms".
    Edited by: Thomas Zloch on Mar 4, 2011 10:55 AM

    Hi mrudul,
    as usual in programming, you got different ways to solve the problem. So if you work through the content here on SCN you will find a lot of examples how to decide between different letter heads. The easiest solution (and might be the best) is to pass the necessary data via the interface and do not add any condition in the form itself.
    How to create a dynamic field and all the stuff is very basic knowledge, so I think you do not need any explaination how to do that. If so I refer you to the official documentation provided by SAP.
    If you have some minutes please work through this blog Before You Ask - Just another guide and phrases like "urgent" or "do reply" are just not necessary to get an answer
    ~Florian

  • 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

  • How to print the text in points wise in sap script

    hi friends,
    how to print the text in points wise in sap script.
    ex: if suppose paragraph consists of 15 lines. then according to one sentence or one fullstop (.) it should give point 1. like that...
    1. hai how ru.
    2. what r  u doing.
    3.where r u.
    like this i want numbering.. waiting for ur replys.
    thanks,
    kiran

    declare a counter
    data : cnt type char 4.
    print :
    cnt = cnt + 1.
    &cnt& &text&
    cnt = cnt + 1. and so on.
    or.
    if the data is in an internal table
    loop at internal_table.
    cnt = cnt + 1.
    write form.
    in script -&cnt& &text&
    endloop.
    Edited by: NIKHILKUMAR POOJARI on Nov 17, 2008 11:18 AM

  • How to Print a text in bold format in a classic report ??

    How to Print a text in bold format in a classic report ??

    hi
    u can use
    <b>FORMAT  INTENSIFIED ON.</b>
    regards
    ravish
    reward if useful

  • How to print a text in java?

    How to print a text in java?

    of corse, i have JTextField in my frame that i want to extract the text and print it on a paper with a printer.

  • How to print header and footer in SET_TABLE_FOR_FIRST_DISPLAY

    Hello Experts,
             How to print header and footer while using the method SET_TABLE_FOR_FIRST_DISPLAY, any tips from the experts will be appreciated.
    Regards,
    Babu

    Hi,
    there are four events for printing: print_end_of_list, print_top_of_list, print_end_of_page and print_top_of_page. More information about implementing these events is in this bible for ALV:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Cheers

  • How to print the texts retrived by using READ_TEXT fun module in Smartform

    Please tell me how to print the text which is rertrived by using the READ_TEXT function module in smartform.
    I have coded all things in the program lines and in that i am retriveing the long texts.
    I am getting the text lines in my internal table clearly, the thing is that I am not able to pass these lines to the text.
    I have to print the trouble ticket. in that the notes log I have to pass.
    its urgent. Points will be rewarded for any type of clue. whether it will work or not.

    There are a few ways to do it. If you need to take all of the text in the text type, in your SF text element choose "Include Text".
    Populate the fields with the data that corresponds to the text type. It is similar to the interface to the FM "Read_Text.
    Text Name
    Text Obje
    Text ID 
    Language
    Encase any variables with the "&" symbol.
    If you have already coded the call to the FM "READ_TEXT" and loaded the text into an internal table, create a loop and loop through the itab. Inside of the loop create a text element and add a variable in the text element for the field you are looking to output.

  • How to print Arabic text along with the English in smartform ( ECC6 version

    Hi All,
    our is ECC6 version, Non unicode, ABAP stack ( not dual stack )
    is it possible to print in Arabic language in the above version ?
    if yes, then please let me know how to print Arabic text and English text in the same smartfrom.
    i tried in the following procedures :
    1) i created standard text (SO10) in arabic language.
    i called in the smartform ( include text - i )
    langage AR
    but system throws error message saying, required language is not installed.
    2) if i use READ_TEXT function module.
    text getting printed in diff format but not in arabic.
    waiting for your replies..

    ECC6 and Non-Unicode? I think you'll need multiple code pages, I doubt there's a mixed Arabic/Latin1 available. And I don't think SAP supports new MDMP systems any more. If you need to support multiple languages you really need to go Unicode. It's probably easier to do the Unicode conversion than to try to support multiple code pages and you have to make the switch eventually.

  • How to restrict header text changes in sales order level

    Dear Experts,
    how to restrict header text changes in sales order level change mode
    thanks

    Hello Chandu,
    how to restrict header text changes in sales order level change mode
    In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
    Please try out this approach and let us know your latest observation on this issue.
    Regards,
    Sarthak

Maybe you are looking for

  • Problem with very simple 2 threads java application

    Hi, As fa as i'm concerned this is a thread licecycle: 1. thread created: it is dead. 2. thread started: it is now alive. 3. thread executes its run method: it is alive during this method. 4. after thread finishes its run method: it is dead. No I hav

  • ITunes 10.1 no longer syncs?

    After updating to the latest iTunes 10.1, it keeps crashing when attempting to sync new songs. Windows says iTunes isn't responding, checks for solution, and closes. This problem has only happened with this version of iTunes, and syncing music is the

  • AMD HD8530M OpenCL Accelaration

    Hi everyone,   I'm new on this comunity, I'm interested in buying a notebook with an internal AMD HD8530M Graphic Card, I've checked and it seems that this card support OpenCl 1.2, but on the Premiere Pro CC is not listed in the supported graphics ca

  • Alternative account Number in G/L

    Hello experts, We have a company that besides the usual balance structure uses also an alternative one for its country. When I run the Balance sheet query with the normal hierarchy I can see all the nodes correctly. But when I use the one for its cou

  • OSB prospective is not showing up on elcipse

    Hello, I am running with an issue for OSB and need your expert help. I am running my SOA on AIX 64 bit and we I have installed OEPE - Oracle Enterprise Pack for Eclipse 11.1.1.7.2. with OSB 11.1.1.5.0. This OEPE pack. to do the development, I have do