How to deactivate the screen fields dynamically in Module Pool Program?

Hi guys,
     How to <b>activate & deactivate the screen fields</b> of a <b>module pool program</b>
<b>dynamically</b> through program. Like Change mode and display mode in a single
screen.

Hi,
Make use of a Variable,say gv_flag, for both Activate and Deactivate functionalities. As many times you hit the same button, change this variable value. For example, let us say first time you hit this button, assign value 'X' to this variable. Second time you hit this button, assign value ' ' to this variable. In PBO based the variable value  you have to Activate and Deactivate.
PBO.
  if gv_flag = 'X'.  " Activate
    loop at screen.
      if screen-fname = 'ITAB1-MATNR'.
         screen-input = '1'.
         modify screen.
      endif.
    endloop.
  elseif gv_flag = ' '.   " Deactivate
      if screen-fname = 'ITAB1-MATNR'.
         screen-input = '0'.
         modify screen.
      endif.
    endloop.
  endif.
PAI.
  case sy-ucomm.
     when 'ACDC'.   " Activate/Deactivate
         if gv_flag = 'X'.
           gv_flag = ' '.
         else.
           gv_flag = 'X'.
         endif.
  endcase.
thanks,
sksingh

Similar Messages

  • Validations on the screen fields in a module pool program

    Hi all
    i am creating a sales order against a purchase order ,i am selecting a PO click on a button to call another screen which has all the mandatory fields of the SO i want validations on the screen fields or the input fields as when i enter the header data and the items data and the partner data from the input serach help that is already enabled on the screen fields ,if there is any mismatch among the fileds and an error message is displayed for example:-" material no 100-100 does not exist for  sales area" then only that field where this message is present should be field enabled and the rest of the fields should be field disabled.
    also the error message i m displaying is in short text form and not in long text i clicked on it (long text) however how to use it was not known to me .
    thanks
    varun
    Moderator message: please do more research before asking, try solving problems yourself first, look for previous discussions of similar issues, post texts in more readable format, you have been warned several times before.
    Edited by: Thomas Zloch on Feb 7, 2012

    i want to have input search help as if i select sales document type then corresponding sales organizations should appear
    This would be quite opposite of what h_vakz does. h_vakz gives Sales document based on Sales org..and you want vice versa. Create a simple SH with
    selection method : TVAKZ
    AUART as importing only
    VKORG as exporting only. So when you enter an AUART you get all VKORG it is defined in. I'm not aware of a standard search help which matches the requirement. If anybody does please help me.
    i have header data (only mandatory fields),items data,partner data(all mandatory fields)
    and when i select all the header data the search help that is on the material number and partners role and number should appear corresponding to that header data
    You will have to be more specific sir..
    not able to apply please guide someone
    As for that just mention them in SCREEN->ELEMENT LIST->REFERENCES

  • Applying search help on the screen fields of a module pool program

    hi all
    i am creating a sales order against a purchase order i am stuck at applying the search helps
    i have header data (only mandatory fields),items data,partner data(all mandatory fields)
    i want to have input search help as if i select sales document type then corresponding sales organizations should appear and when i select all the header data the search help that is on the material number and partners role and number should appear corresponding to that header data
    i found following search helps as:-
    h_vakz and h_mvke
    not able to apply please guide someone
    thanks
    varun

    i want to have input search help as if i select sales document type then corresponding sales organizations should appear
    This would be quite opposite of what h_vakz does. h_vakz gives Sales document based on Sales org..and you want vice versa. Create a simple SH with
    selection method : TVAKZ
    AUART as importing only
    VKORG as exporting only. So when you enter an AUART you get all VKORG it is defined in. I'm not aware of a standard search help which matches the requirement. If anybody does please help me.
    i have header data (only mandatory fields),items data,partner data(all mandatory fields)
    and when i select all the header data the search help that is on the material number and partners role and number should appear corresponding to that header data
    You will have to be more specific sir..
    not able to apply please guide someone
    As for that just mention them in SCREEN->ELEMENT LIST->REFERENCES

  • How to Add F4 Help To a Screen Field In a Module Pool Program

    Hi Friends,
    1. How to Add F4 Help To a Screen Field In a Module Pool Program?
    2. How to select a single cell in ALV report output for interactive reporting ?
    Kindly give code example.
    regards,
    Pradeep

    Hi,
    Try using the fm 'F4IF_INT_TABLE_VALUE_REQUEST'.
    Refer the link below for selecting  single cell.
    alv
    Reward points if useful.
    Regards
    Rose

  • How to track changes to fields in a Module Pool Program

    Hi Experts,
    I have one requirement to track the changes to some fields used in the Program, The fields for tracking the changes will be maintained in a table T1, this will be changed dynamically. 
    There are many screens in the program and many fields in each screen.
    1. How to do the coding for tracking the changes, the code should track all the changes to the fields maintained in the table T1.
    Thanks in Advance.
    Baburaj

    Hi Baburaj,
    The table logging concept will helpful for this requirement.(Tcode: scu3 --> give  table name --> u can find changes for all fields).
    Make use of concept change documents (auditing purpose used) --> CDHDR,CDPOS tables.
    If you want to track changes to your own program, You need write some API to store the data.
    Regards
    Bhupal Reddy

  • Want to know the screens associated with a module pool program ??

    Hi,
    I have an M type program (module pool), say SAPMF05M. I want to
    1) see which transaction code initiated it ??
    2) see the screens associated with it ??
    how do i achieve this ?? I know just the program name !!
    thanks

    Go to SE80, make sure "program" is in the object list box, enter the program name in the field underneath the object listbox and hit enter.  You will see a bunch of folders in  the tree structre.  There will be one for screens and one for transactions.
    Please remember to award points for helpful answers.  Thanks.
    Regards,
    Rich HEilman

  • How to Read the Screen Fields after a Transaction ?

    Hi all,
    I am working on the Transaction 'O4K_LICENSE'. After the transaction is run, it generates an Internal License number which is displayed on the screen. I tried using 'GET PARAMETER', but as the CALL TRANSACTION is called within a loop, the SAP Global memory is not getting refreshed and iam getting the same value for every loop for the Internal License Number.
    Is there any function Module other than DYNP_VALUES_READ to get the screen field values? I tried using the above function module, but in vain and it is not getting any values.
    Warm Regards,
    Vijay.

    Well .... let me explain this very clearly.
    The table OIHL has a composite primary key which is the combination of "External License Number" and "Internal License Number". The latter is generated after running the O4K_LICENSE transaction.
    Moreover, iam attaching every record with a record generated in the program. Now, the same User(ERNAM) can create records having the same External License Number.
    For example:
    If i created a record yesterday with an external License Number 123, then say an internal lic no of 3 is assigned to it.
    If i Create another record today with the same external lic no of 123, and an internal no of say 20 is attached to it, then i donot have any criterion to select the one which i have created today, as it fetches both the records.
    To add to the worst, there is no timestamp field also.
    Message was edited by: Vijay Sai

  • How to validate the field values in module pool program?

    Hi Guys
         I am working with module pool programming.
         Here I want to validate the fields like below.
         with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled.  This can be done by checking all the fields individually.
         I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
         If it is possible, can anyone help me?

    You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
    If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>.
    ENDCHAIN.
    all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
    Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
    ashish

  • Want to change the text of a coloumn dynamically in module pool program

    Hi to all experts,
    I need to change the text in a table control( of a column)of a module pool program dynamically ....depending on the company cod e.

    Hi,
    In program depends on the condition you can access the table_control-cols-name and modify it accordingly.
    Eg:
    CONTROLS TABLE_CONTROL TYPE TABLEVIEW USING SCREEN 100.
    you can access the control like:
    TABLE_CONTROL-COLS[1]-SCREEN-NAME
    and modify the same dynamicaly
    cheers
    shibu

  • Screen Field Color in Module pool

    Hi Experts,
                      I have a requirement like based on the field content i want to change the color to the screen field. I have written code like below. But i'm getting dump.
            LOOP AT SCREEN.
              IF screen-group1 = 'G02'.
                screen-color = 'C411'.   -
    > Getting dump here
                MODIFY SCREEN.
              ENDIF.
            ENDLOOP.
    Please tell me whether it is possible to give color in module pool or not.
    Thanks and Regards,
    nag.

    Hi Sam,
                 Thanks for ur reply. I have tried using only integers.But i'm not getting color. My code is below
            LOOP AT SCREEN.
              IF screen-group1 = 'G02'.
                screen-color = '411'.
                MODIFY SCREEN.
              ENDIF.
            ENDLOOP.
    color is INT4 type rite but we are passing only 3 characters to screen-color.But i didn't color to my field.

  • Calling search helps dynamically in module pool program

    Hi Experts,
    I have created two search helps. I need to call these search helps in my module pool program dynamically for a single field (i.e ZMATNR).
    you might be known... if it is a single search help, we can assign that in field attributes.
    But here... I need to call different search helps for a single field based on the condition.
    Pls help me.
    Thanks
    Raghu

    Hi,
    Use the below function module and  pass the search help created in search help field according to the condition.
    Process on Value-request.
    if condition = A.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created                                                          
    Elseif  Conditon =B.
    call function " F4IF_FIELD_VALUE_REQUEST"
    TABNAME           =                                                         
    FIELDNAME        =                                                       
    SEARCHHELP     =  "Mention search help created      
    Endif.
    Regards,
    Prabhudas

  • 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>

  • How to restrict the screen field TASK in SWI2_FREQ tcode

    Hi All,
    The user who ever has authorization for this transaction code is able to access all the task types irrespective of SAP modules from back end.
    The concern is that the task type of any module should not be visible for un-authorized people.
    In the front end only the authorized people can see work flow items (mail's) and it's according to business requirement.
    Is there any solution?
    If Yes, Pls let me know .
    Thanks
    Heena.

    Hi Heena
    I'm afraid that you won't find any standard SAP Authorization object that can help you here,
    You might how ever be able to solve it with HR Structural authorization, but be carefull here, if you activate the structural authorization check you migh be looking at a large SAP Security Project.
    I would usually not recommend that you give access to this transaction to other than your workflow administrators. But if you need to you might be able to create transaction-variants with fixed tasks, and the assign thoose to a t-codes, to which you grant access
    Regards
    Morten Nielsen

  • How to pass the field value from module pool program to smartform using submit?

    // AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.
    gv_orderid= wa-itemid./
    SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN
                                  WITH p_order = gv_orderid
                                  AND RETURN.
    //AT driver pgm(zmusic_store_smf):
    START-OF-SELECTION.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'ZMUSIC_SMARTFORM1'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = lv_form
       EXCEPTIONS
         no_form                  = 1
         no_function_module       = 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.
    CALL FUNCTION lv_form
       EXPORTING
    *      iv_orderid = is_purchase_item-zorder_id.
    iv_orderid = gv_orderid.
    // here i'm trying to call my smartform('ZMUSIC_SMARTFORM1')  from this driver pgm but unable to access the value of gv_orderid please help me out with this.

    Declare the gv_orderid in modulepool program.
    And Declare the parameter as import parameter in smartform.
    CALL FUNCTION  lv_form
       EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         =
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             =
    *   USER_SETTINGS              = 'X'
         i_input                    =  gv_orderid
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5

  • Delete field dynamically in Module pools

    Hi,
    Is is possible to delete or add a particular field at runtime.
    I can make it invisible but is it possible to remove it.
    Thanks in advance.
    Aditya

    The typical approach would be to define, say, 20 input fields in the screen, and hide those you don't want.  If you name the fields carefully, you can make the coding more elegant e.g. something like this snippet (not syntax checked):
        loop at screen.
    *" Name of screen fields is something like gs_9999-email_01, gs_9999-email_02 etc
          split screen-name at '-' into l_prefix l_suffix. "get email_nn in l_suffix
          l_char_2 = l_suffix+6(2). "get number from end
          if l_char_2 co '0123456789 '. "looks like a number...
            l_numc_2 = l_char_2.
            if l_numc2 > gs_9999-lines_to_show. "how many you want on screen
              screen-active = gc_screen_off. " constant = '0'
            endif.
            modify screen.
          endif.
        endloop.

Maybe you are looking for

  • Office Web Apps 2013 not loading Power Point

    I installed Office Web Apps (2013) patched on a 2012 R2 server and I am having issues loading a power point onto the stage in a conference. It says "Loading..." for a few minutes and then eventually says "Either you've lost network connectivity or ou

  • IOS 7 Calendar List View on main page

    Hi Apple, The main reason for me to take an Iphone was the calendar and all the sync around it. Now on IOS 7 Calendar you have remove one of the most important feature for me. When we are on the calendar we don't have the list at the bottom. This fea

  • I want to display a HTML file that is stored locally on my machine.

    Hello, I am having a problem with my paths (I believe). I have created a JEditorPane that reads in a HTLM page. If the page is form the web it works fine: page_jep.setPage("http://www.google.com");However I want to display a HTML file that is stored

  • Z2 vs Z3

    Hi Sony i bought my sony z2 from 2 months and i believe this is a superb phone.. WHICH SHOULD LAST AS SONY's 2014 FLAGSHIP UNTIL I BUY UPCOMING Z4 2015's FLAGSHIP today after z3 family announcement i can see that my z2 is getting old somehow while bo

  • Guarranteed Message Delivery with OSB 11g

    Hi, I'm currently working on a scenario with OSB that requires me to set up guaranteed message delivery. The business scenario is that on one end I have a flat file polling service and I have to transform this data into XML and store it to DB. Concis