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: 

TLINE-TDLINE IS NOT GETTING POPULATE

Former Member
0 Kudos
600

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

1 ACCEPTED SOLUTION

SrihariNerella
Participant
0 Kudos
199

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

9 REPLIES 9

rvinod1982
Contributor
0 Kudos
199

Hi,

To get header text data no need to concatenate IT-BANFN and IT-BNFPO. Just pass IT-BANFN to NAME parameter.

Regards,

Vinod

SrihariNerella
Participant
0 Kudos
200

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

NAeda
Contributor
0 Kudos
199

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

Former Member
0 Kudos
199

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

kesavadas_thekkillath
Active Contributor
0 Kudos
199

Check whether the data exists in table stxh and stxl

with the same input .

0 Kudos
199

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

0 Kudos
199

Hi Keshu,

Data is not there. could you tell why it is happing.

Regards,

Ranu

kesavadas_thekkillath
Active Contributor
0 Kudos
199

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

0 Kudos
199

Thanks Keshu , it is solved