Populating selection screen

Hi i have a requirement wherin i will select a value on the selection screen using F4 help and then based on the value selected some other fileds on the selection screen will get populated.
For this i am using the below code but somewhere i am going wrong.Can you please point out where i m going wrong.
AT SELECTION-SCREEN ON VALUE-REQUEST  FOR s_accno-low.
  PERFORM z_search_help.
FORM z_search_help .
  CLEAR:   inttab,
           fieldtab_rt,
           returntab.
  REFRESH:   inttab,
             fieldtab_rt,
             returntab.
  SELECT accountnumber customerid FROM zskd_tab INTO TABLE inttab WHERE accountnumber = lv_accno.
  fieldtab_rt-tabname = 'ZSKD_TAB'.
  fieldtab_rt-fieldname = 'ACCOUNTNUMBER'.
  APPEND fieldtab_rt.
fieldtab_rt-tabname = 'YHR_EPAY_PM_DE_HRBP_HELP'.
fieldtab_rt-fieldname = 'ZZENAME'.
APPEND fieldtab_rt.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
  DDIC_STRUCTURE         = ' '
      retfield               = 'ACCOUNTNUMBER'
  PVALKEY                = ' '
     dynpprog               = sy-cprog
     dynpnr                 = sy-dynnr
     dynprofield            = 'ACCOUNTNUMBER-LOW'
  STEPL                  = 0
  WINDOW_TITLE           =
  VALUE                  = ' '
     value_org              = 'S'
  MULTIPLE_CHOICE        = ' '
  DISPLAY                = ' '
  CALLBACK_PROGRAM       = ' '
  CALLBACK_FORM          = ' '
  MARK_TAB               =
IMPORTING
  USER_RESET             =
    TABLES
      value_tab              = inttab
    field_tab              = fieldtab_rt
    return_tab             = returntab
  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.
loop at returntab.
s_custno-sign = 'I'.
    s_custno-option = 'EQ'.
    s_custno-low = returntab-fieldval.
endloop.

Hi,
Please see the below code. In this example if you give carrid automatically connid and fldate will be filled.
PARAMETERS: carrid TYPE scarr-carrid ,
            connid TYPE spfli-connid,
            fldate TYPE sflight-fldate.
TYPES : BEGIN OF typ,
            carrid TYPE s_carr_id,
            connid TYPE s_conn_id,
            fldate TYPE sflight-fldate,
        END OF typ.
DATA : t_scarr TYPE TABLE OF typ,
      fs_scarr TYPE typ.
DATA : t_fill TYPE TABLE OF  dselc,
       fs_fill TYPE dselc,
       t_return_tab TYPE TABLE OF ddshretval,
       t_field_tab TYPE TABLE OF dfies.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid.
  SELECT carrid
        connid
         fldate
    FROM sflight
  INTO TABLE t_scarr.
  fs_fill-fldname = 'F0001'.
  fs_fill-dyfldname = 'CARRID'.
  APPEND fs_fill TO t_fill.
  CLEAR fs_fill.
  fs_fill-fldname = 'F0002'.
  fs_fill-dyfldname = 'CONNID'.
  APPEND fs_fill TO t_fill.
  CLEAR fs_fill.
  fs_fill-fldname = 'F0003'.
  fs_fill-dyfldname = 'FLDATE'.
  APPEND fs_fill TO t_fill.
  CLEAR fs_fill.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'CARRID'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'CARRID'
      value           = 'CARRID'
      value_org       = 'S'
    TABLES
      value_tab       = t_scarr
      field_tab       = t_field_tab
      return_tab      = t_return_tab
      dynpfld_mapping = t_fill
    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.
Regards,
Supriya.
Edited by: Supriya.ch on Feb 23, 2012 3:27 PM

