F4 help for a selection screen parameter with filename created dynamically

Hi All,
          I have a requirement where in an F4 help should be present for a selection screen parameter. After selecting the filepath and clicking OK button on the Dialog, the filename should be dynamically get created in the selection screen parameter field. For example:
if the path is D:\DOCS then at the end of DOCS the filename should automatically get populated.
Like below string:
D:\DOCS\new.txt
Is there any function module or method which does this kind of activity.
Thanks in advance,
Deepak

this code will help:
FORM get_filename  CHANGING p_filename.
  DATA      : lv_filename  TYPE string,
              lv_rc TYPE i,
              li_filetable TYPE filetable.
  CONSTANTS : lc_fname TYPE string VALUE 'ZRPP4000.XLS',
              lc_fpath TYPE string VALUE 'C:\',
              lc_extn TYPE string VALUE 'XLS'.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      default_filename        = lc_fname
      initial_directory       = lc_fpath
      default_extension       = lc_extn
    CHANGING
      file_table              = li_filetable
      rc                      = lv_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
IF  sy-subrc = 0 .
    READ TABLE li_filetable INTO lv_filename INDEX 1.
    IF sy-subrc = 0.
      p_filename = lv_filename.
    ENDIF.
  ENDIF.
  REFRESH li_filetable.
  CLEAR:lv_filename.
ENDFORM.                    "get_filename
" p_filename is selection screen parameter

