cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ALTERNATIVE function in smartform.

Former Member
0 Kudos

hi,

in my smartform..one of teh reqirements is i need to fetch the knb1-zterm field to the form. but if teh field value equals to 'cam3' it should be printed as '30 days' in the output form. pls help me where should i give the condition here..can i use teh 'alterantive' option the form...if sopls tell me the procedure to do so...thnx in advance...

santosh.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

No need for an alternative condition node.

Create 2 text items:

On one of them you output: &knb1-zterm& and in conditons tab of that text set knb1-zterm <> 'cam3'

On the other text item you ouput '30 days' and in conditions tab of that text set

knb1-zterm = 'cam3'

Former Member
0 Kudos

hi alex, thanx for ur answer. but i have a small doubt. you are saying to create text nodes right. but the content of the two text nodes should be printed on the same place. then, how can we acheive this one.

Former Member
0 Kudos

Hi,

Actually the text node is a variable that can have 2 values. The possibility of value depend upon the if condition

Regards,

Navin

Former Member
0 Kudos

If the text node doesn't print the next one will take its place if you put both of them under the same column node.

column1

text1

text2

column2

text3

text4

Former Member
0 Kudos

hi sathish, u can achive this as follows.

1. in global difinations>global data declare 2 varialbles 1 is for knb1-zterm,,,(v_xxx), and another is for text valeu--''cam3'.... (v_yyy) .

2.then in the INITIALIZATIONS tab> INPUT and output PARAMETERS>give the field names declared in setep1.

3. in the initalizations..

select zterm from knb1 into v_xxxx where xxxxx.

if v_xxxx = 'CAM3'.

v_yyy = ''30 days' .

endif.

.

4. intet a text node in u any window (where u want to print the valeu) the print this v_yyy.

<b>one more thing T052 and T052U table u will get all the Paymnent terms and the TExt to the Payment term</b>

<b>in anothter way...</b>

same as above... but here dinamically u can select the text from database table..wht ever the value in knb1-zterm... u cane get the text from T052

select TEXT1
 from T052U
 into v_yyy
 where spars = sy-langu and
          zterm = knb1-zterm

.

let me know if u have any issues

Former Member
0 Kudos

declare variable in global definition.

in page and window tree

suppose you have created text node to display the data, before this

right click mouse button and ->select create-> program lines.

here you can write abap code.

check the condition.

if zterm = 'cam3',

MOVE '30' TO variable.

endif.

and display this variable.