Application Development 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: 

Pick the data from HEAD. TEXT

Former Member
0 Kudos

I want to pick the data from :-

VF02 - Put the billing Doc. no. - Display Doc. Header List -

Head. Text.

In Head. Text i write something & it will be display in my report.Is there possible if yes then how ??

6 REPLIES 6

Former Member
0 Kudos

Hi,

YEs it is possible.

Use 'READ_text' function module.

For passing parameter to 'read_text'

Go-to header text as u have mentioned earlier.

In that put text . Go-to details(Second icon after create in bottom)

After that goto->header.

You wil get

Text Name

Language

Text ID

Text Object

Pass these parameters to your FM 'READ_text'.

data : tdlines TYPE STANDARD TABLE OF tline ,

wa type tline.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = Text ID language = Language

name = Text Name

object = Text Object

TABLES

lines = tdlines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8

.

loop at tdline into wa.

write : /wa-tdline.

endloop.

Edited by: Anil Mane on Sep 24, 2008 7:30 AM

Former Member
0 Kudos

Hello

Use FM 'READ_TEXT'

Former Member
0 Kudos

Hi,

Check this sample code


REPORT  z_test1.

TABLES:
  thead.

PARAMETERS:
  p_vbeln TYPE vbak-vbeln.

PARAMETERS:
  p_textid TYPE thead-tdid.

DATA:
  BEGIN OF t_thead OCCURS 0.
        INCLUDE STRUCTURE thead.
DATA:
END OF t_thead.
DATA:
  w_line TYPE i,
  w_idx TYPE i,
  w_flag TYPE i.
DATA:
  BEGIN OF t_tline OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA:
END OF t_tline.

DATA:
  w_test TYPE thead-tdname,
  w_temp TYPE string VALUE 'FIRST ASSIGNMENT'.


START-OF-SELECTION.
  w_test = p_vbeln.

  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = p_textid
      language                = sy-langu
      name                    = w_test
      object                  = 'VBBK'
    TABLES
      lines                   = t_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 NE 0.
    MESSAGE 'HEADER TEXT NOT FOUND' TYPE 'I'.
  ENDIF.

  LOOP AT t_tline.
    WRITE: / t_tline-tdline.
  ENDLOOP.

Regards

Abhijeet

0 Kudos

This coding is working fine but it doesn't show the text which i put in the VF02.

It simly shows the information msg. :- HEADER TEXT NOT FOUND.

0 Kudos

Hi Sumit,

the program which I have posted is for fetching sales order text, you can use similar type of code to fetch text for Billing document, you need to find text id and text object first.

Regards

Abhijeet

0 Kudos

Hi summit,

Use the FM as follows;

CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = '0002'
      language                = sy-langu
      name                    = '0092000005' "Substitute with the field having bill number
      object                  = 'VBBK'
    TABLES
      lines                   = t_tline
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.

Regards

Karthik D