Select options - dynp_values_update

Hi,
I need to update a select option ( multiple values ) in the selection screen. I tried with DYNP_VALUES_UPDATE but it was not working. I am checking on this for last two days but did not reach the solution.
Please donot tell me to use submit statement ( calls an internall session ) becuase that is what i got when i searched in SCN. I want this functionality to happen when the f4 help is selected. We are providing a popup of multiple checkboxes when f4 is pressed on a select option. When one or more check boxes are selected then those values must be appended to the select option. Please give me some ideas.
If i have to use DYNP_VALUES_UPDATE then how should i use it for select option ?
Regards
Kesav

Hello Keshav,
Not sure why you've used REUSE_ALV_POPUP_TO_SELECT. You can achieve the same by turning on the MULTIPLE_CHOICE param in F4IF_INT_TABLE_VALUE_REQUEST. Check this code snippet:
DATA: v_field TYPE fieldname.
SELECT-OPTIONS: s_field FOR v_field NO INTERVALS.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'S_FIELD-LOW'.
      screen-input = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_field-low.
* Local type declarations
  TYPES : BEGIN OF t_flds,
    tabname   TYPE dfies-tabname,
    fieldname TYPE dfies-fieldname,
    keyflag   TYPE dfies-keyflag,
    fieldtext TYPE dfies-fieldtext,
  END OF t_flds.
  CONSTANTS: lc_field TYPE fieldname  VALUE 'FIELDNAME'.
* Local data declarations
  DATA:
        ls_flds TYPE t_flds,
        lt_flds TYPE STANDARD TABLE OF t_flds,
        ls_values TYPE ddshretval,
        lt_values TYPE STANDARD TABLE OF ddshretval,
        lt_dfies TYPE TABLE OF dfies,
        ls_dfies TYPE dfies.
* Get field details of the Table
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = 'MARC'
      langu          = sy-langu
    TABLES
      dfies_tab      = lt_dfies
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.
  IF sy-subrc = 0.
    LOOP AT lt_dfies  INTO ls_dfies WHERE fieldname NE 'MANDT'.
      MOVE-CORRESPONDING ls_dfies TO ls_flds.
      APPEND ls_flds TO lt_flds.
    ENDLOOP.
  ELSE.
    EXIT.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = lc_field
      window_title    = 'Select the Table Field'(001)
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'S_FIELD-LOW'
      value_org       = 'S'
      multiple_choice = 'X'
      display         = 'F'
    TABLES
      value_tab       = lt_flds
      return_tab      = lt_values.
  s_field-sign    = 'I'.
  s_field-option  = 'EQ'.
  LOOP AT lt_values INTO ls_values .
    s_field-low = ls_values-fieldval.
    APPEND s_field.
  ENDLOOP.
  DATA: lt_dynpread   TYPE STANDARD TABLE OF dynpread,
        lwa_dynpread  TYPE dynpread.
  READ TABLE s_field INDEX 1.
  IF sy-subrc = 0.
    lwa_dynpread-fieldname  = 'S_FIELD-LOW'.
    lwa_dynpread-fieldvalue = s_field-low.
    APPEND lwa_dynpread TO lt_dynpread.
*  Update the screen field values
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = sy-repid
        dynumb               = sy-dynnr
      TABLES
        dynpfields           = lt_dynpread
      EXCEPTIONS
        invalid_abapworkarea = 1
        invalid_dynprofield  = 2
        invalid_dynproname   = 3
        invalid_dynpronummer = 4
        invalid_request      = 5
        no_fielddescription  = 6
        undefind_error       = 7
        OTHERS               = 8.
    IF sy-subrc NE 0.
    ENDIF.
  ENDIF.
Hope this helps.
BR,
Suhas

