cancel
Showing results for 
Search instead for 
Did you mean: 

form (pretext , posttext)

Former Member
0 Kudos

hi ,

Am working with form.

am displaying the values from my text elements.

So wats my requirement is

am doing like this.

NAME : &name1&

so when there is no value for &name1&

its displaying the String 'NAME' : <blank>

but i want to display it when it contains the value &name1&

eg : NAME : martin

give me the syntax.

Thanks & regards,

Rajesh .k

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In SAPScripts there's two methods

/: IF &name1& NE &SPACE&

AS NAME: &name1&

/: ENDIF

Or

AS &'NAME: 'name1&

When using quotes inside the && the text only prints where there is a value.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

if im right u r using SMARTFORMS .... goto the CONDITION tab of text element put the following ,,,,,

Field Name Relational Operator Comparision Value

name1 Not Equal to Initial

if u r using script

u can write

if &name& is not initial.

name : &name&.

endif.

hope this helps ...

Former Member
0 Kudos

hi,

In your form u code like this.

if &name1& is not initial.

/E NAME : &name1&.

ENDIF.

Then u will get name only when it has value.

regards,

sreelakshmi

Former Member
0 Kudos

Hi Rajesh,

Let us take a simple example.

You are printing vendor name as follows.

Vendor Name: &lfa1-lifnr&

print this as

if &lfa1-lifnr& is not initial.

Vendor Name: &lfa1-lifnr&

endif.

thanks & regards

Kishore M

Former Member
0 Kudos

hi check this.

if &name1& <> ' '.

Name : &name1&

endif.