Making screen field uneditable in runtime

Hi all,
   I have a field that should be READ-ONLY when the screen appears (SCREEN-INPUT = 0). Then i should be able to select F4 help for the field, for which i make     SCREEN-INPUT = 1. But after selection of a value from the F4 help i want to make the field again READ-ONLY   (SCREEN-INPUT = 0) which is not happening.
   Either am able to display the value that i select from F4 help or I am able to  make the field READ-ONLY. Both are not happening together.
   Can any one please let me know how to do this.
Thanks and Regards,
Ram.

hi ram kumar check this one, i worked with this kind of scenraio, check only the bold portion, the rest just shows the scenario
When i looping again at at selection screen output i check whether the field with F4 help is filled or not and then lock them accordingly
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ST_NAME.
  CLEAR: FIELD_VALUE, DYNPRO_VALUES.
  REFRESH DYNPRO_VALUES.
  FIELD_VALUE-FIELDNAME = 'EXCH'.
  APPEND FIELD_VALUE TO DYNPRO_VALUES.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME             = SY-CPROG
      DYNUMB             = SY-DYNNR
      TRANSLATE_TO_UPPER = 'X'
    TABLES
      DYNPFIELDS         = DYNPRO_VALUES.
  READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
  IF FIELD_VALUE-FIELDVALUE IS NOT INITIAL.
    IF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 1.
      FIELD_VALUE-FIELDVALUE = 'BSE'.
    ELSEIF SY-SUBRC = 0 AND FIELD_VALUE-FIELDVALUE = 2.
      FIELD_VALUE-FIELDVALUE = 'NSE'.
    ENDIF.
    SELECT STOCK ST_NAME
                 CURRPR
                 FROM
                 ZEXCH
                 INTO TABLE TEMP_ITAB
                 WHERE EXCH = FIELD_VALUE-FIELDVALUE.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        RETFIELD    = 'ST_NAME'
        DYNPPROG    = SY-CPROG
        DYNPNR      = SY-DYNNR
        DYNPROFIELD = 'ST_NAME'
        VALUE_ORG   = 'S'
      TABLES
        VALUE_TAB   = TEMP_ITAB
        RETURN_TAB  = RETURN.
    SELECT STOCK CURRPR
                 FROM ZEXCH
                 INTO (T_CODE, T_CURRPR)
                 WHERE ST_NAME = RETURN-FIELDVAL.
    ENDSELECT.
    CLEAR DYNPRO_VALUES[].
    FIELD_VALUE-FIELDNAME = 'ST_NAME'.
    FIELD_VALUE-FIELDVALUE = RETURN-FIELDVAL.
    APPEND  FIELD_VALUE  TO DYNPRO_VALUES .
    FIELD_VALUE-FIELDNAME = 'ST_CODE'.
    FIELD_VALUE-FIELDVALUE = T_CODE.
    APPEND  FIELD_VALUE  TO DYNPRO_VALUES .
    CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
      EXPORTING
        BETRG  = T_CURRPR
      IMPORTING
        STRING = T_CHAR.
    FIELD_VALUE-FIELDNAME = 'CURRPR'.
    FIELD_VALUE-FIELDVALUE = T_CHAR.
    APPEND  FIELD_VALUE  TO DYNPRO_VALUES .
* Update the dynpro values.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        DYNAME     = SY-CPROG
        DYNUMB     = SY-DYNNR
      TABLES
        DYNPFIELDS = DYNPRO_VALUES.
  ENDIF.
