cancel
Showing results for 
Search instead for 
Did you mean: 

Read_Text item text in Smartforms

Former Member
0 Kudos

Hi all,

i need to display the item text of VL02N in Smartforms.

i have retreived data using READ_TEXT into a internal table IT_TEXT1. i am looping at IT_LINES to populate the internal table IT_TEXT1.

it carries all the data. But while displaying it is displaying the last record only.

In the Smartform also i am looping at the table IT_TEXT1 to display IT_TEXT1-TDLINE.

But the last record is only displayed.

 
DATA: IT_LINE    LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE,
       IT_TEXT1   LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE.


LOOP AT IT_LIPS.
 CONCATENATE: IT_LIPS-VBELN  IT_LIPS-POSNR INTO IT_THEAD1-TDNAME.
      IT_THEAD1-TDOBJECT = 'VBBP'.
      IT_THEAD1-TDID = '0002'.
      IT_THEAD1-TDSPRAS = 'EN'. " V_LANG .
      APPEND IT_THEAD1.


       CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT                        = SY-MANDT
          ID                            = IT_THEAD1-TDID
          LANGUAGE                      = V_LANG
          NAME                          = IT_THEAD1-TDNAME
          OBJECT                        = IT_THEAD1-TDOBJECT
        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
                .
          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 IT_LINE INTO W_LINE.
       APPEND W_LINE TO IT_TEXT1.
      ENDLOOP.
      CLEAR:  IT_LINE, W_LINE.

 ENDLOOP .  

KINDLY LET ME KNOW how to display all the Item texts.

kindly point out where i am going wrong.

Thanks.

Suki.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Ramesh ,

it is just simple,

declare one varialble type string .

DATA: V_TEXT TYPE STRING.

Then write the following code at the end of the read_text .

LOOP AT IT_LINE INTO W_LINE.

CONCATENATE W_LINE V_TEXT INTO V_TEXT.

ENDLOOP.

Then display the V_TEXT,

Reward if it is usefull,

KP

Former Member
0 Kudos

thank you krishna prasad ,

you answer is help full

regards,

uday...

Answers (3)

Answers (3)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Where have u witten ur code? in driver prog or the smartform itself?

Former Member
0 Kudos

Hi,

you are not looping the internal table IT_LINE in smartform.

try the below steps.

For example in main window

1. Create the loop for IT_TEXT1

2. Create the text and write the text (WA_TEXT1-TDLINE)

Regards,

Boobalan S

Former Member
0 Kudos

Hi,

I am looping at IT_LINE and Populating the data into IT_TEXT1 in the driver program. while debugging i am seeing all the data.

In the Smartform in the Main Window,

GLOBAL DATA : V_TEXT1 LIKE TLINE-TDLINE.

LOOP AT IT_TEXT1 into WA_TEXT1.

V_TEXT1 = WA_TEXT1-TDLINE.

ENDLOOP.

But i am clueless why i am getting only the last record.

Former Member
0 Kudos

u need to declare the IT_TEXT1 in the tables section of the smartform interface.

declare it like it_text1 like TLINE.

EG:

  • Call Smartfrom to print the document

CALL FUNCTION v_form_fm

EXPORTING

p_deci_auhtority = p_da

TABLES

IT_TEXT1 = IT_TEXT1

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

Former Member
0 Kudos

Hi,

As you said i have included the IT_TEXT1 in the TABLES parameter.

 

data :        IT_TEXT1   LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE.

CALL FUNCTION '/1BCDWB/SF00000010'
    EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
      E_VBELN                    = E_VBELN
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
    TABLES
      IT_LIKP                    = IT_LIKP
      IT_VBFA                    = IT_VBFA
      IT_VBAK                    = IT_VBAK
      IT_VBPA                    = IT_VBPA
      IT_KNA1                    = IT_KNA1
      IT_ADRC                    = IT_ADRC
      IT_LIPS                    = IT_LIPS
      IT_LIPSD                   = IT_LIPSD
      IT_MCHB                    = IT_MCHB
      IT_TEXT1                   = IT_TEXT1
      IT_TEXT2                   = IT_TEXT2
      IT_LINE3                   = IT_TEXT3
      IT_CONFOUT                 = IT_CONFOUT
      IT_THEAD1                  = IT_THEAD1

* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

.

Former Member
0 Kudos

it is a with header line table isnt it..you need to give the suare brackets [ ]

CALL FUNCTION '/1BCDWB/SF00000010'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

E_VBELN = E_VBELN

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

IT_LIKP = IT_LIKP

IT_VBFA = IT_VBFA

IT_VBAK = IT_VBAK

IT_VBPA = IT_VBPA

IT_KNA1 = IT_KNA1

IT_ADRC = IT_ADRC

IT_LIPS = IT_LIPS

IT_LIPSD = IT_LIPSD

IT_MCHB = IT_MCHB

IT_TEXT1 = IT_TEXT1[]

IT_TEXT2 = IT_TEXT2

IT_LINE3 = IT_TEXT3

IT_CONFOUT = IT_CONFOUT

IT_THEAD1 = IT_THEAD1

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

And one advice do not hard code the smartform function module name. Use SSF_FUNCTION_MODULE NAME to get the SF function module name. The FM name is dynamic in nature.