IF CONDITION IN SMARTFORM.

Hello all,
Just facing a small problem in smart form.
The code goes as follows ::
PLANT: &GRLABEL-WERKS&
/* Codes works fine. Displayed correctly.
/: IF &GRLABEL-WERKS& = '01'
Inside IF
/: ELSE
Outside IF
/: Endif
The problem is in if condition. Its going in else part even if first condition is satisfied.
Is ht ere any problem in hte code or anything?? I am not getting a way out.
Please help me.

/:PROTECT
WBS ELEMENT: &W_GRLABEL-PS_PSP_PNR&
PLANT: &W_GRLABEL-WERKS& //
/: IF &W_GRLABEL-WERKS& = '6001'
INSIDE IF
/: ELSE
OUTSIDE IF
/: ENDIF
/: ENDPROTECT
THE Code goes as above.
All the values are populated properly and are checked.
The values are passed from the ABAP Code to smartform using a  structure.
All is fine but the IF is not working.
It should either execute "If or else" but in my case its executing both.
If one condition is satisfied, it should not go in the else part but its going.

Similar Messages

  • If Condition in Smartform - window text- without program lines

    Hi,
       I have faced one problem in smartforms. In smartforms i have a window (main.) It has five lines. For Fifth line only i need to check one condition. if it is true then print the Line otherwise i need one Blank line to print.
    How i write if condition in smartforms window - text. 
    Mahesh.

    Hi Mahesh,
    You need to create and alternative node and put your text into that.  An alternative will check a condition, and process one of two nodes depending if it is true or false.  Based on your condition, on true you can have your current text element and on false a text element containing a blank line.
    Regards,
    Nick

  • ERROR IN OUTPUT WITH  CONDITIONS IN SMARTFORM

    I have   two conditions in smartform.
    if i_final-konrth NE g_temp9.
       i_final-ssign eq g_temp10.
    then we need to print text1 in the output. There are no program lines in the  text.
    g_temp9 and g_temp10 are passed from the program. text1 is not getting outputted. Could anybody help in this issue ?

    hI,
        i have written break username in program lines but the cursor is not stopping. please tell me why

  • Using if condition in smartforms

    Hi,
    I have a requirement like the following in smartforms
    if condition satisfy display one set of text or else some other text.(or don't display)
    how we can write code in smartforms (not in driver program).If any body knows tell me.
    Thanks
    Regards,
    Nandha

    Right click on the window you want to implement the code
    Choose Create-> Flow Logic -> Alternative
    In the true part -> Right Click (Choose)
        Create the Text Elements to be displayed
    To implement the code block choose
    ((( Create -> Flow Logic -> Programs Lines (write your ABAP Code here) ))
    Message was edited by: Kanthimathi Krishnan

  • Issue with if condition in smartform text elements

    Hi all.
    iam having a problem in smart forms
    itab has 3 fields
    id   matnr    werks
    1 a p1
    1 b p2
    1 c p3
    2 b l1
    2 c l2
    3 q u1
    3 l u2
    i neead output like in the smart form
    -id = 1-
    a p1
    b p2
    c p3
    -id = 2-
    b l1
    c l2
    -id = 3-
    q u1
    l u2
    I have aloop in main window
    itab into wa_itab.
    then i have program lines
    iam writing any perform statment insted iam write the code in here
    input paramters wa_itab-id
    output paramters id
    i declared id type zabc-id under global data in global definations
    CLEAR : ID.
    ON CHANGE OF WA_itab-ID.
    *BREAK point.
    ID = WA_ITab-iD.
    ENDON.
    after the program lines i have a text
    /: if &id& ne ' '.
    ---id = &id& ---
    /: endif
    &wa_itab-matnr&  &wa_itab-werks&
    now i see the output
    -id = 1-
    a p1
    -id=-  i don't need this (&id& has no value)
    b p2
    -id=-  i don't need this
    c p3
    -id = 2-
    b l1
    -id=-  i don't need this
    c l2
    -id = 3-
    q u1
    -id=-  i don't need this
    l u2
    I checked my code if two items have same id the id has no value and you can see the output also
    but for some reason its still goinng into the if condition
    And also is there away that i can debugg my text elements like in scripts. my break point doesn't take me to the text elements
    Thanks

    1. Move only the ID into one internal table say i_id,
    2. Now in your smartform,  create a table and loop at i_id into wa_id.
    3.Print your ID in a text, &wa_id-id&
    3. Now in main area  of the table Create a loop with the internal table you mentioned above with 3 elements, say, i_data into wa_data  give CONDITION as wa_data-id = wa_id-id.
    4. Print your other values &wa_data-matnr& &wa_data-werks&
    5. outside main area, clear the work areas.
    This should work fine as i use the same logic in one of my current developments!!!

  • Pricing Condition in SMARTFORMS

    Hi All,
    I am working on smartforms.I have given select query for codition records like following.
    SELECT SINGLE  KBETR FROM  KONV   INTO TOTAL WHERE KNUMV = VBDKA-KNUMV AND KPOSN = VBDPA-POSNR AND KSCHL = 'PR00'.
    Its displaying error that VBDKA is not maintained in DICTIONARY.
    I need to check condition from VBDKA(not a header table).
    How to get condition from the table VBDKA AND VBDPA?
    I want to do it smartform only.
    Thanks,
    Murthy

    if you do the select in the smartform then you should also add the tables
    tables: VBDKA
    in the header coding
    kind regards
    arthur

  • How to Handle Blank Field Value based Condition in SmartForms

    Dear Sir,
    In SMARTFORM , we need to define a Condition that incase Field Value is not equal to  BLANK value (blank means that field is empty) then a specific text gets printed .
    Our problem is that  We do not know as how to define  Empty Field Value  based condition .
    Had it been Non Empty Field value based condition then solution was simple and could be done in following way :
    Field Value                        R                     Comparision Value
    WA_KZDKZ                      =                      'X'
    In our case , we need to give Blank (Empty Value) instead of 'X' .
    Kindly help us pl .
    Rgds
    B Mittal

    Hi,
    To handle blank field values in SMARTFORMS,
    Go to the conditions tab in your SMARTFORM and give condition there
    Field                Comparision operator          value
    <Field name>      <> Here symbol is diff     space.
    eg:
    wa_mara-matnr    =/                                   space.
    Regards,
    Santosh Kumar M.

  • How can i give conditions in smartform text editor

    Hi all,
    i want to display something based on some condition using text element in smartforms , how can i do it.
    in SAP Scripts normally we give conditions in text element using command line(/:)
    but it wont work in smartforms , how can i give the same in smartforms ?
    please help me soon.
    thank you.

    Hi,
    You can use the Conditions tab for the corresponding text.
    ex: in the text-editor consider you are displaying a name field based on a variable
    <b>
    ws_name
    ws_variable</b>
    In the text give the field to be displayed
    &ws_name&
    In the conditions tab give
    ws_variable = 'X'
    This will print the value from ws_name only when ws_Variable = 'X'.
    Regards,
    Tushar

  • Conditional Printing :SMARTFORM

    Hello All,
    I am new to Smartforms and I am working on reservation pick list. I need to propose available bins based on qty for each line item. So if there are 2 bins for line item 0001, I should display line no, material no, Qty in only on first line.
    Should be like this:
    Line Material Qty Bins
    0001 123456 2 ABC
    blank blank blank XYZ
    Can somebody tell me where do I put the condition?
    Thanks,
    Chandni

    Please find a very good code sample explaining such condition checks and program lines etc,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    Regards
    Kathirvel

  • Remove Blank Page conditionally in Smartforms

    Hi  Experts this is Arun,
    I have Requirement in such a way that, Form should contain three different pages which display three different records using three different internal tables.My problem is I have to avoid second and third page if it does not contain any records in it.How can i conditionally skip those two pages.1st page always contain records in it.Thanks in advance.

    Hi,
    Please follow the below steps.
    1. in your 2nd page, After your first node (any window, text etc...). Create-> Flow Logic -> Program lines.
    In that program lines, Write code as below (First create a variable in Global seettings-> w_flag type flag).
    if i_tab[] is initial.
    w_flag = 'X'.
    endif.
    2. On same node create->Flow logic-> command. In Command node, First, Check the box for "GOto New Page".  Give your next page that is your 3rd page. And in Condition tab put following:
    Field name -> w_flag ,,,, Rlation operator -> = ,,,, Com value 'X'.
    It will directly take you to your 3rd page if i_tab is initial. Do the same for 3rd page..
    Must be solving your problem
    Regards,
    lokesh.
    Edited by: Lokesh Tarey on Apr 20, 2010 7:43 AM

  • 'AND' Conditional operator in smartform

    Hi experts,
    I have  to use AND condition in smartform (text).
    For OR condition there is a standard icon sothat can use.
    But how can we get AND contion in smartform.
    if I am giving AND condition it is showing error
    I have tries in SDN before posting my problem but i couldn't get solution for that
    Please help me out of this problem.

    Hi Saravanan,
    You dont need to give AND condtion. Just give two conditions in the conditions tab. it will work
    Regards
    Shanly

  • If condition in forms

    Hi,
    Can anyone post how to implement if condition in smartforms text module so that based on it we have to call a subroutine by means of perform statement and we have to print the value of changing parameter in the text module of smartform.
    can anyone post the solution for the above requirement so that I'll award max points to them.

    HI,
    IF condition EQ 'XYZ.
    perform <subroutinename> in program <pgm name>
    using <var>
    changing<var>
    endperform.
    else.
    perform <subroutinename1> in program <pgm name>
    using <var1>
    changing<var1>
    endperform.
    endif.
    In the program
    FORM <subroutinename1> TABLES  INPUT STRUCTURE ITCSY
                                   OUTPUT STRUCTURE ITCSY.
    After doing the manipulations pass these values to OUTPUT
    and then in the form print those changing or using parameters.
    ENDFORM.
    Regards,
    Venkatesh

  • Smartforms doubts

    1.HOW TO USE IF CONDITIONS IN SMARTFORMS?
    2.HOW TO DRAW BOXES IN SMARTFORMS
    I TRIED TO DRAW BOX WITH FOLLOWING
    POSITION  XORIGIN 5 CH YORIGIN 12 LN
    SIZE WIDTH 15 CH HEIGHT 2 LN
    BOX FRAME 10 TW INTENSITY 10
    DONT KNOW WHY ITS NOT WORKING
    3.How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?I CAME TO KNOW THAT I SHOULD GIVE OUTPUT_OPTIONS AS PRINTER NAME IN SSF_OPEN,BUT DONT KNOW HOW TO DO THIS.TRIED GIVING BOTH SSF_OPEN,SSF_FUNCTION_MODULE_NAME,BUT NOT WORKING.
    THANKS A LOT

    hi gopi,
    1.For boxes in sf-Create a window node in the navigation tree of the Form Builder.
    If you create the window in the Form Painter using the context menu, you can use the mouse to position it immediately.
    Enter a unique name for the node and a description (for example, booked flights).
    On the General Attributes tab select a window type. The window types Copies Window and Final Window are secondary windows with additional attributes. See also: Processing Windows

  • Single spool for different smartforms

    Hi
    Abapers ,
    I need to print different layouts in single spool.
    How can I do it.
    Thanks in advance,
    Vani

    Thank you very much  Mrutyun and Murugesh.
    I have used SSF_OPEN and SSF_CLOSE function modules.
    If the same smart form is called n times it outputting fine but depending upon the condition , corresponding smartforms should be called. In such case a case 'formatting_error' is the exception when calling the function module name.
    Please suggest what might be wrong.
    once again Thanks.

  • Alternative Option in Smartform

    HI,
    what is the use of ALTERNATIVE Option in Smartform?
    Regards
    Sandeep

    Hi,
    Alternatives are True and False conditions in smartforms.
    Right click at the window option, then goto flowlogic and then create an alternative by selecting the Alternative option.
    Under Pages and Windows, windows(right-click)->flowlogic->alternative.
    Once you click on alternative you will find a true and false button is being created.
    In the general attributes tab, you can define the conditions as per your requirement.

Maybe you are looking for

  • E3000 Won't load any site.

    I forgot my E3000 router password so I restarted to factory settings. I tried to set up using the software that I downloaded for the site and It didn't work, It gave me some errors that I was able to fix later running the software from a windows XP s

  • While loop in subVI

    Hello I have a doubt about using while loops in VI and subVI. I have a VI, with two loop that are executed in parallel, and stoped with the same button, by using property nodes and references. One of the while loop executes a subVI. If the Block Diag

  • Web Tier in front of Oracle apps r12

    Dear Gurus, I hope you inform me is there any installation documents or mechanism to configure http server to redirect url to oracle apps login page or only http server is related to weblogic only? I searched for how to use web tier in front of oracl

  • 2 node cluster windows 2008 R2 cluster won't form

    Hi, I'm trying to build a 2 node cluster and having no luck at all.   My validation works great but when I go to create the cluster it fails on the forming cluster section after about 2 minutes.   I seem to have everything in order and can't figure o

  • Translation for search help

    Hi, does anyone know how to provide translation for a search help? thanks Regards Nitin