*                     At  Selection-Screen output
AT SELECTION-SCREEN OUTPUT.
*  APPEND 'ONLI' TO CURRENT_SCR-EXCL.   "Execute
*  APPEND 'PRIN' TO CURRENT_SCR-EXCL.   "Execute and Print
*  APPEND 'SJOB' TO CURRENT_SCR-EXCL.   "Execute in Background
  LOOP AT SCREEN.
    IF SCREEN-NAME = 'ACCNO'.
      SELECT ACCNO
             NAME
             BANK
             BANKACC
             AMOUNT
             FROM ZUSERDETAILS
             INTO (ACCNO,NAME,BANK,BANKACC,AMOUNT)
             WHERE ACCNO = TEMP_ACCNO.
      ENDSELECT.
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ENDIF.
    IF SCREEN-NAME = 'NAME' OR
       SCREEN-NAME = 'BANKNAME' OR
       SCREEN-NAME = 'BANKACC' OR
       SCREEN-NAME = 'AMOUNT' OR
       SCREEN-NAME = 'CURRPR' OR
       SCREEN-NAME = 'ST_CODE'.
      SELECT NAME FROM ZBANKCODE INTO BANKNAME WHERE BANK = BANK.
      ENDSELECT.
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ENDIF.
<b>    IF SCREEN-NAME = 'ST_NAME'.
      IF ST_NAME IS NOT INITIAL AND FLAG_SEL IS INITIAL.
        CLEAR LIMPR.
        CLEAR QTY.
        IF EXCH = 1.
          L_EXCH = 'BSE'.
        ELSEIF EXCH = 2.
          L_EXCH = 'NSE'.
        ELSE.
          FLAG_END = 'X'.
          MESSAGE I000(ZZ) WITH 'Select an exchange from dropdown'.
          STOP.
        ENDIF.
        SELECT STOCK CURRPR
                     FROM
                     ZEXCH
                     INTO (ST_CODE, CURRPR)
                     WHERE ST_NAME = ST_NAME
                     AND EXCH = L_EXCH.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          FLAG_END = 'X'.
          CLEAR CURRPR.
          CLEAR ST_CODE.
          CLEAR ST_NAME.
          LOOP AT SCREEN.
            IF SCREEN-NAME = 'ST_CODE' OR SCREEN-NAME = 'CURRPR'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
          MESSAGE I000(ZZ) WITH 'This is not valid name of the stock'.
          STOP.
        ENDIF.
      ENDIF.</b>
    ENDIF.
  ENDLOOP.

