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: 

How to read Smartform Text Module

Former Member
0 Kudos

Hi All,

I have a requirement to read Smartform Text module in my program. I have searched SDN for any existing questions on this but I couldn't find any help. I thought we can use READ_TEXT but seems it is not helpful. Could you please let me know any FM or class method available for this. You can use example Smartform text module SF_ADRS_FOOTER.

Regards,

Yellappa.

3 REPLIES 3

Former Member

I have got one more function module SSFRT_READ_TEXTMODULE which helped me. I am closing the thread.

0 Kudos

Hi,

Below is the sample report to read the text of text module.



report  ztest_date.

data: lr_form type ref to cl_ssf_fb_smart_form.
data: lr_node type ref to cl_ssf_fb_node.
data: lr_text type ref to cl_ssf_fb_text_item.

data: ls_varheader type ssfvarhdr.
data: ls_text type tline.


start-of-selection.

  create object lr_form.

  try.
      call method lr_form->load
        exporting
          im_formname = 'SF_ADRS_FOOTER'.
    catch cx_ssf_fb .
  endtry.

  if lr_form is bound.
    read table lr_form->varheader into ls_varheader index 1.
    if sy-subrc = 0.
      lr_node ?= ls_varheader-pagetree.
      if lr_node is bound.

        lr_text ?= lr_node->obj.

        if lr_text is not initial.

          loop at lr_text->text into ls_text.
            write:/ ls_text-tdline.
          endloop.

        endif.

      endif.
    endif.
  endif.

0 Kudos

Hi,

Used below code:

DATA :

T_LINESTYPE TABLE OFTLINE
W_TDLINESTYPETLINE
V_WORKTYPECHAR255


1) Call FM READ_TEXT and pass


CALL FUNCTION 'READ_TEXT'

   EXPORTING

    CLIENT                         = SY-MANDT

     ID                                = 'Z038'

     LANGUAGE                 = sy-langu

     NAME                         BIL_NUMBER

     OBJECT                      = 'VBBK'

   TABLES

     lines                            = T_LINES

IF sy-subrc = 0.

LOOP AT t_lines INTO W_TDLINES.

   CONCATENATE V_WORK W_TDLINES-TDLINE INTO V_WORK SEPARATED BY SPACE.

   CONDENSE V_WORK.

   CLEAR W_TDLINES.

ENDLOOP.

REFRESH T_LINES.

ENDIF.


                                                                      OR


2 ) See below attached screen shot