on 09-28-2012 1:33 PM
Hello SAP Mentors,
I am Ranjani and I am new to SAP, beginner level. I have a doubt regarding Smartforms. How do I give conditions like IF ELSE, INCLUDE etc which are used in SAPscripts? I want to convert the conditions given in SAPscripts to Smartform style. How should I go about this? Kindly help.
Thanks and Regards,
Ranjani.
Hi Ranjani...
IF you have a existing Script, using Conversion utility you can convert that Script directly into a smartform and check the behavior of your conditions how they are getting converted in the smartform.. :-). In the Tcode Smartforms, navigate to Menu Utilities -> Migration -> Import Script forms.. this will help you in migration.
For if ... endif conditions, for text or any other node in the smartform, you have a tab called "Conditions". Here you can specify the needed conditions
Your include statements can be directly included using the Text Node. In the TExt node, you will find a option Text type = Include TExt in General Tab. This will directly include your text.
Hope this helps you !!
- HArshad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You will have to follow a step by step procedure
First of all you need to make a list of all the conditions in SAP Script and what actions need to be performed with those conditions.
Once this is done you can start building the Smartform and declare the wondows and text elements.
You can include the conditions at text elements level in the condition tab and do the desired action.
You can also create a code line element in smartform and write a piece of code or logic based on your need at suitable place i.e before some table or some text element.
Hope this helps.
Regards,
Sandeep katoch
Hi Harshad,
Thank you for your response. I have already browsed through these options. But I want to know regarding other conditions such as
DEFINE, ADDRESS ... ENDADDRESS, PROTECT ... ENDPROTECT, NEW-PAGE, CASE .... ENDCASE, PERFORM ... USING
How should I give such conditions in Smartforms?
Regards,
Ranjani.
Hi Sandeep,
Thank you for your reply. Can we declare any type of condition in the conditions tab? Or can we give that condition in the code line element part where we give custom logic? which one is better?
Say, there is a condition like "&'Delivery to 'PEKKO-ABLAD&" in SAPscript. How should I declare this in Smartform? Can I directly give it in text editor?
Regards,
Ranjani.
Hi,
You can choose anyone based on the requirement.
Say if you have a condition like xyz not equal to x and abc not equal to Y or abc Not equal to Z.
These type of condition you can directly oput in the text element.
If you have some calculations then you can refer to the code writing element.
The condition which you have mentioned is not exactly a condition
Here whatever be the value in PEKKO-ABLAb wil be written in delivery to.
in this case you can directly write in text element deliver to &PEEKO-ABLAD&.
Hope this helps.
Regards
Sandeep Katoch
Hi
Define does nothing but declare a variable in SAP script which you can use.
You can declare this in your smartform global definition tab
Address End Address is nothing but the address window ehich again you can create in your samrtform without this statement
Protect Endprotect does nothing but prevent page breaks while you are migrating from one window to another. Using this statement a new window will not appear in the new page but will continue on the same page.
Case Endcase : you can use in the code wizard of samrtform by using flow logic.
Perform : you can again use the calculation either in driver program or in form itself in code wizard.
Hope this helps
Regards,
Sandeep Katoch
Hi,
Thanks. I have a question.
Is there any optimal method of declaring the fields used in the SAPscript in Smartforms? Like for using the field LFDAT of structure RM06P in the directly in the text editor, its throwing an error saying the field is unknown. When I declare the same variable as VAR1 TYPE RM06P-LFDAT in global definitions, it’s fine. Do I have to declare these fields in the similar fashion? Or is there any other method of declaring these fields?
What do I do when there are a number of fields?
Hi,
You have two options
1: Declare the whole structure in global interface and use the fields which are necessary but it will increase program overhead so its better we go with option 2
2: Declare each field separately but if there are many fields that are being used of same table or structure you can decalre entire table.
3: You can also declare like ABAP in the types section of global interface which will work as same as it works in ABAP.
Similarily you can again write code in initialization part in global interface.
Regards,
Sandeep Katoch
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.