Similar Messages

  • Making screen field mandatory

    hi can any one help in making the field email as a mandatory in su01 t-code and kindly help with process where to go and what are the steps do i take to make the field mandatory

    Go to SHD0,
    give the transaction as SU01 and give the name of transaction variant for example 'USR1'. click create. Since your requirement is only for email give some dummy name and click on create. In the next screen give some dummy name and enter and continue till you reach the screen with this title "Screen values 0900 Program SAPLSZA5" . In this screen for the field 'Email' check the box under 'required' column. now click exit&save. give some short text in the next screen and save it under appropriate package, Transport requests.
    Note : you can default your transaction variant as the standard variant. (SHD0 - standard variants tab-> Activate/Deactivate as standard variant)
    Now go to se93 and click on create , give transaction code as for example 'SU01N' (this will be your new transaction for creating user with email as mandatory field) and choose start object as 'Transaction with variant'
    In the resultant screen, give the transaction code as SU01 and transaction variant as 'USR1' (the one we created earlier), check on all gui support box's accordingly, and save it under appropriate package and Transport request.
    From here on you can use SU01N as the transaction for creating users with email as a mandatory field.

  • How to change the screen field text in runtime

    Hi ,
      I want to change the screen button text in runtime IN ABAP dynpro screens. if anybody know this please post some helpful answer
    Regards,
    Anil kumar G

    Hi Anil..
    We can change the Text of a Pushbutton dynamically.
    For this:
    1. Declare a Global variable with the Same name as the Button in TOP include
      Eg:   Data: Button1(30).
    2. In the PBO module of the Screen assign the Text to this variable:
       Eg:
        Module set_text OUTPUT.
            Button1 = 'This is the text'.
        ENDMODULE.
    <b>REWARD IF HELPFUL.</b>

  • Getting screen field values during runtime

    Hi everyone,
    In debugger for dynamically getting the screen field values we will be using  (SAPLMGMW)CALP-ENDPA this format to get the value of the field CALP-ENDPA.
    But this will give only for fields.My question is that how to get the screen field labels values in debugger.
    Take a look at following picture.

    Hi,
    Try putting a watch point on the screen field name and see where it is changing.
    If your need is before that it won't be possible to get it as it is a processed value.
    Also if it is updating on screen but still you are not getting that means the value is not transported from the Screen to the program in that case use the FM DYNP_VALUES_READ to get the values the documentation has the usage else there are lot of blogs just search it.
    Regards

  • Making Screen field visible for BDC upload

    Hi All
    I have an existing BDC program to add Vendor data to LFB1 table using transaction FK01
    Now I want to add Personnel No. PERNR value in LFB1-PERNR
    On the Account Information (SAPMFK02 Screen 0210) screen field Personnel number is not visible so I am not able to run the BDC program it says LFB1-PERNR field not available on screen.
    Please let me know how can i make that field visible on the screen

    Hi Akshay,
    U can make it visible thru SPRO transaction.
    Financial accounting --> accounts receivable and acounts payable --> Vendor master --> Master data --> Define screen layout per company code.
    Choose the specific company code and make the necessary changes,.
    thank you.
    reward points if u find the discussion useful

  • Making screen fields non-editable in standard SAP screen

    Hi All,
    I have a reuirement. In transaction code CAA2 I have to make the field 'Incoming payment method' (EZAWE) as read only/non-editable. This field is available in table FKKVKP. We can make this field as read only by performing some configuration setting. But this field needs to be disabled based on some validations.
    For example EZAWE field should appear in changable mode when user has the role 'ZDJ: SUPER_USER' assigned to him. If the user does not hold this role the EZAWE fields needs to be disabled.
    One more thing here I don't have to use screen variants for this.
    Thanks,
    Venkat

    >
    Vijay Babu Dudla wrote:
    > Try with Transaction Variants , if there is no exit available to modify the screen dynamically, check the Transaction code SCDO.
    >
    > Search SDN with Transaction Variants
    Hi,
    I think it is SHD0. correct me if am wrong
    Rhea.
    Edited by: rhea on Oct 17, 2008 12:39 PM

  • Transaction programming - Making screen fields 'output only'

    Hi all,
    I have a problem concerning a screen - it is so that the screen is used by several transactions - Create 'plan', Display 'plan' and Change 'plan'.
    When it's called from the 'Display' transaction I want the screen to be output-only. So I wrote something like this:
    MODULE modify_screen OUTPUT.
    if sy-tcode = 'ZAF03'.
    loop at screen.
    if screen-name cp 'I_AFPL*'.
    screen-input = '0'.
    modify screen.
    endif.
    endloop.
    endif.
    ENDMODULE.
    The problem is that this screen contains a tabstrip control. The subscreens on the pages of the tabstrip control contain table controls, and the table controls refer to some internal tables in the program.
    All the fields which I want to make 'output only' are fields of internal tables beginning with 'I_AFPL' that's why the condition...
    This works very well for the fields on the main screen, but not for the fields of the table controls on the tabstrip control... and I'm calling that module from the main screen and also from the subscreens of the 'pages' of the tabstrip control. In the debugger I see that the input is set to 0 but when the screen 'comes on screen' I can still do input in those fields...
    Can anyone tell me what I'm doing wrong?
    Thanks,

    Hi Ashish,
    for table control to disable a column we use the cols property in the screen'..the tablecontrol-cols is set to zero to inactivate a column
    Now assume the name of your table control is ZTABLECONT..double click on the screen painter on the table control..these 2 names must be the same....
    if you need to disable columns of table control as a part of user action..like say click of a button..it can be entered in PAI by checking the sy-ucomm
    data declaration:
    data : cols like line of ZTABLECONT-cols.
    Case sy-ucomm.
    when 'PUSH'.
    loop at ZTABLECONT-cols into cols.
    if cols-screen-input = '1'.
    cols-screen-input = '0'.
    endif.
    modify ZTABLECONT-cols from cols index sy-tabix.
    endloop.
    endcase.
    This will disable all the columns
    for a particular column do the following
    For this imagine you have 5 columns
    in the below code
    index = 1 => column 1
    index = 2 => column 2
    index = 3 => column 3
    index = 4 => column 4
    index = 5 => column 5
    in the below code , only column2 will be disabled....
    so whicever column you want to disable ..just give the index
    for multiple disabling..just write the code accordingly
    LOOP AT ZTABLECONT-cols INTO cols WHERE index = 2.
    IF cols-screen-input = '1'.
    cols-screen-input = '0'.
    ENDIF.
    MODIFY ZTABLECONT-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    Pls check and revert....
    Regards
    Byju

  • Making Screen fields Non editable in Migo

    Hi TO ALL,
    In MIGO T-code , aganist oubound delivery under Batch Tab i want to make fields Non editable.
    I am unable to find suitable exit for this,can any body help me regarding this.
    Thanks

    Hi,
    Use Transaction variant (Tcode : SHD0) to make fields display only.
    Regards,
    Ashok.

  • Change Dialog Screen Field Position Dynamically

    Hi
    Can I change screen field position at runtime?
    I saw that in the SCREEN Structure there aren't any fields to set the position. Is there a Function Module or a Class to do that?
    Thanks,
    Eyal

    Hi Eyal,
    Good Question.
    1. R/3 abap does not allow this facility.
    2. However, if we use a custom control /container,
       then there one property LEFT, TOP,
      which is avaialbe in the OO hierarchy.
      CL_GUI_OBJECT  1 
      CL_GUI_CONTROL 2  <----
      ... CL_GUI_ALV_GRID, ETC. ETC.
    3. This 2 has got this property
    4.  we can use like this.
      CALL METHOD grid->set_top
        EXPORTING
          top        = 1500
        EXCEPTIONS
          cntl_error = 1
          OTHERS     = 2.
    5. I tried but i don't know why its not working.
    regards,
    amit m.

  • Short Dump while making a fields as required in BDT object screens

    Hi,
    I'm making a field as "required" by checking the required button on that field in the BDT screen.
    But am getting a short dump when I'm trying to use that screen.
    It seems like some data is getting converted to bad format due to this (am not fully sure about it.)
    Any idea on this.
    Thanks & Regards,
    Vipul.

    Hi Pinaki,
    The entire functionality is working absolutely perfect if I dont check that field as "Required" .
    I'm not sure if I'm missing some customising or is it a problem with BDT.
    Thanks & Regards,
    Vipul.

  • While making field invisible at runtime in FPM_FORM_UIBB that row is coming as blank

    Hi All,
    In one of the requirement we are making one of the fields indivisible at runtime in the method -  GET_DATA  of the class - CL_HRESS_PER_DETAIL.
    But row in which the filed is made invisible is coming as blank .
    Is there any way to change the row number of the fields at run time .
    Thanks
    Amol

    We don't have option for specifying the row / column options at runtime.
    In structure FPMGB_T_FIELDUSAGE We have only Mandatory/Visibility/Read-only/Enabled options to set for any field.

  • MAKING A FIELD MANDATORY IN SELECTION SCREEN

    HOW TO MAKE THE SELECTION SCREEN FIELDS MANDATORY USING LOOP AT SCREEN STATEMENT.I TRIED USING IT WITH AT SELECTION SCREEN EVENT.BUT IT WAS NOT WORKING.SO CAN ANY OF U PROVIDE SAMPLE CODE FOR THIS.
    THANKS.

    Hi,
    You can do it simple:
    AT SELECTION-SCREEN ON s_matnr.
    IF s_matnr IS INITIAL.
        MESSAGE e055(00).
    Make an entry in all required fields
    ENDIF.
    (s_matnr: is a field on the selection screen)
    Good luck.
    Gilad Hubara.

  • Making a Screen field mandatory

    Hi Experts,
    How ot make a screen field mandatory in Module pool Program. I have created a screen containing five fields and in that need to make 3 fields as mandatory.
    Please let me know and thanks in advance.
    Sunil Kumar

    In the Screen painter , Double click your field to display the properties.
    In the Attributes,  Go to 'Program' tab and in the 'Input' dropdown select the value as 'Required'

  • Making a field on screen input enabled or disabled

    Dear Friends,
    Please suggest how can I make a field on my dialog-program screen input enabled or disabled through coding. I understand that the same can be done by setting screen parameters but i wish to do that through programming only.
    Regards,
    Alok.

    Hi Alok,
           A field can Enabled or Disabled by setting its attributes.
    As it is a element placed on screen and modify the screen  you need to modify the screen table.
    loop at screen.
    screen-group1 = 'SC1'.
    Enable:
    if screen-name = 'PA_MATNR':
      screen-input = '1'.
      screen-output = '0'.
    modify screen.
    endif.
    DISABLE:
    if screen-name = 'PA_MATNR':
      screen-input = '0'.
      screen-output = '1'.
    modify screen.
    endif.
    endloop.   
    Some more Info :
    1  --- Active
    1 --- Input
    1 --- Output
    0 --- Invisible
    Screen field is displayed, even if Invisible is set statically.
    Field contents are displayed.
    Ready for input, even if Input is not set statically. However, not ready for input if the Output only is set statically.
    1
    1
    0
    0
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Ready for input, even if Input is not set statically.
    1
    0
    1
    0
    Screen field is displayed, even if Invisible is set statically.
    Field contents are displayed.
    Not ready for input, even if Input is set statically.
    1
    0
    0
    0
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Not ready for input, even if Input is set statically.
    1
    1
    1
    1
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
    1
    1
    0
    1
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Output is masked by asterisks (*).
    Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
    1
    0
    1
    1
    Screen field inactive.
    Screen field is not displayed, regardless of the static attributes.
    0
    0
    0
    1
    Screen field inactive.
    Screen field is not displayed, regardless of the static attributes.
    Br,
    Laxmi

  • Regarding Selection-Screen Field Display

    Hi All,
    I have issues with Selection-Screen field display.
    The Actual issue is i had declared a selection screen field as: <b>s_exgen FOR embk-exgen</b>.
    <b>EMBK-EXGEN</b> is actually <b>20</b> Char length field.
    But in output display it is being shown as <b>18</b> Char field though i can type in all <b>20</b> characters.
    But <b>display</b> restricted to <b>18</b> Characters only.
    Can anybody give me the solution for the same!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi,
    You can decrease the visible length of the field but you can not increase more than database field length. check SAP help on this :
    select-options: s_exgen FOR embk-exgen VISIBLE LENGTH 5.
    ... VISIBLE LENGTH vlen
    Effect
    This addition allows you to shorten the visible length of the corresponding screen field on the selection screen to vlen.
    Variant 2
    SELECT-OPTIONS sel FOR (f).
    Additions as in variant 1.
    Effect
    In this variant, (f) must be a field containing the name of the actual reference field at runtime. The system creates the LOW and HIGH fields as character fields with length 45. However, their appearance on the selection <b>screen is inherited from the reference field whose name is contained in field f at runtime.</b>
    Regards
    Appana

Maybe you are looking for

  • How can I simply export comments to a single list

    Thanks in advance for your help. Does anybody know how to export the comments in acrobat as a single list (ideally to excel or word)? Typically my workflow is to convert documents (drawings, figures, sketches, charts, text) that make up a report to P

  • How to set the username in PeopleEditor programmatically

    Hi , How to set the user name in people picker entity programmatically. I have tried this: <sp:PeopleEditor ID="sppcustom" runat="server" AllowEmpty="false" MultiSelect="false" SelectionSet="User" /> In the webpart cs code: PeopleEditor sppcustom = n

  • Payslip distribution (in pdf format) via email

    Dear All, Please help with the configuration steps to distribute payslip in PDF Format to their official email.Kindly suggest the steps to configure the same. Best Regards,

  • Connecting to mysql 3.23

    I need to use a username other than root to connect to our mysql database. Changing the name is not possible so I though I would be able to supply the mysqldump or even the original create table statements which I have in a text file. None of these s

  • My IMac is restarting constantly after maverick install how do I fix this?

    My I mac is constantly restarting and the fan has started to constantly run after installing Maverick up day How do I fix this?