Module pool subscreen issue

Hi
I my module pool application, I have a tab strip having 4 tabs designed in local scrolling (PAI). But after entering some values on tab 1 , when I navigate to tab 2, the gui components of tab1 also appear on tab2  and screen becomes messed up.
How to correct it?
Regards
Vishal Kapoor

Hi,
Just check if u are using same subscreen area and calling the same subscreen in all of them..
If u use different subscreen area for each tab then try this:
Pbo.
Call subscreen subarea1
Including sy-cprog ‘subscno’.
Call subscreen subarea2
Including sy-cprog ‘subscno’.
Call subscreen subarea3
Including sy-cprog ‘subscno’.
Pai.
Call subscreen subarea1.
Call subscreen subarea2.
Call subscreen subarea3.
If u are using same subscreen area for all tabs then try this :
Data dynnr type sy-dynnr.
Pbo.
Case my_tab-activetab.
When ‘fc1’.
Dynnr = ‘subscno1’.
When ‘fc2’.
Dynnr = ‘subscno2’.
When ‘fc3’.
Dynnr = ‘subscno3’.
Endcase.
Pai.
Case ok_code.
When ‘fc1’ or ‘fc2’ or ‘fc3’.
My_tab-active tab = ok_code.
Endcase.
hope it helps.
reward if useful.

