READ_TEXT BKPF

I am trying to read the Invoice Notes Test. For printing.
Invoices can come from RBKP or from the BKPF.
When i give object as RBKP READ_TEXT function module is giving the text.
But for BKPF it is not giving. Please if any one have idea what Object name i should give for BKPF entries. 
See the following code snippet how i am calling ... read_text
SELECT SINGLE * FROM rbkp INTO l_rbkp WHERE belnr = inv_number AND gjahr = inv_fy.
    IF sy-subrc <> 0.
      SELECT SINGLE * FROM bkpf INTO l_bkpf WHERE belnr = inv_number AND gjahr = inv_fy.
      IF sy-subrc = 0.
        l_object = 'BKPF'.
      ENDIF.
    ELSE.
      l_object = 'RBKP'.
    ENDIF.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        client                  = sy-mandt
        id                      = id
        language                = sy-langu
        name                    = name
        object                  = l_object
      TABLES
        lines                   = i_notes
      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.

Hi Madhavi,
  There are no TEXT Objects with the name BKPF.
Even though the invoices come from different tables, the Text IDs are not dependent on the table from which you get them.
Do you know in which transaction this TEXT is visible?
You can find the text id if we know in which transaction it is viewed.
Regards,
Ravi

Similar Messages

  • How to use read_text...

    Hello experts,
    I have been tasked to get the start and end date from t-code FB03. Now my question is, what will I put in it? Here is my code where I plan to put the read text:
    LOOP AT it_bsis ASSIGNING <fs_bsis>.
        SELECT SINGLE bukrs belnr gjahr budat bldat xblnr bktxt FROM bkpf
        INTO (bkpf-bukrs, bkpf-belnr, bkpf-gjahr, it_bseg-budat,
              it_bseg-bldat, it_bseg-xblnr, it_bseg-bktxt)
        WHERE bukrs = <fs_bsis>-bukrs
          AND belnr = <fs_bsis>-belnr
          AND gjahr = <fs_bsis>-gjahr.
        SELECT SINGLE bukrs belnr buzei gjahr shkzg dmbtr lifnr sgtxt
        FROM bseg INTO (it_bseg-bukrs, it_bseg-belnr, it_bseg-buzei,
                        it_bseg-gjahr, it_bseg-shkzg, it_bseg-dmbtr,
                        it_bseg-lifnr, it_bseg-sgtxt)
        WHERE bukrs = <fs_bsis>-bukrs
          AND belnr = <fs_bsis>-belnr
          AND gjahr = <fs_bsis>-gjahr
          AND koart = 'K'
          AND hkont = <fs_bsis>-hkont
          AND umskz = 'K'
          AND fdlev = 'DP'.
      ENDLOOP.
    Again, thank you guys and have a great day!

    First you need to find out exactly what text that you need to get.  The text headers are stored in STXH,  here you can see the object, id, and name of the text.  You can get the object and id by using transaction code SE75.  This will list all of the text objects and the ids underneath them.  The NAME is usually the key of the object.  For example, for Sales Document Header Text, the name is the sales document number.  Other NAMEs are a combination. For example, material memo text, It is a combination of material number and plant.  To find exactly what object, id, and how the NAME is built, I usually create a text using the standard transaction.  Then go to SE16, on table STXH, and do a query for "Created By" = me, and "Created Date" = today.  This will give me the header record of the text that I just created.  Now I can see what the Object, ID, and NAME is.  With this information, you can pass to the READ_TEXT function module and get your text.
    Make sense?
    Regards,
    Rich Heilman

  • Rewrite value in BKPF when FI document posting

    Hello!
    I need your advice. I have task - Сlear field XREF2_HD in table BKPF when FI document is posting  (FB01, for excemple).
    I`m using BTE 1120 "Substitute header and items", belong you can see FM code which i use:
    FUNCTION ZSAMPLE_PROCESS_00001120.
    ""Локальный интерфейс:
    *"  IMPORTING
    *"     VALUE(I_BKDF) TYPE  BKDF OPTIONAL
    *"  TABLES
    *"      T_BKPF STRUCTURE  BKPF
    *"      T_BSEG STRUCTURE  BSEG
    *"      T_BKPFSUB STRUCTURE  BKPF_SUBST
    *"      T_BSEGSUB STRUCTURE  BSEG_SUBST
    *"      T_BSEC STRUCTURE  BSEC OPTIONAL
    *"  CHANGING
    *"     REFERENCE(I_BKDFSUB) TYPE  BKDF_SUBST OPTIONAL
    BREAK-POINT.
    LOOP AT T_BKPF.
    T_BKPF-XREF2_HD = '!!!!'.
    MODIFY T_BKPF INDEX SY-TABIX.
    ENDLOOP.
    ENDFUNCTION.
    But after execute this FM, all changes in T_BKPF are rollbacked (it`s OK, becouse after execute T_BKPF is rewrited from local table L_BKPF).
    I think, i should i change data in T_BKPFSUB table, but field XREF2_HD is`t included into BKPF_SUBST structure. So, i have two questons:
    1. How i can add field XREF2_HD into BKPF_SUBST?
    2. What can i do?
    The best regreades, DrAlex

    You are right, using a where-used option on OPEN_FI_PERFORM_00001120_P, display a MOVE-CORRESPONDING from BKPF_SUBST to XBKPF internal table.
    It does not seem to exist any point to enhance this structure in standard, you may append fields to this structure that should update BKPF (creating append ZABKPF_SUBST) but that may cause inconsistencies in other database tables, you could try to use a substitution rule (OBBH) and not the BTE to fulfil your requirement.
    Regards,
    Raymond

  • Loop at FM  Read_text

    Hi All,
    If I hardcode material number, without loop statement call function READ_TEXT gives subrc 0. If I pass it through internal table in a loop, it ends up with SUBRC 4.
    Moreover, this does not even enter into FM Read_text.
    can somebody help me with this.
    lOOP AT ITAB.
    ALL FUNCTION 'READ_TEXT'
      EXPORTING
        CLIENT                        =   SY-MANDT
        ID                                  =  'GRUN'
        LANGUAGE                =  'EN'
        NAME                          =  ITAB-MATNR
        NAME                          =  '000000000123456789'
        OBJECT                       =  'MATERIAL'
      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
    ENDLOOP.
    Thanks
    Sharat

    Try if this works.
    parameters p_matnr type matnr.
    data: temp_text type table of tline with header line,
          where_cond(20) type c.
    data : begin of text_id ,
             tdobject(10) value 'MVKE',
             tdname(70),
             tdid(4)      value '0001',
             tdspras   value 'D',
           end of text_id.
    start-of-selection.
    concatenate '%'
                p_matnr
           into where_cond.
    select single tdname
      from stxl
      into text_id-tdname
    where relid   = 'TX' and
           tdspras = 'E'  and
           tdname like where_cond.
    import tline = temp_text[]
      from database stxl(TX) id text_id.
    write: / sy-subrc.
    loop at temp_text.
      write : / temp_text-tdline.
    endloop.
    Thanks
    Mahesh

  • Urgent : Link b/w MKPF and BKPF and BSIS

    Hi,
    I am making a report in which i have to display the vendor payment status.
    In table BKPF there is a field called AWKEY and AWTYP and i want to reterive data form it and after that in BSIS table there is a field called XREF3 which is similar to the AWKEY in the BKPF table.
    plzz tel me how to make the realtion b/w these tables as help will be deifnately rewarded.

    hi,
    i am able to reterive data from now but i want to have this method also which u had told.
    i am doing inner join concept but accorind to tyou :-
    pass the first 10 characters of AWKEY to MBLNR of MKPF.
    how should i use this concept?
    Edited by: abaper2008 on May 24, 2008 8:48 AM

  • Accessing BKPF table takes too long

    Hi,
    Is there another way to have a faster and more optimized sql query that will access the table BKPF? Or other smaller tables that contain the same data?
    I'm using this:
       select bukrs gjahr belnr budat blart
       into corresponding fields of table i_bkpf
       from bkpf
       where bukrs eq pa_bukrs
       and gjahr eq pa_gjahr
       and blart in so_DocTypes
       and monat in so_monat.
    The report is taking too long and is eating up a lot of resources.
    Any helpful advice is highly appreciated. Thanks!

    Hi max,
    I also tried using BUDAT in the where clause of my sql statement, but even that takes too long.
        select bukrs gjahr belnr budat blart monat
         appending corresponding fields of table i_bkpf
         from bkpf
         where bukrs eq pa_bukrs
         and gjahr eq pa_gjahr
         and blart in so_DocTypes
         and budat in so_budat.
    I also tried accessing the table per day, but it didn't worked too...
       while so_budat-low le so_budat-high.
         select bukrs gjahr belnr budat blart monat
         appending corresponding fields of table i_bkpf
         from bkpf
         where bukrs eq pa_bukrs
         and gjahr eq pa_gjahr
         and blart in so_DocTypes
         and budat eq so_budat-low.
         so_budat-low = so_budat-low + 1.
       endwhile.
    I think our BKPF tables contains a very large set of data. Is there any other table besides BKPF where we could get all accounting document numbers in a given period?

  • Performance issue in BI due to direct query on BKPF and BSEG tables

    Hi,
    We had a requirement that FI document number fieldshould be extracted in BI.
    Following code was written which has the correct logic but performance is bad.
    It fetched just 100 records in more than 4-5 hrs.
    The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
    Is there any way to improve this code like adding GJAHR field  in where clause? I dont want to change the logic.
    Following is the code:
    WHEN '0CO_OM_CCA_9'." Data Source
        TYPES:BEGIN OF ty_bkpf,
        belnr TYPE bkpf-belnr,
        xblnr TYPE bkpf-xblnr,
        bktxt TYPE bkpf-bktxt,
        awkey TYPE bkpf-awkey,
        bukrs TYPE bkpf-bukrs,
        gjahr TYPE bkpf-gjahr,
        AWTYP TYPE bkpf-AWTYP,
        END OF ty_bkpf.
        TYPES : BEGIN OF ty_bseg1,
        lifnr TYPE bseg-lifnr,
        belnr TYPE bseg-belnr,
        bukrs TYPE bseg-bukrs,
        gjahr TYPE bseg-gjahr,
        END OF ty_bseg1.
        DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
        wa_bkpf TYPE ty_bkpf,
        it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
        wa_bseg1 TYPE ty_bseg1,
        l_s_icctrcsta1 TYPE icctrcsta1.
        "Extract structure for Datasoure 0co_om_cca_9.
        DATA: l_awkey TYPE bkpf-awkey.
        DATA: l_gjahr1 TYPE gjahr.
        DATA: len TYPE i,
        l_cnt TYPE i.
        l_cnt = 10.
        tables : covp.
        data : ref_no(20).
        SELECT lifnr
        belnr
        bukrs
        gjahr
        FROM bseg
        INTO TABLE it_bseg1.
        DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
        SELECT belnr
        xblnr
        bktxt
        awkey
        bukrs
        gjahr
        AWTYP
        FROM bkpf
        INTO TABLE it_bkpf.
        IF sy-subrc EQ 0.
          CLEAR: l_s_icctrcsta1,
          wa_bkpf,
          l_awkey,
          wa_bseg1.
          LOOP AT c_t_data INTO l_s_icctrcsta1.
            MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
          select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
          WHERE belnr = l_s_icctrcsta1-belnr.
          if sy-subrc = 0.
              if COVP-AWORG is initial.
           concatenate l_s_icctrcsta1-refbn '%' into ref_no.
                  READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
                  l_s_icctrcsta1-refbn
                  awtyp = COVP-AWTYP
                  gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
                ELSE. " IF AWORG IS NOT BLANK -
                concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
                READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
                ref_no
                awtyp = COVP-AWTYP
                gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
               endif.
          endif.
            CLEAR: l_s_icctrcsta1.
            CLEAR: COVP, REF_NO.
          ENDLOOP.
        ENDIF.

    Hello Amruta,
    I was just looking at your coding:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
    MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
    select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
    WHERE belnr = l_s_icctrcsta1-belnr.
    if sy-subrc = 0.
    if COVP-AWORG is initial.
    concatenate l_s_icctrcsta1-refbn '%' into ref_no.
    READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
    l_s_icctrcsta1-refbn
    awtyp = COVP-AWTYP
    gjahr = l_gjahr1.
    Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
    I guess that this table does not contain millions of entries. Am I right?
    If yes, the the first step would be to pre-select COVP entries:
    select BELNR AWORG AWTYP into lt_covp from COVP
    for all entries in c_t_data
    where belnr = c_t_data-belnr.
    sort lt_covp by belnr.
    Once having this data ready, you build an internal table for BKPF selection:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
      clear ls_bkpf_sel.
      ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
      read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
      if sy-subrc = 0.
        ls_bkpf_sel-awtyp = lt_covp-awtyp.
      endif.
      ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
      insert ls_bkpf_sel into table lt_bkpf_sel.
    ENDLOOP.
    Now you have all necessary info to read BKPF:
    SELECT
    belnr
    xblnr
    bktxt
    awkey
    bukrs
    gjahr
    AWTYP
    FROM bkpf
    INTO TABLE it_bkpf
    for all entries in lt_bkpf_sel
    WHERE
      awkey = lt_bkpf_sel-awkey and
      awtyp = lt_bkpf_sel-awtype and
      gjahr = lt_bkpf_sel-gjahr.
    Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
    Moreover I would even try to make a join on DB level. But first try this solution.
    Regards,
      Yuri

  • Table relations between vbrk and bkpf for  Accounting Document Number

    hello,
    i am using 4 tables to get data into my programs.
    vbrk,vbrp konv and bkpf.
    i want to get belnr from bkpf.i found relation between vbrk and belnr.but in vbrk table belnr's value is initial.
    can anybody tell me that how should i relate vbrk and bkpf or how to get Accounting Document Number(belnr) from bkpf for Billing Document(vbeln).
    regards,
    soniya s.

    hi,
    chekc this. its working for me.
    data : WA_AWKEY LIKE BKPF-AWKEY.
    data :  WA_BELNR LIKE BKPF-BELNR.
    data : LENGTH TYPE I.
    *BREAK MTABAP.
    LENGTH = STRLEN( IT_VBRK-VBELN ).
    if  LENGTH = '10' .
    MOVE it_vbrk-VBELN TO WA_AWKEY.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR.
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY .
    else.
    CONCATENATE '0' it_vbrk-vbeln INTO wa_awkey.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR .
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY.
    endif.

  • How to use read_text function module

    Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
    thanks,
    Mahe

    Dear,
    Use below code.
    DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
    V_TDNAME LIKE THEAD-TDNAME.
    V_TDNAME = PO_NUMBER.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        ID                            = 'F01'
        LANGUAGE                      = 'EN'
        NAME                          = V_TDNAME
        OBJECT                        = 'EKKO'
      TABLES
        LINES                         = IT_LINE.
    Thanks and Regards,

  • ALV report on BKPF and BSID

    hi gurujis,
                  with your kind help i am learning something, but there is problem in each step. Now i am working with FI , i have came to  know about two tables,
    they are BKPF and BSID i have to join them and also produce output on the basis of 4 inputs like company no, coustomer no, currency and posting date. I need your help on this, can somebody send me the code to do this.
    Also i would like to know is there any FM's to join two or more tables, if yes, please send me the name of that module with an complete example.
    I need this , it is very urgent.
    Thanks,
    KHAN.

    hi Khan,
    SELECT bkpf~...
                 bsid~...
    INTO TABLE ...
    FROM bkpf AS bkpf
    INNER JOIN bsid AS bsid
    ON bkpf~bukrs EQ bsid~bukrs
    AND bkpf~gjahr EQ bsid~gjahr
    AND bkpf~belnr EQ bsid~belnr
    WHERE bkpf~bukrs EQ p_bukrs
          AND bsid~kunnr IN s_kunnr
          AND bkpf~waers EQ p_waers
          AND bkpf~budat EQ p_budat.
    hope this helps
    ec

  • Relationship between Table BKPF and RBKP

    Hello Developers,
    I need to fetch value of field BKTXT  from table BKPF and this value need to insert in internal table i_tab.
    in the below situation:
    select bebeln bebelp bwerks ausnam alifnr abelnr
             abldat abudat
             caedat cekgrp cbukrs cekorg
             dbanfn dbnfpo dnetpr dafnam
      into corresponding fields of table i_tab
      from rbkp as a join rseg as b on abelnr = bbelnr
                     join ekko as c on bebeln = cebeln
                     join ekpo as d on cebeln = debeln
                                          and bebelp = debelp
      where a~budat in s_date
        and b~werks in s_werks
        and c~bstyp = c_f
        and c~ekorg in s_ekorg
        and a~bukrs in s_bukrs.
    Can any one suggest how to relate table BKPF with other table like RBKP.
    Thanks in advance.
    Regards
    Sundeep

    Hi,
    perform the following steps:-
    1.   Go to transaction SQVI
    2.   Create a View
    3.   Enter title
    4.   Choose the Data source as Table Join
    5.   Go to insert table and add table as per your requirement.
    and hereafter you can find relation between any two tables...
    Rgds/Abhi

  • Problem in using FM READ_TEXT to read Material Sales Text.

    Hi Guys,
    I am developing a Customer Outstanding report in which I display all the invoices of a particular customer.
    I need  to read "Material Sales Text" which comes under "Item Text" tab in transaction FBL5N.
    I have used READ_TEXT in my program. I have identified the Object, and ID but I am stuck up with the Name. I dont know what Name to pass. I have tried passing the Invoice Number in "Name" but couldnt get the text.
    Request you to please help me out. Please check the below code.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            =    '0001'
        language                      =  SY-LANGU
        name                          =  -
        object                        =  'VBBP'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         =  tl001
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       OTHERS                        = 8
    Thanks.

    *&      Form  READ_TEXT
    FORM read_text  USING    p_tdid  p_tdname
                    CHANGING p_tdline.
      DATA: it_line  TYPE STANDARD TABLE OF tline,
            wa_line  TYPE tline                  ,
            l_tdid   TYPE thead-tdid,
            l_tdname TYPE thead-tdname.
      l_tdid   = p_tdid.
      l_tdname = p_tdname.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id       = l_tdid
          language = 'E'
          name     = l_tdname
          object   = 'VBBP'
        TABLES
          lines    = it_line
        EXCEPTIONS
          OTHERS   = 8.
      LOOP AT it_line INTO wa_line.
        IF NOT wa_line-tdline IS INITIAL.
          p_tdline = wa_line-tdline.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " READ_TEXT

  • How to use Read_Text  in Smartforms

    Hi Experts,
    I am developed smartforms .My probelm is i need to use the read_text in smartforms . i am fetch the text in print program how to use this text in smartform.
    Pls suggest me.
    This is my print program .
    REPORT  zsd_invoice_text.
    PARAMETERS : p_vbeln TYPE vbrk-vbeln.
    DATA : fname TYPE rs38l_fnam.
    DATA:BEGIN OF i_vbrk OCCURS 0,
         vbeln type VBELN_VF,
         END OF i_vbrk.
    DATA: lt_lines  TYPE STANDARD TABLE OF tline,
          wa_lines  TYPE tline.
    DATA: ld_text(18) TYPE c.
    *DATA: tdobname TYPE tdobname.
    CONSTANTS: c_id TYPE thead-tdid VALUE  '0002',
                          c_object TYPE thead-tdobject VALUE 'VBBK'.
    DATA: lv_name TYPE tdobname.
    select vbeln from vbrk into table i_vbrk where vbeln eq p_vbeln.
    loop at i_vbrk.
    read table i_vbrk with key vbeln = i_vbrk-vbeln.
    endloop.
    lv_name = i_vbrk-vbeln.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id        = c_id
          language  = sy-langu
          name      = lv_name
          object    = c_object
    *  IMPORTING
    *    header    = ld_header
        TABLES
          lines     = lt_lines
        EXCEPTIONS
          id        = 1
          language  = 2
          name      = 3
          not_found = 4
          object    = 5.
        IF sy-subrc <> 0.
        ELSE.
          LOOP AT lt_lines INTO wa_lines.
            CONCATENATE ld_text wa_lines-tdline INTO ld_text.
          ENDLOOP.
        ENDIF.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = 'ZSD_INVOICE_TEXT'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
    IMPORTING
       fm_name                  = fname
    EXCEPTIONS
       no_form                  = 1
       no_function_module       = 2
       OTHERS                   = 3
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION fname
      EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         =
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             =
    *   USER_SETTINGS              = 'X'
        p_vbeln                    = p_vbeln
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
       formatting_error           = 1
       internal_error             = 2
       send_error                 = 3
       user_canceled              = 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.
    Thanks in Advance
    purnaneelu
    Edited by: Purnaneelu on Jun 9, 2009 7:11 AM

    Hi,
    Used below code:
    1) Call FM READ_TEXT and pass
    DATA :
    T_LINES
    TYPE TABLE OF
    TLINE
    W_TDLINES
    TYPE
    TLINE
    V_WORK
    TYPE
    CHAR255
    CALL FUNCTION 'READ_TEXT'
       EXPORTING
        CLIENT                         = SY-MANDT
         ID                                = 'Z038'
         LANGUAGE                 = sy-langu
         NAME                         =  BIL_NUMBER
         OBJECT                      = 'VBBK'
       TABLES
         lines                            = T_LINES
    IF sy-subrc = 0.
    loop at t_lines INTO W_TDLINES.
       CONCATENATE V_WORK W_TDLINES-TDLINE INTO V_WORK SEPARATED BY SPACE.
       CONDENSE V_WORK.
       CLEAR W_TDLINES.
    ENDLOOP.
    REFRESH T_LINES.
    ENDIF.
                                                                          OR
    2 ) See below attached screen shot

  • 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 text rertrived by using the 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 module.
    its urgent. Points will be rewarded for any type of clue. whether it will work or not.

    loop the table into which u have retrieved the text .
    in the form interface of the smartform ... in importing parameter give the that table name .
    and in smartform whereever u want to print there insert the data into work area and pass to fields for dispaly .
    decalre ur work area in global defintions
    thnaks .

Maybe you are looking for

  • Mapping Versions/History in Integration Repository

    We are running PI7.0 - SP10....  A highly suspect version with some ropey patches supplied by SAP! We have imported a Mapping version into our XIT system that does not work, however, our XID system is about to be either restored or upgraded due to so

  • White Screen

    I seem to be having a problem with my MacBook Pro and I was wondering if anyone could give me any suggestions. Earlier today I was watching a show on Hulu through Firefox, and then I opened Adium. After the buddy list loaded, I decided to close it ag

  • Problem in select-options value request

    Hi All, I have one select-option s_opt for vendor description. I want to have value request for both s_opt-low and s_opt-high. For that i have to write the functonal module at selection-screen on value-request for s_opt-low. and at selection-screen o

  • What does error code 150:30 mean and why can i not access my elements site

    what does error code 150:30 mean I cannot access my element equipment

  • Get iview ID in runtime

    Hi, I have one iview in content area and footer is same for all the iviews displaying in content area. I got one link in footer which opens a document. This  document is specific to the iview displayed in contentarea, so i need to get ID of an iview