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: 

Header Text For Orders

Former Member
0 Kudos

Hi ALL,

How to get the Headre Text for the Sales Order Number...

Do we have to use READ_TEXT if yes..

what all parameters to be passed and what will b ethe OBJECT for this ....

Thanks .

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Object should be VBBK.

Name should be the SO Number.

Regards,

Ravi

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Object should be VBBK.

Name should be the SO Number.

Regards,

Ravi

Former Member
0 Kudos

Hi,

The texts you find in all SAP Object, like orders, invoice, materials, ... can be extract with FM 'READ_TEXT'.

To know the parameters of the FM, you 'll have to go to the text ( in plain page mode ), then you do "GOTO" -> "HEADER", and a pop-up window opens with the parameters you need ( Text name, language, text id, text object ).

The table "t_tdline" contains the entire text .

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = w_id

language = sy-langu

name = w_name

object = w_object

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = t_tdlines

Regards,

Bhaskar

Former Member
0 Kudos

hi,

Go to header texts and get the id, name, object of the text.


tables : vbak.

DATA: BEGIN OF lines OCCURS 0.
       INCLUDE STRUCTURE tline.
DATA: END OF lines.

data : text1(60) TYPE C  ,
      text2(60) TYPE C  ,
      text3(60) TYPE C  ,
      text4(60) TYPE C  ,
      text5(60) TYPE C  .

data:  w_id       like thead-tdid,        "Text ID
      w_name     like thead-tdname,      "Name
      w_object   like thead-tdobject.    "Texts: aplication

     w_id   = 'Z100'.
     w_name = VBAK-VBELN.
     w_object = 'VBBK'.

     clear lines.
     CLEAR TEXT1.
     CLEAR TEXT2.
     CLEAR TEXT3.
     CLEAR TEXT4.
     CLEAR TEXT5.

     call function 'READ_TEXT'
          EXPORTING
               id                      = w_id
               language                = 'E'
               name                    = w_name
               object                  = w_object
          TABLES
               lines                   = 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.

     ELSE .
       REad table lines index 1.
       if sy-subrc = 0.
         text1 = lines-tdline.
       endif.
       REad table lines index 2.
       if sy-subrc = 0.
         text2 = lines-tdline.
       endif.
       REad table lines index 3.
       if sy-subrc = 0.
         text3 = lines-tdline.
       endif.
       REad table lines index 4.
       if sy-subrc = 0.
         text4 = lines-tdline.
       endif.
       REad table lines index 5.
       if sy-subrc = 0.
         text5 = lines-tdline.
       endif.

     ENDIF.

Regards

sailaja.

Former Member
0 Kudos

HI GOTO header -> texts for particular sales order and select the text you want.

Double click on the text so that u will get a form header. in that goto HEader so that u will find the vallues to be passed to FM READ_text.

Reward for useful answers

ferry_lianto
Active Contributor
0 Kudos

Hi,

Yes, you can use FM READ_TEXT to read header text for sales order.

Please check this sample code.


DATA: TDNAME LIKE THEAD-TDNAME.
 
CLEAR: TEXT. REFRESH: TEXT.
 
TDNAME = VBAK-VBELN.
 
CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID = '0001'
    LANGUAGE = SY-LANGU
    NAME = TDNAME
    OBJECT = 'VBBK'
  TABLES
    LINES = TEXT
  EXCEPTIONS
    NOT_FOUND = 1.

Regards,

Ferry Lianto

0 Kudos

HI All ,

Thanks for your comments on this ..

I was passing all the parameters as mentioned by you..only mistake i was doing was not passing the leading zeroes in Sales Order ..

Its now working ..

Thanks .