Application Development and Automation 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: 
Read only

Smartforms coding in the editor (Command Line; IF-condition)

rob_postema
Participant
0 Likes
3,615

I've got a Smartform with only 1 window MAIN.

Based on a flag in the incoming structure, i need to print some data.

Incoming structure = ZHRU_RV_BEERSHIP and the flagfield = ZHRU_RV_BEERSHIP-FLAG.

I use the SAPscript type of editor where I can choose /: for command.

However the IF condition is simply being ignored and the data is always being printed.

See example below.

Does anyone know how to tackle this issue?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,834

Hi Rob,

You have to use Alternative Condition,In conditions tab

ZHRU_RV_BEERSHIP-FLAG = 'ST_SALE_1'.

7 REPLIES 7
Read only

Former Member
0 Likes
2,834

Hi,

Try to create global variable and put your code to program node. After getting data into variables, use text node to display them.

Regards,

Read only

Former Member
0 Likes
2,835

Hi Rob,

You have to use Alternative Condition,In conditions tab

ZHRU_RV_BEERSHIP-FLAG = 'ST_SALE_1'.

Read only

0 Likes
2,834

Hi,

Thx, but the problem is that the the Smartform is one big window, and does not have separate windows/textboxes in it.

All data is printed top-down.

I created Global Variable(s): WA_NAME1 & WA_NAME2 etc.

Right before the main I inserted the condition like:

When the condition = TRUE, I wite the content of my structure-field (  zhru_rv_beership-st_name1)

to the Global Variable WA_NAME1.

And in the MAIN-window I address this field: WA_NAME1.

But, nothing happens!, the field is not displayed!

What do i do wrong!

Read only

0 Likes
2,834

Where did you write the code for fetching the data into the structure?

Read only

0 Likes
2,834

I'm fetching the data into the structure in the calling program.

What I did right now is

- In the Global Definitions, I created some varaiables.

- In the initialisaztion I fill those variables based on some conditions

- In the main i write those variables.

Downside is that you have a lot of coding inthe Smatrform (don't like it to be honest)

And, when the variable is initial/empty, the Form is reserving an empty line for it.

I don't want a blank line, I want all my text to fit together.

So if field is empty, don't show blank line.

Everyone thx for the help so far, if someone has got an anser to the last question (issue with the blank line when field is initial) than i would be very happy.

Read only

0 Likes
2,834

You have to take Text element instead of program lines and place the variable in text element.In conditions tab of text element check your condition.

If you do like this this'll not print empty line, But you've to use this text element only to this line( for this variable).

Read only

0 Likes
2,834

Thx, !

everything solved, case closed.

Customer happy.