Set Default Values in Listbox with Dialog Programming

Hi all,
I am stuck with a problem i.e  I am working with Dialog Programming Screen
where i have to set default values in some n numbers of Listbox which i have created on Screen.
This default value is needed to be fetched from database table.
I am using single table. Hence no confusion that i have to first fetch data from 1st listbox then corresponding data is fetched into second & so on ..NO NO This is not required.
Simple one screen which will update a table in database, where  some fields on the screen needs to be default set as per tables domain default values set while table creation.
Please help me out in this.
Thanks & Regards,
Sandhya.

Please search SDN, before you post a new forum from next time... any ways just follow the below code..
u need to use the FM 'VRM_SET_VALUES' to implement list box in module pool. Check the below code. u have to write this code in PBO..
if c = 0.
select land1 landx from t005t into table wi_country.
sort wi_country by land1.
delete adjacent duplicates from wi_country comparing all fields.
loop at wi_country.
wa_ctry-key = wi_country-land1.
wa_ctry-text = wi_country-landx .
append wa_ctry to wi_ctry.
endloop.
call function 'VRM_SET_VALUES'
exporting
id = 'ZCUST_MASTER1-COUNTRY'
values = wi_ctry
exceptions
id_illegal_name = 1
others = 2
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
c = 1.
endif.
Hope this helps u,
Regards,
Rajesh

