How to set checkboxes in Smartforms?

Hello Experts,
I have a created a form using smartforms.
In that form there are 3 check box and any one of the chk box has to be checked based on the user selection in the selection screen.(Other two chk box has to be unchecked)
I wrote the condition (if else)  in the text element itself but it is not comming .....
Please help me in this...
Thanks
Krushna
Edited by: Julius Bussche on Dec 13, 2008 12:33 PM

Moderators are the only persons entitled to respond to ur-gent & emergency situation. I notified them wait for the action.
Meanwhile
Read the [Rule of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement].
Regards
Karthik D

Similar Messages

  • How to create CheckBox in Smartform

    Hi All,
    Any body please tell me how to create and display checkbox in Smartforms.
    Thanks,
    Neethu.

    Hi Neethu,
    Check this link:
    Check boxes in smartform
    Even you might have easily got this if you do a simple searcch:
    http://forumsa.sdn.sap.com/search.jspa?threadID=&q=checkboxsmartform&objID=f231&dateRange=thisyear&numResults=15&rankBy=10001
    Regards,
    Swarna Munukoti.

  • How to set checkbox to fill max or min value in field

    Hi all,
    I am pretty new to the adobe acrobat and I just created my first pdf form. I would ask for a help:
    In this form I have 2 fields where in one is price with VAT and in other without VAT. I also have a check box and total price field in form.
    I would like to set this form in a way that if check box is checked price with VAT is copied in the total price field and if check box is unchecked the price without VAT would be copied in the total price field.
    My idea is to set the checkbox to copy max value to total price field if checked and min if unchecked. Is there a way to do that? Is there a better way to achieve that?
    Thanks for sour help, I appreciate it!
    Luka
    (I am not familiar with Java)

    You can set the min/max to int.MIN_VALUE/int.MAX_VALUE or
    Number.MIN_VALUE/Number.MAX_VALUE
    It isn't unbounded, but will hopefully meet your needs.

  • How to set checkbox and textbox readonly dynamically.

    Hi,
    I have a requirement where I need to set the checkbox and textbox readonly if the value of a particular column is 'Y'. Can you please help or point to the right help documents.
    Harshad

    Sumit,
    Here transient VO approch is not required.
    Harshad,
    Do the steps Sumit has mentioned, but for step1, you don't need the transient VO, what you need to do is, in your present VO query based on your VO attribute, you need to add one more attribute in the VO query itself, by adding a decode statement like
    Decode(attr,'Y',0,1)
    Just make this attribute of type Boolean in VO wizard. Basically
    0--> true
    1-->false
    when these values are mapped in java.So, here you are saved from creating a new transient VO and adding a row in it.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to Set Checkbox of ALV Grid Dark on Display Mode

        ABAP experts, I want to switch between display mode and edit mode for some columns of ALV Grid. So I set "LVC_S_FCAT-EDIT" "X" for the columns which need to switch mode, and use method "SET_READY_FOR_INPUT" to switch.
        Currently, the function of switch mode has been achieved. But icons of checkbox columns are light but not dark when display mode, although the columns can't be edited. (Please refer to the image below.) I want to make checkbox columns dark as other columns on display mode.
        I tried to use "CL_GUI_ALV_GRID=>MC_STYLE_ENABLED" and "CL_GUI_ALV_GRID=>MC_STYLE_DISABLED", but failed. I also studied sample program "BCALV_EDIT_05" which is related to checkbox in ALV Grid, and compared my program with this program. But I still have not found problems.
        Help me solve this problem, please.
        Part of my codes are as follows.
        Part 1:
    IF iv_is_create_group = abap_true OR iv_is_edit_group = abap_true.
           set_enable( iv_flag = 1 ).
           LOOP AT gt_acct_group_item ASSIGNING <lfs_acct_group_item>.
             CLEAR ls_celltab.
             IF <lfs_acct_group_item>-celltab IS INITIAL.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'CHECK_BOX'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'XPORE'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
             ELSE.
               LOOP AT <lfs_acct_group_item>-celltab ASSIGNING <lfs_celltab>.
                 <lfs_celltab>-style = cl_gui_alv_grid=>mc_style_enabled.
               ENDLOOP.
             ENDIF.
           ENDLOOP.
         ELSE.
           set_enable( iv_flag = 0 ).
           LOOP AT gt_acct_group_item ASSIGNING <lfs_acct_group_item>.
             IF <lfs_acct_group_item>-celltab IS INITIAL.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'CHECK_BOX'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'XPORE'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
             ELSE.
               LOOP AT <lfs_acct_group_item>-celltab ASSIGNING <lfs_celltab>.
                 <lfs_celltab>-style = cl_gui_alv_grid=>mc_style_disabled.
               ENDLOOP.
             ENDIF.
           ENDLOOP.
         ENDIF.
         CALL METHOD gr_grid->refresh_table_display
    *      EXPORTING
    *        is_stable      =
    *        i_soft_refresh =
           EXCEPTIONS
             finished       = 1
             OTHERS         = 2
         IF sy-subrc <> 0.
    *     Implement suitable error handling here
         ENDIF.
        Part 2:
    METHOD set_enable.
         gr_grid->set_ready_for_input(
             i_ready_for_input = iv_flag
    ENDMETHOD.

    Hi Liu,
        Please go through the below code.
    *& Report  YEDIT_DISPLAY
    REPORT  YEDIT_DISPLAY.
    TABLES : VBAK.
    TYPE-POOLS SLIS.
    TYPES : BEGIN OF TY_VBAK,
              VBELN TYPE VBAK-VBELN,
             END OF TY_VBAK,
             BEGIN OF TY_FINAL,
               BOX TYPE C,
               VBELN TYPE VBAK-VBELN,
             END OF TY_FINAL.
    DATA : IT_VBAK TYPE TABLE OF TY_VBAK,
            WA_VBAK TYPE TY_VBAK,
            IT_FINAL TYPE TABLE OF TY_FINAL,
            WA_FINAL TYPE TY_FINAL,
            IT_FCAT TYPE TABLE OF SLIS_FIELDCAT_ALV,
            WA_FCAT TYPE SLIS_FIELDCAT_ALV.
    START-OF-SELECTION.
       PERFORM FETCH_DATA.
       PERFORM FCAT_DATA.
       PERFORM DISPLAY.
    *&      Form  FETCH_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FETCH_DATA .
       SELECT VBELN INTO TABLE IT_VBAK FROM VBAK UP TO 10 ROWS.
       LOOP AT IT_VBAK INTO WA_VBAK.
         WA_FINAL-VBELN = WA_VBAK-VBELN.
         APPEND WA_FINAL TO IT_FINAL.
         CLEAR : WA_FINAL , WA_VBAK.
       ENDLOOP.
    ENDFORM.                    " FETCH_DATA
    *&      Form  FCAT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FCAT_DATA .
       WA_FCAT-COL_POS = 1.
       WA_FCAT-FIELDNAME = 'BOX'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'BOX'.
       wa_fcat-checkbox = 'X'.
       WA_FCAT-EDIT = 'X'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
       WA_FCAT-COL_POS = 2.
       WA_FCAT-FIELDNAME = 'VBELN'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'Sales Document'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
    ENDFORM.                    " FCAT_DATA
    *&      Form  DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY .
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = SY-REPID
    *   I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
          IT_FIELDCAT                       = IT_FCAT
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
         TABLES
           T_OUTTAB                          = IT_FINAL
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
       IF SY-SUBRC <> 0.
    * Implement suitable error handling here
       ENDIF.
    ENDFORM.                    " DISPLAY
    FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM
                             RTAB TYPE slis_selfield.
       CASE UCOMM.
         WHEN '&IC1'.
           MESSAGE 'SUCESSFUL' TYPE 'S'.
         WHEN '&DATA_SAVE'.
           PERFORM FIL_FCAT.
           PERFORM DISPLAY1.
         WHEN 'BACK'.
           LEAVE TO SCREEN 0.
         WHEN OTHERS.
           LEAVE TO SCREEN 0.
       ENDCASE.
    ENDFORM.
    *&      Form  FIL_FCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIL_FCAT .
    CLEAR IT_FCAT.
       WA_FCAT-COL_POS = 1.
       WA_FCAT-FIELDNAME = 'BOX'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'BOX'.
       wa_fcat-checkbox = 'X'.
    **  WA_FCAT-EDIT = 'X'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
       WA_FCAT-COL_POS = 2.
       WA_FCAT-FIELDNAME = 'VBELN'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'Sales Document'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
    ENDFORM.                    " FIL_FCAT
    *&      Form  DISPLAY1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY1 .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = SY-REPID
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
          IT_FIELDCAT                       = IT_FCAT
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
         TABLES
           T_OUTTAB                          = IT_FINAL
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
       IF SY-SUBRC <> 0.
    * Implement suitable error handling here
       ENDIF.
    ENDFORM.                    " DISPLAY1
    Here i written code under the SAVE button , if requires you create your own status and apply.
    Regards,
    Krishna

  • How to set checkbox unchecked when press F11

    There is a checkbox in my form, and its default is uncheck. However, where I press F11 to query, the checkbox is checked.I want it unchecked when I press F11. How can I do it? Thank you.
    Best Regards,
    Sheng

    At first I thought the order of the form controls might matter.  When I run this code:
    <cfdump var="#GetTickCount()#">
    <form action="TestCfgrid.cfm" method="post">
    <input name="x" type="text" />
    <input type="button" value="x" />
    <input type="submit" />
    </form>
    While I am in the text box, if I press the enter key the form submits.  I originally tried it with the submit and button inputs in the opposite order.
    Note that the enter button will not submit the form if you are in a select control (aka dropdown) or a textarea or if your focus is not on a form element.  That's the default behaviour.  If you want to override that, you'll have to write some javascript.

  • How to Set CheckBox values in Before Headr Process

    In my Before Header process I read a database table that contains a code field that I would like to use to have my checkbox values checked if the field contains one of the values.
    Example the database file my have "LWR"
    On the form the Check box is
    L - For Loading
    W - For Waiting
    R - Relase
    P - Posted
    J - Job
    .....etc
    So when I read the record for my above example I would like L, W, and R checked.
    What is the best method to do this?
    THanks.

    Are you storing the values with their ":" separators (like 'L:W:R')?  If so, the checkbox code does the transformation logic.  In which case, there is no need to code insertion of the : when populating the checkbox.  No need to remove them before saving the values.
    Howard

  • Printing Checkbox on Smartforms

    Hi All,
         I want to print "CheckBox" on my smartforms..
    I tried adding the command  "697" .. But it is not working.. It just prints it (697).. & not the checkbox.
    Also how do we add "Bullet points".
    rdgs
    Prasad

    Hi Prasad,
    I don't think it will show the check box in the print preview.
    Refer to the link below :
    How to create checkbox in smartforms??
    Try to take print out and check if you are able to get the check box or not.
    Let us know if it does not resolve your issue.
    REgards,
    KC

  • How to set border lines in table and also in template in the smartforms ?

    How to set border lines in table and also in template in the smartforms ?
    As I have to create table with following detals
    total row = 3
    row1 = 3 column
    row2 = 6 column
    row3 = 9 column
    for 2nd and 3rd row data to be fetched using coding.
    so can anybody explain me what should i use
    Table or Template ?
    and I want the border like excel format.
    Can anybody suggest me ?
    Thanks
    naresh

    if the data is multiple i.e. line items choose table.
    if the data is single i.e. fixed choose template.
    Create table
    >  Draw u r no lines
    > choose option select pattern
    > select display framed patterns
    Choose u r required one.
    out lined, or full lined. u can choose option.
    same procedure to be followed for template also.
    with regards,
    Kiran.G

  • How to output a checkbox in Smartform?

    Does anybody know how to output a boolean as a checkbox in Smartform. I looked at the online help but found nothing about this. Thanks.

    I found it out myself, in note 104272.
    Thanks anyway.

  • How to set default selected checkbox in af:tableSelectMany /

    Hi,
    I am new to ADF technology, I am using JDev 10..3g.
    I want to set the checkbox as default selected for particular rows.
    but I don't know how to set default selected checkbox in <af:tableSelectMany />
    Is there any way to do this using ADF<af:tableSelectMany />
    Thanks,
    Mohammed

    Hi Jeroen,
    Thanks for reply. but the problem is that I am getting data from database and based on some flag I need to select checkbox while page is loading first time.
    at that time the table is null as till now it not rendered. and when its rendered it means page is displayed now.
    just before display I need to set checkbox as selected.
    I don't want to do like this (when user is pressing any command button then only is should update checkbox selection).
    Thanks,
    Mohammed.

  • How to set the Mail and Fax options  for the Smartforms ???

    How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .

    >
    veera Karthik wrote:
    > How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .
    Hi
    Check this Link:
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/28d3b9d26211d4b646006094192fe3/frameset.htm
    P.S: Never say reply me soon....people answer you here voluntarily and as everyone has their own desk to manage...sp replies may late or early..depending upon the availabality of the members.
    Vishwa.

  • CheckBox - how to set custom icons

    I need to figure out how to set a custom icon for a selected checkbox via the UIManager
    This works for un-selected checkboxes:
    UIManager.put("CheckBox.icon", new ImageIcon("../images/unselectedCheckBoxIcon.png")));
    how to change the icon when it is selected?
    I don't know the UIManager property for a selected checkbox icon and using the setSelectedIcon on the checkbox object it self does not seem to work:
    checkbox.setSelectedIcon(new ImageIcon("../images/selectedCheckBoxIcon.png"));
    Thanks for any ideas how to solve this!!

    Hi mKorbel, many thanks for your suggestion!
    For anyone interestsed,
    here is a small example of how I made it working.
    Unfortunately I cannot attatch the icon images that I use, but the selected icon can be downloaded from here, resize it to 32*32, remove the cross in the middle to save it as the unselected icon.
    * Modified sample code taken from here
    * http://www.java2s.com/Tutorial/Java/0240__Swing/CustomizingJCheckBoxCheckMarkIcon.htm
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.net.URL;
    import javax.swing.AbstractButton;
    import javax.swing.ButtonModel;
    import javax.swing.Icon;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    public class IconCheckBoxSample {
      public static void main(String[] args) {
            JFrame frame = new JFrame("Iconizing CheckBox");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Icon checked = new CheckBoxIcon();
            Icon unchecked = new CheckBoxIcon();
            JCheckBox aCheckBox1 = new JCheckBox("Pizza", unchecked);
            aCheckBox1.setSelectedIcon(checked);
            JCheckBox aCheckBox2 = new JCheckBox("Calzone");
            aCheckBox2.setIcon(unchecked);
            aCheckBox2.setSelectedIcon(checked);
            Icon checkBoxIcon = new CheckBoxIcon();
            JCheckBox aCheckBox3 = new JCheckBox("Anchovies", checkBoxIcon);
            JCheckBox aCheckBox4 = new JCheckBox("Stuffed Crust", checked);
            frame.setLayout(new GridLayout(0,1));
            frame.add(aCheckBox1);
            frame.add(aCheckBox2);
            frame.add(aCheckBox3);
            frame.add(aCheckBox4);
            frame.setSize(300, 200);
            frame.setVisible(true);
    class CheckBoxIcon implements Icon {
      public void paintIcon(Component component, Graphics g, int x, int y) {
        AbstractButton abstractButton = (AbstractButton)component;
        ButtonModel buttonModel = abstractButton.getModel();
        if(buttonModel.isSelected()) 
            g.drawImage(createImage("../images/selectedCheckBoxIcon.png","info"), x, y, component);
        else
            g.drawImage(createImage("../images/unselectedCheckBoxIcon.png","info"), x, y, component);
      public int getIconWidth() {
        return 33;
      public int getIconHeight() {
        return 33;
      protected static Image createImage(String path, String description) {
            URL imageURL = CheckBoxIcon.class.getResource(path);
            Image icn = null;
            if (imageURL == null) {
                if(null==icn){
                    //System.out.println("path: "+path);
                    icn = new ImageIcon (CheckBoxIcon.class.getResource(path.replace("..",""))).getImage();
                    if(null!=icn)
                        return icn;
                    else{ 
                        System.err.println("Resource not found: " + path);
                        return null;
                 return null;
            } else {
                return (new ImageIcon(imageURL, description)).getImage();

  • How to set exceptions for automatic cookie-clearing on closure?

    Firefox is forgetting my two-step google logins. On the google two-step verification page, there's a checkbox which says "Don't ask for codes again on this computer."
    But firefox keeps asking for codes.
    i have firefox set to clear cookies on closing.
    i also have the urls below set as exceptions, in two places:
    -in about:permissions, they are all set to allow, and also to keep offline data without asking
    -in options/privacy/exceptions
    mail.google.com
    maps.google.com
    calendar.google.com
    www.google.com
    shopping.google.com
    plus.google.com
    *.google.com
    google.com
    gmail.com
    this forum is messing up my list, above. Each url is a separate item in exceptions. The bulleted one actually starts with a star. (good job mozilla, thanks for this ancient text editor)
    how do clear all cookies EXCEPT the ones above, when i close firefox? Or, is this not a cookie problem?
    do i need to include "http://"
    this article did not help
    https://support.mozilla.org/en-US/questions/974020

    That worked. (no, it didn't)
    It's very confusing that Firefox has settings for how to handle cookies on closing in three different places. They should change that.
    "Keep until I close Firefox" seems redundant with "Clear History when Firefox closes" with "Cookies" checked. Then there are settings in "about:permissions". No way to know which one takes precedence. That's poor user-design.
    For others having this problem, here's a clear explanation. However, this is only PART of the fix, hoping to find the complete fix later in this thread.
    You CAN make FF keep only certain cookies on closing, and erase all others. Here's how to set all cookies to be cleared as soon as you close firefox, except your exceptions:
    # Go to Tools > Options > Privacy.
    # Under "History", pick "Firefox will Use custom settings for history"
    # Click "Exceptions", and add the cookies you want to keep. Click "Close"
    # Click "Keep until I close Firefox"
    # If you have "Clear History when Firefox closes" checked, then:
    * Click "Settings"
    * Uncheck "Cookies", and click "OK".
    6. Click "OK" to close the settings box.
    (now this forum has a formatting toolbar, thx! why didn't have one before?)

  • How to?? show smartform and generate pdf at the same time

    hi experts,
    how can i show the smartform and generate  a pdf at the same time?? i have a control parameter gtotf in X and i generate the pdf but i want to show the smartform at the same time??
    thx in advance

    Hi...
    call fm <sf function name>
    exporting...
    importing..
    tables..
    now in the outputparam set the getotf as 'X'.
    call the same FM again and get the otf data.
    call fm <sf fm name>

Maybe you are looking for