Clear Input Field

I need to clear the input field on the screen, if the input by the user is invalid. This is a generic code and need to be used in many screens. I would not really like to hard code the field names in the code to clear the input field (in the PAI event of the screen). Is there a way to use SCREEN-NAME variable to clear the input field dynamically whose name is stored in SCREEN-NAME variable?
Any help would be highly regarded !!!!

Hi Nikhil,
see this report
select second radiobutton and press on enter ,
enter some values in the PO number and press enter it will show you the error message and it wil clear the values also
REPORT ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).
******DATA DECLARATIONS**********
DATA : BEGIN OF IT_PLANT OCCURS 0,
MATNR LIKE MARA-MATNR,
WERKS LIKE MARC-WERKS,
PSTAT LIKE MARC-PSTAT,
EKGRP LIKE MARC-EKGRP,
END OF IT_PLANT.
DATA : BEGIN OF IT_PONO OCCURS 0,
EBELN LIKE EKKO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
END OF IT_PONO.
TABLES EKKO.
********END OF DATA DECLARATIONS*********
********SELECTION SCREEN DESIGN ***********
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
******END OF SELECTION SCREEN DESIGN****************
*********INITIALIZATION OF SELECTION SCREEN ELEMENTS.*****
INITIALIZATION.
P_WERKS = '1000'.
S_EBELN-LOW = '4500016926'.
S_EBELN-OPTION = 'EQ'.
S_EBELN-SIGN = 'I'.
APPEND S_EBELN.
CLEAR S_EBELN.
************END OF INITIALIZATION***********************
***********SCREEN MODIFICATIONS*******************
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
********END OF SCREEN MODIFICATIONS*****************
***************SCREEN VALIDATIONS *****************
at selection-screen.
SELECT SINGLE *
FROM EKKO
INTO EKKO
WHERE EBELN IN S_EBELN.
IF SY-SUBRC 0.
SET CURSOR FIELD 'S_EBELN-LOW'.
MESSAGE E999 WITH TEXT-005.
clear S_ebeln-low.
ENDIF.
********end of screen validation*****************
START-OF-SELECTION.
*set pf-status '100'.
IF R1 EQ 'X'.
SELECT MATNR
WERKS
PSTAT
EKGRP
FROM MARC
INTO TABLE IT_PLANT
WHERE WERKS = P_WERKS.
LOOP AT IT_PLANT.
WRITE : SY-VLINE , 2 IT_PLANT-MATNR COLOR COL_KEY,
21 SY-VLINE , 22 IT_PLANT-WERKS COLOR COL_KEY,
27 SY-VLINE ,28 IT_PLANT-PSTAT COLOR COL_NORMAL,
43 SY-VLINE ,44 IT_PLANT-EKGRP COLOR COL_NORMAL.
ENDLOOP.
ENDIF.
IF R2 EQ 'X'.
SELECT EBELN EBELP MATNR WERKS LGORT
FROM EKPO
INTO TABLE IT_PONO
WHERE EBELN IN S_EBELN.
LOOP AT IT_PONO.
WRITE : SY-VLINE , 2 IT_PONO-EBELN COLOR COL_KEY,
12 SY-VLINE , 13 IT_PONO-EBELP COLOR COL_KEY,
18 SY-VLINE , 19 IT_PONO-MATNR COLOR COL_NORMAL,
37 SY-VLINE , 38 IT_PONO-WERKS COLOR COL_NORMAL,
44 SY-VLINE , 45 IT_PONO-LGORT COLOR COL_NORMAL, 49 SY-VLINE..
ENDLOOP.
ENDIF.
TOP-OF-PAGE.
IF R1 EQ 'X'.
*ULINE AT /1(48).
WRITE : SY-VLINE ,2 'MATERIAL NUMBER',
21 SY-VLINE , 22 'PLANT',
27 SY-VLINE , 28 'STATUS',
43 SY-VLINE , 44 'GRUP', 48 SY-VLINE.
ULINE AT /1(48).
ENDIF.
IF R2 EQ 'X'.
WRITE : SY-VLINE , 2 'PO NUMBER',
12 SY-VLINE, 13 'ITEM',
18 SY-VLINE,19 'MATERIAL NUMBER',
37 SY-VLINE, 38 'PLANT',
44 SY-VLINE, 45 'GRUP',
49 SY-VLINE.
ULINE AT /1(50).
ENDIF.
END-OF-PAGE.
ULINE AT /1(50).
WRITE :/10 'PAGE NUMBER', SY-PAGNO.
kindly reward if helpful.
cheers,
Hema.

