‎2008 Nov 13 6:24 PM
Hi,
I have sales order num and want to read Header texts. Can someone please give me an example.
Thanks,
Veni.
‎2008 Nov 13 6:32 PM
MOVE wa_vbak-vbeln TO v_vbeln.
you have to pass sales order number ,id,object.
to get those values go to SE75.
select text objects and IDs and display.
search for sales.you will get object for sales and double click on it to get the Text IDs.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'Z004'
language = sy-langu
name = v_vbeln
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
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.
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2008 Nov 13 6:30 PM
Hope this helps
DATA: LS_XTHEAD LIKE THEADVB.
DATA tlinetab LIKE tline OCCURS 0 WITH HEADER LINE.
(This structure is only suitable the first time we entry the VA01)
READ TABLE XTHEAD INTO LS_XTHEAD WITH KEY TDOBJECT = XTHEAD-TDOBJECT
TDNAME = XTHEAD-TDNAME
TDID = XTHEAD-TDID
TDSPRAS = XTHEAD-TDSPRAS.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = LS_XTHEAD-tdid
language = LS_XTHEAD-tdspras
name = LS_XTHEAD-tdname
object = LS_XTHEAD-tdobject
TABLES
lines = tlinetab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
CHECK sy-subrc = 0.
‎2008 Nov 13 6:32 PM
MOVE wa_vbak-vbeln TO v_vbeln.
you have to pass sales order number ,id,object.
to get those values go to SE75.
select text objects and IDs and display.
search for sales.you will get object for sales and double click on it to get the Text IDs.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'Z004'
language = sy-langu
name = v_vbeln
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
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.
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2008 Nov 13 6:50 PM
Hi,
Is the following code correct.
data: itab_read like tline occurs 10 with header line.
V_vgbel has order number.
concatenate v_vgbel '0000' into f_vgbel.
If I give just V_vgbel sales order number it is giving me dump.
If I give f_vgbel then, no dump but nothing is comming in itab_read.
Is there anything wrong in my code.
Please help.
Thanks,
Veni.
call function 'READ_TEXT'
EXPORTING
id = '0021'
language = 'E'
name = f_vgbel
object = 'VBBK'
TABLES
lines = itab_read
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.
‎2008 Nov 13 6:52 PM
Hi
VGBEL-Document number of the reference document
its different to sales order number .. all though both are vbeln..
‎2008 Nov 13 7:00 PM
Hi,
In my program it is declared as sales order number and I debuged it and checked the number is sales oder number only.
v_vgbel like lips-vgbel, " Sales Order Number
select single vgbel matnr from lips
into (v_vgbel,v_matnr)
where vbeln = v_vbeln
and posnr = v_posnr.
Thanks,
Veni.
‎2008 Nov 13 7:07 PM
if you can double click in lips-vgbel it will take you to the field.. which says
VGBEL VGBEL CHAR 10 0 Document number of the reference document
if this is the number you want text .. then the object which you are passing into read_text will change.. thats the reason ur table is not getting data.
‎2008 Nov 13 7:27 PM
Hi,
I went in to Sales order header texts and double clicked on the text and went to goto -> header. Then I got text name as sales order num, textid 0021, text object VBBK and language EN.
Will the following v_vbeln work for me as text name?
--
select single vbeln from vbak into (v_vbeln)
where vbeln = v_vgbel.
Thanks,
Veni.
‎2008 Nov 13 7:36 PM
hi veni
at times there will be spaces in between vbeln <space> posnr
check in STXH table with the object tdname and tdid and check if you are returning any data..
if you are getting in table and not in read text.. there is some problem in the table deceleration or some code issue...
‎2008 Nov 13 7:43 PM
Hi,
Here is exactly how it is in my STXH table. it gave TDTXTLINES as 1.
Text Object VBBK
Text Name 0001994817
Text ID 0021
Language Key E
TDTXTLINES 1
Thanks,
veni.
‎2008 Nov 13 8:18 PM
you dont have to concatenate sy-mandt to SO number.
just pass the SO number itself.
concatenate v_vgbel '0000' into f_vgbel.
MOVE v_vgbel TO f_vgbel.
‎2008 Nov 13 9:33 PM
Hi,
I have these values.
v_vgbel 0001994817
f_vgbel 00019948170000
v_vgbel is my sales order number
f_vgbel is ordernum + item num (as this is header text I am passing 0000 as item num)
If I just give v_vgbel(Order num) it is giving me the following dump. If I give f_vgbel(order num+0000) it is not giving me any dump, but no values are comming in itab_read.
I will really appriciate your help.
Thanks,
Veni.
Runtime Errors CALL_FUNCTION_CONFLICT_TYPE
Except. CX_SY_DYN_CALL_ILLEGAL_TYPE
Date and Time 11/13/2008 13:29:19
Short text
Type conflict when calling a function module.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLXLID" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
A function module was called incorrectly.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "EXIT_SAPLVMDE_002" "(FUNCTION)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The call to the function module "READ_TEXT" is incorrect:
The function module interface allows you to specify only
fields of a particular type under "NAME".
The field "V_VGBEL" specified here is a different
field type
.
‎2008 Nov 13 11:51 PM
the value passed to this FM should be of type THEAD-TDNAME.
you dont have to concatenate the mandt or item for reading header text.
if you see the values in STXH table the text name is 10 characters(just the SO number).
Text Object VBBK
Text Name 0001994817
Text ID 0021
Language Key E
TDTXTLINES 1Try this code :
*DATA : f_vgbel TYPE THEAD-TDNAME.*
*MOVE v_vgbel TO f_vgbel.*
call function 'READ_TEXT'
EXPORTING
id = '0021'
language = 'E'
name = f_vgbel
object = 'VBBK'
TABLES
lines = itab_read
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.
‎2008 Nov 13 7:06 PM
Hi,
Try this..
data: v_name TYPE THEAD-TDNAME.
concatenate sy-mandt V_vgbel into v_name.
call function 'READ_TEXT'
EXPORTING
id = '0021'
language = 'E'
name = v_name " Changed here.
object = 'VBBK'
TABLES
lines = itab_read
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.Thanks
Naren
‎2008 Nov 14 8:06 AM
hi Veni
try this code:
data: v_vgbel like lips-vgbel.
data: v_name type thead-tdname.
data: itab_read like tline occurs 10 with header line.
select single vgbel matnr from lips
into (v_vgbel,v_matnr)
where vbeln = v_vbeln
and posnr = v_posnr.
v_name = v_vgbel.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'Z004'
language = sy-langu
name = v_name
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
lines = itab_read
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.
Edited by: hikarulea on Nov 14, 2008 4:06 PM
‎2008 Nov 14 9:10 AM
Dont you know how to search in SDN.
If you do a search with READ_TEXT you will get tons of threads having code samples.
Read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting more.
And always search before posting a question.
Regards
Karthik D