cancel
Showing results for 
Search instead for 
Did you mean: 

Page Numbering and If stmts in SmartForms?

Former Member
0 Kudos

I am new to SmartForms. I am passing tabel data successfully to the SmartForm. However, where do I write logic for:

1) Page numbering....anybody have a simple method with syntax, and where to put it in the SmartForm?

2) How do I write an IF stmt. ie. If v_fielda is initial move 'X' to v_fielda?

Thank-You

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

Page Numbering:

Add a Text Node to your window and write

Page &SFSY-PAGE& of &SFSY-FORMPAGES(4ZC)&

Condition or any other logic:

You can't write the IF condition any more in the Text node in Smartform. You have to write your conditions or logic in the Program Lines.

In the Context menu of any node:

Create > Flow Logic > Program Lines.

Check this link for help on Program Lines and everything for Smartforms:

http://help.sap.com/SAPHELP_NW04S/helpdata/EN/a3/80bae8dfd911d3b576006094192fe3/frameset.htm

Regards,

Naimesh Patel

Edited by: Naimesh Patel on Jan 2, 2009 9:57 AM - Help link added

Former Member
0 Kudos

Hello Naimesh,

No. 1 issue: Resolved...Thank-You.

No. 2 issue: I am still not quite sure how to do this. I have a loop with text as a sub-node. The text node looks something like this:

*******************************************

Charges:&GS_AFPO-CHARG&

*******************************************

I want to say if :&GS_AFPO-CHARG& is initial then use :&GS_AFPO-ZCHARG_INIT&

We are on 46C. So I did create=>program lines (did not see flow logic) as a sub-node to the Text node under my loop.I see input and output parameters on this page, but I am still not sure how to do this? Any quick suggestion you can give me?

Thanks.

naimesh_patel
Active Contributor
0 Kudos

Take one temporary variable say W_CHARG. Declare under the Global Variables

Now, in the input enter

GS_AFPO-CHARG

GS_AFPO-ZCHARG_INIT

in Output enter

W_CHARG

Write your logic like:

IF GS_AFPO-CHARG is initial

W_CHARG = GS_AFPO-ZCHARG_INIT.

ELSE

W_CARGE = GS_AFPO-CHARG

ENDIF.

Now, print W_CHARGE to your text node.

Regards,

Naimesh Patel

Former Member
0 Kudos

Got it Naimesh...Thanks!

In conclusion then, I assume there is no text editor that can be used with line commands in SmartForms?

naimesh_patel
Active Contributor
0 Kudos

Text editor is same but it is removing all statments with command line (/:) at runtime. So, we can't write any logic in that text editor.

Regards,

Naimesh Patel

Answers (0)