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: 

Variables in SMARTFORMS

Former Member
0 Kudos
1,802

Hi all,

In our Smart forms we have fixed text of 10-12 lines , within which we have 1-2 variable data (dynamic).

Now for this in the smartform,we were thinking to use Standard text SO10 .

Another query is that if we define std texts in SO10 for different cases,we need to call these within the same smartform i.e. something like CASE structure in the SMARTFORM...Whats the best way to achive the above?

BR,

Disha.

6 REPLIES 6

Former Member
0 Kudos
202

Hi,

Anybody any suggestions?

BR,

Disha.

Former Member
0 Kudos
202

TO what I understood.

U can handle this dynmic process in the program or routines program and pass the value to varible and then use this varible is the smart form.

Hope this helps.

Regards

Former Member
0 Kudos
202

Hi Disha,

May be you can use some code like this:

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'ST'

language = sy-langu

name = <Standard text name>

object = 'TEXT'

TABLES

lines = it_lines

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.

LOOP AT it_lines INTO wa_lines.

IF wa_lines-tdline CS '<fdate>'.

REPLACE ALL OCCURRENCES OF '<fdate>' IN wa_lines-tdline WITH lv_create.

ENDIF.

IF sy-tabix = 1.

ls_bodypart-content_ascii = wa_lines-tdline.

ELSE.

IF wa_lines-tdformat NE '='.

CONCATENATE ls_bodypart-content_ascii cl_abap_char_utilities=>newline

wa_lines-tdline INTO ls_bodypart-content_ascii.

ELSE.

CONCATENATE ls_bodypart-content_ascii

wa_lines-tdline INTO ls_bodypart-content_ascii.

ENDIF.

ENDIF.

ENDLOOP.

Note: <fdata> is the dynamic variable declared in standard text(SO10).

BR,

Swagatika

Former Member
0 Kudos
202

Hi Disha,

As i understood you need to print variable text ie text to be printed is not known to you. So you cannot hardcode it. This is very common

1. . <b>]First make it sure if it is header text / item text</b>.

a.For header text . store the document no in a variable (say.. text_name)

b. for item text concatenate the doc no & item no & store it in the variable.

2. <b>get the text id for that text</b>.

3.<b>get the object name for that text</b>.

4. <b>language(usually EN)</b>

<u><i><b>then in smartform :</b></i></u>

change the text type to <b>INCLUDE TEXT</b>.

enter the relevant fields you already have stored.

check the box --> no error if no text exist.

activate the form.

I think this will solve your problem.

waiting for rewards....

regards,

Dibyendu.

Former Member
0 Kudos
202

Hi Disha,

As i understood you need to print variable text ie text to be printed is not known to you. So you cannot hardcode it. This is very common

1. . <b>]First make it sure if it is header text / item text</b>.

a.For header text . store the document no in a variable (say.. text_name)

b. for item text concatenate the doc no & item no & store it in the variable in the driver program.

2. <b>get the text id for that text(say: ztest)</b>.

3.<b> get the object name for that text(say: VBBK)</b>.

4. <b>language(usually EN)</b>

<u><i><b>then in smartform :</b></i></u>

change the text type to <b>INCLUDE TEXT</b>.

enter the relevant fields you already have stored:

1. in text name field enter in this format: &text_name&

2. text id --> ZTEST.

likewise.....

check the box --> no error if no text exist.

activate the form.

I think this will solve your problem.

waiting for rewards....

regards,

Dibyendu.

Former Member
0 Kudos
202

Self-answered!