2009 Nov 11 5:30 AM
Hi,
I want to pint header text of me51n into my smart form. For this i am using read_text and passing all required parameters.
But my TLINE-TDLINE IS NOT GETTING POPULATE.
Same code i am writing for item text and here TLINE-TDLINE IS GETTING POPULATE.
Could any one tell me how to get header text .
I am using code given below:-
CONCATENATE IT-BANFN IT-BNFPO INTO NAME.
data : tline1 like tline occurs 0 with header line.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'B01'
LANGUAGE = 'E'
NAME = NAME
OBJECT = 'EBANH'
IMPORTING
" HEADER =
TABLES
LINES = tline1
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.
LOOP AT TLINE1.
CASE SY-TABIX.
WHEN 1.
LINE3 = TLINE1-TDLINE.
WHEN 2.
LINE4 = TLINE1-TDLINE.
ENDCASE.
ENDLOOP.
Regards,
Ranu
2009 Nov 11 5:35 AM
Check the fallowing code .
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: TNAME LIKE THEAD-TDNAME,
T_STXH TYPE STANDARD TABLE OF STXH,
W_STXH TYPE STXH,
L_TEXT TYPE STRING.
SELECT SINGLE * FROM STXH INTO W_STXH
WHERE TDOBJECT = 'QMEL'
AND TDNAME = P_QMNUM
AND TDSPRAS = 'EN'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = W_STXH-TDID
LANGUAGE = W_STXH-TDSPRAS
NAME = W_STXH-TDNAME
OBJECT = W_STXH-TDOBJECT
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER = HTEXT
TABLES
LINES = LTEXT
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.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
CONCATENATE L_TEXT LTEXT-TDLINE INTO L_TEXT SEPARATED BY SPACE.
ENDIF.
ENDLOOP.
Regards
Nandan.N
2009 Nov 11 5:34 AM
Hi,
To get header text data no need to concatenate IT-BANFN and IT-BNFPO. Just pass IT-BANFN to NAME parameter.
Regards,
Vinod
2009 Nov 11 5:35 AM
Check the fallowing code .
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: TNAME LIKE THEAD-TDNAME,
T_STXH TYPE STANDARD TABLE OF STXH,
W_STXH TYPE STXH,
L_TEXT TYPE STRING.
SELECT SINGLE * FROM STXH INTO W_STXH
WHERE TDOBJECT = 'QMEL'
AND TDNAME = P_QMNUM
AND TDSPRAS = 'EN'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = W_STXH-TDID
LANGUAGE = W_STXH-TDSPRAS
NAME = W_STXH-TDNAME
OBJECT = W_STXH-TDOBJECT
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER = HTEXT
TABLES
LINES = LTEXT
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.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
CONCATENATE L_TEXT LTEXT-TDLINE INTO L_TEXT SEPARATED BY SPACE.
ENDIF.
ENDLOOP.
Regards
Nandan.N
2009 Nov 11 5:37 AM
Hi Ranu Sharma,
1. There is no need to write READ_TEXT in SMARTFORMS
Create one text with Type Include text.
EX:
Text Name &TDNAME&
Text Object EKPO
Text ID &TDID&
Language &LANGUAGE&.
and Check the tick mark-No error if no text exists.
2. In your Example
before calling the read_text, check whether text exits or not by writing the select statement like this
SELECT SINGLE * FROM STXH WHERE TDOBJECT = 'VBBP'
AND TDNAME = V_NAME
AND TDID = '4002'
AND TDSPRAS = 'E'.
IF SY-SUBRC = 0.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = '4002'
LANGUAGE = V_LANG
NAME = V_NAME
OBJECT = 'VBBP'
TABLES
LINES = IT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
Regards
Aeda
2009 Nov 11 6:07 AM
Hi
sy-subrc is ne 0. that means text is not there. could you tell me why it is not exist as i am entering data in header and saving it
Regards
Edited by: ranu sharma on Nov 11, 2009 7:08 AM
2009 Nov 11 5:43 AM
Check whether the data exists in table stxh and stxl
with the same input .
2009 Nov 11 6:07 AM
Hi
sy-subrc is ne 0. that means text is not there. could you tell me why it is not exist as i am entering data in header and saving it
Regards
Edited by: ranu sharma on Nov 11, 2009 7:08 AM
2009 Nov 11 6:18 AM
Hi Keshu,
Data is not there. could you tell why it is happing.
Regards,
Ranu
2009 Nov 11 7:36 AM
check in me53n once.
if its displaying there...then you are passing worng values.
Edited by: Keshu Thekkillam on Nov 11, 2009 1:06 PM
2009 Nov 11 8:25 AM