Similar Messages

  • Populating selection screen of one prog by calling from another prog

    This is regarding variant population.
    I need to populate values in selection screen fields of one program (program 2)by calling from another executable ABAP program(.Program 1)
    I can identify the variant that i need ot populate.But there is a pushbutton in the selection screen of Program 2 which on clicking leads to some more fields in a pop up screen.How can I populate values in those fields there ?Please help.
    Thanks & Regards,
    Savitha

    I got a problem like that, then I tried to do a BDC, but it doesn't accept BDC's so I made a vbs program. This could help:
    FORM exec_vbs .
      DATA:BEGIN OF it_file OCCURS 0,
               line TYPE string,
           END OF it_file.
      DATA:filename     TYPE     string.
      CLEAR it_file[].
      it_file-line = 'msgbox "Variant will be updated, please don''t move or minimize the screen"'.
      append it_file.
      it_file-line = 'Dim objShell:Set objShell = CreateObject("WScript.Shell")'.
      append it_file.
      it_file-line = 'do while(ObjShell.AppActivate("R/A Settlements")=FALSE)'.
      append it_file.
      it_file-line = '  wscript.sleep 2000'.
      append it_file.
      it_file-line = 'loop'.
      append it_file.
      it_file-line = 'wscript.sleep 500:ObjShell.SendKeys "%ye":wscript.sleep 1999'.
      append it_file.
      it_file-line = 'do while(ObjShell.AppActivate("SAP Easy Access")=FALSE)'.
      append it_file.
      it_file-line = '  wscript.sleep 1000'.
      append it_file.
      it_file-line = 'loop'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "cj8g":wscript.sleep 940:ObjShell.SendKeys ""'.
      append it_file.
      it_file-line = 'wscript.sleep 1500'.
      append it_file.
      it_file-line = 'do while(ObjShell.AppActivate("Actual Settlement")=FALSE)'.
      append it_file.
      it_file-line = '  wscript.sleep 1000'.
      append it_file.
      it_file-line = 'loop'.
      append it_file.
      it_file-line = 'wscript.sleep 1950'.
      append it_file.
      it_file-line = '''controlshiftF7'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "^+":wscript.sleep 3100'.
      append it_file.
      it_file-line = '''shift+F2'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "+":wscript.sleep 2199'.
      append it_file.
      it_file-line = '''shift+F10'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "+":wscript.sleep 500:''SCROL DOWN'.
      append it_file.
      it_file-line = 'for x = 1 to 2: ObjShell.SendKeys "":wscript.sleep 500:next'.
      append it_file.
      it_file-line = '  wscript.sleep 500:ObjShell.SendKeys "":Wscript.Sleep 950'.
      append it_file.
      it_file-line = '''shift+F4'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1999:ObjShell.SendKeys "+ it_file-line = 'Wscript.Sleep 1000:ObjShell.SendKeys "C:\TEMP\Worksheet.txt"'.
      append it_file.
      clear it_file-line.
      concatenate 'Wscript.Sleep 500:ObjShell.SendKeys "' TEMP_FOLDER '\Worksheet.txt' '"' into it_file-line.
      append it_file.
      it_file-line = 'Wscript.Sleep 400:ObjShell.SendKeys "":Wscript.Sleep 2500:ObjShell.SendKeys "":Wscript.Sleep 1900'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "^s":Wscript.Sleep 2900'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1200'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1200'.
      append it_file.
      it_file-line = 'ObjShell.SendKeys "%"'.
      append it_file.
      it_file-line = 'Wscript.Sleep 1700'.
      append it_file.
      concatenate TEMP_FOLDER '\settle.vbs' into filename.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = filename
        TABLES
          data_tab = it_file.
      CALL FUNCTION 'WS_EXECUTE'
        EXPORTING
          PROGRAM = filename.
      IF SY-SUBRC <> 0.
      ENDIF.

  • Populating description field in selection-screen

    Hi Experts,
    My WD report has a selection-screen with select-options and parameters built using IF_WD_SELECT_OPTIONS.
    One of the select-options has a search help, but the value it returns is a guid, so I want to have a new read-only description field, populated with the description of the selected value, next to the input field for the guid.
    How can I do this?
    I tried adding a new read-only parameter field and populating it in WDDOMODIFYVIEW but I got a short dump when I tried to set the value, because the new field is not in the context of the component controller.
    Many thanks,        Ben

    Hi Ben,
    You will have to define the new field in the context and then programatically bind the value of the description field to this attribute.
    But ideally, you can have a structure, which the two fiels (guid & description), and define a search help which is mapped to the structure, then you do not need to do any programming, the description field should get populated automatically.
    Hope this helps.
    Regards
    Wenonah

  • Possibele entries are not populating for the fields on the selection screen

    Hi,
    Possible entries are not populating for the fields on the selection screen for the query.But its working fine in Development and Quality Systems.
    Can any body help me out
    Regards,
    Amit.

    Hi,
    In the Selection screen,go to Settings->Value Restrictions tab->Read Mode Settings->Custom radio button and select the options Values in Master Data or Only Values in InfoProv or Only Posted values for navigation.
    After this setting,check whether you are getting the data or not.
    Rgds,
    Murali

  • Selection screen field is not populated without pressing "Enter"

    Hello All,
    I am calling a report from module pool using SUBMIT statement. I have defined a selection screen as subscreen on module pool screen. On this selection screen i have a select option S_BUKRS. When I input company code 1000 and just press execute button on module pool, it is taking me to the report output. But S_BUKRS is not filled before the submit statement and hence report is executing as if S_BUKRS is initial.
    I put a breakpoint and saw that the field S_BUKRS is not filled before calling the repot.
    I re-ran the transaction (module pool) and this time after inputting 1000 in S_BUKRS I pressed enter and then pressed execute button. Now the value is transferred to report since S_BUKRS[] is filled.
    Do I need to press enter key after inputting the values on the selection screen everytime; before pressing the execute button?
    What could be the issue and how can I resolve it?
    I am calling the report in PAI of module pool using statement SUBMIT ZREPORT1 WITH s_bukrs IN s_bukrs AND RETURN.
    Thanks,
    Sandeep

    sandeep akula wrote:
    Hello All,
    > I am calling a report from module pool using SUBMIT statement. I have defined a selection screen as subscreen on module pool screen. On this selection screen i have a select option S_BUKRS. When I input company code 1000 and just press execute button on module pool, it is taking me to the report output. But S_BUKRS is not filled before the submit statement and hence report is executing as if S_BUKRS is initial.
    > I put a breakpoint and saw that the field S_BUKRS is not filled before calling the repot.
    > I re-ran the transaction (module pool) and this time after inputting 1000 in S_BUKRS I pressed enter and then pressed execute button. Now the value is transferred to report since S_BUKRS[] is filled.
    > Do I need to press enter key after inputting the values on the selection screen everytime; before pressing the execute button?
    > What could be the issue and how can I resolve it?
    > I am calling the report in PAI of module pool using statement SUBMIT ZREPORT1 WITH s_bukrs IN s_bukrs AND RETURN.
    > Thanks,
    > Sandeep
    I believe, you should be able to caputre the value of S_BUKRS in AT SELECTION-SCREEN event even if the user executes the program with out hitting Enter key. Make sure that you are including the CALL SUBSCREEN <area> statement in the PAI as the first statement.
    -Rajesh.

  • Auto-populating the selection screen parameters for web report

    hello
    i am having a scenario where my web report is a link to another internet application (a BSP application) and it is called by clicking some link or button on the BSP page.
    can i pass the selection values for BW Web report directly from BSP application through a query string or by setting some cookie values so that the user will directly view the report on click of that link?
    Thanks in advance.
    Regards
    Rajeev

    we can do this by adding a URL as the query-string with web template_id and with the selection screen parameters as key value pairs

  • Reading Text File from selection Screen and populating table (Urgent)

    Hi All,
    I have some requirment like i in my report i have to initial my Input feild from text file is it good to populate a internal table or range.
    I have three feild in a excel file that entry can more then 500
    data example
    Matnr Date             Day
    A1     10.07.2007    12
    B1     10.07.2007    10
    A1     19.07.2007    15
    C1     20.08.2007    30
    E1     11.09.2007    12
    This report for Price Protection claim.
    even u can help me out with proper table plz this is urgent.

    Hi..
    <b>parameters:</b>
      p_file(50) type c.
    <b>data:</b>
      begin of itab occurs 0,
         matnr type vbak-matnr,
         date type sy-datum,
         day(2) type n,
      end of itab.
    <b>at selection-screen on value-request for p_fname.</b>
      perform get_path.
    <b>start-of-selection.</b>
    <b>CALL FUNCTION 'GUI_UPLOAD'</b>
      <b>EXPORTING
        FILENAME                      =  p_fname
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'</b>
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
    <b>  TABLES
        DATA_TAB                      = itab</b>
    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.
    This Sub routine is used to get the file name
    *There are no interface parameters passed to this subroutine.
    FORM get_path .
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
       DEF_FILENAME            =  P_FNAME
      DEF_PATH               = ' '
      MASK                   = ' '
      MODE                   = ' '
      TITLE                  = ' '
    IMPORTING
       FILENAME                =  P_FNAME
      RC                     =
    EXCEPTIONS
       INV_WINSYS             = 1
       NO_BATCH               = 2
       SELECTION_CANCEL       = 3
       SELECTION_ERROR        = 4
       OTHERS                 = 5
    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.                    " get_path
    data:

  • Selection screen Parameters  - Select -options  values  populated from ITAB

    PARAMETERS  : PLANT
    SELECT-OPTIONS : MATERIAL
    My Selection Screen contents of  should  change   as  the PLANT changes ..
    and i want  to populate the  contents of  SELECT-OPTIONS  from an ITAB  how can i do that .
    wen  plant changes  its  corresponding  materials should  reflect  inthe Select -options.   this is my need .
    please solve..
    thanks, .
    Aslam.

    Srry Raj u misundersttod me ...
    I was not saying ur solution is not gud ...my question was different .....may be this is not the right forum to ask what i want to know ....
    just bear with me moderators plz ...
    i just wanted to understand the interview process...since I have not appreared for any interview ( I started my carreer with a company and I am still with it ..wuld luv to continue [:d])
    I believe , if you would have asked me the same question probably i would not have given u the best possible solution...as u r also admitting for ur particular scenario ur solution is better than max's .....
    as an inteviewer will u expect the best solution from me .....( which might not come to my mind ( nd I am sure will not ..I luv abap debugger ) or u just wanna check if I know how to use difference selection screen events .
    If u wanted to hear only the better solution ...( I am rejected ............now I will have to continue sticking to my current job [:d], not bcoz i prefer but bcoz I cant switch )
    if u want to test if i know how to use selection screen events then ( I am selected ...but now I would like to stick to my current job ...bcoz I want to )
    Now I realize I cannot do ABAP without Debugger.

  • Populating data into a field on selection screen

    hi alll..........
    my query is how to populate data into a field in a selection screen which has help on value request....
      suppose ..  there is a field in the standard selection screen with name kunnr which has help on value request option and is done as a list box. now i want to populate data from kna1-kunnr to this field....
    how can i do it....
                                                           urs friendly...
                                                       prashanth

    You have to call the FM F4IF_INT_TABLE_VALUE_REQUEST to show the F4
    F4IF_INT_TABLE_VALUE_REQUEST
    https://forums.sdn.sap.com/click.jspa?searchID=6971766&messageID=3699312
    F4IF_INT_TABLE_VALUE_REQUEST

  • How to create a report with selection screen that can run in background

    Sorry to ask these basic questions but I am knew to ABAP Programming.
    To keep it simply, I am attempting to create a report that has a simple parameter driven selections screen with one field.  That field takes in a folder path from the user.  The user executes the report.  The report creates a simply BDC that goes into SE16, gathers data from a table, and exports the results to a text file using the folder path provided.  I created a variant for the folder path field in the selection screen hoping to use it while executing the report in the background.  The report is not exporting the file as it did when run in the foreground for some reason.
    I am wondering what event is triggered when a report is executed in the background.  In the foreground (or when I execute the program via SE38->Execute->With Variant) the user needs to execute the program by hitting the execute button once the variant has populated the folder path field.  It works then, so I am trying to get the same to work in the background.  I am thinking I didn't put the program together correctly to accommodate the running in the background.  How can you create a report that can accept user input via variant into a selection screen and then run in the background?
    Please, any information would be greatly appreciated.
    Thanks you all for reading this!!!

    Ok, finally I understand what you're doing. Initially you lost me with the SE16 reference...
    Not sure what you're trying to achieve overall, but apart from the fact that you cannot export/download a file to a user's PC via background job (unless you have a mapped network share on the server or something like an FTP server on the user's PC, but both are pretty hypothetical scenarios and unlikely to occur).
    Also, the BDC approach to get data via SE16 is pretty awkward. Note that SE16 is guarded by some authorization checks and often users won't have access in production (which might not matter if you intend to always run your program in background via dedicated batch user). However, I have no clue why you wouldn't want to use [open SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_READING.htm] to read the data. You could then save it on the application server or if you really have to get it to the user you can consider e-mailing the file (extracts should be compressed before sending). For the latter you'll find plenty of references here, basically it's the [business communication services|http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/1c5d3aebba4c38e10000000a114084/frameset.htm] that you'd need to look at.

  • Selection screen field problem

    Hello experts..
    i have a selection screen , in that i have a field   s_bwart for mseg-bwart.
    some times the user will input the data in the field and sometimes he wont. we have fixed movement types combination like
    11-21 , 13-24 , 13-56 , 101-543 , 101-544 etc.
    if the user did not input any thing in the selection screen , i am populating s_bwart in at-selection screen event with all the mvt types. after executing the report when user presses the back button to come to the selection screen, there the s_bwart field is containing all the mvt types in single values ie in the select options screen. So the user dont want that, if he comes back nothing should be there in the selection screen field s_bwart if he has not inputted anything. if he inputs only 11 mvt type then when he comes back after executing the report he should see only 11 in the select screen field ie s_bwart. Please send the replies on how to solve the problem.

    hi,
    in ur program try to display values for users in START-OF-SELECTION event as it triggers after the selection screen displayed for users. if user doesn't give any input then display default values in this event. and also create a variable
    for ex:
    data: ws_flag type c,
             p_value type i.
    after u display default values for users in selection screen assign the flag as ' X '
    ws_flag = 'X'.
    before leaving ur program based on flag try to do like this.
    if ws_flag = ' X '.
        clear s_data. // s_data is the select options for u.
    else.
         s_data = p_value. // the value which user gave in selection screen as i/p.
    endif.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • How to capture the user change in an input field on a selection screen?

    I am coding a selection screen in which there are two input fields. The first field takes a Unix directory from the user input. Based on the input value, the second field will be populated with a the name of a file under the corresponding directory.
    My question is how I can make the program capture the user input without having to make the user press ENTER after they enter the value in the first field?
    Any help will be greatly appreciated.

    Venkat,
    Actually you led me to the real solution! It's the function module DYNP_VALUES_READ that does the trick for me. This function enables the program to capture dynamic user changes without recourse to PAI. Please refer to the code below:
    REPORT   zreiabsintf MESSAGE-ID zreiabsintfmc.
    *<HGDC------------------------------------------------------------------
    *  Selection screen for the conversion program
    *HGDC>------------------------------------------------------------------
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-001.
    PARAMETERS: p_indir   LIKE epsf-epsdirnam OBLIGATORY,                   " Inbound file directory
                p_infile  LIKE epsf-epsfilnam DEFAULT gc_infile OBLIGATORY, " Inbound file name
    SELECTION-SCREEN END OF BLOCK input.
    *<HGDC------------------------------------------------------------------
    *   Displays a file-open dialog when the user clicks the search
    *   help button next to the inbound file text field. The user
    *   can select the inbound file visually.
    *HGDC>------------------------------------------------------------------
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
    * Capture any user change to the directory.
      PERFORM check_dir_change.
    * Display the file open dialog
      PERFORM file_open_dialog CHANGING p_infile.
    *<HGDC------------------------------------------------------------------
    * Global constants
    *HGDC>------------------------------------------------------------------
    CONSTANTS:
        gc_indir  LIKE epsf-epsdirnam
                  VALUE '/interfaces/<SID>/inbound/',      " Default inbound directory template
        gc_infile LIKE epsf-epsfilnam VALUE 'input'.       " Default inbound file name
    *<HGDC------------------------------------------------------------------
    * Global data
    *HGDC>------------------------------------------------------------------
    DATA:
        gs_dynpfields   TYPE dynpread,                        " Fields of the current screen
         gt_dynpfields   LIKE STANDARD TABLE OF gs_dynpfields. " Table of the screen fields
    *&      Form  file_open_dialog
    *       Opens a dialog window for the user to choose a file in
    *       the specified Unix directory.
    *      <--P_FILE is the file to be selected.
    FORM file_open_dialog  CHANGING p_file.
    * Validate the directory.
      OPEN DATASET p_indir FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        MESSAGE i001(zreiabsintfmc) WITH p_indir.    " Unable to open the given directory
        EXIT.
      ENDIF.
      CLOSE DATASET p_indir.
    * Call the dialog window to open a file in the directory.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_indir
        IMPORTING
          serverfile       = p_file
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE i002(zreiabsintfmc).                 " Failed to open the file.
        EXIT.
      ENDIF.
    ENDFORM.                    " file_open_dialog
    *&      Form  check_dir_change
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM check_dir_change .
      CLEAR gs_dynpfields.
      CLEAR gt_dynpfields.
      gs_dynpfields-fieldname = 'P_INDIR'.
      gs_dynpfields-fieldvalue = p_indir.
      APPEND gs_dynpfields TO gt_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = gt_dynpfields
        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  NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_dynpfields INTO gs_dynpfields INDEX 1.
      p_indir = gs_dynpfields-fieldvalue.
    ENDFORM.                    " check_dir_change
    Thanks for all your answers! The problem is now solved.
    Edited by: Ning Hu on Apr 9, 2008 11:32 AM
    Edited by: Ning Hu on Apr 9, 2008 11:34 AM

  • How to replace the existing selection screen with new selection screen

    Hi,
    I have first selection screen with parametre as a table name, then I have created dynamic selection screen as 2nd selection screen with different fields of that table as select options. This is done using genaration of dynamic report. Now If I click on button on this 2nd selction screen , then I want to replace this 2nd dynamic selection screen , with the other selection screen fields.
    Can anybody guide me, How to do replace one slection screen with different selection screen.
    and one imp thing is this selction screen is populating with dynamic fields on it.
    Regards,
    Mrunal

    As I can understand you want to make some of the screen field to disable or visible on screen  depending upon the interaction of user with screen 1.
    You may use this example code in PBO of screen 2.
    LOOP AT SCREEN.
        " action has been taken to modify the area office screen as per the option chosen at screen 99.
        CASE ACTION.
            " if the user has taken up the option of UPLOAD
          WHEN 'UP'.     " screen processing while we upload the plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'AO_DO' OR SCREEN-NAME = 'AO_VE'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
          WHEN 'DN'.      " screen processing while we upload the approved plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'AO_UP' OR SCREEN-NAME = 'AO_VE'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
          WHEN 'VW'.      " screen processing while we view the plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'RLGRAP-FILENAME' OR SCREEN-NAME = 'FNAME'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
            " and hide the file input field
            IF SCREEN-NAME = 'AO_DO' OR SCREEN-NAME = 'AO_UP'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
        ENDCASE.
      ENDLOOP.

  • 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

  • AT SELECTION-SCREEN OUTPUT event of standard tcode

    Hi
    I need User-exit or BADI or Enhancment spot in AT SELECTION-SCREEN OUTPUT event of ME55.
    I need to populate the default cost center into the cost center field from user parameters with pid 'KOS' when i execute the ME55.
    I maintained the PID in user parameters but the value is not getting populated in ME55.
    Please let me know
    Govi

    Thanks Benedict
    Creating Module %_S_KOSTL and write our own logic to bring the parameter id value of Cost center from User profiles is NOT possible in program RM06BF00,  screen 1000.
    We can do that in Copied program of RM06BF00 ..which is the very last option.
    I wanted to do that with User-exits or BADI or Enhancement spot etc...which i Couldn't do it so far...
    The alternate might be Zprog and Ztcode or an SNOTE..
    if you ALL think its NOT possible with User-exits or BADI or Enhancement spot or SNOTE etc..Then i will close this Thread...
    Please let me know ASAP...
    Thanks
    Govi

Maybe you are looking for

  • HP Envy M7-J020DX (17inch Touchsmart​) touchpad is too sensitive

      I prefer to use the touchpad when sitting with the pc.  This is a new one, purchased yesterday.  It is handy to be able to tap the touchpad to select what the arrow is on....even more so with this new pc.  With only "clicking" selected in propertie

  • A strange problem using the zip files

    I'm currently working on a university project with another student in which we use zip files (using the java ZipFile , and ZipOutputStream classes), we write certain data to a zip file (and verify that it is there by checking the disk). and later we

  • No image appears in the workspace even though the image is opened by Photoshop

    I just installed Photoshop CC 2014.2.2. from the Creative Cloud so all settings are still default, etc. However when I try to open a .jpeg, there is no image that shows up in the workspace. It is just a blank workspace, even though the file shows up 

  • No Devices and Interface in MAX

    Hi all, I recently installed the evaluation version of LabVIEW and I am trying to communicate with a Mark-10 Series 5 force gauge. The problem, however, is that MAX does not seem to detect the instrument or any other instrument. There isn't even a De

  • Ringtone not sounding

    I have the ringer volume up and set a ringtone. However now incoming calls only vibrate and flash the blue LED. The ringtone used to work but will not anymore. What's up?