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: 

SMARTFORMS field displaying string literal instead of a variable's value

bmierzwi
Participant
0 Kudos

Hello,

I have a trouble with SMARTFORMS. I need to add a new column to display the Customs Number on an export invoice.
I have recently upgraded my SAP version from 7.30 to 7.60 and the default editor of text fields didn't work. When I tried to reference a variable which value should be displayed in a particular field - it was blank. All the fields that were already added and working correctly (all fine on the invoice document itself) just didn't display anything. See below:

I found the information that this is because the default editor doesn't work above SAP 7.40 version and I need to change the editor used by SMARTFORMS to MS Word (SE38 -> RSCPSETEDITOR -> F8 -> Mark both checkboxes -> Activate).

Indeed - that made the variables referenced in every field visible

The problem is - my CUSTOM_WEREHOUSE_NUMBER_I which I am adding does not work correctly. Instead of displaying the variable I am referencing, like all other fields do correctly, it displays what I added in the editor as a string ltieral:
1. The variable is added as one of the globals, just like &l_kraj_poch& which is fine:

2. It is referenced correctly in the editor for the field (in the same manner as &l_kraj_poch&):

3. But the result is a string literal instead of an actual value from the code

Any ideas what I am doing wrong? Thanks in advance.

Kind Regards,

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

You have two solutions to enter a variable name. As you saw, you must not type &L_STAWN& directly in the text, it will consider this as plain text, not as variable.

Instead, you must use one of the two buttons:

> displays a dialog where you can type &L_STAWN& and it will then be considered as a variable.

> displays a dialog where the raw text is displayed, here you can type &L_STAWN& and it will be considered as a variable.

6 REPLIES 6

zeshanshafqat79
Active Participant

Please consult with your sap basis consultant. your sap GUI has some missing patch of smartform editor.

Deputy Manager (SAP BI/BW and SAP Analytics Cloud)

Sandra_Rossi
Active Contributor

No need to tell us the solution for the first part of your question (that is not a question in fact). It has been already asked and answered many times in the forum. It also mistakes few people who answer, as you can see.

Sandra_Rossi
Active Contributor

You have two solutions to enter a variable name. As you saw, you must not type &L_STAWN& directly in the text, it will consider this as plain text, not as variable.

Instead, you must use one of the two buttons:

> displays a dialog where you can type &L_STAWN& and it will then be considered as a variable.

> displays a dialog where the raw text is displayed, here you can type &L_STAWN& and it will be considered as a variable.

Thank you, this solution resolved my problem. 🙂 I added the variable with the button with a green plus and it's displayed properly. You save my life once again.

SugguSandeep
Active Participant

Hi bmierzwi,

I hope you are doing well 🙂

_________________________

Firstly i advise to clear with the concept check out this document & get revise it it will be very helpful

Document Link : Smartforms Concept & Practical

Once check out this question which is similar to you

SAP Community Question for this Question i had given answer check it out : Answer

_________________________

I hope you will find the Solution,

Reward It, If it helps you 🙂

Thanks,

Suggu Sandeep.

bmierzwi
Participant
0 Kudos

Thank you for the tips. I added the first section thinking that to explain what my problem is, I should explain why I might be in this place to begin with.