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.

Similar Messages

  • 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

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • 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

  • 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

  • Custom field added in Module pool is not reflecting in SRM Shopping cart

    Hi all,
    I have to add a custom field for Plant in the Ship-To address subscreen(BBPSC01) in Shooping cart in SRM.
    I have added the field in the program "saplbbp_sc_ui_its" in screen 310.
    But I think need to write the HTML code/Java script in HTML template to trigger the code from module pool.
    As I am new to this scenario, can anyone please let me know the procedure to follow.
    Thanks,
    Rakesh.

    Hello Anubhav,
    If your new customer fields are not displayed dynamically, re-generate Dynpro concerned using report BBP_DYNPROS_GENERATE.
    Regards.
    Lauurent.

  • HOW to ADD F4 help to a  field on SCREEN (MODULE POOL)

    Hi,
         How to add f4 help to a field in screen ..plz help
    Regards,
    Saleha

    Hi Saleha,
                    In order to add F4 help to a field in modeule pool follow these steps:-
    1. First go to SE11 and create your own search help( if you dont know how to create a search help please feel free to ask me, it is very easy).
    2. Now in your module pool program program go to the layout of your screen.
    3. Now when you see the attributes of this field in the Dict tab you will find the field Search Help. Now here you can specify the name of the search help you created in SE11.
    There is also another mehtod to create the dynamic search help. eg:- in a posted document data get the Document nos related to that company code.
    The sample code is like this:-
    First of all declare the module below in the flow logic of your screen then create it in your main program.
    You declare the module in the PROCESS ON VALUE-REQUEST.
    PROCESS ON VALUE-REQUEST.
    FIELD TXT_DOCNO MODULE VALUE_BELNR.
    You also need to create an internal table where you wil store results of the select query fired below in the module.
    here you will get a F4 help on the filed Document Number(TXT_DOCNO) based on the field Company code (TXT_CODCO)
    MODULE VALUE_BELNR INPUT.
    progname = sy-repid.
      dynnum   = sy-dynnr.
      CLEAR: field_value, dynpro_values.
      field_value-fieldname = 'TXT_CODCO'.
      APPEND field_value TO dynpro_values.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname     = 'BKPF'
          fieldname   = 'BUKRS'
          dynpprog    = progname
          dynpnr      = dynnum
          dynprofield = 'TXT_CODCO'.
    CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname             = progname
                dynumb             = dynnum
                translate_to_upper = 'X'
           TABLES
                dynpfields         = dynpro_values.
      READ TABLE dynpro_values INDEX 1 INTO field_value.
      SELECT  BUKRS BELNR
        FROM  BKPF
        INTO  CORRESPONDING FIELDS OF TABLE it_doc1
        WHERE BUKRS = field_value-fieldvalue.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'BELNR'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'TXT_BELNR'
                value_org   = 'S'
           TABLES
                value_tab   = it_doc1.
    ENDMODULE.                 " VALUE_BELNR  INPUT
    Hope you find this information useful, let me know.
    Regards,
    Aditya.

  • 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

  • Field validation in Module Pool

    Hi,
    In my module pool, on main screen there are various fields, now out of these i've to give validation for 4 fields through a drop down field such that:
    There are 2 items in my drop down, when 1st item of drop down is clicked then out of 4 fields for which i've to give validation, 2 should be Active (should take input) and other 2s should be inactive.
    And if I click the 2nd item of dropdown then there shoud be vice versa(inactive ones should b active now and active ones should be inactive now).
    Also got the function module VRM_SET_VALUES & a program DEMO_DYNPRO_DROPDOWN_LISTBOX for dropdown but don't know how can I use. If anybody can tell for either of or for both probs then will be a great help.

    Hi,
    As for the question regarding (de)activating fields:
    parameters: pa_list ... "your listbox
    data: st_first_two type i value 1,   "status of first two fields,
            st_last_two type i value 0.   "status of last two fields
    at selection-screen.   "in PAI
      "determine status of fields depending of what was choosen
      if pa_list = '1st_item'.   "if first item picked
         st_first_two = 1.
         st_last_two = 0.
      else.                           "2nd picked
         st_first_two = 0.
         st_last_two = 1.
      endif.
      "now change them
      Loop at screen.
         if screen-name CS 'First_field' or
            screen-name CS 'Secodn_field'.
            screen-input = st_first_two.                  "(de)activate first two fields
        elseif screen-name CS 'Third_field' or
                 screen-name CS 'Fourth field'.
             screen-input = st_last_two.                 "(de)activate last two fields
         endif.
        modify screen.
      endloop.
    This way you can in turn activate/deactivate your fields depending of the item picked in the listbox.
    As for the question, this fm (VRM_SET_VALUES) is used to populate possible entires in the listbox in PBO (AT SELECTION-SCREEN OUTPUT) which user can later pick. It is usually used to fill data with your custom structure, not the DDIC one. Go through this demo and see step by step how data are populated to listobox (just before screen is displayed).
    Also refer [this link|http://sap.niraj.tripod.com/id38.html]. It gives quite good explanation how it should be used.
    Regards
    Marcin

  • 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

  • Runtime change of field text in module pool

    Hi All,
    I have a requirement where I have 2 fields in module pool. Based on input of first field the text of second field is decided. i.e. we have to change the text of second field based on value of first screen.
    How to handle this.
    Edited by: Suchender Dagar on Nov 24, 2010 5:38 AM

    Hi,
    Define a variable w_field(20) type c.
    Put a input/output field in the second screen ( with the name w_field ) where you want the text and change the attribute of that field by removing the tick input checkbox and then selecting the 2D attribute of tat field, this will make the field as text field.
    Then in PBO of the screen screen write the code based on the First field fill the text in the seconf field.
    Regards,
    Madhukar Shetty

  • Deletion of tcode in module pool

    hi,
    i have created two transaction codes for one program in module pool....now i deleted one tcode...even i deleted that it is showing in the tree how to make it not to display it on left side ?

    Hi.
    Please try.
    Tr-cd:SE80
    1)[Refresh Tree Dispiay] button.
    or
    2)menu [Utilities]-[Update Navigation Index]

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

  • 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

  • PUSH BUTTON text and tooltip dynamic in module pool

    I want to change  at runtime the text and tooltip of a push button which belongs to a screen of module pool (not a pf_status).
    Is there anyone who can help me?

    HEllo,
    Check this report done by Rich,
    Ok..here is my example. Most of the code was generated by screen painter via the tabstrip control wizard. Create screen 100, use the tabstrip control wizard to create your tabstrip, name it TABSTRIP. Double click on the tab text elements, rename them TABSTRIP_TEXT1 and TABSTRIP_TEXT2 for the tab text elements, make sure that the output only check box is checked.
    REPORT ZRICH_0003 .
    data: TABSTRIP_TEXT1(30) type c,
          TABSTRIP_TEXT2(30) type c.
    start-of-selection.
    call screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    module STATUS_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    Fill the tabstrip text elements here!
    TABSTRIP_TEXT1 = 'Text 1'.
    TABSTRIP_TEXT2 = 'Text 2'.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module USER_COMMAND_0100 input.
    endmodule.                 " USER_COMMAND_0100  INPUT
    FUNCTION CODES FOR TABSTRIP 'TABSTRIP'
    CONSTANTS: BEGIN OF C_TABSTRIP,
                 TAB1 LIKE SY-UCOMM VALUE 'TABSTRIP_FC1',
                 TAB2 LIKE SY-UCOMM VALUE 'TABSTRIP_FC2',
               END OF C_TABSTRIP.
    DATA FOR TABSTRIP 'TABSTRIP'
    CONTROLS:  TABSTRIP TYPE TABSTRIP.
    DATA:      BEGIN OF G_TABSTRIP,
                 SUBSCREEN   LIKE SY-DYNNR,
                 PROG        LIKE SY-REPID VALUE 'ZRICH_0003',
                 PRESSED_TAB LIKE SY-UCOMM VALUE C_TABSTRIP-TAB1,
               END OF G_TABSTRIP.
    DATA:      OK_CODE LIKE SY-UCOMM.
    OUTPUT MODULE FOR TABSTRIP 'TABSTRIP': SETS ACTIVE TAB
    MODULE TABSTRIP_ACTIVE_TAB_SET OUTPUT.
      TABSTRIP-ACTIVETAB = G_TABSTRIP-PRESSED_TAB.
      CASE G_TABSTRIP-PRESSED_TAB.
        WHEN C_TABSTRIP-TAB1.
          G_TABSTRIP-SUBSCREEN = '0101'.
        WHEN C_TABSTRIP-TAB2.
          G_TABSTRIP-SUBSCREEN = '0102'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.
    INPUT MODULE FOR TABSTRIP 'TABSTRIP': GETS ACTIVE TAB
    MODULE TABSTRIP_ACTIVE_TAB_GET INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN C_TABSTRIP-TAB1.
          G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB1.
        WHEN C_TABSTRIP-TAB2.
          G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB2.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.
    Screen Flow is ....
    PROCESS BEFORE OUTPUT.
    PBO FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
      MODULE TABSTRIP_ACTIVE_TAB_SET.
      CALL SUBSCREEN TABSTRIP_SCA
        INCLUDING G_TABSTRIP-PROG G_TABSTRIP-SUBSCREEN.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    PAI FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
      CALL SUBSCREEN TABSTRIP_SCA.
      MODULE TABSTRIP_ACTIVE_TAB_GET.
    MODULE USER_COMMAND_0100.
    Vasanth

Maybe you are looking for