cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Form - text element not being printed

Former Member
0 Kudos

Hi,

I am trying to add a text element to a form by using se71 and got to text elements -> "Change Editor".

From the program I call "WRITE_FORM" function to display the value. I can see that data is extracted but not getting printed on the form.

I am not sure what is wrong as I am new to SAP Form.

What is needed to be done to add a new text element in the form ?

Could someone please help me out with this ?

Thanks very much.

Manish.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Manish,

You need to mention the text element in the write_form

and for each text element you need separate write_form.

This is a preety easy thing .If you are getting stuck at some point please eleborate.

Regards

Vivek

Former Member
0 Kudos

Hi,

I have added following lines using se71 -> text elements -> "change editor"

/E L_LONG_TEXT

&G_LONG_TEXT&

and in the program, I have got following code:

LOOP AT lit_text INTO lgf_text.

IF l_count > 1.

EXIT.

ENDIF.

CLEAR g_long_text.

g_long_text = lgf_text-tdline.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'MAIN'

element = 'L_LONG_TEXT'

EXCEPTIONS

window = 1

element = 2.

IF sy-subrc = 1.

window = 'MAIN'.

PERFORM message_window.

ENDIF.

IF sy-subrc = 2.

window = 'MAIN'.

ereignis = 'L_LONG_TEXT'.

PERFORM message_element.

ENDIF.

l_count = l_count + 1.

CLEAR lgf_text.

CLEAR g_long_text.

ENDLOOP.

in debug mode I can see that the value is being populated in the variable g_long_text but not getting printed in the form.

Please let me know if you need more information.

Thank you

Manish.

Former Member
0 Kudos

Hi,

Just after clear g_long_text , Insert:

CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'

EXPORTING

name = 'G_LONG_TEXT'

value = g_long_text.

*

Just before CALL FUNCTION WRITE_FORM

CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'

EXPORTING

name = 'G_LONG_TEXT'

value = g_long_text.

I hope this helps,

Regards

Raju Chitale

Former Member
0 Kudos

Hi,

I am able to view the value in "Graphical display of spool request" but when I click on the print button values are not displayed in the form. I am not sure what is wrong as I am new to SAP scripts.

Any help is much appreciated.

Former Member
0 Kudos

hi sir,

what the purpose of this 'TEXT_SYMBOL_SETVALUE' fun module and at whar time we have to use. in some prog's it is using and in some prgs not using.

plz help when to use this function module.

Answers (2)

Answers (2)

Former Member
0 Kudos

new field/value is appearing in the spool file.A separate program reads the spool file and formats it accordingly and displays the form.This program would undergo changes to display the new field/value in the form.

Thanks you

Manish.

Former Member
0 Kudos

Hi!

You can add text elements to your SAPScript with the following command:

/: INCLUDE 'MYTEXTELEMENT' OBJECT 'TEXT' ID 'ST' LANGUAGE 'EN'

Be sure it exists on the same mandant on the same language in SO10.

Regards

Tamá