Similar Messages

  • Issue with clear input field icons in IE10

    Hi,
    In IE10, every input field displays a clear icon (an "x").
    I need to remove these icons through CSS (if you delete the date field, an error is displayed).
    Following MS solutions are not working in ADF:
    input::-ms-clear { display: none; }
    or
    ::-ms-clear { display: none; }
    or
    input::-ms-clear { visibility: hidden; }
    or
    input::-ms-clear { width=0; height=0 }
    Thanks, kind regards,
    V
    jDeveloper version: 11.1.1.6.0

    It seems that a CSS solution should be removing height and line-height for the field and create a padding height:
    css - How to remove clear button ( 'X' button ) from IE10 textboxes in compatibility mode? - Stack Overf…
    Fir me it works (chaging accordingly the padding):
    .ie10f{
      height: 0px !important;
      line-height: 0px !important;
      padding-top: 22px !important;
      padding-bottom: 22px !important;

  • How to clear input field value on back

    Hi All,
    I have developed an application, in which user put sales order on first page and press a button then its detail display on second page using restAPI. Now when I press back button on second page then it takes me to first page with holding previous sales order value in input field. And when I change its value and press that button again then it shows me previous sales order detail.
    Please suggest me, how to refresh cache and input fields value on back button?
    Thanks & Regards
    Shubhanshu

    Hi Viren,
    My code is,
    First view
    sap.ui.jsview("uitest2.first", {
      getControllerName : function() {
      return "uitest2.first";
      createContent : function(oController) {
      var text = new sap.m.Label({
            text: 'Dealer Code',
           layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center })
      var input =  new sap.m.Input("CUSTOMER",{
            type: sap.m.InputType.Text,
          placeholder: 'Enter Dealer code...',
          layoutData: new sap.m.FlexItemData({growFactor: 1, alignSelf: sap.m.FlexAlignSelf.Center}) 
      var Dealer = new sap.m.HBox({ 
                items:[  text,input
    //                   new sap.m.Label({
    //                   text: 'Dealer Code'
    //                   new sap.m.Input("CUSTOMER",{
    //                   type: sap.m.InputType.Text,
    //                   placeholder: 'Enter Dealer code...'
                       height : "6em"
          var button = new sap.m.Button({
               text: "Submit",
               press: function(oEvent) {
                  oController.loadData();
                  app = sap.ui.getCore().byId("myApp");
                  app.to("idsecond1");//, sap.ui.getCore().byId("CUSTOMER").getValue());
               layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center}) 
          return new sap.m.Page({
         title: "Sales Dealer Info",
         content: [ Dealer,button
    First controller
    sap.ui.controller("uitest2.first", {
        loadData: function() {      
            var oParameters = ({
            "CUSTOMER" : sap.ui.getCore().getElementById('CUSTOMER').getValue(),    
             console.log(oParameters);
             var url = "http://###########:8000/sap/bc/zrst_customer?sap-client=800/";
             var oModel = new sap.ui.model.json.JSONModel();
             $.ajax({             
             url : url ,
             dataType : "jsonp",
             type : "POST",
             data: oParameters,
             success: function(data,textStatus,jqXHR) {
             data = JSON.parse(data);
                     console.log(data);   
                     oModel.setData(data);
             sap.ui.getCore().setModel(oModel);
    Second View
    sap.ui.jsview("uitest2.second", {
      getControllerName : function() {
      return "uitest2.second";
      createContent : function(oController) {
      var oTable = new sap.m.Table("table",{
           headerText: "Dealer data",
           columns: [
             new sap.m.Column({
               header: new sap.m.Label({text: "NAME"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
               header: new sap.m.Label({text: "CITY"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
               header: new sap.m.Label({text: "COUNTRY"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
               header: new sap.m.Label({text: "COUNTRYISO"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
              header: new sap.m.Label({text: "STREET"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
              header: new sap.m.Label({text: "PST_CODE"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
              header: new sap.m.Label({text: "TELEPHONE"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
             new sap.m.Column({
              header: new sap.m.Label({text: "EMAIL"}),
      demandPopin  : true,
      minScreenWidth : "Tablet",
           items: {
           path: "/KEY",
           template: new sap.m.ColumnListItem({
           cells: [
                   new sap.m.Text({                              //new sap.m.ObjectIdentifier
                   text: "{NAME}"
                   new sap.m.Text({
                   text: "{CITY}"
                   new sap.m.Text({
                   text: "{COUNTRY}"
                   new sap.m.Text({
                   text: "{COUNTRYISO}"
                   new sap.m.Text({
                   text: "{STREET}"
                   new sap.m.Text({
                   text: "{PST_CODE}"
                   new sap.m.Text({
                   text: "{TELPHONE}"
                   new sap.m.Text({
                   text: "{EMAIL}"
      return new sap.m.Page({
      title: "Dealer Info",
      showNavButton: true, 
      navButtonTap:function(){ 
      app = sap.ui.getCore().byId("myApp"); 
      app.to("idfirst1"); 
      sap.ui.getCore().getElementById('CUSTOMER').setValue("");
      oModel.refresh();
      content: [ oTable
    Index.htm
    <!DOCTYPE HTML>
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <script src="resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m,sap.ui.commons"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <!-- only load the mobile lib "sap.m" and the "sap_mvi" theme -->
      <script>
      sap.ui.localResources("uitest2");
      var app = new sap.m.App("myApp",{initialPage:"idfirst1"});
      var page = sap.ui.view({id:"idfirst1", viewName:"uitest2.first", type:sap.ui.core.mvc.ViewType.JS});
      var page1 = sap.ui.view({id:"idsecond1", viewName:"uitest2.second", type:sap.ui.core.mvc.ViewType.JS});
      app.addPage(page).addPage(page1);
      app.placeAt("content");
      </script>
      </head>
      <body class="sapUiBody" role="application">
      <div id="content"></div>
      </body>
    </html>
    Thanks
    Shubhanshu

  • Clearing the data buffer from the input fields

    Hi,
    I am using an user exit CONFPP02 for the Tcode: co11n. I have written a program such that the confirmation numbers having the status CNF will not be allowed to be processed. The whole confirmation is terminated when the system checks the confirmation number and its status as CNF. If the status of the confirmation number is PCNF, the program allows the further processing of the Tcode Co11n.
    The problem starts when the user enters the PCNF status confirmation number and enters, the system stores the values in the various input fields. Now without exiting the initial confirmation screen, if the user replaces the Confirmation number of the PCNF status to the Confirmation number of the CNF status , the system issues a warning message:"  Confirmation no. or order/sequence/operation has been changed
    However, the input fields still contain default values from thepreceding confirmation". if the user says yes, the program written is bypassed , thus allowing the reconfirmation of the CNF confirmation number  into PCNF confirmation number .
    Can anybody suggest a suitable method to clear the data stored defultly in the input fields so that the program can be made to work.
    With regards,
    Avinash.S
    Mobile no:09996192456

    Hi Gilad,
    I never use Preview and did not use Preview at all before sending the document over to my most recent client either.
    I only opened Preview up this morning after I discovered that all of the form data had disappeared on his end! And the only reason I opened up Preview was because I already knew it looked fine in Acrobat so wanted so wanted to view the form in a different application.
    My client would not even have notified me about it had he not sent the signed form back to me and I saw there was no data there! I then called him and asked him about the missing data and he said that he thought I had simply sent over the form purposely with blank fields:(
    I have just emailed him to ask him what application he opened it up in. My understanding is that he is on Windows because ne mentioned to me his company was using Windows when we last spoke. Perhaps he has a personal Macbook where he opened it? I just don't know and can hopefully soon find out:)
    But THANK YOU for letting me know about that script! I appreciate it:) I have now downloaded and installed it and will just have to use it on ALL of my forms before sending them out:)

  • Input Field not getting cleared.

    Hi Fellow Abapers,
    I have a peculiar problem. I have done a Module pool program as below.
    PROCESS AFTER INPUT.
      CHAIN.
        FIELD ztrsc_histh-trptr.
        MODULE user_command_0100.
      ENDCHAIN.
      CHAIN.
        FIELD ztrsc_fibld-fidocamt.
        MODULE user_fidocamt ON CHAIN-REQUEST.
      ENDCHAIN.
    MODULE user_command_0100.
    CASE sy-ucomm.
      WHEN 'NEXT'.
         CLEAR ztrsc_fibld-fidocamt.
         GET NEXT RECORD AND DISPLAY.
    ENDCASE..
    ENDMODULE.
    Input FIELD ztrsc_histh-trptr is display only after Transporter Code is entered and we press "ENTER" key.
    Input FIELD ztrsc_fibld-fidocamt is enabled. I enter some value "10".
    i have a button as next. When the next record is shown the next record shows but although I clear FIELD ztrsc_fibld-fidocamt, in the debug mode it clears THE FIELD VALUE ztrsc_fibld-fidocamt AND THEN GETS THE NEXT RECORD AND PUTS THE CORRECT NEXT AMOUNT OF THE NEXT RECORD INTO ztrsc_fibld-fidocamt, but when it appears on the Statement FIELD ztrsc_fibld-fidocamt as per the below code.
    CHAIN.
        FIELD ztrsc_fibld-fidocamt.
        MODULE user_fidocamt ON CHAIN-REQUEST.
      ENDCHAIN.
    the old value of "10" re-appears although I had cleared it in the previous Module program. What could be the reason.
    Regards
    Yao Chhang

    Thanks a lot for your prompt answer. Well yes if i clear in the PBO the value gets cleared, but then i wanted to get the next records value into the value field, well the problem got solved in a much easier way i put everything into one chain endchain statement.

  • How to clear the input fields

    when I click on search button, I get the search result, but along with those results, I see some input fields automatically assigned the values in the search input, which should not be.
    values are assigned to these fields because of controller context field values, once the values are populated these values are assigned everywhere where istle feild referring to.
    How to keep the user input without changes?
    Thanks!

    Naveen,
    You set contradictory requirements: on one hand you have mapping, where values are always synchronized; on other hand you whant them to be unique.
    Just break your existing mappings.
    1. Create separate attributes in view context(s) if you do not need to access them in component controller or you do not need to be synchronized between views.
    2. Create unique set of attributes in component controller for combination of attributes that really must be synchronized. Then map view context attributes accordingly.
    VS

  • Want the data store values to be displayed in input field of form

    Hi,
    I wanted to know wether is there possibility of displaying the data in a input field instead of expression field.
    In our model i have used a form which has material type,plant and Vendor connected to data service1 in turn gives the out put in chart and i also have the second input form which has To(0CALMONTH) combo box which is connected to Data service2 and gives the data in table.
    But what i wanted is to i also want to use the input fields of first form to second Data service2 and get the data based on on inputs of form1 and form2i.e also To field.
    We can connect the port from form1 to DS2 but problem is we need to click the submit of form1 and form2 and it doesnt gives the output according the input of form1 and form2 as it gives the output of that form when we click that submit button.
    I have followed help.sap for data tore procdure.
    So i have used a datstore where i will store the values of form1 and call it in expression field which i will add and hide it in form2(hide because user should not see that input fields).
    Formula used in data store for expression field.
    IF(CONTAINS(STORE@matltype,@Material_Type),STORE@matltype,STORE@matltype &(IF(LEN(STORE@matltype)>0,'; ',''))&@Material_Type)
    But whats happening is the value is getting concatenated when i goon change the values in input field, so i wanted to get the values to be replaced as soon as i change input field of form1(if  use replace function its not working) and also it would be more preferrable if we use input field instead of expression field.
    I would also like to know is there any alternate solution for the above requirement instead of datastore.
    Thank You
    K.Srinivas

    Hi,
          I have Form1 connected to Data service1 displays the data in a Chart and i have another Form2 connected to Dataservice2 displays the data in table.
    In form1 there are Material Type,plant, and Vendor and form2 i have To (0CALMONTH)SO now i want also Form1 inputs for Table which gets teh data from Dataservice2.
    What i have said earlier is connecting Form1 to Dataservice doesnt fetch the data correectly,its because if i click submit in form1 i get the data of those 3 inputs and i need to click the submit button in form2 after giving input which shows the data accordingly where it doesnt fulfill the requirement.
    So i wanted some solution for that.For that reason i have used the data store and the procedure i have followed the help.sap as i said in my above mesage.
    If Data store is also suggestable than i want to display the data in Text input Field  instead of Expression field which should replace the previous values as soon as values change in data store.
    Hope i have tried to be clear if still it is not i am ready to explain again.
    Thank You
    K.Srinivas

  • Input field value help

    Hi all,
    i gt problem to gt the value from the input field:STUDENT-OBJECT_ID, STUDENT-FILE_NAME into my sql statement. I using module. When i delcare a static value objectid = stud. My sql statement can regnoize. How can i gt the objectid base on my input field in the module?
    MODULE VALUE_FNAME1 INPUT.
    <b>*objectid = STUDENT-OBJECT_ID.
    *filename = STUDENT-FILE_NAME.</b>
    <b>objectid = 'STUD'.
    filename = 'STUDFILE'.</b>
      SELECT  FIELD_NAME
        FROM STUDENT
        INTO  CORRESPONDING FIELDS OF TABLE values_tab1
    WHERE OBJECT_ID = objectid and FILE_NAME = filename.
    endmodule.

    Hi Gary,
    Check the below code.
    tables: t001k.
    For Identification Number
    DATA: BEGIN OF it_bwkey OCCURS 0,
            bwkey LIKE t001k-bwkey,
          END OF it_bwkey.
    data: v_bukrs(4).
    For Run date
    DATA: BEGIN OF it_bukrs OCCURS 0,
            bukrs LIKE t001k-bukrs,
          END OF it_bukrs.
    DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS:    p_bukrs(4) TYPE c.
    SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK main.
    Validation Section
    INITIALIZATION.
      SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BUKRS'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_BUKRS'
          value_org       = 'S'
        TABLES
          value_tab       = it_bukrs
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.
      TABLES: t130r.
      DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des
              INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<
      DATA: END OF   dynpfields.
      DATA : sy_repid LIKE sy-repid,
             sy_dynnr LIKE sy-dynnr.
      CLEAR dynpfields.
      REFRESH dynpfields.
      dynpfields-fieldname = 'P_BUKRS'.
      APPEND dynpfields.
      Lesen des akt. Wertes von Dynpro
      sy_repid = sy-repid.
      sy_dynnr = sy-dynnr.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = sy_repid
          dynumb     = sy_dynnr
        TABLES
          dynpfields = dynpfields
        EXCEPTIONS
          OTHERS     = 01.
      IF sy-subrc = 0.
        READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
        IF sy-subrc = 0.
          v_bukrs = dynpfields-fieldvalue.
        ENDIF.
      ENDIF.
      SELECT bwkey FROM t001k
      INTO TABLE it_bwkey
      WHERE bukrs = v_bukrs.
      DELETE ADJACENT DUPLICATES FROM it_bwkey.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BWKEY'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'S_BWKEY'
          value_org       = 'S'
        TABLES
          value_tab       = it_bwkey
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

  • How to clear text fields when the user navigates back to the screen

    Hi,
    Does anyone have any idea on how to clear the text input fields and dropdown boxes when the user navigates back to the screen, say for e.g. create screen?
    My issue is that i have plenty of fields in the create screen within a form. Is there a way to avoid programaticaly blanking out every field and just do it at the form level using an api to reset to a state before the user entry?
    Thanks

    This code allows you to make it more generic, and you would need to tweak it if there are more than TextInput controls, but it should provide some ideas.
    As far as using states, you could use SetProperty to set the text to empty, but that might be messier.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.containers.FormItem;
          import mx.controls.TextInput;
          import mx.events.IndexChangedEvent;
          import mx.core.Container;
          private function clearSreen(evt:IndexChangedEvent):void{
            var view:Container = tn.selectedChild as Container;
            for each(var child:Object in view.getChildren()){
              if(child is FormItem){
                var subchild:DisplayObject = child.getChildAt(0);
                if(subchild is TextInput){
                  TextInput(subchild).text = "";
        ]]>
      </mx:Script>
      <mx:TabNavigator id="tn" resizeToContent="true"
        change="clearSreen(event)">
        <mx:Form id="frm1" label="View Number One">
          <mx:FormItem label="First name:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Last name:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
        <mx:Form id="frm2" label="View Number Two">
          <mx:FormItem label="Address1:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Address2:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="City:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="State:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Zip code:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
      </mx:TabNavigator>
    </mx:Application>
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • How to capture the user change in an input field on a selection screen?

    I am coding a selection screen in which there are two input fields. The first field takes a Unix directory from the user input. Based on the input value, the second field will be populated with a the name of a file under the corresponding directory.
    My question is how I can make the program capture the user input without having to make the user press ENTER after they enter the value in the first field?
    Any help will be greatly appreciated.

    Venkat,
    Actually you led me to the real solution! It's the function module DYNP_VALUES_READ that does the trick for me. This function enables the program to capture dynamic user changes without recourse to PAI. Please refer to the code below:
    REPORT   zreiabsintf MESSAGE-ID zreiabsintfmc.
    *<HGDC------------------------------------------------------------------
    *  Selection screen for the conversion program
    *HGDC>------------------------------------------------------------------
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-001.
    PARAMETERS: p_indir   LIKE epsf-epsdirnam OBLIGATORY,                   " Inbound file directory
                p_infile  LIKE epsf-epsfilnam DEFAULT gc_infile OBLIGATORY, " Inbound file name
    SELECTION-SCREEN END OF BLOCK input.
    *<HGDC------------------------------------------------------------------
    *   Displays a file-open dialog when the user clicks the search
    *   help button next to the inbound file text field. The user
    *   can select the inbound file visually.
    *HGDC>------------------------------------------------------------------
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
    * Capture any user change to the directory.
      PERFORM check_dir_change.
    * Display the file open dialog
      PERFORM file_open_dialog CHANGING p_infile.
    *<HGDC------------------------------------------------------------------
    * Global constants
    *HGDC>------------------------------------------------------------------
    CONSTANTS:
        gc_indir  LIKE epsf-epsdirnam
                  VALUE '/interfaces/<SID>/inbound/',      " Default inbound directory template
        gc_infile LIKE epsf-epsfilnam VALUE 'input'.       " Default inbound file name
    *<HGDC------------------------------------------------------------------
    * Global data
    *HGDC>------------------------------------------------------------------
    DATA:
        gs_dynpfields   TYPE dynpread,                        " Fields of the current screen
         gt_dynpfields   LIKE STANDARD TABLE OF gs_dynpfields. " Table of the screen fields
    *&      Form  file_open_dialog
    *       Opens a dialog window for the user to choose a file in
    *       the specified Unix directory.
    *      <--P_FILE is the file to be selected.
    FORM file_open_dialog  CHANGING p_file.
    * Validate the directory.
      OPEN DATASET p_indir FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        MESSAGE i001(zreiabsintfmc) WITH p_indir.    " Unable to open the given directory
        EXIT.
      ENDIF.
      CLOSE DATASET p_indir.
    * Call the dialog window to open a file in the directory.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_indir
        IMPORTING
          serverfile       = p_file
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE i002(zreiabsintfmc).                 " Failed to open the file.
        EXIT.
      ENDIF.
    ENDFORM.                    " file_open_dialog
    *&      Form  check_dir_change
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM check_dir_change .
      CLEAR gs_dynpfields.
      CLEAR gt_dynpfields.
      gs_dynpfields-fieldname = 'P_INDIR'.
      gs_dynpfields-fieldvalue = p_indir.
      APPEND gs_dynpfields TO gt_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = gt_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc  NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_dynpfields INTO gs_dynpfields INDEX 1.
      p_indir = gs_dynpfields-fieldvalue.
    ENDFORM.                    " check_dir_change
    Thanks for all your answers! The problem is now solved.
    Edited by: Ning Hu on Apr 9, 2008 11:32 AM
    Edited by: Ning Hu on Apr 9, 2008 11:34 AM

  • How i can show the selection screen input field in the top of page in alv

    hi ,
              how i can show the selection screen input field in the top of page in alv  grid output.
    tell me the process

    Hi,
    excample from my program:
    FORM topof_page.
      DATA: l_it_header   TYPE TABLE OF slis_listheader WITH HEADER LINE,
            l_info        LIKE l_it_header-info.
      DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
      DATA: l_key LIKE l_it_textpool-key.
      READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
      DEFINE m_selinfo.
        if not &1 is initial.
          clear l_it_header.
          l_it_header-typ   = 'S'.
          l_key = '&1'.
          translate l_key to upper case.
          read table l_it_textpool with key key = l_key.
          if sy-subrc = 0.
            shift l_it_textpool-entry left deleting leading space.
            l_it_header-key = l_it_textpool-entry  .
          endif.
          loop at &1.
            case &1-option.
              when 'EQ'
                or 'BT'
                or 'CP'.
                write &1-low to l_it_header-info.
              when others.
                write &1-low to l_it_header-info.
                concatenate &1-option
                            l_it_header-info
                       into l_it_header-info
                       separated by space.
            endcase.
            if not &1-high is initial.
              write &1-high to l_info left-justified.
              concatenate l_it_header-info
                          l_info
                     into l_it_header-info
                     separated by space.
            endif.
            if &1-sign = 'E'.
              concatenate ']'
                          l_it_header-info
                     into l_it_header-info.
            endif.
            append l_it_header.
            clear: l_it_header-key,
                   l_it_header-info.
          endloop.
        endif.
      END-OF-DEFINITION.
      m_selinfo: s_trmdat,
                 s_trmext,
                 s_trmint,
                 s_fkdat,
                 s_delno,
                 s_vbeln,
                 s_deact,
                 s_kdmat.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = l_it_header[].
    ENDFORM.
    I hope, this will help you.
    Regards
    Nicole

  • Clear WBS field in sales order using bapi_salesorder_createfromdat2.

    Hi,
    Situation is this, I have a sales order, where the WBS element in the line item is populated. I want to clear that field to blank and save the sales order.
    When I try to do that using the bapi_salesorder_createfromdat2, it says that it is successful, but when I go back to the sales order and see that field is still populated and not cleared. But the same field if I clear it through VA02 it works fine.
    Header level update flag is set as 'U'.
    I have tried setting up 'D' 'U' and 'I' for the update flag for the line item. Still no luck.
    Given below is the sample code, did anybody else also faced the same issue.
    Data Section.
    data : sal_t_in type standard table of BAPISDHD1,
           sal_s_in like line of sal_t_in.
    *data : sal_t_in type standard table of BAPISDH1,
    *       sal_s_in like line of sal_t_in.
    data : ret_t type standard table of bapiret2,
           ret_s like line of ret_t.
    data : partner_t type standard table of bapiparnr,
           partner_s like line of partner_t.
    data : item_t type standard table of bapisditm,
           item_s like line of item_t.
    data : item_t_inx type standard table of BAPISDITMX,
           item_s_inx like line of item_t_inx.
    data : schdl_t type standard table of BAPISCHDL,
           schdl_s like line of schdl_t.
    data : schdl_t_inx type standard table of BAPISCHDLX,
           schdl_s_inx like line of schdl_t_inx.
    data : ord_view type order_view.
    data : sal_t_key type standard table of sales_key,
           sal_s_key like line of sal_t_key.
    data : ord_t_hdr type standard table of bapisdhd,
           ord_s_hdr like line of ord_t_hdr.
    data : ord_t_itm type standard table of bapisdit,
           ord_s_itm like line of ord_t_itm.
    data : hdr_inx type BAPISDHD1X.
    data : hdr2_inx type BAPISDH1X.
    data : qty type DZMENG.
    data : logic_switch type BAPISDLS.
    data : sd_doc_out type BAPIVBELN-VBELN.
    data : sd_hdr_out type BAPISDHD.
    data : sd_hdr_stat type BAPISDHDST.
    Logic Section.
    sal_s_in-doc_type = 'ZOR'.
    hdr_inx-updateflag = 'U'.
    ord_view-header = 'X'.
    ord_view-item = 'X'.
    sal_s_key-vbeln = '0000001067'.
    append sal_s_key to sal_t_key.
    call function 'BAPISDORDER_GETDETAILEDLIST'
      exporting
        i_bapi_view                   = ord_view
    *   I_MEMORY_READ                 =
      tables
        sales_documents               = sal_t_key
       ORDER_HEADERS_OUT             = ord_t_hdr
       ORDER_ITEMS_OUT               = ord_t_itm
    *   ORDER_SCHEDULES_OUT           =
    *   ORDER_BUSINESS_OUT            =
    *   ORDER_PARTNERS_OUT            =
    *   ORDER_ADDRESS_OUT             =
    *   ORDER_STATUSHEADERS_OUT       =
    *   ORDER_STATUSITEMS_OUT         =
    *   ORDER_CONDITIONS_OUT          =
    *   ORDER_COND_HEAD               =
    *   ORDER_COND_ITEM               =
    *   ORDER_COND_QTY_SCALE          =
    *   ORDER_COND_VAL_SCALE          =
    *   ORDER_CONTRACTS_OUT           =
    *   ORDER_TEXTHEADERS_OUT         =
    *   ORDER_TEXTLINES_OUT           =
    *   ORDER_FLOWS_OUT               =
    *   ORDER_CFGS_CUREFS_OUT         =
    *   ORDER_CFGS_CUCFGS_OUT         =
    *   ORDER_CFGS_CUINS_OUT          =
    *   ORDER_CFGS_CUPRTS_OUT         =
    *   ORDER_CFGS_CUVALS_OUT         =
    *   ORDER_CFGS_CUBLBS_OUT         =
    *   ORDER_CFGS_CUVKS_OUT          =
    *   ORDER_BILLINGPLANS_OUT        =
    *   ORDER_BILLINGDATES_OUT        =
    *   ORDER_CREDITCARDS_OUT         =
    *   EXTENSIONOUT                  =
    loop at ord_t_itm into ord_s_itm.
    move-corresponding ord_s_itm to item_s.
    call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
      exporting
        input         = item_s-WBS_ELEM
    IMPORTING
       OUTPUT        = item_s-WBS_ELEM
    *move space to item_s-WBS_ELEM.
    append item_s to item_t.
    endloop.
    clear item_s_inx.
    item_s_inx-updateflag = 'D'.
    item_s_inx-wbs_elem = 'X'.
    append item_s_inx to item_t_inx.
    call function 'BAPI_SALESORDER_CREATEFROMDAT2'
      exporting
        SALESDOCUMENTIN               = '0000001067'
        order_header_in               = sal_s_in
        ORDER_HEADER_INX              = hdr_inx
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   TESTRUN                       =
    *   CONVERT                       = ' '
    * IMPORTING
    *   SALESDOCUMENT                 =
      tables
        RETURN                        = ret_t
       ORDER_ITEMS_IN                = item_t
       ORDER_ITEMS_INX               = item_t_inx
        order_partners                = partner_t
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
    *   ORDER_CONDITIONS_IN           =
    *   ORDER_CONDITIONS_INX          =
    *   ORDER_CFGS_REF                =
    *   ORDER_CFGS_INST               =
    *   ORDER_CFGS_PART_OF            =
    *   ORDER_CFGS_VALUE              =
    *   ORDER_CFGS_BLOB               =
    *   ORDER_CFGS_VK                 =
    *   ORDER_CFGS_REFINST            =
    *   ORDER_CCARD                   =
    *   ORDER_TEXT                    =
    *   ORDER_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
    call function 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =
    Result I get when I execute is
    S     V4     233     SALES_HEADER_IN has been processed successfully     VBAKKOM
    S     V4     233     SALES_ITEM_IN has been processed successfully          VBAPKOM     000001
    S     V1     311     Standard order 1067 has been saved          Standard order     1067
    Which means it says it save successfully..but data is not changed.
    Any Ideas??
    Thanks and Regards,
    Mahesh.

    Hi,
    The problem is fixed. The item inx table I was not passing the item number field, so the bapi was not knowing which line item to update.
    It was a stupid overlook on my part.
    Thanks and Regards,
    Mahesh.

  • Disable an Input field with the help of a radio button selection.

    Hi Guys,
    I know it is a very basic question and also has many threads for the mentioned query. None of the threads gave me a real clue about the problem. It is as follows:
    Simply, I have an input field and there are two more radio buttons on the screen, say rd1, and rd2.
    Initially Rb_gtgr is active and input field is blank and disabled, and when i select Rb_selgr, input field should be active and mandatory. It means when i try to execute the code with out entering any value after it is enabled, an error message should appear. For this the code is as follows:
    AT SELECTION-SCREEN OUTPUT.
      PERFORM screen_grace_on.
    AT SELECTION-SCREEN ON p_grace.
      PERFORM check_grace_days.
    FORM screen_grace_on .
      DATA: l_v_grace TYPE char2.
      CONSTANTS: l_c_grace TYPE char7 VALUE 'P_GRACE'.
    l_v_grace = p_grace.
    CLEAR p_grace.
      IF rb_selgr EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-required = 1.
           screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-input = 0.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " SCREEN_GRACE_ON
    FORM check_grace_days.
      IF rb_selgr EQ c_x AND  p_grace EQ 0.
        PERFORM screen_grace_on.
        MESSAGE e492(/ams/ramfcmess1).          " Enter the number of Grace days
      ELSEIF rb_selgr EQ c_x AND p_grace GE 0.
        PERFORM screen_grace_on.
      ENDIF.
    ENDFORM.
    Ideally this code should work since in the PBO i.e., At selection screen output i am enabling the fields, and also when i select the second radio button i am also checking for the value too..
    I am working on 4.7 version of SAP. The Most interesting observation is it works fine for few variants, and not with others.
    Thank you

    Hi,
    Go through this following code,
    selection-screen begin of block B2 with frame title TEXT-005.
    selection-screen begin of line.
    parameters:     P_BIRPT type C radiobutton group RAD1 default 'X' user-command UCOMM.
    selection-screen comment 3(20) TEXT-002 for field P_BIRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_COLRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-003 for field P_COLRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_PAYRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-004 for field P_PAYRPT.
    selection-screen end of line.
    selection-screen end   of block B2.
    selection-screen begin of block B1 with frame title TEXT-001.
    select-options: SO_KTOKD for  KNA1-KTOKD modif id M4,
              SO_BLART for  BSIS-BLART modif id M2.
    parameters:     P_PAID   type ZCLEAR     modif id M3 as listbox visible length 20.
    selection-screen end   of block B1.
    at selection-screen output.
      loop at screen.
        if P_BIRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2' or SCREEN-GROUP1 = 'M3' .
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_COLRPT eq 'X'.
          if SCREEN-GROUP1   = 'M3'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_PAYRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
          if SCREEN-GROUP1   = 'M4'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        endif.
      endloop.
    Thanks
    Anil D

  • How to compare value in input field to value in database?

    Hi all. I need to clear up if the value in the input field (e.g. input_field) is equal to at least one record in the field (e.g. name) in database table (e.g. customers), or not. The code should be like this:
    IF...
      message001.  "(there's such a record in database)
    ELSEIF...
      message002.  "(there's no such record in database)
    ENDIF.
    thanks all.

    Hi,
    I think u r asking about validating the selction screen and displaying a mess if that input is not in the DB right?
    AT SELECTION-SCREEN ON s_matnr.
    *Validate material no details
      PERFORM validate_matno.
    FORM validate_matno.
      SELECT SINGLE matnr INTO v_matnr
             FROM mara
             WHERE matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.
    Make sure that u are validating against the header table.
    say eg if u wnat t validate matnr in marc, then do as below.
    SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
    AT SELECTION-SCREEN ON s_matnr.
    *Validate material no details
      PERFORM validate_matno.
    FORM validate_matno.
    DATA: v_matnr LIEK mara-matnr.
      SELECT SINGLE matnr INTO v_matnr
             FROM <b>mara</b>
             WHERE matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.
    Dont select from marc.
    Hope this is clear.

  • How to Add Input Field in IC Webclient

    Dear Experts,
           I want to add one Input field in Interaction Center Webclient(IC Webclient).Is it Possible?If Possible Kindly Send me the Step by step Procedure.
    It is Urgent Requirement.Please Help me.
    Helpful Answers Will be rewarded.
    Regards,
    Ashok.

    Dear Albert,
      I have read the Blog "IC Web Client - Modifying View Layout - I".I am realy Impressed.I got the similar kind of requirement from my Client.In this Blog they are not clearly Explained about Adding the functionality for that Input Field.
         could you Please Explain me about how to add the functionality For that input Field.It is Very Urgent.Please Help me.
    Thanks & Regards,
    Ashok.

Maybe you are looking for

  • Windows 8.1 64 bit and USB 3.0 connection Error

    What a Nightmare to me after I have purchased my Probook 470 G2 with window 8.1 64bit and USB 3.0.  after my setup for my new laptop, there are 2 issues i am facing now: 1. my USB 3.0 external drive can work properly with my old window 7 laptop with

  • Which audio interface?

    What is the best low to mid range audio interface with spdif & phantom power? I only need a couple of inputs. It will be used with Garage Band for now. Also, I used to use an Apple G4 with Digital Peformer 3 (yep, 3), Motu, and a Yamaha O1V. I've bee

  • FI Spend Data for SRM, Has any one Generated the DataSource from SPL?

    Hello Friends: I am planning to activate the standard BI Content forSpend Analysis. Specifically the infoCube: 0SR_FICO1 and the DSO 0SR_FIDS1.The online documentation recommends creating a Special Purpose Ledger in the source system and supplies a s

  • Problem with USB on MacBook

    The problem started when I connected a USB hub with 4 USB ports to my MacBook, at first it was working, but than a message appeared that some USB device is consuming too much power... So than I disconnected the hub, but now only one of the two USB po

  • Migration from SQL Server 7 to Oracle 8i

    I am new to Oracle, is there a way to migrate all tables and store procedure form SQL Server 7 to the oracle database thanks; null