Similar Messages

  • Module pool - subscreen

    Hi
    I am using module pool. I have a main screen with tab strip & two buttons (Save & Edit ).
    Now I want following functionality.
    when user clicks on "Edit" on (main screen) some I/O elements on sunscreen should be active
    and when user clicks on "Save" on (main screen) those I/O elements on sunscreen should be deactivated.
    How to do this , as sunscreen do not have okcode - how to capture user command

    You can use the Ok-code value in the PBO of your subscreen to hide/unhide the fields, provided you are not clearing the ok-code in the main screen's PAI.
    If you are, use a variable to hold the value, such as this:
    IF ok-code = 'EDIT'.
    variable = 'E'.
    and use the value of this variable in your subscreen's PBO to change the screen elements.
    Hope this helps.
    Sudha

  • Default values in module pool screen issue

    Hello,
    I have 6 input fields in one of my module pool tab-strip. I can able to populate default values in 4 fields, but 2 fields are not showing default value on the screen. I am passing these default value for all 6 fields in PBO module of that screen. My question is, why only these 2 fields are not showing default values on the screen?
    Thanks,
    Shree

    Edgar,
    Thanks for the reply, I checked again, the screen fields and variables name is exactly same.
    Here is the sample code:
    MODULE status_2050 OUTPUT.
      gv_id_no_2050 = '200'.
      gv_matnr_2050 = '232020191'.
      gv_ebeln_2050 = '20019100'.
      gv_qty_2050 = 3.
      gv_bukrs_2050 = 'JP01'.
      gv_comments_2050 = 'my comments here'.
    ENDMODULE.

  • Issue while opening websites from module pool subscreen.

    I have three subscreens which do open while user clicks a radio button on the main screen . Now in two of the subscreens,there are two text fields which contain url of two websites . When i am setting a GUI status when sy-pfkey/sy-ucomm = 'PICK' , they are getting set but inside the PAI of subscreens when I am writing :-
    When sy-ucomm = 'PICK'.
    call fn 'call_browser'.
    The websites don't open  because the PICK fn code is not getting triggered.
    In two of the subscreens ,the website addresses / urls will be fixed whereas in the third subscreen,the website address comes from  field "tline" .
    So I can't handle the scenario through buttons and assigning function codes to them.
    Pls advise.

    Dear Subankar,
    For that  screen filed select option like drill down with key.
    Regards,
    Madhu.

  • Getting error while calling a subscreen in  module pool program

    HI  ALL,
                         ACTUALLY I'M GETTING A SYNTAX ERROR WHILE I'M CALLING A SUBSCREEN
                       IN A MODULE POOL PROGRAM IN PAI MODULE
                       THE ERROR IS AS FOLLOW
                           "." or "ID ... FIELD ..." expected after "SUBSCREEN"
                        CAN ANYBODY PLS HELP ME.
    REGARDS
    ANDREWS

    HI MAX ,
                      THE CODE IS AS FOLLOWS:
    *& Report  ZTABSTRIP_PS
    REPORT  ZTABSTRIP_PS.
    type-pools : vrm.
    DATA:number1 type I,
         number2 type I,
         result  type I,
         ok_code like SY-UCOMM,
         employee1 type c,
         ABAP(19)    type c,
         SALES(19)  type c,
         HR(19)      type c,
         MM(19)     type  c,
    employee type c.
        emp type c.
    CONTROLS  tabstrip TYPE TABSTRIP.
    CALL SCREEN 100.
    call screen 110.
    call screen 130.
    call screen 120.
    call screen  140.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
      SET TITLEBAR 'TITLE'.
      CASE OK_CODE.
        WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program.
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
       WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
      when 'TAB1'.
    tabstrip-activetab = 'TAB1'.
       when 'TAB2'.
    tabstrip-activetab = 'TAB2'.
    result = number1 + number2.
       when 'TAB3'.
      tabstrip-activetab = 'TAB3'.
    SET TITLEBAR 'TITLE1'.
      when 'TAB4'.
        tabstrip-activetab = 'TAB4'.
       if employee = 'NEERAJ'.
         ABAP = 'NEERAJ'.
       elseif employee = 'UMESH'.
         SALES = 'UMESH'.
       ELSEIF employee = 'RAM'.
         HR = 'RAM'.
       elseif employee = 'ANIL'.
         MM = 'ANIL'.
         endif.
       employee = employee.
    WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    ENDCASE.
       WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program .
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0110  OUTPUT
          text
    **MODULE STATUS_0110 OUTPUT.
    SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    **case ok_code.
    **WHEN 'back' or 'exit' or 'delete'.
        leave PROGRAM.
        WHEN 'save'.
          MESSAGE 'please choose a valid function ' TYPE 'W'.
    ENDCASE.
    **ENDMODULE.                 " STATUS_0110  OUTPUT
    *&      Module  USER_COMMAND_0110  INPUT
          text
    MODULE USER_COMMAND_0110 INPUT.
      number1 = number1.
      number2 = number2.
    CLEAR NUMBER1.
    CLEAR NUMBER2.
    REFRESH NUMBER1.
    REFRESH NUMBER2.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    *&      Module  STATUS_0130  OUTPUT
          text
    MODULE STATUS_0130 OUTPUT.
    SET PF-STATUS 'STATUS2'.
    SET TITLEBAR 'xxx'.
    RESULT = number1 + number2.
    *CLEAR RESULT.
    REFRESH RESULT.
    ENDMODULE.                 " STATUS_0130  OUTPUT
    *&      Module  STATUS_0120  OUTPUT
          text
    MODULE STATUS_0120 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    DATA:  l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'ANIL'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '2'.
      l_value-text = 'RAM'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '3'.
      l_value-text = 'NEERAJ'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '4'.
      l_value-text = 'UMESH'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
    l_name =  'employee'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID                    =  l_name
          VALUES                =  li_list
       EXCEPTIONS
         ID_ILLEGAL_NAME       = 1
         OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR li_list.
    ENDMODULE.                 " STATUS_0120  OUTPUT
    *&      Module  USER_COMMAND_0120  INPUT
          text
    MODULE USER_COMMAND_0120 INPUT.
    INCLUDING sy-repid '140'.
    employee1 = employee.
    IF employee1 CS 'NEERAJ'.
      call SUBSCREEN    sub4  .
      ABAP = 'NEERAJ'.
      CLEAR ABAP.
    ELSEIF employee1 CS 'UMESH'.
       call SUBSCREEN  sub4  .
        SALES = 'UMESH'.
        CLEAR SALES.
    elseif employee1 CS 'RAM'.
      call SUBSCREEN sub4 .
       HR = 'RAM'.
       CLEAR  HR.
    ELSEIF employee1 CS 'ANIL'.
       call SUBSCREEN sub4 .
       MM = 'ANIL'.
       CLEAR MM.
       endif.
    ENDMODULE.                 " USER_COMMAND_0120  INPUT
    *&      Module  STATUS_0140  OUTPUT
          text
    MODULE STATUS_0140 OUTPUT.
    *CASE OK_CODE.
       WHEN employee1  'NEERAJ'.
         screen-active = 1.
         ABAP = 'NEERAJ'.
       WHEN employee1 = 'UMESH'.
         screen-active = 1.
         SALES = 'UMESH'.
       WHEN employee1 = 'RAM'.
         screen-active = 1.
         HR = 'RAM'.
       WHEN employee1 = 'ANIL'.
         screen-active = 1.
         MM = 'ANIL'.
         endif.
    *ENDCASE.
    ENDMODULE.                 " STATUS_0140  OUTPUT

  • Edit a field in ALV tree in a subscreen of a module pool

    Hi
    I want to make a field editable in the ALV tree based on some condtions in a subscreen of a module pool.  I used the edit = 'X' field in the fieldcatalog still it  is showing the field as display and not edit.
    Please help me to get the field as editable and save it to the database table.
    Please not this is ALV TREE
    Regards,
    Mozila

    Hi Mayank,
    Thanks for the reply
    I am using oops method.
    I tried making the field which is to be made editable  as wa_fieldcatalog-edit = 'X'. But its not working. I didnt get you when you said  edit in layout object.
    I also went through the demo programs but these programs are not having editable fields.
    My code is as follows:
    IF tree4 IS INITIAL.
    * create container for alv-tree
      l_tree_container_name = 'TREE4'.
      CREATE OBJECT l_custom_container
        EXPORTING
          container_name              = l_tree_container_name
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5.
    * create tree control
      CREATE OBJECT tree4
        EXPORTING
          i_parent                    = l_custom_container
          i_node_selection_mode       = cl_gui_column_tree=>node_sel_mode_multiple
          i_item_selection            = 'X'
          i_no_html_header            = 'X'
          i_no_toolbar                = 'X'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7.
    * create hierarchy
      CALL METHOD tree4->set_table_for_first_display
        EXPORTING
          is_layout       = s_layo
        CHANGING
          it_sort         = it_sort
          it_outtab       = it_final
          it_fieldcatalog = it_fieldcat.
    ELSE.
      CALL METHOD tree4->refresh_table_display
        EXPORTING
          it_sort           = it_sort
        EXCEPTIONS
          program_error     = 1
          failed            = 2
          cntl_system_error = 3
          others            = 4
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endif.

  • Module pool Issue

    Hi
    I have created  a module pool program , its working fine on development , bbut when transporting in quality server there is coming error in include  SAPMPROGTOP  in line 8  DDIC ztable is not active while ztable is active in Development server ,
    even after it i activated Ztable then tranported it but issue is same in quality even i checked ZTABLE in quality there is showing status  NEW instead of active while in DEV this is active. how can i resolve this
    Thanks .

    Hi Chandra,
    There is a possibility that if you had created any data elements or domains which are dependent on this table and did not transport them first, the table will not get activated. Check if any such sub elements you have created are not transported, if yes, transport them first and then the table.
    Vikranth

  • Calling subscreen in module pool

    Hi friends,
                    I am trying to call sub-screen in module pool.
    but it is giving me an error as  "." or "ID ... FIELD ..." expected after "SUBSCREEN".
    i am using followning statement
    CALL SUBSCREEN SUB  INCLUDING SY-REPID '0101'.
    OR
    CALL SUBSCREEN SUB. (SUB is screen i have created in layout).
    I tried it a lot, but not able to solve it.
    Kindly help me.

    Hi Kiran,
    <li>Subscreen concept is like this. You have one main screen. You want another screen which has to be displayed on main screen when you run main screen.
    <li>First we need to create subscreen area on main screen. Goto layout and click subscreen element and place on main screen and name to that subscreen area as SUB.
    <li>Now create another screen type subscreen. place fields on that and write logic.
    <li> Check REPORT demo_dynpro_subscreens.
    Thanks
    venkat.O

  • Conditional call to a subscreen in module pool program.

    Hi,
    Could anybody please let me know how i will be able to call a subscreen conditionally in a module pool program?
    Example: I have to call a subscreen XXXX if a FLAG = X. How will I achieve this?
    I tried to write the below code in PAI
    if flag = 'X'.
    call subscreen XXXX.
    endif.
    This produced an error.
    Regards,
    Smithesh

    Hi
    In TOP Include
    data repid type sy-repid,
            dynnr type sy-dynnr.
    In PBO of main screen
    module status_100. " First Call This Module to provide the SubScreen Number to below Code
    call subscreen sub including repid dynnr. " This serves the purpose of calling subscreen based on condition
    in Program.
    module status_100.
    repid = sy-repid.
    if your_condition = 'X'. " This also can be implemented in any PAI logi as its purpose is just to pass a value to DYNNR
    dynnr = '200'. " The SUB Screen  Number you want to pass
    else.
    dynnr = '300'. " Dummy Sub Screen Screen or any other (Make Sure these are of SUB SCREEN type )
    endif.
    endmodule
    Cheerz
    Ram

  • Subscreen in module pool

    Hi,Iam new to module pool.My requirement is to display data on the same screen in table control when the end user clicks on a pushbutton.For that I have created a work area in the main screen.I have created a subscreen with the table control I want data I want.But it is getting displayed immediately when the first screen is getting displayed.It should get displayed when user clicks on a pushbutton.
    I think my question is clear,if not PLZ tell me where to clarify.

    Hi,
    i got a solution for your problem and i tried it and is successful, i hope this wil resolve your problem.
    as you said when you execute the transaction the table control wil be displayed, but for that you  creat one more empty subscreen and make it default subscreen.
    then you assign your subscreen with table control to be called when pushbutton is pressed.
    DATA: NUMBER(3) TYPE N VALUE '300'. "empty subscreen
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    CALL SUBSCREEN AREA INCLUDING SY-REPID NUMBER.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    CALL SUBSCREEN AREA.
    in report program.
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'DISPLAY'.
    NUMBER = '200'. "subscreen with table control
    WHEN 'BACK'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    regards,
    prakash reddy .s

  • Issue With Search Help in Module Pool

    Dear All,
    I have an Issue with Search help. I have created a Module Pool Program. In this module pool, User requires the search helps for the fields.
    Imagine there are 3 fields on a screen. Field1, field2 and field3.
    Field2 entries depends on field1 and field3 entries depends on field1 and field2.
    I have created a collective search help. and created the corresponding Ztables to maintain the search help entries.
    Now I assigned the same collective search help to both the fields . i.e. field2 and field3. But when i execute the module pool program, and press F4 on these fields , the data shown is write. BUT for the 3rd field, when I select F4, The second field values are transfered to the screen, instead of third field value.
    Any Idea will be appreciated .
    Help me , Its very Urgent.
    Regards,

    Did you check the screen field names & search help name? is it identical & unique?
    Raja T

  • Checkbox issue in module pool program

    Hi all,
    I have a small issue in a module pool program using checkboxes. The requirement is that my basic list should contain the data with checkboxes and as per the selection by the user, the selected records should appear in the next screen (secondary list). But after selection, all the records barring the last record is appearing in my secondary list. Below are the screenshots of my program:
    These are the global variables I declared:
    The layout for the  basic list is as shown. The function code is cbox for checkbox.
    The flow logic :
    The code for user-command:
    Now on executing the program,
    As you can see, sales orders 4970,4972,4974 and 4975 are selected. So after clicking NEXT, in the secondary list , the data for these selected sales orders from VBAP table should come up. But instead, the records from 4970, 4972 and 4974 are displayed except the last sales order which is 4975.
    This is happening for all the records. The last selected sales order is not getting selected. Why is it so?
    Thanks.
    Manish

    Hi Ali,
    I have modified the code but there are still a couple of things which are confusing me. In the below screenshot you can see the modified version of the code:
    Now to see what is going wrong, I tried to debug the code. I placed the breakpoint on 'NEXT' as shown. Then I selected the following sales orders and pressed NEXT.
    In the debugger, IT_VBAK1 correctly holds the 2 selected values:
    IT_VBAP displays the values correctly as well.
    Now, this is where the issue is. On clicking the BACK button and selecting another sales order (4974):
    IT_VBAK1 holds the additional sales order 4974 along with the previous ones as well:
    IT_VBAP also displays the values accordingly as per the debugger:
    But in the table control, the sales order 4974 is not displayed. Only the initial sales orders are displayed.
    1) There is nothing wrong with the code as the debugger shows the records are held and displayed correctly by the internal tables. So what could be the reason for the data not to be displayed correctly in the table control? I also tried refreshing IT_VBAP after the BACK button, but still it isnt working. 
    2) Also, another thing I've seen that is after clicking the BACK button, when I select the sales orders, only data from 2 sales orders are displayed in the secondary list.
    For example, if I select any number of sales orders and press NEXT, then all the data are displayed correctly in the secondary list. Once I click the BACK button and deselect all of them and then I checkbox 3 sales orders (more than 2), then only the records for 2 sales orders are displayed, not the 3rd one.   Why is this happening?
    Regards
    Manish.

  • Selection screen as subscreen in module pool main screen

    hello
    i having problem with a module pool  and a selection screen subscreen , i have my main screen 100 in my module pool
    i create a sub screen area , then in my top include i define a seleccion screen as subscreen  150
    i define some paramets and select-options ( for the select-options feature is because i choose use the subscreen )
    so far here is OK , the problem is when i fill the subscreen data and press a pushbutton define in the main screen ( 100 )
    the field are getting cleared ( BTW i call the subscreen in the PBO of the main screen ( 100 ) using call SUBSCREEN SUB_AREA INCLUDING SY-REPID '150'. ) so my question is how i can do for save the data filled in the subscreen ?
    thanks

    i find the solution of my own question:
    in the first line of the PAI event of the main screen ( where you call the subscreen ) need add 'call subscreen SUB_AREA_NAME_HERE.

  • Selection screen regeneration issue in Module pool

    Hi experts,
    I have designed a module pool in which i have included a selection screen as sub screen , and for the scenario i need to give custom f4 help for the selection  field for that i have included logic ,My issue is when ever i am changing other code in the programs (other screen logic) the selection screen  is reverting back to normal ...again i have to do the flow logic and screen change of selection screen.
    Suggest me how i can avoid this .
    Regards,
    Siva Prasad.

    and for the scenario i need to give custom f4 help for the selection  field for that i have included logic
    was the error, use some AT SELECTION-SCREEN ON VALUE-REQUEST FOR {para|selcrit-low|selcrit-high} or PARAMETERS/SELECT-OPTIONS MATCHCODE OBJECT search_help  statement, and your problem will vanish... (Edition of a generated object is hardly ever a good idea and never good practice)
    Regards,
    Raymond

  • Select-option on subscreen for Module pool

    Hi all,
    I need to add some elements on standard screen of a standard transaction. Everything works fine, but the problem starts when I want to add select-option. It is displayed, but when I press on Multiple selection button no action occurs, no window appears...I simplified the case and created test program with test screen and also I get the same behaviour. Anyone had similiar problem?
    Thnak you in advance for help,
    Anna

    I donot know how u have created the select-option. but u can try these 2 methods to create it. And I have checked that both of them work fine.
    1) How to create a select-options in a module pool screen.
    Method 1
    a) Create a subscreen area in your screen layout where you want to create the select options.
    b) In the top include of  your module pool program declare a selection screen as a subscreen e.g.
           SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
                 select-options s_matnr for mara-matnr.
           SELECTION-SCREEN END OF SCREEN.
    c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
           CALL SUBCREEN sub_area INCLUDING  <program>   <screen>
      This call subscreen statement is necessary for transport of values between screen and program.
    Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
    Method 2
    a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
    struc_tab_and_field-fieldname = con_cust.  " 'KUNNR'
    struc_tab_and_field-tablename = con_kna1.  " 'KNA1'.
    CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
              EXPORTING
              TITLE                   = ' '
                text                         = g_titl1                                " 'Customers'
                tab_and_field     = struc_tab_and_field
              TABLES
                RANGE                   = rng_kunnr
              EXCEPTIONS
                NO_RANGE_TAB          = 1
                CANCELLED                    = 2
                INTERNAL_ERROR     = 3
                INVALID_FIELDNAME = 4
                OTHERS                           = 5.
    IF NOT rng_kunnr[] IS INITIAL.
             Read the very first entry of the range table and pass it to
             dynpro screen field
               READ TABLE rng_kunnr INDEX 1.
               IF sy-subrc = 0.
                  g_cust = rng_kunnr-low.
    ENDIF.
    You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
    Regards,
    Joy.

Maybe you are looking for