Application Development and Automation 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: 
Read only

Edit_Text

Former Member
0 Likes
393

Dear Friends,

I am display text in smartforms by using Include text .

now my condition is if text is not available in Particular Document it should Pick From other document.

regards,

S reddy

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
361

Hi,

How are are including the standard text now? are you using Text type as "Include text" or getting the value by creating the Program lines?

You can easily do it by creating Program lines.

Text Node
     Program lines Node                   " Write the Logic to get the Long text
        Loop Node                              " As we get long text in FM READ_TEXT in TLINES table, loop that
           Text node                    " This node for printing Long text

Sample code

lv_tdname = WA_VBDPR-TDNAME.

 CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                            = lc_0001
        language                      = sy-langu
        name                          = lv_tdname
        object                        = lc_vbbp
      TABLES
        lines                         = lt_tline
EXCEPTIONS
       OTHERS                        = 8
    IF sy-subrc <> 0.

    ENDIF.

IF lt_tline[] IS INITIAL.

CLEAR : lv_tdname.

lv_tdname = WA_VBDPR-TDNAME1.                 " Other document

 CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                            = lc_0001
        language                      = sy-langu
        name                          = lv_tdname
        object                        = lc_vbbp
      TABLES
        lines                         = lt_tline
     EXCEPTIONS
       OTHERS                        = 8
              .
    IF sy-subrc <> 0.

    ENDIF.

ENDIF.

Regards

Bala Krishna

2 REPLIES 2
Read only

Former Member
0 Likes
361

Hi,

Have condition in the condition.

if is initial.

write a code to fetch the data from other document.

Endif.

insert in to a text.

Thanks

Karthi.S

Read only

former_member585060
Active Contributor
0 Likes
362

Hi,

How are are including the standard text now? are you using Text type as "Include text" or getting the value by creating the Program lines?

You can easily do it by creating Program lines.

Text Node
     Program lines Node                   " Write the Logic to get the Long text
        Loop Node                              " As we get long text in FM READ_TEXT in TLINES table, loop that
           Text node                    " This node for printing Long text

Sample code

lv_tdname = WA_VBDPR-TDNAME.

 CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                            = lc_0001
        language                      = sy-langu
        name                          = lv_tdname
        object                        = lc_vbbp
      TABLES
        lines                         = lt_tline
EXCEPTIONS
       OTHERS                        = 8
    IF sy-subrc <> 0.

    ENDIF.

IF lt_tline[] IS INITIAL.

CLEAR : lv_tdname.

lv_tdname = WA_VBDPR-TDNAME1.                 " Other document

 CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                            = lc_0001
        language                      = sy-langu
        name                          = lv_tdname
        object                        = lc_vbbp
      TABLES
        lines                         = lt_tline
     EXCEPTIONS
       OTHERS                        = 8
              .
    IF sy-subrc <> 0.

    ENDIF.

ENDIF.

Regards

Bala Krishna