Similar Messages

  • Clearing the displayed value for a SELECT-OPTION

    How do I clear the displayed value of a SELECT-OPTION? 
    I have 2 SELECT-OPTIONs on my screen (standard basic report program screen).  I use code like this to populate the drop-down boxes for each one. 
    =====
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
      PERFORM fill_prgrp_values.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
      PERFORM fill_prctr_values.
    =====
    The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION. 
    If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:
    1.  Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
    2.  Clear the displayed value from the second SELECT-OPTION that the user entered previously.  That value became invalid when the user picked a new value for the first SELECT-OPTION. 
    How do I clear that second displayed value? 
    I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low.  They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen. 
    I need to clear out the displayed value so the user will either leave it blank or enter or select a new value. 
    I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen. 
    Thanks for your help.

    Sorry, but calling DYNP_VALUES_UPDATE did not work.  This is how I coded it. 
    fld_reset_rcd-fieldname  = 'S_PRCTR'.
      fld_reset_rcd-stepl      = sy-stepl.
      CLEAR fld_reset_rcd-fieldvalue.      "  re-initialize s_prctr
      CLEAR fld_reset_rcd-fieldinp.        "  what goes in here?
      APPEND fld_reset_rcd TO fld_reset_tbl.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname = 'ZFI_GL_BALANCE_NGL'
          dynumb = '1000'
        TABLES
          dynpfields = fld_reset_tbl
    <Added code tags>
    I have discovered that CLEAR and REFRESH of s_prctr will clear it somewhat.  If I enter multiple values, ranges, etc., they will all be cleared, EXCEPT for the one single value that is displayed on the main screen.  It is not cleared and it remains if you push the button to display the pop-up to enter ranges, etc. 
    To devrath.sampat  --  Thanks for your example for building the drop-down list, but that is not the problem I am having.  I am already able to build it just fine. 
    To repeat my problem, if I: 
    1.  first enter / select a value for the first SELECT-OPTION s_prgrp
    2.  then enter / select a value for the second SELECT-OPTION s_prctr
    3.  And finally go back and select a new value of the first SELECT-OPTION s_prgrp from its drop-down list,
         when I do, the program needs to clear the value displayed on the main screen for the second SELECT-OPTION s_prctr (any additional values, ranges, etc., are cleared by CLEAR and REFRESH, if I go look; but not the value shown on the main screen).
    Edited by: Scott Crosby on Feb 14, 2012 4:20 PM
    Edited by: Suhas Saha on Feb 15, 2012 12:03 PM

  • How to catch the select-options value in AT SELECTION-SCREEN event?

    Hi,all
    This is my code:
    SELECT-OPTIONS: P_BUKRS FOR T012-BUKRS.
    PARAMETERS: P_BNKA TYPE BANKA.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BNKA.
    select single bankl from bnka where bukrs = p_bukrs.
    Last statement failed because p_bukrs was null.
    So, How can I got the value of p_bukrs in AT SELECTION-SCREEN event?

    Hi Jie,
    try following code.
    REPORT zanu_test.
    TABLES : t012.
    PARAMETERS: p_bukrs LIKE t012-bukrs.
    PARAMETERS: p_bnka TYPE banka.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bnka.
      DATA: BEGIN OF dynpfields OCCURS 0.
              INCLUDE STRUCTURE dynpread.
      DATA: END OF dynpfields.
    *---  IT for changing fields on the screen
      DATA : t_dynp_flds LIKE  dynpread OCCURS 0 WITH HEADER LINE,
             t_dynpfields LIKE  dynpread OCCURS 0 WITH HEADER LINE.
      DATA: l_bukrs  LIKE t012-bukrs.
      DATA: BEGIN OF it_bank OCCURS 0,
              banka LIKE bnka-banka,
           END OF it_bank.
      DATA: l_tabix LIKE sy-tabix.
      dynpfields-fieldname = 'P_BUKRS'. APPEND dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname               = 'ZANU_TEST'
                dynumb               = sy-dynnr
           TABLES
                dynpfields           = 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 EQ 0.
        READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
        IF sy-subrc EQ 0.
          MOVE dynpfields-fieldvalue TO l_bukrs.
        ENDIF.
      ELSE.
        EXIT.
      ENDIF.
      SELECT b~banka INTO CORRESPONDING FIELDS OF TABLE it_bank
      FROM t012 AS a
      INNER JOIN bnka AS b
      ON abanks = bbanks AND abankl = bbankl
      WHERE a~bukrs = l_bukrs.
      CLEAR l_tabix.
      CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
           EXPORTING
                endpos_col   = 85
                endpos_row   = 20
                startpos_col = 50
                startpos_row = 10
                titletext    = text-035
           IMPORTING
                choise       = l_tabix
           TABLES
                valuetab     = it_bank
           EXCEPTIONS
                break_off    = 1
                OTHERS       = 2.
      IF sy-subrc EQ 0.
        READ TABLE it_bank INDEX l_tabix.
        IF sy-subrc EQ 0.
    *---  Clear IT t_dynp_flds
          CLEAR : t_dynp_flds,
                  t_dynp_flds[].
    *---  Append screen values
          t_dynp_flds-fieldname = 'P_BNKA'.
          t_dynp_flds-fieldvalue = it_bank-banka.
          APPEND t_dynp_flds.
          CLEAR  t_dynp_flds.
        ENDIF.
      ENDIF.
    *---  Change screen field contents w/o PBO
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                dyname               = 'ZANU_TEST'
                dynumb               = sy-dynnr
           TABLES
                dynpfields           = t_dynp_flds
           EXCEPTIONS
                invalid_abapworkarea = 1
                invalid_dynprofield  = 2
                invalid_dynproname   = 3
                invalid_dynpronummer = 4
                invalid_request      = 5
                no_fielddescription  = 6
                undefind_error       = 7
                OTHERS               = 8.
    START-OF-SELECTION.
    -Anu

  • Select-Options in dialog program

    Hi there,
    I'm using a selection-screen in a dialog program, I declared it in the TOP.
    Selection-screens
    SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
    parameters: p_lifnr type lfa1-lifnr  obligatory ,
                p_werks type t001w-werks obligatory .
    SELECT-OPTIONS:
      s_licha FOR zbrtconsig-licha.
    SELECTION-SCREEN END OF SCREEN 101.
    I have to use the event at selection-screen on value-request for s_licha-low, and I need the values from the fields p_lifnr and p_werks. the problem is:
    If I only fill the fields p_lifnr, p_werks and click on F4 for s_licha, the values of p_lifnr and p_werks are not updated, they are empty. Only wether I do an Enter this fields is updated.
    Thanks,
    Alexandre Nogueira

    Hi,
    i am not clear about your problem, please expalin it clearly.
    use FM : DYNP_VALUES_UPDATE to update screen fields.
    use FM : DYNP_VALUES_READ to read screen fields.
    use SET /GET Parameter id's to set parameters
    this FM will update the screen fields before to PBO event.
    check this link for sample code :
    Re: Issue Related to Module pool
    Regards
    Appana

  • [Selection Screen] Select-Options populate mult. values & Green pushbutton

    Hi,
    I programmatically fill a SELECT-OPTIONS on event AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_us-low.
    As I use a FM ('RHP0_POPUP_F4_SEARK') that allows me to select several entries in a single step, the right pushbtton stays unchanged. I have to press enter to make it go green.
    I tried thinks like:
        ls_dynpfield-fieldname = '%_S_US_%_APP_%-VALU_PUSH'.  " 'S_US-LOW'.
        ls_dynpfield-fieldvalue = ICON_DISPLAY_MORE.
        APPEND ls_dynpfield TO lt_dynpfields.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = sy-repid
            dynumb               = sy-dynnr
          TABLES
            dynpfields           = lt_dynpfields
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
    and it works but it's not that nice !
    Any idea how to avoid this behaviour and directly set it green?
    Thanks in advance.
    Best regards,
    Guillaume

    Hi
    Guillaume Garcia
    U can try following code. it may help you.when I press f4. Colour will change to Green.
    REPORT  ztest.
    tables: mara.
    CONSTANTS : tp_mara type C VALUE 'X'.
    select-OPTIONS: matnr for mara-matnr..
    at SELECTION-SCREEN on VALUE-REQUEST FOR matnr-low.
    matnr-sign = 'I'.
    matnr-option = 'BT'.
    matnr-low  = '1'.
    matnr-high = '2'.
    append matnr.
    matnr-sign = 'I'.
    matnr-option = 'BT'.
    matnr-low  = '4'.
    matnr-high = '5'.
    append matnr.
    SUBMIT ZTEST VIA SELECTION-SCREEN WITH matnr IN matnr.
    START-OF-SELECTION.
    BREAK-POINT.
    END-of-SELECTION.
    Many thanks,
    Suyog.

  • Updating Select Options via Function Module

    I contrast to the previous posting, I would like to update the single values for a select option.  I am attempting to use the DYNP_VALUES_UPDATE, but I can only update the value on the screen and not the underlying structure.  I have also tried using the RD_SELECTIONSCREEN_UPDATE but with no success either.  Has anyone tried this before?
    I am using a bespoke screen (ALV with multiple row selection) as the F4 dropdown which works fine and I have my values but cannot then update the selection screen.
    I am on 4.6C.
    Thanks in advance
    Ian

    Hello Ian,
    The option of updating the select-options internal tabler seems right for the description of your requirement. However, I would like just give you a word of caution here - <i>Do that in your <b>initialization</b> event</i>.
    Example:
    tables mara.
    select-options s_matnr for mara-matnr.
    initialization.
      s_matnr-sign = 'I'.
      s_matnr-option = 'EQ'.
      s_matnr-low = <Value1>.
      append s_matnr.
      s_matnr-low = <Value2>.
      append s_matnr.
      s_matnr-low = <ValueN>.
      append s_matnr.
    Hope this helps,
    Regards,
    Anand Mandalika.

  • Dynamic F4 help for workcenter based on plant given in select-option

    Hi all,
    I need to give F4 help on work center based on plant values in the select-options in the selection screen. I am using the FM DYNP_VALUES_READ to get the low and high values in the plant  field of selection screen. The problem is i do not know how to fetch the extension values of s_werks. dynpro fields what i am passing is s_werks-low and s_werks-high. But how will i name the extension field of s_werks. Even i have tries giving only s_werks. But FM is giving invalid dynpro field exception . Please help on this.

    You need to use FM DYNP_VALUES_READ to read values entered on selection screen and then you need to use FM F4IF_INT_TABLE_VALUE_REQUEST.
    FM DYNP_VALUES_READ can read the values of screen fields
    You have to use the function module DYNP_VALUES_READ to read the selection screen data after u enter the field value in Plant . Based on that, then call the function module F4_INT_VALUE_REQUEST. And this function module will
    retrive based on the value enter on the field1.
    F4IF_INT_TABLE_VALUE_REQUEST
    This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
    Have a look at below sample code:
    If you have two parameters, you want to display values(f4) in parameter 2 depending on the values entered in parameter 1.
    REPORT Z_SRI_HELP_VALUE_FOR_TABLES .
    tables tcurt.
    DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
    PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
    P_LTEXT LIKE TCURT-LTEXT, "Long Text
    P_KTEXT LIKE TCURT-KTEXT. "Short Text
    Example of updating value of another field on the screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
    CLEAR: DYFIELDS[], DYFIELDS.
    *select currency
    CALL FUNCTION 'HELP_VALUES_GET'
    EXPORTING
    fieldname = 'WAERS'
    tabname = 'TCURT'
    IMPORTING
    SELECT_VALUE = P_WAERS.
    get long text for the selected currency
    SELECT SINGLE LTEXT FROM TCURT
    INTO DYFIELDS-FIELDVALUE
    WHERE SPRAS = SY-LANGU
    AND WAERS = P_WAERS.
    IF SY-SUBRC 0.
    CLEAR DYFIELDS-FIELDVALUE.
    ENDIF.
    update another field
    DYFIELDS-FIELDNAME = 'P_LTEXT'.
    APPEND DYFIELDS.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
    DYNAME = SY-CPROG
    DYNUMB = SY-DYNNR
    tables
    dynpfields = DYFIELDS .
    Example of reading value of another field
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
    *read another field
    CLEAR: DYFIELDS[], DYFIELDS.
    DYFIELDS-FIELDNAME = 'P_WAERS'.
    APPEND DYFIELDS.
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = SY-CPROG
    DYNUMB = SY-DYNNR
    TABLES
    DYNPFIELDS = DYFIELDS .
    READ TABLE DYFIELDS INDEX 1.
    get short text and update current field
    SELECT SINGLE KTEXT FROM TCURT
    INTO P_KTEXT
    WHERE SPRAS EQ SY-LANGU
    AND WAERS EQ DYFIELDS-FIELDVALUE.
    Have a look at below sample code:
    REPORT ZTEST_F4 .
    DATA : BEGIN OF ITAB OCCURS 0,
    NAME LIKE KNVK-NAMEV,
    E_MAIL LIKE ADR6-SMTP_ADDR,
    END OF ITAB.
    PARAMETER : P_EMAIL LIKE ADR6-SMTP_ADDR.
    INITIALIZATION.
    ITAB-NAME = 'A'.
    ITAB-E_MAIL = email@removed '.
    APPEND ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_EMAIL.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'E_MAIL'
    DYNPPROG = 'ZTEST_F4'
    DYNPNR = '1000'
    DYNPROFIELD = 'P_EMAIL'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = ITAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3
    Another Code sample:
    REPORT DEMO_DYNPRO_F4_HELP_MODULE.
    TYPES: BEGIN OF VALUES,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    END OF VALUES.
    DATA: CARRIER(3) TYPE C,
    CONNECTION(4) TYPE C.
    DATA: PROGNAME LIKE SY-REPID,
    DYNNUM LIKE SY-DYNNR,
    DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
    FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
    VALUES_TAB TYPE TABLE OF VALUES.
    CALL SCREEN 100.
    MODULE INIT OUTPUT.
    PROGNAME = SY-REPID.
    DYNNUM = SY-DYNNR.
    CLEAR: FIELD_VALUE, DYNPRO_VALUES.
    FIELD_VALUE-FIELDNAME = 'CARRIER'.
    APPEND FIELD_VALUE TO DYNPRO_VALUES.
    ENDMODULE.
    MODULE CANCEL INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE VALUE_CONNECTION INPUT.
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = PROGNAME
    DYNUMB = DYNNUM
    TRANSLATE_TO_UPPER = 'X'
    TABLES
    DYNPFIELDS = DYNPRO_VALUES.
    READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
    SELECT CARRID CONNID
    FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
    WHERE CARRID = FIELD_VALUE-FIELDVALUE.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'CONNID'
    DYNPPROG = PROGNAME
    DYNPNR = DYNNUM
    DYNPROFIELD = 'CONNECTION'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = VALUES_TAB.
    ENDMODULE.
    The screen flow logic is as follows:
    PROCESS BEFORE OUTPUT.
    MODULE INIT.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    PROCESS ON VALUE-REQUEST.
    FIELD CONNECTION MODULE VALUE_CONNECTION.
    For the Flight number field, the POV module VALUE_CONNECTION is called. The
    function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the user’s selection into the screen field CONNECTION.
    I hope it helps.
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • F4 Help for select-options.

    Hi  Experts,
    I need to use F4 help for a select - options field from a particular table.I have written the below code and it worked well.
    FORM sub_show_help.
      SELECT bukrs
       FROM zfica_accurate
        INTO TABLE gt_accurate.
        delete ADJACENT DUPLICATES FROM gt_accurate.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BUKRS'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'S_CMCODE'
          window_title    = 'COMPANY CODE'
          value_org       = 'S'
          multiple_choice = 'X'
        TABLES
          value_tab       = gt_accurate
          return_tab      = gt_return.
      s_cmcode-sign    = 'I'.
      s_cmcode-option  = 'EQ'.
      LOOP AT gt_return INTO gw_return .
        s_cmcode-low = gw_return-fieldval.
        APPEND s_cmcode.
      ENDLOOP.
      READ TABLE s_cmcode INDEX 1.
      IF sy-subrc = 0.
        gw_dynpread-fieldname  = text-018.
        gw_dynpread-fieldvalue = s_cmcode-low.
        APPEND gw_dynpread TO gt_dynpread.
    UPDATE THE SCREEN FIELD VALUES
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = sy-repid
            dynumb               = sy-dynnr
          TABLES
            dynpfields           = gt_dynpread
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
      ENDIF.
      IF sy-subrc <> 0.
        MESSAGE i003.
      ENDIF.
    The problem is , I need to create a new type for s_cmcode(select-option ) field with the same structure as the select-option and the code is as below. I have created an internal table gt_sfield similar to s_cmcode . I have replaced s_cmcode with gt_sfield but the below code is not working. Its the same as the above program but its not showing up the values in the field.Could anyone please help me.
    fORM SUB_SHOW_HELP.
      SELECT BUKRS
       FROM ZFICA_ACCURATE
        INTO TABLE GT_ACCURATE.
    gt_sfield[] = s_cmcode[].
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = 'BUKRS'
          DYNPPROG        = SY-REPID
          DYNPNR          = SY-DYNNR
          WINDOW_TITLE    = 'COMPANY CODE'
          VALUE_ORG       = 'S'
          MULTIPLE_CHOICE = 'X'
        TABLES
          VALUE_TAB       = GT_ACCURATE
          RETURN_TAB      = GT_RETURN.
      LOOP AT GT_RETURN INTO gw_return.
          gw_sfield-SIGN    = 'I'.
          gw_sfield-OPTION  = 'EQ'.
        MOve gw_return-fieldval to gw_sfield-low.
        APPEND gw_sfield to gt_sfield.
    ENDLOOP.
      READ TABLE gt_sfield INDEX 1 INTO gw_sfield .
      IF SY-SUBRC = 0.
        gw_dynpread-fieldname = 'S_CMCODE'.
        move  gw_sfield-low to gw_dynpread-fieldvalue.
        APPEND GW_DYNPREAD TO GT_DYNPREAD.
    UPDATE THE SCREEN FIELD VALUES
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            DYNAME               = SY-REPID
            DYNUMB               = SY-DYNNR
          TABLES
            DYNPFIELDS           = GT_DYNPREAD
          EXCEPTIONS
            INVALID_ABAPWORKAREA = 1
            INVALID_DYNPROFIELD  = 2
            INVALID_DYNPRONAME   = 3
            INVALID_DYNPRONUMMER = 4
            INVALID_REQUEST      = 5
            NO_FIELDDESCRIPTION  = 6
            UNDEFIND_ERROR       = 7
            OTHERS               = 8.
      ENDIF.
      IF SY-SUBRC <> 0.
        MESSAGE I003.
      ENDIF.
    ENDFORM.

    Hi,
    The fucntion module 'DYNP_VALUES_UPDATE' should be used only for updating the screen field values. In your case you are updating the internal table using this function module.
    Thanks
    Pavan

  • How to fill empty parameter (selection-option)

    Hi!
    On selection screen I have two parameters (s_egrid and s_empid). If user enter something in first (but not in second) one, second one should be filled from database.
    The problem is that I don't know how to fill the empty parameter.
    Let's say that i have an internal table i_zemployee with list of all necessary employee Id's (stored in field empid)
    if I Ioop like this
    loop at i_zemployee into wa_zemployee.
        insert wa_zemployee-empid into s_empid.
      endloop.
    ... I did something stupid but i hope that you understand what i need:
    s_emipd[1] = 'u1'.
    s_emipd[2] = 'u7'.
    s_emipd[3] = 'u9'.
    ... like array of user id's.
    and this s_empid I need in my next SELECT statement like
    SELECT * FROM ...
        WHERE empid in s_empid.
    if someone knows the solution thanks in advance!
    T.

    HI try something like this...
    tables: mara, makt.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab.
    data : begin of btab occurs 0,
    maktx like makt-maktx,
    end of btab.
    ata mak like makt-maktx.
    DATA : return like ddshretval occurs 0 with header line.
      data: begin of dynpfields occurs 3.
              include structure dynpread.
      data: end of dynpfields.
    select-options: p_matnr for mara-matnr.
    select matnr from mara into table itab where matnr IN p_matnr.
    loop at itab.
    write: / itab-matnr.
    endloop.
    Initialization.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
    REFRESH ITAB.
    SELECT matnr FROM mara INTO TABLE ITAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'MATNR '
    dynprofield = 'P_MATNR '
    dynpprog = sy-REPID
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = ITAB
    return_tab = return.
    select single maktx from makt into  mak where matnr = return-fieldval.
    p_matnr = return-fieldval.
    refresh return.
    clear return.
    move 'P_MAKTX' to dynpfields-fieldname.
    move mak to dynpfields-fieldvalue.
    append dynpfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname                     = 'SY-REPID'
        dynumb                     = '1000'
      tables
        dynpfields                 = dynpfields
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    refresh return.
    clear return.
    validate according to ur requirement.
    Regards
    Syed A

  • Select-Option F4 Help Multiple Selection

    Hi
    I have wriiten the code to provide custom F4 help for a field using F4IF_INT_TABLE_VALUE_REQUEST' and then updating the values back to screen using Function Module DYNP_VALUES_UPDATE.
    It is working fine when the F4 is used on the main screen, But when i click on the multiple selection button and press F4, i do get the F4 values list, but selected value is not getting passed back to the field.
    I guess the issue is the field name changes in the multiple section option, Please suggest how can i fix it.
    *&      Form  update_date_bATCH
          Updating the sel_screen with the retrieved values
    FORM update_date_batch USING pt_filename pt_fieldvalue.
    Rundate
      st_dyn_fields-fieldname  = pt_filename.
      st_dyn_fields-fieldvalue = pt_fieldvalue.
      APPEND st_dyn_fields TO it_dyn_fields.
    Function Module to update the screen with the values retrieved
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = it_dyn_fields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          OTHERS               = 8.
      IF sy-subrc <> 0.
        MESSAGE i006(zffi).
      ENDIF.
    ENDFORM.                    " update_new_date_time

    You have added the F4 to a select-option for areport and would like to get the F4 values back into the select-option, when the user selects multiple values?
    If this is the case you have to fill the internal table behind the select-option and this will have to based on waht the user selected.
    The first value will go on to the screen the way you have done it.
    If this is what you want to do?
    Rene

  • Populating select-option, parameter simultaneously

    Hi All,
    I have a select option and a parameter on the selection screen. The parameter is disabled for input and enabled for output. The F4 for the the select option has a numeric value and a corresponding text (comes from a standard function module). When I select a value from F4, the numeric value should go to the select-option and the text should go to the input disabled parameter.
    At the moment, I am having to press an enter after choosing F4, for the text to reflect in the parameter field. I need both of them displayed at the same time, without having to press an enter.
    Please guide me about how I could achieve this.
    Thanks and Regards,
    Vidya.

    use this code in your F4 Help of Select Option after F4 Help Function Module .
    DATA SCR_FIELDS  LIKE DYNPREAD   OCCURS 0 WITH HEADER LINE.
    SCR_FIELDS-FIELDNAME =  ur parameter Name.
    SCR_FIELDS-FIELDVALUE =  ur parameter value(ur Text Field)
    APPEND SCR_FIELDS.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          DYNAME               = PROG_name
          DYNUMB               = SY-DYNNR
        TABLES
          DYNPFIELDS           = SCR_FIELDS
        EXCEPTIONS
          INVALID_ABAPWORKAREA = 1
          INVALID_DYNPROFIELD  = 2
          INVALID_DYNPRONAME   = 3
          INVALID_DYNPRONUMMER = 4
          INVALID_REQUEST      = 5
          NO_FIELDDESCRIPTION  = 6
          UNDEFIND_ERROR       = 7
          OTHERS               = 8.
    So you need not have to press Enter
    Regards,
    Alpesh
    Edited by: Alpesh on Mar 14, 2009 11:44 AM

  • Report help for multiple Date Select options

    Hi Friends,
    For a particular year wise report, the client wants 12 date select-options which are changeable and informal every year .The report will also be displayed as per the given date selection period wise. Please help me how to fetch the datas from the table as per the given selection period. Currently the report have one date select-option where the user gives selection range as 1.04 to 31.03. It's related to EB power consumption report and hence the new requirement on date selection which are informal and not a fixed date of every year.
    Ex:Selection-Screen
    Period 1 : 08.04.2008 to 12.05.2008
    Period 2: 12.05.2008 to 20.06.2008
    Period 3: 21.06.2008 to 28.07.2008
    Period 4: 29.07.2008 to 15.08.2008
    Period 5: 15.08.2008 to 21.09.2008
    Period 6 : 21.09.2008 to 14.10.2008
    The data will derive as per the above selection ranges.......
    Please advise with example.
    thanks & regards
    Sankar.

    >
    sankar babu wrote:
    > Ex:Selection-Screen
    > Period 1 : 08.04.2008 to 12.05.2008
    > Period 2: 12.05.2008 to 20.06.2008
    > Period 3: 21.06.2008 to 28.07.2008
    > Period 4: 29.07.2008 to 15.08.2008
    > Period 5: 15.08.2008 to 21.09.2008
    > Period 6 : 21.09.2008 to 14.10.2008
    Hi,
    In this case just derive all records matching dates between 08.04.2008 (low in first select-options) and 14.10.2008(high in last select-options.
    Also my advice is to use a single select-options and prompt the user to give the dates as ranges in the multiple entries dialog which can be opened by clicking the button on the right side of the select-options.
    Regards
    Karthik D

  • How To... Change the Data Type for a SELECT-OPTIONS at run time.

    Hello,
    I am trying to restrict the values available for entry into a SELECT-OPTIONS at run time depending on user input.
    The logic is as follows. The user has two input fields. A PARAMETER field which has the type RSDIOBJNM and allows them to choose an InfoObject. And the user has a SELECT-OPTIONS field to allow them to select the Characteristic values for that InfoObject.
    I would like the following example to be possible:
    The user enters 0MATERIAL into the PARAMETER. When the user clicks on the SELECT-OPTIONS control code will derive a list of possible options the user can enter in the SELECT-OPTIONS. In this case only values found in the master data or at least no values greater than 18 characters.
    I have looked at the following function module SELECT_OPTIONS_RESTRICT and this do not appear to be helpful as they only restrict on the signs allowed for the values (unless I misunderstand, it is a complex function module!).
    The code I have so far is (thus the user enters a InfoObject into p_char1 and the select options so_char1 should only accept active values of that InfoObject):
    declaration of variables for user interface
      DATA c_char(32) TYPE c.
    declaration of count variable
      DATA i_count TYPE i.
    declaration of user interface
      SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
        PARAMETERS: p_ipack TYPE RSLOGDPID.
      SELECTION-SCREEN END OF BLOCK a1.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
        PARAMETERS: p_char1 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char1  for c_char NO INTERVALS.
        PARAMETERS: p_char2 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char2  for c_char NO INTERVALS.
        PARAMETERS: p_char3 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char3  for c_char NO INTERVALS.
      SELECTION-SCREEN END OF BLOCK b1.
    Is what I am trying to do possible???
    Thanks for any help. Ross.

    You really want to restrict possible values of a select-option based on another field, not change the length of type of the select-option field, right?
    Here is what you do:  Code a custom F4 value help for the select-option at event AT SELECTION-SCREEN ON VALUE REQUEST FOR..  The first thing you do here is read the value of the parameter field (p_ipack in your example).  You can use function module DYNP_VALUES_READ.  Based on this value, you can propose values for the select-option fields.  Note that the use can still enter whatever s(he) wishes in to the select-option field without pressing F4. In this case, you will have to code some input validations taking into account the value in the p_ipack field.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

  • How to hide some select-option of Logical Database in report?

    How to hide select-option of  Logical Database in report?eg . In Logical Database 'PNP' , my code is 'GET  PERNR' , excute the report , select-screen is displayed . I want to hide some select-options , such as PNPPERNR-LOW .
    Edited by: rongrong wang  on Mar 26, 2008 9:31 AM

    U need to write code in initialization as
    initialization.
    loop at screen.
    if screen-name = 'PNPPERNR-LOW'.
    screen-active = '0'.
    modify screen.
    endif.
    if screen-name = 'PNPPERNR-HIGH'.
    screen-active = '0'.
    modify screen.
    endif.
    endloop.

Maybe you are looking for

  • SharePoint 2013 July 2014 CU - People Picker fields empty in Edit forms

    After applying the July 2014 CU for SharePoint server, I discovered that Person or Group (People Picker) fields are not populated with server values in list item Edit forms.  However, the field values can be viewed in list views and in Display forms.

  • SQL query with parallel hint  running very slow

    I have a SQL query which joins three huge tables. (given below)      insert /*+ append */ into final_table (oid, rmeth, id, expdt, crddt, coupon, bitfields, processed_count)      select /*+ full(t2) parallel(t2,31) full(t3) parallel(t3,31)*/      seq

  • IWeb sites in internet explorer

    I have created a site for our company that can be viewed at www.ourlandscapers.com. On Safari & Firefox, it looks fine, but on Internet explorer (which 99% of our clients use), it looks like a big mess, with overwriting, field boxes, red x's everywhe

  • Date find from week of year.

    Hi all, I have week number values of the year, ie values are ranging from 1-52. i want to find out start and end dates of the week. do we have any functions provided by oracle to achieve this. Please help me.

  • Keep getting message "You can't sign in at this time. Try signing in again" on iCloud.

    Keep getting message "You can't sign in at this time. Try signing in again" on iCloud. No problem with iPhone or iPad, just desktop.