Selection screen - where is my parameter?

Hi all!
I've got a curious situation! I added a new parameter in my abap program.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
PARAMETERS p_wkzrl  TYPE boolean AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b1a.
In our test system it works fine! But in our productive system is no flag! The source code is right, but the parameter will not be displayed on screen. We have the right order in our transport queue. Is it possible that there is a buffer with inconsistent data? Very curious....!
Thanks for help!
Florian

Oh sorry - that was a copy + paste error! There are more blocks that are encapsulated by block b1!
But we solved it! Although the complete program was active, we simply gerenerate it again and it works. Seems that there was something inconsistent.
Thank you,
Florian

Similar Messages

  • User defined selection screen sequence

    Hello Everyone,
    I have a kind of an issue with selection screens. Story goes like this. I have a main sel.screen (no 1000) where I have some selection list. Now based on this selection i display another sel.screen (with my given number, let's say 9000). Then i fill selection criterion on screen 9000 press F8 and I get results. So far so good. Now when i 'back' button system displays the first, initial sel.screen (1000) instead of the last displayed (9000). I've tried to modify this behaviour and I am able to display the last sel.screen (9000) after pressing 'back' button but then when i press 'F8' instead of results I get initial sel.screen (1000) again. Is there anything I could do to make it work in the way I want to ?
    Regards
    Pawel

    Ok so let me present the code (or at least the most important parts) as Selva asked because using 'set screen 0' did not help. it is possible that I used it in wrong place so even more presenting code should help:
    * some global data definition
    *definition of mail sel.screen:
    SELECTION-SCREEN BEGIN OF BLOCK selscr1
                     WITH FRAME TITLE text-001.
    PARAMETERS: "select interface
         p_i001(4) as listbox visible length 20 OBLIGATORY DEFAULT 'XXX'.
    SELECTION-SCREEN END   OF BLOCK selscr1.
    *definiotion of following sel.screens;
    SELECTION-SCREEN BEGIN OF SCREEN 1002.
      SELECTION-SCREEN BEGIN OF BLOCK selscr2 WITH FRAME TITLE text-001.
        PARAMETER: p_ws02(4) as listbox visible length 20 OBLIGATORY DEFAULT 'XXX'.
    *    PARAMETER: p_t02 like GV_TABNAME DEFAULT 'zint_v_infin002'.
      SELECTION-SCREEN END   OF BLOCK selscr2.
    SELECTION-SCREEN end OF SCREEN 1002.
    SELECTION-SCREEN BEGIN OF SCREEN 1004.
      SELECTION-SCREEN BEGIN OF BLOCK selscr3 WITH FRAME TITLE text-001.
        PARAMETER: p_ws04(4) as listbox visible length 20 OBLIGATORY DEFAULT 'XXX'.
      SELECTION-SCREEN END   OF BLOCK selscr3.
    SELECTION-SCREEN end OF SCREEN 1004.
    *******************   END OF SCREENS ***********************************************************
    AT SELECTION-SCREEN ON p_i001. "parameter from screen 1000
      CASE p_i001.
        WHEN '002'.
          call SELECTION-SCREEN 1002.
        WHEN '004'.
          call SELECTION-SCREEN 1004.
        WHEN OTHERS.
          CALL SELECTION-SCREEN 1000.
       ENDCASE.
    *** some settings made basing on selections from following screens
    AT selection-SCREEN on p_ws02.
      gv_werks = p_ws02.
    AT selection-SCREEN on p_ws04.
      gv_werks = p_ws04.
    INITIALIZATION
    * filling listbox
    START-OF-SELECTION.
      CASE p_i001.
        WHEN '002'.
         "select 002 relevant data
         "alv display
        WHEN '004'.
         "select 004 relevant data
         "alv display
      ENDCASE.
      END-OF-SELECTION.
    so as i mentioned before when i press 'back' on alv list I end up with screen 1000 instead 1004 (it's 1004 in real life not 9000). when i tried to change i was able to display 1004 selection when i pressed 'back' on alv but then instead of getting new list system takes ma back to 1000 scr again
    regards
    Pawel

  • Selection Screen - Date and Time

    Hi,
    I have given a selection screen where the user needs to key in the input in the following format
    dd.mm.yyyy hh:mm:ss.
    Reason is that the database fetching these elements accepts only in this criteria.
    Now as they look into automating this program, they would want to automatically take the current system date and time - 24 hours .
    How do I achieve this in the above format? If this is not possible, let me know if i can make the selection screen with normal sap date format and convert it to the above format on passing to the select statement.
    Regards
    Sam

    Hi Sam,
    See this. Is this your requirement.
    With this we are able to get Current time-stamp to selection parameter.
    REPORT ZTEST.
    DATA: L_TS TYPE TZNTSTMPS,
           L_TS_C TYPE CHAR14.
    PARAMETERS:
    P_TMSTMP TYPE TMSTMP OBLIGATORY MEMORY ID TEST.
    INITIALIZATION.
       GET TIME STAMP FIELD L_TS.
       MOVE L_TS TO L_TS_C.
       SET PARAMETER ID  'TEST' FIELD L_TS_C.
    The output is
    Jogeswara Rao K

  • Selection screen text in chinese

    Hi,
    I have added a selection screen comment for a parameter (checkbox) to a report. This text is maintained in english but when I login in chinese it is not visible at all.
    Where as text for other existing fields are visible.
    Has anyone encountered such problem before or can help.
    Regards,
    Viv

    Hi,
    Go to   T.Code: SE63  and follow the below path
    Translation >R/3 Enterprise> Short Texts -->  S3-ABAP Texts -->  REPT Text Elements
    Then give the Program name as an Object Name and Chooses the languages..
    There you can Translate all the required texts for that program.
    Regards,
    Kalam.A

  • Selection screen : matchcode on RYEAR and also question on FILE_SAVE_DIALOG

    Hiii
    Question 1 -->
    i have on the selection screen a parameter of type RYEAR i check in database and theere is no matchcode attach to it.
    can you please advise whether there is a standard matchcode i can used or am i missing something?
    Question 2 -->
    And also on my selection screen i have 2 parameter
    P_path type string
    P_name type string
    on the P_path we need to put the directory name and also implement a F4 where user can browse the directory.   On the p_name we will put the file name
    have done somwthing like that.  sorry i don't remember the exact name?
    at selection screen on value request p_path
    call method cl_xxxxx-file_save_dialogue
    the problem is that the FILE_SAVE_DIALOGUE i must enter the a file name on the pop-up before clicking on save,
    I don't want an F4 of P_PATH i want to only the browse directory path not save. can you please advise if there are another method for that?

    Check this code;
    PARAMETER: p_path TYPE char50,
                                   p_name TYPE char50.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
      DATA: lv_path TYPE string.
      lv_path = p_path.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
    *      window_title         = 'Jay'
          initial_folder       = lv_path
        CHANGING
          selected_folder      = lv_path
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      p_path = lv_path.

  • Condition on selection screen parameters

    Hi friends,
    I have an ABAP query. Here , I have a date field (ISEG_ZLDAT - Cycle count date ) in the selection screen which is a parameter (not a select option). I have to write a condition for the report to pull all the materials which have a cycle count date less than the value entered on the selection screen.
    How do I give this condition in the code ? Is there a way to do it without using select options ?
    Please help.
    Thanks,
    Dikshitha

    Hi Dikshitha,
        as also said by others try it this way:
    Parameters:
      p_ZLDAT type ISEG-ZLDAT.
    Data:
      t_ISEG like standard table of ISEG.
    select * from ISEG into table t_ISEG where ZLDAT lt p_ZLDAT.
    if sy-subrc ne 0.
    endif.
    With luck,
    Pritam.

  • About selection screen validation

    Hi all,
            I have query regarding a selection screen.
            I have one field in a selection screen where i ve put the matnr field as a parameter from MARA table.
             My requirement is that when I will select any material by pressing F4 and select the value the corresponding material description will come automatically in another field which I had taken in the Selection screen.I must get it automatically without any push button or execute button.
             Now where I have to write the logic of the code and at which event of the report .
             Please experts help me.
    With regards,
      Abir.

    REPORT  ZSRIM_TEMP10.
    tables : mara,makt.
    data : v_maktx type makt-maktx.
    parameters : p_matnr type mara-matnr,
                 p_maktx type makt-maktx.
    AT SELECTION-SCREEN OUTPUT.
    if p_matnr is not initial.
       select single maktx from makt into v_maktx
             where matnr = p_matnr and spras = sy-langu.
        p_maktx = v_maktx.        
    endif.
    I am sorry, this code will works only if you click any enter key etc.. then only Description will appear.
    Regards
    Srikanth.
    Message was edited by: Srikanth Kidambi

  • Selection Screen in LSMW

    Am using direct input method.
    i want to provide user with* Selection Screen* where user will enter Material No.
    i have to check whether that material present in MARA table or not.
    If that material not present there error message or proceed with LSMW for other changes in MM02.
    kindly help with selection screen logic guyssssssssssss

    what kind of selection screen do you expect?
    in step 5 you can add e.g. a parameter in ___global_data____ section  like this :
    parameter: PMATNR like mara-matnr.
    if you then execute the step for data conversion this parameter appears along with the usual fields for transaction number.
    and in field mapping for material number you add this code to issue a message into the :
    SELECT single       * FROM  MARA into wa_mara
           WHERE  MATNR  = PMATNR.
    if sy-subrc <> 0.
    write: 'material not found' , PMATNR.
    endif.

  • Finding selection screen code in xmb_support_restart

    Hi experts,
    There is a standard program called zsxmb_support_restart which i copied and made zsxmb_support_restart, which has got  a selection screen,where i can put the message id.
    But i need to pass this MID through  a function module, so that the message id is taken as input into the z program dynamically, when i call the function module. 
    I am not being able to find the position of selection screen in the z program (zsxmb_support_restart) code, which i need to comment out, so as to pass the value from the FM input parameter .
    Please suggest.
    Thanks,
    shreya

    Maybe, in property tab of report, it's linked to a logical DB, with selection-screen parameters.

  • Validating a selection screen filed

    Hi Experts,
    I need to to validate a selection screen field .The field is mentioned as selection parameter and it is obligatory.
    To validate this i have written the logic as follows:
    AT SELECTON SCREEN ON <FIELD-NAME>.
    SELECT STATEMENT.
    IF SY-SUBRC NE 0.
    ERROR MESSAGE.
    endif.
    But here my question is select-options acts like an intenal table,Inthis case do we need to loop to the select-options fields or else do we have any other alternative solution.
    Edited by: vinay raj on Aug 31, 2010 10:51 AM

    Hi,
    Looping is not required for this validation.  And as you have said select statement using IN oerator does not throw any error message if the value is not present in select-options.
    AT SELECTON SCREEN ON <FIELD-NAME>.
    SELECT STATEMENT .... where field in s_field.
    IF SY-SUBRC NE 0.
    ERROR MESSAGE.
    endif.
    But if you want to check whether the value entered in select-options is invalid then you can refer the below sample code
    which can be used to check for the validity of the value  of valuation class entered in the selection screen where valuation class is used as select-options. In the below code table T025 has all the values of valuation class. If the entered value does not exist in this then it indicates that the value entered in selection screen is invalid. 
    AT SELECTON SCREEN ON <FIELD-NAME>.
    PERFORM check_valuation_class.
    FORM check_valuation_class.
      DATA : lv_bklas TYPE bklas.
      IF NOT p_bklas-low IS INITIAL.
        SELECT SINGLE COUNT(*) FROM t025
        INTO (lv_bklas) WHERE bklas EQ p_bklas-low.
        IF sy-subrc NE 0.
          MESSAGE e021(zfm001).
        ENDIF.
      ENDIF.
      IF NOT p_bklas-high IS INITIAL.
        SELECT SINGLE COUNT(*) FROM t025
        INTO (lv_bklas) WHERE bklas EQ p_bklas-high.
        IF sy-subrc NE 0.
          MESSAGE e021(zfm001).
        ENDIF.
      ENDIF.
    ENDFORM.                    " check_valuation_class

  • At Selection-screen Events!

    Hi!
      Pls tell me the order of selection screen events in sequence
    Pls give some sample program for validation of selection screen i/p without using search helps.
      Thanks

    Hi Rahul
    Basic form
    AT SELECTION-SCREEN.
    Additions
    1. ... ON psel
    2. ... ON END OF sel
    3. ... ON VALUE-REQUEST FOR psel_low_high .
    4. ... ON HELP-REQUEST FOR psel_low_high
    5. ... ON RADIOBUTTON GROUP radi
    6. ... ON BLOCK block
    7. ... OUTPUT
    Effect
    This event only makes sense in reports, i.e. in programs set to type 1 in the attributes. Type 1 programs are started via a logical database and always have a selection screen where the user can specify the database selections.
    The event is processed when the selection screen has been processed (at the end of PAI ).
    If an error message ( MESSAGE Emnr ) is sent during the event, all fields on the selection screen become ready for input.
    After further user input, AT SELECTION-SCREEN is executed again.
    Note
    You should only perform very expensive checks with AT SELECTION-SCREEN if the program is then started (not every time the user presses ENTER). Here, you can read the system field SSCRFIELDS-UCOMM (provided a statement TABLES SSCRFIELDS exists). If the field has one of the values 'ONLI' (= Execute) or 'PRIN' (= Execute and Print), the report is then started, i.e. the selection screen is closed and the processing continues with START-OF-SELECTION . Remember that the selection screen (and thus also AT SELECTION-SCREE N ) is also processed in variant maintenance and with SUBMIT VIA JOB . You can determine which of these applies by calling the function module RS_SUBMIT_INFO .
    Addition 1
    ... ON psel
    Effect
    This event is assigned to the selection screen fields corresponding to the report parameter or selection criterion psel .
    If the report starts an error dialog at this point, precisely these fields become ready for input.
    Addition 2
    ... ON END OF sel
    Effect
    For each selection criterion sel on the selection screen, you can call a further screen by pressing a pushbutton. On this screen, you can enter any number of single values and ranges for the selection criterion sel .
    When this screen has been processed (i.e. at the end of PAI for this screen), the event AT SELECTION-SCREEN ON END OF sel is executed.
    At this point, all the values entered are available in the internal table sel .
    Addition 3
    ... ON VALUE-REQUEST FOR psel_low_high
    Effect
    With this addition, the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. The effect of this is twofold:
    The pushbutton for F4 (Possible entries) appears beside the appropriate field.
    When the user selects this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4 , the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field psel_low_high at the end of this processing block are copied to the appropriate input/output field.
    This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options (SELECT-OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the value help in the database program SAPDBxyz .
    Addition 4
    ... ON HELP-REQUEST FOR psel_low_high
    Effect
    As with the addition ON VALUE-REQUEST the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. When the user presses F1 on the relevant field, the subsequent processing block is executed. You can thus implement a self-programmed help for the input/output fields of the selection screen. If the program contains such an event and the user presses F1 , the system processes this rather than displaying the documentation of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field.
    This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options (SELECT-OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition HELP-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the help in the database program SAPDBxyz .
    Addition 5
    ... ON RADIOBUTTON GROUP radi
    <u><b>Effect</b></u>
    This event is assigned to the radio button groups on the selection screen defined by PARAMETERS par RADIOBUTTON GROUP radi .
    If the report starts an error dialog at this point, precisely these fields of the radio button group radi become ready for input again.
    <b>
    Addition 6</b>
    ... ON BLOCK block
    Effect
    <b><i>This event is assigned to the blocks on the selection screen defined by SELECTION-SCREEN BEGIN/END OF BLOCK block .
    If the report starts an error dialog at this point, precisely these fields of the block block become ready for input again.</i></b>
    <u><b>Note</b></u>
    In which sequence are the events AT SELECTION-SCREEN ON psel ... , AT SELECTION-SCREEN ON RADIOBUTTON GROUP ... , AT SELECTION-SCREEN ON BLOCK ... , AT SELECTION-SCREEN processed?
    <i>The AT SELECTION-SCREEN ON psel ... events assigned to the parameters or selection options are executed in the sequence they are declared in the program, i.e. in the sequence they appear on the selection screen.
    The events assigned to the radio button groups are executed according to the first parameter of the radio button group.
    The events assigned to the blocks are executed "from the inside to the outside".</i>
    <b>Example</b>
    SELECT-OPTIONS SEL0 FOR SY-TVAR0.
    SELECTION-SCREEN BEGIN OF BLOCK BL0.
    SELECT-OPTIONS SEL1 FOR SY-TVAR1.
    SELECTION-SCREEN BEGIN OF BLOCK BL1.
    PARAMETERS P0 RADIOBUTTON GROUP RADI.
    PARAMETERS P1 RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN BEGIN OF BLOCK BL2.
    PARAMETERS P3.
    SELECTION-SCREEN END   OF BLOCK BL2.
    SELECT-OPTIONS SEL2 FOR SY-TVAR2.
    SELECTION-SCREEN END   OF BLOCK BL1.
    SELECTION-SCREEN END   OF BLOCK BL0.
    <b>Sequence:</b>
    AT SELECTION-SCREEN ON...
    SEL0
    SEL1
    RADIOBUTTON GROUP RADI
    P3
    BLOCK BL2
    SEL2
    BLOCK BL1
    BLOCK BL0
    AT SELECTION-SCREEN is executed at the very end.
    <b>Addition 7</b>
    ... OUTPUT
    <u>Effect</u>
    <b>This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values. Also, since AT SELECTION-SCREEN OUTPUT is first executed after the variant is imported (if a variant is used) and after adopting any values specified under SUBMIT in the WITH clause, changing the report parameters or the selection options in AT SELECTION-SCREEN OUTPUT would destroy the specified values.
    Here, however, you can use LOOP AT SCREEN or MODIFY SCREEN to change the input/output attributes of selection screen fields.</b>
    <u><b>Example</b></u>
    <b>Output all fields of the
    SELECT-OPTION NAME
    highlighted:</b>
    SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
         CHECK SCREEN-GROUP1 = 'XYZ'.
         SCREEN-INTENSIFIED = '1'.
         MODIFY SCREEN.
      ENDLOOP.
    <i><b>The addition MODIF ID XYZ to the key word SELECT-OPTIONS assigns all fields of the selection option NAME to a group you can read in the field SCREEN-GROUP1 . At PBO of the selection screen, all these fields are then set to highlighted.
    </b></i>
    check these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/10/e7dbde82ba11d295a40000e8353423/content.htm
    Reward all helpfull answers
    Regards
    Pavan

  • Hiding Screen fields in a Report selection screen

    Hi Experts,
    I have a requirement to hide/disable  screen fields in a report selection screen when the user clicks on some radio buttons .
    Here is the scenario,
    1) There are 4 radio buttons four radiobuttons in one group on the selection screen:--  
    Block no:1
    PARAMETER: r_not  TYPE c RADIOBUTTON GROUP a1 DEFAULT 'X'.
    PARAMETER: r_prgs TYPE c RADIOBUTTON GROUP a1.
    PARAMETER: r_remv TYPE c RADIOBUTTON GROUP a1.
    PARAMETER: r_noresp TYPE c RADIOBUTTON GROUP a1.
    2) Based on the user clicking/selecting the radio buttons no.2,3 nad 4 i need to hide some fields in the other selection block
    in the selection screen.The parameters are as follows:
    Block no:2( These fields need to be hidden/disabled)
    PARAMETER: r_occ(3) TYPE c OBLIGATORY DEFAULT '1'.
    PARAMETER: r_and TYPE c RADIOBUTTON GROUP g1.
    PARAMETER: r_or  TYPE c RADIOBUTTON GROUP g1.
    PARAMETER: r_days(3) TYPE c OBLIGATORY DEFAULT '1'.
    Thanks

    Contd.....
    AT SELECTION-SCREEN.
      CASE SSCRFIELDS-UCOMM.   
          "When Customer button is clicked set flag 1
        WHEN 'FC01'.
          L_FLAG = '1'.
          "When Sales Order button is clicked set flag 2
        WHEN 'FC02'. "Sales order
          L_FLAG = '2'.
          "When Execute button is clicked set flag 4
        WHEN OTHERS.
          L_FLAG = '4'.
      ENDCASE.
    AT SELECTION-SCREEN OUTPUT.
    CASE L_FLAG.
        WHEN '1'.  "When Customer button is clicked
          LOOP AT SCREEN.
            "Set the Production and Customer Block as inactive
            IF  SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL3'.
              SCREEN-ACTIVE = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        WHEN '2'. "When Sales Order button is clicked
          LOOP AT SCREEN.
            "Set the Production and Customer Block as inactive
            IF  SCREEN-GROUP1 = 'BL1' OR SCREEN-GROUP1 = 'BL2'.
              SCREEN-ACTIVE = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        WHEN '3'.   "When Refresh button is clicked
          LOOP AT SCREEN.
            "Set the all Blocks as active
           IF  SCREEN-GROUP1 = 'BL2' OR SCREEN-GROUP1 = 'BL3' OR SCREEN-GROUP1 = 'BL1'.
              SCREEN-ACTIVE = '1'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        WHEN OTHERS."When Execute button is clicked
          "Set the Sales order and Customer Block as inactive
          LOOP AT SCREEN.
            IF  SCREEN-GROUP1 = 'BL2' OR SCREEN-GROUP1 = 'BL3'.
              SCREEN-ACTIVE = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDFORM.      

  • Passing the values from one selection screen to another report

    Hi all,
    This is my requirement...
    I need to hav a selection screen with various input parameter along with 3 radio buttons...
    If i enter the values and select say first radiobutton the corresponding called program needs to be executed .
    NOTE :
    1)The called program selection screen needs to be skipped
    2) the values entered in the calling program needs to be passed to the called program and the output of the called program needs to be displayed.
    3)the selection screen is the same for both calling and called program
    Can anyone plz help in this regard?
    Regards,
    Gowri Shankar

    Hi...
    Use the statement
    <b>SUBMIT zps_called_report WITH SELECTION-TABLE seltab.</b>
    see the following link....
    <b>http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm</b>
    Hope it helps you...
    Let me know if u have any more doubt...
    Reward points if useful......
    Suresh.......

  • F4 Help for the selection screen field

    Hi Gurus,
    I have to display F4 help for a selection screen field. i am using following code:
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
             EXPORTING
                  retfield        = 'CODE'
                  dynpprog        = lw_repid
                  dynpnr          = sy-dynnr
                  VALUE_ORG       = 'S'
             TABLES
                  value_tab       = gi_text
                 field_tab       = li_fields_tab
                  return_tab      = pi_return_tab
             EXCEPTIONS
                  parameter_error = 1
                  no_values_found = 2
                  OTHERS          = 3.
    My internal table gi_emp has two fields CODE & TEXT. When i select 1 particular value, it returns the CODE value in the pi_return_tab table.
    But my requirement is i have to capture the corresponding TEXT value for the Returned CODE. Ex: following is the F4 help being displayed: -
    001    test
    001    test1
    but is i select code 001(First Value), i also need to capture it's corresponding Text value. In return table pi_return_tab i have only Code value.
    Please help me out.
    Note: Based on return code i can't search into the internal table gi_code, because as shown in the example, code has multiple text.

    Sachin,
    I think this is what you need. The following code will return the key and the text (OR any other columns), if both columns are in the selection screen the selected values (both columns) will also be passed to the corresponding parameters. If you only need the text to be in the return table and not passed to the selection screen then set the parameter for text with NO-DISPLAY option.
    REPORT zktest01 .
    DATA :
      BEGIN OF value_tab OCCURS 0,
        field  LIKE e070-trkorr,
        text   LIKE e07t-as4text,
      END OF value_tab.
    DATA: t_fldtab LIKE dfies OCCURS 0 WITH HEADER LINE,
          t_rettab LIKE ddshretval OCCURS 0 WITH HEADER LINE,
          t_dynmap LIKE dselc OCCURS 0 WITH HEADER LINE.
    PARAMETERS : p_field  LIKE value_tab-field,
                 p_text   LIKE value_tab-text. "NO-DISPLAY.
    INITIALIZATION.
      t_fldtab-tabname   = 'VALUE_TAB'.
      t_fldtab-fieldname = 'FIELD'.
      t_fldtab-langu     = 'E'.
      t_fldtab-position  = 1.
      t_fldtab-offset    = 0.
      t_fldtab-fieldtext = 'Key'.
      t_fldtab-reptext   = 'Key'.
      t_fldtab-leng      = 20.
      t_fldtab-intlen    = 20.
      t_fldtab-outputlen = 20.
      t_fldtab-datatype  = 'CHAR'.
      t_fldtab-inttype   = 'C'.
      t_fldtab-headlen   = 20.
      t_fldtab-keyflag   = 'X'.
      t_fldtab-lowercase = ' '.
      APPEND t_fldtab.
      t_fldtab-tabname   = 'VALUE_TAB'.
      t_fldtab-fieldname = 'TEXT'.
      t_fldtab-position  = 2.
      t_fldtab-offset    = 20.
      t_fldtab-fieldtext = 'Text'.
      t_fldtab-reptext   = 'Text'.
      t_fldtab-leng      = 60.
      t_fldtab-intlen    = 60.
      t_fldtab-outputlen = 60.
      t_fldtab-headlen   = 60.
      t_fldtab-keyflag   = ' '.
      t_fldtab-lowercase = ' '.
      APPEND t_fldtab.
      value_tab-field = '101'.
      value_tab-text = 'dddd'.
      APPEND value_tab.
      value_tab-field = '202'.
      value_tab-text = 'aaaa'.
      APPEND value_tab.
      t_dynmap-fldname = 'FIELD'.
      t_dynmap-dyfldname = 'P_FIELD'.
      APPEND t_dynmap.
      t_dynmap-fldname = 'TEXT'.
      t_dynmap-dyfldname = 'P_TEXT'.
      APPEND t_dynmap.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_field.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'FIELD'
                dynpprog        = 'ZKTEST01'
                dynpnr          = '1000'
                dynprofield     = 'P_FIELD'
                value_org       = 'S'
           TABLES
                field_tab       = t_fldtab
                value_tab       = value_tab
                return_tab      = t_rettab
                dynpfld_mapping = t_dynmap
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc EQ 0.
      ENDIF.
    START-OF-SELECTION.
    Jeffrey Satriadi

  • Selection-screen design

    Hi everyone,
    I am working on a project for which I have to design a selection-screen.
    The requirement is such that there are 3 obligatory fields to be filled by the user, which are as follows:
    P_LAUFD(parameter,obligatory-date),
    P_LAUFI(parameter,obligatory-id),
    P_FILENM(parameter,obligatory-filename),
    P_LOKAAL(checkbox).
    The requirement is such that when the user does not check the checkbox the search help for P_FILENM should show the files from the application server,and when it is checked the files from the presentation server should be shown.
    The code that I have written is listed below, but there is  a problem with it.
    When I don't enter  anything in the first 2 fields, the search field for the 3rd field functions as required, but if I first enter something in the first 2 fields and then click on the checkbox, the search help for P_FILENM does not function as reaquired.
    Please advise.
    Also if possible could you'll  kindly   explain the sequence of events that is getting triggered?
    *&  Include           Z6890_PROJINCLUDE_SEL_SCREEN                     *
    TABLES : SSCRFIELDS.
    DATA: FILE LIKE DXFIELDS-LONGPATH.
    DATA V_FILENAME LIKE IBIPPARMS-PATH.
    DATA: TMP TYPE SSCRFIELDS-UCOMM.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_LAUFD TYPE  D OBLIGATORY,
                P_LAUFI(6) TYPE C OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: P_FILENM(128) TYPE C OBLIGATORY.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    PARAMETER: P_LOKAAL AS CHECKBOX USER-COMMAND SRC.
    SELECTION-SCREEN COMMENT 35(6) TEXT-003.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-004.
    PARAMETERS: P_DEL(2) TYPE C .
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(12) TEXT-005 FOR FIELD P_APPL.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS:  P_APPL(3) TYPE C.
    SELECTION-SCREEN POSITION 37.
    PARAMETERS: P_APDESC(40) TYPE C.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: P_MKDT(8) TYPE N,
                P_NOINV(6) TYPE N.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(12) TEXT-006 FOR FIELD P_TOAMNT.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: P_TOAMNT(13) TYPE N.
    SELECTION-SCREEN POSITION 47.
    PARAMETERS: P_TEKEN(1) TYPE C.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: P_DESC(60) TYPE C.
    SELECTION-SCREEN END OF BLOCK B3.
    ***********************************************************************************************REPORT  Z6890_PROJ_REPORT_DRAFT                 .
    DATA: BEGIN OF GW_LINE,
          TEXT(700) TYPE C,
          END OF GW_LINE.
    DATA: GIN_FILE LIKE TABLE OF GW_LINE.
    INCLUDE Z6890_PROJINCLUDE_SEL_SCREEN.
    AT SELECTION-SCREEN.
      CASE SY-UCOMM.
        WHEN  'EXEC'.
          IF P_LOKAAL = 'X'.
            PERFORM MV_DATA_FRM_PRES_INT .
          ELSE.
            PERFORM OPEN_FILE_ONAPP_SERVER.
          ENDIF.
          LOOP AT SCREEN.
            IF SCREEN-NAME = 'P_DEL'.
              SCREEN-INPUT = 0.
              SCREEN-OUTPUT = 1.
              P_DEL = 'HI'.
            ENDIF.
            IF SCREEN-NAME = 'P_APPL'.
              SCREEN-INPUT = 0.
              SCREEN-OUTPUT = 1.
              P_APPL = 'CHF'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
      ENDCASE.
    AT SELECTION-SCREEN  OUTPUT.
      SET PF-STATUS 'PROJ'.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'P_DEL'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_APPL'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_APDESC'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_MKDT'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_NOINV'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_TOAMNT'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_TEKEN'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        IF SCREEN-NAME = 'P_DESC'.
          SCREEN-INPUT = 0.
          SCREEN-OUTPUT = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAUFD.
      CALL FUNCTION 'F4_DATE'
       EXPORTING
         DATE_FOR_FIRST_MONTH               = SY-DATUM
         DISPLAY                            = ' '
        FACTORY_CALENDAR_ID                = ' '
        GREGORIAN_CALENDAR_FLAG            = ' '
        HOLIDAY_CALENDAR_ID                = ' '
        PROGNAME_FOR_FIRST_MONTH           = ' '
       IMPORTING
         SELECT_DATE                        = P_LAUFD
        SELECT_WEEK                        =
        SELECT_WEEK_BEGIN                  =
        SELECT_WEEK_END                    =
      EXCEPTIONS
        CALENDAR_BUFFER_NOT_LOADABLE       = 1
        DATE_AFTER_RANGE                   = 2
        DATE_BEFORE_RANGE                  = 3
        DATE_INVALID                       = 4
        FACTORY_CALENDAR_NOT_FOUND         = 5
        HOLIDAY_CALENDAR_NOT_FOUND         = 6
        PARAMETER_CONFLICT                 = 7
        OTHERS                             = 8
      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 P_FILENM.
      IF TMP = SSCRFIELDS-UCOMM.
        CLEAR SSCRFIELDS-UCOMM.
        CLEAR TMP.
      ELSE.
        SSCRFIELDS-UCOMM = 'SRC'.
      ENDIF.
      CASE SSCRFIELDS-UCOMM.
        WHEN 'SRC'.
          TMP = SSCRFIELDS-UCOMM.
          CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
    EXPORTING
       PATHNAME               =
               CHANGING
                 PATHFILE               = V_FILENAME
             EXCEPTIONS
               CANCELED_BY_USER       = 1
       SYSTEM_ERROR           = 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.
            IF SY-SUBRC = 1.
              MESSAGE I000(Z6890_PROJ) .
            ENDIF.
          ENDIF.
          P_FILENM = V_FILENAME.
          CLEAR SSCRFIELDS-UCOMM.
        WHEN OTHERS.
          CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
               EXPORTING
                 I_LOCATION_FLAG       = 'A'
                 I_SERVER              = 'ides47_i47_00'
                 I_PATH                = 'D:\usr\sap\'
                 FILEMASK              = '.'
                 FILEOPERATION         = 'R'
               IMPORTING
          O_LOCATION_FLAG       =
          O_SERVER              =
                 O_PATH                = FILE
          ABEND_FLAG            =
        EXCEPTIONS
          RFC_ERROR             = 1
          ERROR_WITH_GUI        = 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.
          P_FILENM = FILE.
         CLEAR SSCRFIELDS-UCOMM.
      ENDCASE.
    *&      Form  MV_DATA_FRM_PRES_INT
          text
    -->  p1        text
    <--  p2        text
    FORM MV_DATA_FRM_PRES_INT .
      DATA: F_NAME TYPE STRING.
      F_NAME = P_FILENM.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = F_NAME
         FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = GIN_FILE
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF SY-SUBRC = 1.
       LEAVE TO LIST-PROCESSING.
       WRITE: / 'Error: File could not be opened!'.
        MESSAGE I001(Z6890_PROJ) WITH P_FILENM.
      ENDIF.
      BREAK-POINT.
    ENDFORM.                    " MV_DATA_FRM_PRES_INT
    *&      Form  OPEN_FILE_ONAPP_SERVER
          text
    -->  p1        text
    <--  p2        text
    FORM OPEN_FILE_ONAPP_SERVER  .
    ENDFORM.

    Hi Piyush,
    Add the below code in your program.
    *Note: you have to take two parameters for files.
    If you select check box then p_pc parameter is visible.
    if you dont select check box then p_app parameter is visible.
    PARAMETERS: p_chk1 AS CHECKBOX USER-COMMAND rusr.
    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS: p_pc  LIKE rlgrap-filename MODIF ID abc.
    PARAMETERS: p_app LIKE rlgrap-filename MODIF ID def.
    SELECTION-SCREEN: END OF BLOCK blk1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'ABC'.
          CLEAR: p_pc, p_app.
          IF p_chk1 = 'X'.
            screen-active = 1.
          ELSE.
            screen-active = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
        IF screen-group1 = 'DEF'.
          CLEAR: p_pc, p_app.
          IF p_chk1 <> 'X'.
            screen-active = 1.
          ELSE.
            screen-active = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_app.
      PERFORM get_fname_app.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pc.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_pc.
    *&      Form  get_fname_app
          text
    FORM get_fname_app.
      DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',
      search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
      file_path LIKE dxfields-longpath.
      CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
        EXPORTING
          i_location_flag = 'A'
          i_server        = ' '
          i_path          = search_dir
          filemask        = c_fnh_mask
          fileoperation   = 'R'
        IMPORTING
          o_path          = file_path
        EXCEPTIONS
          rfc_error       = 1
          OTHERS          = 2.
      IF sy-subrc EQ 0.
        p_app = file_path.
      ENDIF.
    ENDFORM.                    "get_fname_app

Maybe you are looking for