Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

saving the Text using save_text FM

Former Member
0 Likes
3,700

Hi Abap gurus,

i have to save the text in FB03 transaction. i found the option called in the menu bar EXTRAS - > TEXTS. i have written the code as :

*************************************************************************
*UPDATING THE DOCUMENT NUMBER
*************************************************************************

    l_header-tdobject = c_object.
    CONCATENATE s_bukrs w_output-belnr s_gjahr INTO l_name SEPARATED BY space.
    l_header-tdname   = l_name.
    l_header-tdid     = c_id.
    l_header-tdspras  = sy-langu.

    CONCATENATE 'GR NUMBER'
                'GR ITEM NO'
                'GR QTY'
                'GR ASSIGN QTY'
                'RUN DATE'
                'LTL DATE'
                INTO l_notes
                SEPARATED BY space.

    ULINE.

    CONCATENATE w_output-mblnr
                w_output-buzei
*               w_output-gr_qty
*               w_output-gr_assign_qty
                sy-datum
                t_ltldate
                INTO l_notes
                SEPARATED BY space.

    t_line_save-tdformat = '*'.
    t_line_save-tdline   = l_notes.
    APPEND t_line_save.
*    CLEAR  t_line_save.

    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
       client                 = sy-mandt
        header                = l_header
*   INSERT                = ' '
       savemode_direct        = 'X'
*   OWNER_SPECIFIED       = ' '
*   LOCAL_CAT             = ' '
* IMPORTING
*   FUNCTION              =
*   NEWHEADER             =
      TABLES
        lines                 = t_line_save
     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.
  ENDLOOP.

my requirement is that

i have to save header as GR NUMBER', 'GR ITEM NO' , 'GR QTY', 'GR ASSIGN QTY' , 'RUN DATE', LTL DATE'

10 20 30 15 02..3.2012 03..03.2012

20 40 50 13 02..3.2012 03..03.2012

how to print the header ? i am not able to geting using the concatenate statement.

2 REPLIES 2
Read only

former_member189779
Active Contributor
0 Likes
1,901

Go to the text and double click on the text....then goto "Header"

Check what are you getting in Text name, ID etc.

Then call function READ_TEXT to retrive it and print.

Edited by: Vinit Joshi on Feb 16, 2012 11:52 AM

Read only

Former Member
0 Likes
1,901

should be done like the below, shouldn't it?



data: lv_Gr_qty type char15,
         lv_gr_assign_qty type char15,
         lv_today type char10,
        lv_ltldate type char10.

CONCATENATE 'GR NUMBER'
                'GR ITEM NO'
                'GR QTY'
                'GR ASSIGN QTY'
                'RUN DATE'
                'LTL DATE'
                INTO t_line_save-tdline
                       SEPARATED by space.
  
    t_line_save-tdformat = '*'.
    APPEND t_line_save.


   loop at some table into w_output.
      lv_gr_qty = w_output-gr_qty." (put it into char 15 or so).
      lv_gr_assign_qty = w_output-gr_assign_qty. "conver to char field
     write: sy-datum to lv_today mm/dd/yyyy,  "put into correct format.
                w_output-ltldate  to lv_ltldate mm/dd/yyyy. 
    CONCATENATE w_output-mblnr
                               w_output-buzei
                               lv_gr_qty             
                               lv_gr_assign_qty       
                              lv_today                
                              lv_ltldate   
                INTO t_line_save-tdline
                   SEPARATED BY space.
 
    t_line_save-tdformat = '*'.
     APPEND t_line_save.
    CLEAR  t_line_save.
   endloop.

then call your save_text.