Similar Messages

  • Can we create serach help for a selection screen field

    Can we create serach help for a selection screen field with out creating searchhelp object.
    I mean is it possible to create serchelp in the program itself with some specific values i want to give.
    E.g say we can define any internal table and fill it with values and using that into selection screen fields
    Regards
    Mave

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR paymeth.
      PERFORM PAYMENT_HELP.
    FORM PAYMENT_HELP.
      DATA: begin of DESCR_TAB occurs 0,
            DESCR LIKE BKPF-BKTXT,
            END OF DESCR_TAB.
      DATA: gd_repid like sy-repid.
      gd_repid = sy-repid.
      DESCR_TAB-DESCR = 'aaaaa'.
      append DESCR_TAB.
      DESCR_TAB-DESCR = 'bbbbb'.
      append DESCR_TAB.
      DESCR_TAB-DESCR = 'ccccc'.
      append DESCR_TAB.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'DESCR'
                DYNPPROG    = gd_repid
                DYNPNR      = '1000'
                DYNPROFIELD = 'paymeth'
                VALUE_ORG   = 'S'
                DISPLAY     = ' '
           TABLES
                value_tab   = DESCR_TAB.
    endform.
    Svetlin

  • 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

  • Input help for a selection screen field

    I have a selection screen with field species and checkoff activity .
    For a given species('sc','sb' or 'ss') , the input values allowed for the
    check off activity must be 'SCCK' for species 'SC' ,'SBCK' for species 'SB' and so on.
    I need to provide input help for check off activity based on the value of the species.How do i do that?

    PARAMETER : p_val(10) TYPE c ,
                p_val2(10) TYPE c.
    AT SELECTION-SCREEN on p_val.
      IF p_val = 'SC'.
        p_val2 = 'SCCK'.
      ENDIF.

  • To fill selection screen parameter with user's parameter id

    Hi,
    I need to display PLANT on the selection screen of a report as SELECT-OPTIONS.
    When launching the transaction for the report, the program must fill the PLANT by default with the user's own parameter id (WRK) .
    How can it be done?
    Regards
    Nishant

    HI nishant,
    in INITIALIZATION EVENT.
    1. first get the parameter id value
       in some variable of type plant.
       (eg p1)
    2. then (suppose the select option name is myplant)
      MYPLANT-SIGN = 'I'.
      MYPLANT-OPTION = 'EQ'.
      MYPLANT-LOW =  p1 . "<---- from above variable in point 1
    APPEND MYPLANT.
    regards,
    amit m.

  • F4 help for the selection screen field designed in screen painter

    Hi all,
    I have designed selection screen in the screen painter. in that for one of the fields i have to give f4 help. for that i have writter the code in PAI event. in this event i have used the standard Function module for f4 help. but no f4 help is comming for that field. can any body suggest what i have to do.
    Thanks & Regards,
    Giri.

    Hi,
    You must use the correct event to meet ur requirement use  POV event instead of  PAI event.
    for more clarification and example program see  below the demo program
    DEMO_DYNPRO_F4_HELP_DYNPRO
    DEMO_DYNPRO_F4_HELP_MODULE
    Cheers
    fareed

  • F4 HELP FOR ONLY SELECTED FIELD VALUES

    Hi,
    I have to display the F4 help for the selection screen field parameter. From the ICON table, I need to display the field ID values. In the ICON table, I have lot of field values for the field ID, but I need to display only 3 field values into F4 help.(like say @07@, @08@, @0A@ only at the F4 help).
    Thanks in advance.
    Regards
    Ramesh mavilla.

    Hi,
    See the follwoing code example
    REFRESH: I_DYNPREAD .
    CLEAR : I_DYNPREAD .
    I_DYNPREAD-FIELDNAME = 'P_KAPPL'.
    APPEND I_DYNPREAD.
    CLEAR I_DYNPREAD.
    L_REPID = SY-REPID .
    L_DYNNR = '1000' .
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = L_REPID
    DYNUMB = L_DYNNR
    TABLES
    DYNPFIELDS = I_DYNPREAD.
    IF SY-SUBRC EQ 0.
    READ TABLE I_DYNPREAD INDEX 1.
    P_KAPPL = I_DYNPREAD-FIELDVALUE.
    ENDIF.
    REFRESH: I_DYNPREAD .
    CLEAR : I_DYNPREAD .
    REFRESH: I_KSCHL.
    TRANSLATE P_KAPPL TO UPPER CASE.
    TRANSLATE P_KVEWE TO UPPER CASE.
    SELECT KAPPL KVEWE KSCHL VTEXT FROM T685T
    INTO CORRESPONDING FIELDS OF TABLE I_KSCHL
    WHERE KAPPL = P_KAPPL
    AND KVEWE = P_KVEWE
    AND SPRAS = 'EN'.
    IF SY-SUBRC <> 0.
    MESSAGE E001(ZZ) WITH 'No Condition Type exist for Application'.
    *p_kappl ' and Usage' p_kvewe.
    ELSE.
    REFRESH: I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KAPPL'.
    I_FIELDS-SELECTFLAG = ''.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KVEWE'.
    I_FIELDS-SELECTFLAG = ''.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KSCHL'.
    I_FIELDS-SELECTFLAG = 'X'.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'VTEXT'.
    I_FIELDS-SELECTFLAG = ' '.
    APPEND I_FIELDS.
    CLEAR: V_SEL.
    CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'
    EXPORTING
    CUCOL = 0
    CUROW = 0
    DISPLAY = ' '
    SELECTFIELD = 'KSCHL'
    TITEL = 'Cond Type'
    IMPORTING
    IND =
    SELECT_VALUE = V_SEL
    TABLES
    FIELDS = I_FIELDS
    FULL_TABLE = I_KSCHL
    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. "SY-SUBRC.
    And also go throw the link which it clears more about F4
    Check the link below for creating collective search help
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
    Check the ink below for creating elementary search help
    http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm
    <b>Reward with points if helpful.</b>
    Regards,
    Vijay

  • Selection screen parameter validation using search help/check table

    Hi experts,
    I have a select-option that is tied to a search help and check table (type tq80-qmart). Is there a way to automatically validate the field based on what comes up in the F4 search help? What I mean is, when the user hits F4 on the parameter, the list pops up with several records that the user can choose. When the program is executed, I want the program to show an error if the value is NOT in that F4 list.
    I know this can be done in AT SELECTION SCREEN event with a select, but I was wondering if there was a way ABAP does it automatically. Any help will be greatly appreciated.
    Thanks,
    Juan

    Hello Juan,
    SAP does have a standard way of allowing the the user to select from the list via LISTBOX.
    But list box is restricted to parameters only, you cannot attach list boxes to select-options.
    I think the best place to do this validation would be th AT SELECTION-SCREEN event & from your original post it seems you know what code to write

  • One search help for multiple select-options in webdynpro abap

    Hi,
    I need a way to use one search help for multiple select-options fields. My scenario is :
    I have a table for keeping different organizational units' values of different systems. I have pasted some sample data from this table at the end of this mail. On the screen I want to have 1 select-options filed for werks, and 1 select-options filed for vkorg. (In fact I will have more org. unit fields...) In the beginning of my application the user will select sid.
    If the user selects ADS as SID, when he opens search-help for the first org. unit (werks), he will see the records with SID: ADS, VARBL = $WERKS, LANGU = SY-LANGU.
    If the user selects AGT as SID, when he opens search-help for the second org. unit (vkorg), he will see the records with SID: AGT, VARBL = $VKORG, LANGU = SY-LANGU.
    I have created a search-help taking SIDD, VARBL and LANGU as import parameters; used field mapping and bound this search help to my table. I have created 2 context nodes : org1 and org2 having attributes SID, VARBL, VALUE, LANGU .
    I have assigned related SID, VARBL and Langu values to these attributes at runtime as I needed. That way, if I use input field and reference to the related context attributes org1-value and org2-value2 accordingly, search help works well as I want.
    However, when I use select-options field , I can not bind the field to the context data. I can give reference only to ddic structure. Is there any way to reference to a context attribute? I searched for this in SDN, but could find nothing.
    I think I won't be able to use this way. What do you say?
    As I read from forums maybe using OVS help will be suitable for me. But I have to use one search-help for all select-options fields. Do you know how I can determine the active select-options field and pass its name (for instance "werks" ) as parameter to this OVS search help. (Also I'll pass SID and LANGU.)
    MY TABLE (ZBYYT080) CONTENTS:
    SID     VARBL     VALUE     LANGU     VTEXT
    ADS     $WERKS     1     T     Werk 0001
    ADS     $WERKS     11     T     OZYAS  GIDA URETIM YERI
    ADS     $WERKS     5501     T     BOYA GEBZE FABRİKASI
    ADS     $WERKS     5502     T     BOYA CIGLI FABRİKASI
    AGT     $WERKS     2301     T     KAMLI DAMIZLIK
    AGT     $WERKS     9601     T     PANAR DENIZ URETIM YERI
    ADS     $VKORG     22     T     AA KİMYASALLAR
    ADS     $VKORG     8001     T     İINSAAT BOYALARI
    AGT     $VKORG     6500     T     DAMk St.Org
    AGT     $VKORG     5400     T     PANAR St.Org.
    I wish I'm clear enough..
    I will be gald if someone answers me as soon as possible...
    Thanks İn advance..
    MERAL

    Hi,
    Your ques is how to refer to a DDIC search help to refer to selection screen parameter ?
    Am I right ?
    If Yes, then in the interface IF_WD_SELECT_OPTIONS
    method ADD_SELECTION_FIELD, ADD_PARAMETER_FIELD etc
    have importing param like I_VALUE_HELP_TYPE and  I_VALUE_HELP_ID, I_VALUE_HELP_MODE, I_VALUE_HELP_STRUCTURE
    etc which may help you to link your create DDIC Search help to selection screen params.
    this is just a clue from my side. I haven't tried it myself.
    You can go to the where used list of this method and find some sample implementations which use these params.
    Hope this helps.
    Regards
    Manas Dua

  • How to put a value in a selection screen parameter

    how do i forcefully put a value to a field in the selection screen.
    i mean during runtime.
    and it's a parameter not a selection-option.
    thanks

    Hi,
    Check this sample code.It can help you.Basically you need to use 'DYNP_VALUES_READ' in at selection-screen on value-request for s_posnr-low.
    tables : vbap.         " Sales Document: Item Data
                         Constant Declaration                                      *
    CONSTANTS:
      C_X TYPE C VALUE 'X'.     " Translate to Uppercase
                         Variable Declaration                                      *
    Variable for Table index
      data v_sytabix like sy-tabix.
    Variable for Program name
      data L_NAME LIKE SYST-REPID.
    Range for getting values form selection screen
    DATA: BEGIN OF range1 OCCURS 0,
             SIGN(1),
             OPTION(2),
             LOW  LIKE vbap-vbeln,
             high like vbap-vbeln,
          END OF range1.
    Internal table for Report output
      data: begin of i_vbap occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of i_vbap.
    Internal table for output to the F4 help
      data: begin of I_DISPLAY occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of I_DISPLAY.
    Internal table for return value form function module
      DATA: BEGIN OF I_RETURNVAL OCCURS 0.
              INCLUDE STRUCTURE DDSHRETVAL.     " Interface Structure Search
      DATA: END OF I_RETURNVAL.
    Internal table for F4 help field heading
      DATA: I_FIELDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.
    Internal table for getting screen values from selection screen
      data L_SCR_FIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME title text-001.
      select-options:
            S_VBELN for vbap-vbeln no intervals,
            S_POSNR for vbap-posnr no intervals.
    SELECTION-SCREEN end OF BLOCK B1.
    at selection-screen on value-request for s_posnr-low.
      clear: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      refresh: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      L_NAME = SYST-REPID.
      MOVE 'S_VBELN-LOW' TO L_SCR_FIELDS-FIELDNAME.
      APPEND L_SCR_FIELDS.
    Call the Function module DYNP_VALUES_READ to get the values form
    selection screen
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME                         = L_NAME
          DYNUMB                         = SYST-DYNNR
          TRANSLATE_TO_UPPER             = C_X         " X
        TABLES
          DYNPFIELDS                     = L_SCR_FIELDS
       EXCEPTIONS
         INVALID_ABAPWORKAREA           = 1
         INVALID_DYNPROFIELD            = 2
         INVALID_DYNPRONAME             = 3
         INVALID_DYNPRONUMMER           = 4
         INVALID_REQUEST                = 5
         NO_FIELDDESCRIPTION            = 6
         INVALID_PARAMETER              = 7
         UNDEFIND_ERROR                 = 8
         DOUBLE_CONVERSION              = 9
         STEPL_NOT_FOUND                = 10
         OTHERS                         = 11
      IF SY-SUBRC eq 0.
        LOOP AT L_SCR_FIELDS.
          range1-sign = 'I'.
          range1-option = 'EQ'.
          range1-low = L_SCR_FIELDS-FIELDVALUE.
          range1-high = space.
          append range1.
        ENDLOOP.
      ENDIF.
    F4 help Field headings
      I_FIELDTAB-TABNAME = 'I_DISPLAY'.
      I_FIELDTAB-FIELDNAME = 'VBELN'.
      I_FIELDTAB-POSITION = '1'.
      I_FIELDTAB-OUTPUTLEN = '10'.
      I_FIELDTAB-INTTYPE = 'C'.
      I_FIELDTAB-INTLEN = '10'.
      APPEND I_FIELDTAB.
      I_FIELDTAB-FIELDNAME = 'POSNR'.
      I_FIELDTAB-POSITION = '2'.
      I_FIELDTAB-OFFSET = '10'.
      I_FIELDTAB-OUTPUTLEN = '6'.
      I_FIELDTAB-INTTYPE = 'N'.
      I_FIELDTAB-INTLEN = '6'.
      APPEND I_FIELDTAB.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                   into table i_display
                   where vbeln in range1.
    Call the function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD               = 'POSNR'
          WINDOW_TITLE           = 'Line Item'
          VALUE_ORG              = 'S'
          MULTIPLE_CHOICE        = C_X           " (for muliple selection)
        TABLES
          VALUE_TAB              = I_DISPLAY
          FIELD_TAB              = I_FIELDTAB
          RETURN_TAB             = I_RETURNVAL
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 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.
      ELSE.
    Star for For single values
      READ TABLE I_RETURNVAL INDEX 1.
       S_POSNR-LOW = I_RETURNVAL-FIELDVAL.
    End for the single values
    Start For multiple selection
       loop at i_returnval.
         s_posnr-sign = 'I'.
         s_posnr-option = 'EQ'.
         s_posnr-low = I_RETURNVAL-FIELDVAL.
         append s_posnr.
       endloop.
       sort s_posnr.
       read table s_posnr index 1.
    End for multiple selection
      ENDIF.
                         Start-of-selection                                        *
    start-of-selection.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                        into table i_vbap
                        where vbeln in s_vbeln
                          and posnr in s_posnr.
    if the above selection is successful continue the process else exit *
    form the report
      if sy-subrc ne 0.
       message e002 with 'No data to display'.
      endif.
    end-of-selection.
      if not i_vbap[] is initial.
        loop at i_vbap.
          write:/ i_vbap-vbeln, i_vbap-posnr.
        endloop.
      endif.

  • Help on a selection screen

    I need some help on a selection screen.  I have the following:
    SELECTION-SCREEN: BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
    PARAMETERS:       p_bldat TYPE bkpf-bldat OBLIGATORY DEFAULT sy-datum,
                      p_budat TYPE bkpf-budat OBLIGATORY DEFAULT sy-datum,
                      p_xref1 TYPE proj-pspid OBLIGATORY,
                      p_bktxt TYPE bkpf-bktxt,
                      p_bukrs TYPE bkpf-bukrs OBLIGATORY DEFAULT '1100',
                      p_waers TYPE bkpf-waers OBLIGATORY DEFAULT 'USD'.
    SELECTION-SCREEN: END OF BLOCK a1.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:       p_lifnr TYPE ekko-lifnr OBLIGATORY,
                      p_ebeln TYPE ekko-ebeln OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK c1 WITH FRAME TITLE text-003.
    PARAMETERS:       p_amt TYPE wrbtr,
                      p_ret  TYPE wrbtr.
    SELECTION-SCREEN: END OF BLOCK c1.
    SELECTION-SCREEN: BEGIN OF BLOCK d1 WITH FRAME TITLE text-004.
    PARAMETERS:       p_cmode  TYPE callmode DEFAULT 'N' OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK d1.
    AT SELECTION-SCREEN ON p_ebeln.
      SELECT SINGLE kwert INTO p_ret FROM zretention WHERE ebeln = p_ebeln AND ebelp = '00000' AND TYPE = 'C'.
      IF NOT sy-subrc = 0 OR p_ret IS INITIAL.
        CONCATENATE 'Purchase Order' p_ebeln 'does not have any retention available for release!' INTO d_string.
        MESSAGE d_string TYPE 'E'.
      ENDIF.
    AT SELECTION-SCREEN.
      check p_ret is not INITIAL.
      IF p_amt > p_ret.
        MESSAGE 'Amt. To Be Released is more than the remaining retention. Please check your input.' TYPE 'E'.
      ELSEIF p_amt IS INITIAL.
        MESSAGE 'Amt. To Be Released is required. Please check your input.' TYPE 'E'.
      ENDIF.
    What I want is for the parameter p_ret to be populated when the user inputs a PO (p_ebeln).  This seems to work except I want this to be brought in without running through the other checks (AT SELECTION-SCREEN).  In order to bring in p_ret I am having to hit ENTER which will trigger the event AT SELECTION-SCREEN.
    How can I bring in p_ret without triggering the event AT SELECTION-SCREEN?
    Regards,
    Davis

    In this case.
    If you don't want at selection-screen to be triggered on hitting enter, you can give an if condition in at selection-screen.
    tables : sscrfields.
    AT SELECTION-SCREEN ON p_ebeln.
      SELECT SINGLE kwert INTO p_ret FROM zretention WHERE ebeln = p_ebeln AND ebelp = '00000' AND TYPE = 'C'.
      IF NOT sy-subrc = 0 OR p_ret IS INITIAL.
        CONCATENATE 'Purchase Order' p_ebeln 'does not have any retention available for release!' INTO d_string.
       clear sscrfield-ucomm.
        MESSAGE d_string TYPE 'E'.
      ENDIF.
    AT SELECTION-SCREEN.
    if sscrfields-ucomm = 'ONLI'.
      check p_ret is not INITIAL.
      IF p_amt > p_ret.
        MESSAGE 'Amt. To Be Released is more than the remaining retention. Please check your input.' TYPE 'E'.
      ELSEIF p_amt IS INITIAL.
        MESSAGE 'Amt. To Be Released is required. Please check your input.' TYPE 'E'.
      ENDIF.
    endif.
    The code in at selection-screen is executed only when user presses F8. on pressing 'Enter' it will not be executed.
    Hope this helps you.
    Regards,
    Siddarth

  • Error in search help button at selection-screen

    hi all,
    i have a small issue.
    i have created a seach help button in selection screen .
    my code is as bellow.
    TYPES: BEGIN OF ty_ZSD_SNID,
           KUNNR TYPE KUNNR,
           BAREA TYPE WERKS_D,
          END OF ty_ZSD_SNID.
    DATA : it_z TYPE STANDARD TABLE OF ty_ZSD_SNID.
    selection-screen : begin of block b with frame title text-000.
    select-options : skunnr for zsd_snid-kunnr.
    parameters :     pbarea like zsd_snid-barea obligatory.
    selection-screen : end of block b.
    INITIALIZATION.
      SELECT KUNNR BAREA FROM ZSD_SNID INTO TABLE it_z.
      SORT it_z BY BAREA KUNNR.
      DELETE ADJACENT DUPLICATES FROM it_z COMPARING BAREA KUNNR.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SKUNNR-low.
      IF it_z[] IS NOT INITIAL.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
                 EXPORTING
              DDIC_STRUCTURE         = ' '
                   retfield               = 'KUNNR'  " data base table field name
              PVALKEY                = ' '
                  dynpprog               = sy-repid " program name
                  dynpnr                 = sy-dynnr          "screen name
                  dynprofield            = 'SKUNNR-LOW'  " layot field name
              STEPL                  = 0
              WINDOW_TITLE           =
              VALUE                  = ' '
                  value_org              = 'S'
              MULTIPLE_CHOICE        = ' '
              DISPLAY                = ' '
              CALLBACK_PROGRAM       = ' '
              CALLBACK_FORM          = ' '
              MARK_TAB               =
            IMPORTING
              USER_RESET             =
                 TABLES
                   value_tab              = it_z[]   " internal talble name
              FIELD_TAB              =
              RETURN_TAB             =
              DYNPFLD_MAPPING        =
            EXCEPTIONS
              PARAMETER_ERROR        = 1
              NO_VALUES_FOUND        = 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.
      ELSE.
        MESSAGE E000(zsdsn).
      ENDIF.
    my issue is , its working properly if records are there in my z table.
    if no records are there in the table then if i do comment the last message statement then its working.
    if i do uncomment like the above code, then its dumming.
    what i should i do ??
    kind regards

    closed because of no answer.

  • How to limit the search help in the selection screen?

    Hi All,
    I got a selection option in a selection screen,
    say SELECT-OPTIONS KSCHL FOR VAKE-KSCHL.
    I want to limit the output list of the search help of this field, e.g. 33 entries for a specific application and usage.
    What should I do ?
    Thz.

    Hi,
    U can check with these two
    <b>... NO-EXTENSION</b>
    Effect
    The user can only make an entry on one line. Calling the additional "Multiple Selection" screen is not supported and no pushbutton for this appears on the selection screen.
    Addition 12
    <b>... NO INTERVALS</b>
    Effect
    The selection option is displayed on the selection screen without a 'to' field. The pushbutton for calling the "Multiple Selection" screen appears immediately after the 'from' field.
    This addition thus allows you to generate a simplified display on the selection screen. This is particularly useful if you are not making any range selections for this selection option.
    Notes
    On the "Multiple Selection" screen, you can also enter ranges for selection options with "NO INTERVALS".
    By combining this addition with "NO-EXTENSION", you can restrict the user to entry of a single value for the selection option, but with the possibility of also choosing single value options like 'Greater than' or 'Less than or equal'.
    By using the addition " NO INTERVALS" with SELECTION-SCREEN BEGIN OF BLOCK, you can activate the simplified display for all selection options in a block.
    The function module SELECT_OPTIONS_RESTRICT allows you to restrict the set of selection options available for a SELECT-OPTION (for example, only single values and patterns, i.e. 'EQ' and 'CP' are allowed). You can also forbid the leading sign 'E' (= 'Exclude from selection'). This means that you can considerably restrict the selections which can be entered on the selection screen.
    Just now tried it out to limit the search help u have to use NO-EXTENSION.
    <b>Try this simple code.
    Tables: mara.
    SELECT-OPTIONS: s_matnr FOR MARA-matnr NO-EXTENSION.</b>
    Hope this helps.
    Kindly reward points and close the thraed if ur problem got solved.
    U havent rewarded any points?
    Message was edited by: Judith Jessie Selvi

  • F4 help in the selection screen from a int table

    I collected the datas from the function module. and the internal table is populated.
    the internal table contains manny fields.
    among these fields i need to take only one field and this field value to be used for F4 help in the selection screen ( not a dynpro)
    for example : in the selection screen
    I have to select the PO.
    based on the user i have filtered the PO. (determined dynamically by using the user name this i have done it)
    then i have to assign the PO the selection screen.
    which FM will be better to use  for this type of scenario and help me out with some example codes particularly for my req
    Thanks

    Hi ,
    use the FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    This example is for search help for material type .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mtart-low .
    select all material types you want to display in search help into table i_mtart.
    PERFORM select_material_type.
    PERFORM help_material_type.
    *& Form help_material_type
    text
    --> p1 text
    <-- p2 text
    FORM help_material_type .
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    retfield = 'MTART'
    PVALKEY = ' '
    dynpprog = sy-cprog
    dynpnr = sy-dynnr
    dynprofield = 'S_MTART-LOW'
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    value_org = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    value_tab = i_mtart
    FIELD_TAB =
    RETURN_TAB =
    DYNPFLD_MAPPING =
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 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.
    ENDFORM. " help_material_type
    Regards,
    Balaji.

  • Need a drop down for a selection screen

    HI all,
    I need a drop down for a selection screen.
    say for eg: Field is MARA-MTART   (Material Type). The selection is optional and the dropdown should be using check table: T134
    How to get a dropdown? I think a function module is used , but I dont remember the name.
    Kindly reply.
    Thanks in advance.
    Points will be rewarded

    Hi,
    chk the below code...
    TYPE-POOLS: vrm.
    PARAMETER: pr_spart TYPE spart AS LISTBOX VISIBLE LENGTH 7.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_spart.
    INITIALIZATION.
    *----Code for Drop down list....
      DATA: lit_spart_list  TYPE vrm_values, "Table for list of Divisions
              lwa_spart_list TYPE vrm_value,
              lw_name  TYPE vrm_id.            "Name of parameter with list-box.
    *---Assign selected values to table that would be passed to FM VRM_SET_VALUES
      CLEAR : lwa_spart_list,
              lw_name.
    *---Pass required values for list-box display.
      lwa_spart_list-key = 'H'.
      lwa_spart_list-text = 'HL'.
      APPEND lwa_spart_list TO lit_spart_list.
      lwa_spart_list-key = 'S'.
      lwa_spart_list-text = 'SL'.
      APPEND lwa_spart_list TO lit_spart_list.
      lwa_spart_list-key = 'P'.
      lwa_spart_list-text = 'PP'.
      APPEND lwa_spart_list TO lit_spart_list.
      lwa_spart_list-key = 'F'.
      lwa_spart_list-text = 'FR'.
      APPEND lwa_spart_list TO lit_spart_list.
    *Name of parameter to which list is to be assigned
      lw_name = 'PR_SPART'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = lw_name
          values          = lit_spart_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.
    Reagrds,
    nagaraj

Maybe you are looking for

  • How to get column value in grid View

    Hello My first Language is German so bear with my English FIRST vIEW THE SCREEN SHOT PLEASE I am new to asp.net  i am making small application to generate reports in which user give criteria just liek we do in sql server  i have two grid view in acco

  • TS3742 How do I resolve OS 10.8 kernal panics / crashes that occur most frequenly when waking up from sleep mode?

    I get a lot of gray screens of death on my MacBook Pro ever since I went to OS 10.8.  Never had issues with the 10.6 versions and now miss those days.  The kernal panics seem to occur most frequently just waking it up from sleep, regardless of where

  • Conversion Agent by Informatica - serializing mappers

    Hi Guys, I need to create a Conversion agent module (To be called with in Comm channel of XI). The module will be constructed of a parser and 2 mappers. 1st parser will parse a CSV file to XML. 2nd mapper will change the XML structure from non-hierar

  • MacBook Pro water damage

    MMy MacBook Pro was on my wet carpet for 8 hours on Monday and suffered water damage. Will it recover? I attached pics [IMG]http://i59.tinypic.com/10xqydc.jpg[/IMG] [IMG]http://i60.tinypic.com/2nu4zup.jpg[/IMG] [IMG]http://i61.tinypic.com/13zr32c.jpg

  • When doing a restore with Time Capsule, I get -8003 error; restoring nothing

    Hi, When doing a full restore with Time Capsule, I get -8003 error; restoring nothing. This happens with all recent backups. Also after doing a verify/repair of the TimeCapsule disk. This is a dissaster for my originals (my Ableton Live projects). I