Similar Messages

  • Set default value for listbox items - Acrobat Javascript

    Hello,
    I am trying to set the default value for a listbox where multiple items are selected.
    If a single item is selected then this.getField("zzz").defaultValue = x; works fine, but you cannot use defaultValue for multiple indicies. The manual mentions the user or export events but I cannot see how that would work.
    Any help will be appreciated.
    Andrew

    I hope somebody can provide help with this as I'm having a similar problem.
    http://www.directorygump.com

  • Set default value in console.

    Hii all
    I have to set default value in console while running program .. let suppose application is needed username and password .. when it start .. firstly will display ��UserName: ADMIN.. and ADMIN would be editable � let suppose if user want to login with same username then would press enter ..otherwise will edit username with desired name �and so on� so my query is ......is it possible to make any field editable in run time ?? if ya plese give me some sample code..
    Thanks in advance..
    Vaibhav

    hello,
    please let me know ... how can I make my code editable .... give me some sample code... if possible
    Regards
    Vaibhav

  • How to set default values in dialog programming

    hi gurus
    can anyone suggest me
    how to set default values in dialog programming
    thanks&regards
    kals.

    it's a bit dirty but I usually just place it in the PBO with a flag for control. It's simple and not too costly i think.
    MODULE preRender OUTPUT.
      DATA first_time TYPE flag VALUE 'X'.
      IF first_time EQ 'X'.
    *   put your initialization code here
        CLEAR first_time.
      ENDIF.
    ENDMODULE.
    -MiR

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • How to set default file type for Open dialog

    Dear my friends,
    I am using "At selection-screen ON VALUE-REQUEST FOR filepath" to display open dialog and i want to set default file type for open dialog = *.txt.
    Thank your times !

    Hello,
    U can make use of this code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SP_FILE.
      PERFORM SAVE_DIALOG CHANGING SP_FILE G_F_RC.
    FORM SAVE_DIALOG CHANGING PO_FILE PO_RC.
      DATA: L_VA_BOXTITLE     TYPE STRING,
            L_VA_DEFAULTFILE  TYPE STRING,
            L_VA_DEFAULTNAME  TYPE STRING,
            L_VA_DEFAULTPATH  TYPE STRING,
            L_VA_DEFAULTFULL  TYPE STRING,
            L_VA_FILTERTEXT   TYPE STRING,
            L_VA_CODE         TYPE I.
      CLEAR: PO_RC, G_F_CONF.
      L_VA_BOXTITLE   = TEXT-B01.
      L_VA_FILTERTEXT = TEXT-B02.
      IF PO_FILE IS INITIAL.
        CLEAR L_VA_DEFAULTFILE.
      ELSE.
        L_VA_DEFAULTFILE = PO_FILE.
      ENDIF.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE            = L_VA_BOXTITLE
          DEFAULT_EXTENSION       = 'TXT'
          DEFAULT_FILE_NAME       = L_VA_DEFAULTFILE
          FILE_FILTER             = L_VA_FILTERTEXT
          INITIAL_DIRECTORY       = 'C:SAPWorkdir'
        CHANGING
          FILENAME                = L_VA_DEFAULTNAME
          PATH                    = L_VA_DEFAULTPATH
          FULLPATH                = L_VA_DEFAULTFULL
          USER_ACTION             = L_VA_CODE
        EXCEPTIONS
          CNTL_ERROR              = 1
          ERROR_NO_GUI            = 2
          OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        PERFORM CHECK_ERRORTYPE(Z48M_MATDATA_UP) CHANGING SY-MSGTY.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        CLEAR PO_FILE.
        EXIT.
      ENDIF.
      IF L_VA_CODE NE 0.
        MESSAGE S818(3F) WITH TEXT-011.
        CLEAR: PO_FILE, PO_RC.
        EXIT.
      ELSE.
        WRITE L_VA_DEFAULTFULL TO PO_FILE.
        G_F_CONF = G_C_XFELD.
      ENDIF.
    ENDFORM.                    " save_dialog
    If useful reward.
    Vasanth

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • Any opinions on setting default values on Business Partner level?

    Hi All,
    I do not have a question, but would like to have a good discussion on how you should preferably be setting default values on a business partner and it's assignment blocks.
    In my opinion you have two main alternatives:
    1. The "old fashioned" way by using the get_<attribute_name> method and doing some checks for the perticular attribute in the context node.
    2. Using the Badi BADI_CRM_BP_UIU_DEFAULTS to fill fields with a default value. With some enhancements on the assignment blocks (making typed_context attribute public and, when not called yet, calling the badi) you can use the badi for all assignment blocks.
    Because I discovered via debugging that in the, by many forums suggested, badi code a programm error/exception is used so that the default values are only set during creation mode, I started doubting to use the badi. Because once I had set my data declarations to the right references and the exception did not occur anymore, suddenly it always fills the values even when there are already values filled. So additional checks are needed to assure that I am in creation mode.
    Although I like the use of the badi, because all my default values on the whole business partner object can be found in the same place, it is getting a bit strange to: first still enhance the view and context node class, adjust the visibility of the typed_context, call the badi and do all kind of checks to assure that you are in the right view/context node, where this all is faster and more lean and mean when done directly in the get_<attribute_name> method on a context node.
    Anyone who wants to give there opinion on this?
    Regards,
    Martijn.

    Cameron,
    Unfortunately you cannot pass the Account and Contact name before saving the record. Post default tries to capture the name just before the record gets saved, but as the record is yet to be created, the relationship wont exist and only the respective id fields will have values. If you try using account id/ contact id it will work else just pass the time stamp in the name field which will make sure there is some value when the record is saved. later in the back end you might need WS to update the field values.

  • How to hide PNP selection windows and set default values for PNP.

    Hi expert,
         I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
    Many Thanks,

    Hi
    You have mentioned 2 things.
    1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
    HR Report Category
    2.  I want to set default value for some selection items - This you need to achieve in initialization event of your program.
    How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
    Thanks,
    Sreeram

  • Extending flash: how do I set default values for filenames

    Hi,
    I am trying to set default values for filenames
    <choosefile> and <popupslider>s that will show up when
    my XMLpanel first loads in my jsfl extension file. It seems that I
    can only set default values for textbox items.
    How do I do this for filenames and popups?
    As a workaround, I also tried using a flash object dialog box
    to look like a <choosefile>, or any jsfl command, but then
    how do I return those values back to the XMLpanel that calls them.
    and pass the data back to my jsfl script.
    lemme know if you know a way,

    Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
    Misha

  • How to set default values in initialization event for select option

    Abapers,
    I have 3 GL account like 0024831231,0024831238,0024831245.
    Please help me how to set default values in select-options ( s_hkont ) in INTIALIZATION event
    Thanks

    Select option is table <Structure> with fields, low, high, sign & option
    you need to append the value into the select option, with appropriate value in low or
    example:
    S_HKONT-low  = <value>
    S_HKONT-SIGN = 'I'
    S_hkont-OPTION = 'EQ'
    append s_hkont.
    Default value for select-option also can be added directly in select-option statement.
    Regards,
    Mahesh

  • How to set default value in OAMessageLovInputBean?

    Hi,
    How to set default value in OAMessageLovInputBean while loading the page?
    I have tried the following code but its not working.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    String delToLoc = (String)pageContext.getSessionValue("deliverTOLoc");
    Number delToLocId = (Number)pageContext.getSessionValue("deliverToLocId");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject poHeadervo =
    (OAViewObject)am.findViewObject("PoHeaderMergeVO");
    PoHeaderMergeVORowImpl poHeaderVoRow =
    (PoHeaderMergeVORowImpl)poHeadervo.getCurrentRow();
    if (delToLoc != null && !"".equals(delToLoc)) {   
    // poHeaderVoRow.setShipToLocation(delToLoc);
    OAMessageLovInputBean msb = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("DefaultShipToLocation");
    msb.setValue(pageContext,delToLoc );
    Please suggest me how to resolve this issue.
    Thanks & Regards,
    Sunita

    Hi Cristoph,
                      We tried all the way but could not able assign characteristics value before saving the document. it means we can only see the assigned value using transaction CV02N. but our requirement is to check if the user fills any value into characteristics it should check with default value which we would like to assign whenever we create a new part of the document which we are not able to achieve.we tried a lot but could not succeed.
    Nay idea if we can achieve this....
    Regards
    Bhuwan Tiwari

  • How to set default value in transient boolean attribute in VO in ADF

    Hi ADF Experts,
    I have requirement like,I have viewObject with one transient booelan attribute,
    I want to set default value of that boolean attribute as "True"
    How can I achive that please help,
    Tried every thing but no luck.

    Hi,
    I am not sure what is the use of setting a default value for a transient attribute in a read-only VO.
    However, why not include that attribute with a default value in the query itself?
    Something like
    SELECT
         Empno, Ename, Deptno, 'true' as BooleanTransAttr
    FROM EMP
    and set the type of the attribute to Boolean?
    -Arun

Maybe you are looking for