Restricting values in F4 help pertaining to value in other parameter field

Hello experts,
In selection-screen, i have two parameters namely BUKRS and WERKS.
Now when i enter company code in BUKRS, i want to get list of plants of that company code only, in F4 help. I don't want data of other plants which are not related to company code i enter in BUKRS. How can i do so in my program itself. I don't want to create a search help in SE11. What code should i write in AT SELECTION-SCREEN OUTPUT.??

hi,
DATA :      DYNPRO_VALUES TYPE TABLE OF DYNPREAD,"declare like this
      FIELD_VALUE LIKE LINE OF DYNPRO_VALUES.
DATA: t_return3 like ddshretval occurs 0 with header line.
  CLEAR: FIELD_VALUE, DYNPRO_VALUES.
  REFRESH DYNPRO_VALUES.CLEAR FIELD_VALUE.
  FIELD_VALUE-FIELDNAME = 'BUKRS'.
  APPEND FIELD_VALUE TO DYNPRO_VALUES.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME             = SY-CPROG
      DYNUMB             = SY-DYNNR
      TRANSLATE_TO_UPPER = 'X'
    TABLES
      DYNPFIELDS         = DYNPRO_VALUES.
  READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
  SELECT DISTINCT werks FROM Tt001w into table itab where bukrs = FIELD_VALUE-FIELDVALUE.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD    = 'WERKS'
      DYNPPROG    = SY-REPID
      DYNPNR      = SY-DYNNR
      DYNPROFIELD = 'WERKS'
      VALUE_ORG   = 'S'
    TABLES
      VALUE_TAB   = ITAB
      RETURN_TAB  = t_return3."will contain the selected values
regards,
syed

Similar Messages

  • How do I set a NULL value for the parameter field

    Hi
    I've another question. I'm going to set single values for parameter fields.
    // e.g. set today for StartDate parameter field
    fc.setCurrentValue("", "StartDate", new Date());
    It should be possible to set a NULL value for date parameter fields.
    fc.setCurrentValue("", "StartDate", (Date)null);
    But this do not work. How do I set a NULL value correctly?
    Thank you in advance.
    Best regards,
    Thomas

    First question - is it a stored procedure parameter?
    You can't set a regular parameter field value to a null value.
    There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
    Sincerely,
    Ted Ueda

  • Passing a value to a Parameter Field From a VB Form

    Post Author: as1971
    CA Forum: General
    Hello everyone
    I'm using Visual Basic 6.0 and Crystal Report 9.0
    I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr
    In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.
    I'm using the following code to pass a value to the parameter:
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)
    When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)
    Could anybody help me please

    Post Author: VinoTinto
    CA Forum: General
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange                                               Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext)

  • How to get the value of a parameter/field in a ADF Read-Only Form

    Hi,
    My requirement is as follows. Could anyone shed some light on this issue.
    I am showing the records from db table using ADF Read-Only Form ( which uses ViewObject created for the table). Now I want to capture(get) the value of a field in this form and then have to invoke an action based on the value in this field. I mean to say the next page depends the value of a field in this form.
    Please suggest how can I achieve this functionality?
    Thanks in advance.
    ~Sivaji

    That's indeed what Sivaji needs.
    In the page definition you can add a value to the parameters of a certain method. Like RJundi mentioned, point to the attribute of the current row.
    Example:
    The value of the read only textfield will be something like this:
    #{bindings.EmployeeName.inputValue}points to an attribute value in the pageDef of the page:
        <attributeValues id="EmployeeName" IterBinding="AllEmployees">
          <AttrNames>
            <Item Value="EmployeeName"/>
          </AttrNames>
        </attributeValues>The attribute value has also an iterator binding defined in the page def:
        <iterator id="AllEmployees" RangeSize="10"
                  Binds="AllEmployees" DataControl="MyService"/>If you want to 'pass' the attribute of the current row to the service, you can create a methodaction (eg: public void printEmpName(String name)) in the page def or you can drop the method from the datacontrol on to the page. After dropping the method, a screen will appear asking to fill in a value for the parameter ('name' in this example). Fill in '#{bindings.EmployeeName.inputValue}' if you want to pass the EmployeeName of the current row.
    Hope it helps,
    Koen Verhulst

  • Modify default value for static parameter field programmatically

    Hi,
    I have my Crystal Reports stored in a BO Enterprise system. I have written a java programm that scans the repository, loads the CR reports one by one into a ReportClientDocument, modifies the data source and then stores the updated report back to repository (it overwrites the existing objects).
    I was even able to modify the default values for the parameters, which are used for scheduling of each report.
    But what I am trying to do know is to overwrite the default value used when invoking the report interactively. This should be the value found under the Default Value field, when the Properties window of the parameter is opened in the CR designer.
    This is what I have tried so far:
    Option 1: First I tried to set the default values using com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.getDataDefinition().getParameterFieldController().getField(...).getDefaultValues() . The only thing I have managed to do using this approach is to modify the static LOVs that are associated to static parameters. The actual selected value (shown under Default Value in the Properties window for the given parameter field) remained unchanged, when invoking the report in the InfoView or opening it in the CR designer.
    Option 2: I have used com.crystaldecisions.sdk.plugin.desktop.report.IReport.getReportParameters().get(ik).getDefaultValues() to change the default values. I was able to see my changes in the BO repository (using a query on CI_INFOOBJECTS), still the changes did not really have an impact to what is displayed as default value when invoking the report in the InfoView.
    Any help will be appreciated.
    It would be great to know if someone of you has already implemented successfully such a use-case.
    Regards,
    Stratos
    Edited by: Efstratios Karaivazoglou on Dec 9, 2009 8:52 AM
    Edited by: Efstratios Karaivazoglou on Dec 15, 2009 11:33 PM

    Hi,
    For Crystal Design related queries, close this thread and start the thread in the [SAP Crystal Reports Design forums|http://forums.sdn.sap.com/forum.jspa?forumID=300&start=0]
    - Bhushan

  • Pass the results from a selection formula to the default values for a parameter field

    Post Author: kevans
    CA Forum: General
    Crystal 10 u2013 SQL 2000
    I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all.  BUT I donu2019t want this to be a static list where I type in all 40 depts in the default list, I was hoping I could do something more dynamic such a formula field that says u201C if {group.name startswith u2018ITu2019 then {group.name}u201D and then have the parameter field pull from this source.
    Iu2019m sure this has been answered in a previous post but Iu2019m not finding it.  I see stuff on creating a record selection formula such as u2018if {?group} like u2018IT-Secur*u2019 thenu2026u201D  but this leaves too much room for error if people donu2019t type the name correctly.  Maybe Iu2019m not using the record selection formula correctly?  Sorry if I offend anyone but I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed.

    Post Author: sharonmtowler
    CA Forum: General
    if you are creating the parameters in the rpt file, it will only pull values you enter, or directly from the database
    in the record selection you can do something like this, so if they only enter the first 2 characters it should pick up only the IT etc.
    (if eft(,2)={?parameter} then true else ={?parameter})

  • Restrict values for F4 on field in Selection-screen

    Hi,
    For f4 on particular field I am getting list of values. These values are fixed in Value Range of DOMAIN of that field. There are 26  values fixed for that DOMAIN. Now what I need is I need to restrict 26th value from displaying on F4 for that field in selection screen.
    I tried doing it in AT SELECTION SCREEN OUTPUT event  using F4_ON_VALUE REQUEST  FM, fetching data and deleting 26th entry , but before i delete it, It shows all values in selection-screen.
    Please any one guide me.
      Thanks,
    Vanitha P

    You have to use AT SELECTION-SCREEN ON VALUE-REQUEST event.
    Tables:mara.
    TYPES :BEGIN OF gty_mtart,
           mtart TYPE mara-mtart,
           END OF gty_mtart.
    DATA: gt_mtart  TYPE STANDARD TABLE OF gty_mtart,
          gtt_mtart TYPE gty_mtart.
    DATA: gt_return_tab  TYPE TABLE OF ddshretval,
          gwa_return_tab TYPE ddshretval.
    SELECT-OPTIONS:so_mtart FOR mara-mtart.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_mtart-low.
      REFRESH gt_mtart.
      gtt_mtart-mtart = 'Z01'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z02'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z03'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z04'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z05'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z06'.
      APPEND gtt_mtart TO gt_mtart.
      gtt_mtart-mtart = 'Z90'.
      APPEND gtt_mtart TO gt_mtart.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
    *   DDIC_STRUCTURE         = ' '
              retfield               = 'SO_MTART-LOW'
    *   PVALKEY                = ' '
    *   DYNPPROG               = ' '
    *   DYNPNR                 = ' '
    *   DYNPROFIELD            = ' '
           value_org              = 'S'
    *   MULTIPLE_CHOICE        = ' '
    * IMPORTING
    *   USER_RESET             =
            TABLES
              value_tab              = gt_mtart
    *   FIELD_TAB              =
           return_tab             = gt_return_tab
    *   DYNPFLD_MAPPING        =
         EXCEPTIONS
           parameter_error        = 1
           no_values_found        = 2
           OTHERS                 = 3
      IF sy-subrc = 0 AND gt_return_tab IS NOT INITIAL.
        CLEAR gwa_return_tab.
        READ TABLE gt_return_tab INTO gwa_return_tab INDEX 1.
        IF sy-subrc = 0 AND gwa_return_tab-fieldval IS NOT INITIAL.
          so_mtart-low = gwa_return_tab-fieldval.
        ENDIF.
      ELSEIF sy-subrc <> 0.
        REFRESH gt_return_tab.  CLEAR: gwa_return_tab.
      ENDIF.

  • Multiple values Parameter field Display

    I created a Parameter field that allows multiple values.
    When I put this field en the report (to display in the report the parameters selection) I only see the first value.
    How Can I do to display all the values of the Parameter field that the user chose ?
    Thanks,
    Gabriel

    If the parameter is of type string then create a formula with:
    join({?Your Parameter},", ");
    Display this formula instead of the parameter.  It will display all chosen values separated by a comma.

  • Using SEARCH HELP exit in dependency of other parameters from my dynpro.

    Hello experts,
    how can I access the values of input fields (parameters or select-options) from my dynpro?
    I need to build a F4-help in dependencie of another field on the screen with help of the F4 - exit. I think this should be possible.
    If I do test the search help with SE11 it works fine. All parameters from screen are given in SHLP_TAB[1]-INTERFACE (the parameter of my f4-help-exit)
    The short example explains the problem more detailed.
    REPORT  test_dynpro_events_ck.
    PARAMETERS ea1 TYPE my_char_10_ck DEFAULT 'here I push F4' MATCHCODE OBJECT MY_F4_HELP_CK.
    PARAMETERS ea2 TYPE my_char_10_ck DEFAULT 'this is the value I need to generate the F4 help of field ea1'.
    MY_F4_HELP_CK:
    import: EA1 and EA2
    export EA1
    Many Thanks
    Christian

    Thank you so far.
    But how are these parameters passed to the search help without using global set/get parameters or DYNPRO_READ_VALUE? Why can I put these parameters to my search help as input parameters ... seems to be useless if I use search help on Selection-Dynpros?
    Is there not a better way to deal with search-helps which are dependent from other input fields? Btw. I need the value without passing PAI and PBO.
    In my Example:
    doing some text inputs in field EA2 -> hit search help on EA1 -> need a selection dialog in dependency of the input in EA2. This can not be that complicated?
    Many thanks
    Christian

  • Need to restrict values in F4 help for Batch Characteristic

    Hi,
    I need to restrict values in F4 Help for a batch characteristic based on values entered for another characteristic. I could not find any BADI or Exit for this purpose. There is a BADI CACL_VALUE which is triggered after an entry is selected from dropdown list but nothing when we press F4. I thought of using Object Dependency but I need to write a programming logic for the requirement. Please let me know if there is any way to write program in Object Dependency or any other way for this requirement.
    Regards,
    Nikhil

    Hi nikhil simha,
    first of all, find out which search help is called.
    [Hierarchy of the Search Help Call|http://help.sap.com/saphelp_nw70/helpdata/en/0b/32e9b798da11d295b800a0c929b3c3/frameset.htm]
    may help you.
    If you know the search help, you may enhance it, but first of all you should check the where-used-list and make sure that the search help shows the requested behavior only in the context where you want it to.
    If it is your own program, you may be better off to create your own search help and define the triggering fields as search help interface input fields. Then you can use the values to filter results.
    Regards
    Clemens

  • F4 help:Restrict Value Range

    Hello Experts,
    I want to a search help for one field such that when user click on F4 help , it will again pop- up with one  screen, in which I need to have 2- 4 fields to Restrict the values then user enter some values here then F4 help will appaer.
    Like in standard tables mseg-lifnr F4 help Restrict Value Range screen , but i require only one tab
    Plz suggest
    Aastha

    Hello,
    Use the following piece of code.
    Parameter : p_value type ......
      TYPES : BEGIN OF y_value,
                      value TYPE text6,
                     END OF y_value.
      DATA : t_value TYPE STANDARD TABLE OF y_value.
      DATA: t_return TYPE STANDARD TABLE OF ddshretval.
    Fill table t_value with the values which  u require in the F4 help.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield         = 't_value-value' 
          dynpprog     = sy-repid
          dynpnr         = sy-dynnr
          dynprofield   = 'p_email'     
    TABLES
          value_tab       = t_value
          return_tab      = i_return
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.

  • Hi experts,   restricted value through F4 help

    hi all
    in alv grid output there is a input enabled field say xyz, this field is given f4 help by creating ztable, and when f4 is pressed on xyz field, it is fetching all the data related to that field, but the user wants restricted value with respect to company code and land1. 
    how to restrict the value coming in through F4 help ???
    thanking u in advance
    rocky

    Rocky,
    In  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    check the name of the USER_COMMANG.Based on  User command there will be one FORM ......... ENDFORM .
    In that there will be selection statement to internal table by which you are getting F4 help.Put the condition WHERE company code eq and land1 eq.
    Pls. reward if useful.....

  • How to restrict values of Dimensions in Webi report prompt

    Hi
            I need to create a WebI report for a set of Business users. We have several thousands of Agencies. Business Users want to see only the agencies they work with (about 100) in the prompt. This way they need not go through thousands of agencies they dont work with. I tried to use List Of Values option but that didnt give me desired result.  Please let me know how to restrict values in prompt to few values from the n number of values available in database.
    Thanks in advance.

    Hi,
    there is no such step-by-step!
    I would encourage you to consult documentation and search for terms 'row level restriction' in the help guides.
    Practice makes perfect
    Good luck
    H

  • How to restrict a user typing a custom value in the dDocAccount field.

    I have dDocAccount field drop down pre-populated with 2 values - Dept1, Dept2. However, user can able to type any other values (say Dept3) in the account text box and checkin a doc from WCC UI. How to restrict user from entering custom values?
    As an alternate solution - for time being i have the above account field is set as hidden using rule. I am trying to derive the account value from another one field's value (say Departments field with values Dept1, Dept2). I tried below code and found working:
    Department is a custom field created as option list with values Dept1, Dept2
    Under the Rules, for the field dDocAccount, is derived field checked and added below code
    <$dprDerivedValue=#active.xDepartment, getValue("#local","dOption")$>

    Hi,
    If Department is a custom metadata then you should access it like xDepartment(as any other custom metadata), not dDepartment.
    I know it is also possible to change the HTML that is generated for the dDocAccount field, to add javascript validation and so on, maybe this approach plus some additional JS and HTML twists and you should get it working(via component development).
    Hope it helps,
    Vlad

  • How to restrict value of materila in a PR created from PS to 1 Rupee

    Hello Gurus,
    While creation of material PR from P, system is picking value either info record or material master. How can we restrict value of materila in a PR created from PS to 1 Rupee?
    Nagaraj

    Hi,
    On costing variants(OPL1)->valuation varient u can define which would be picked for planing, there give top priority for "Plan price 1"
    To get plan price 1, you have to update on material master(mm02) on costing 2 tab as 1 rupee for all required materials.
    hope this would help
    regards,
    SL

Maybe you are looking for

  • AMD Athlon 64 3800+ cpu upgrade to AMD Athlon 64 X2

    Hello everyone, First of all, I have been to cpu-upgrade.com and typed in my current (CPU)--> AMD Athlon 64 3800+ 2.40GHz (motherboard)--> ASUS A8M2N-LA (Naos) GL6.  According to the website, my AM2 Socket (940pin) is capable of upgrading to a Dual C

  • Touchsmart 600-1120 successfully upgraded to Windows 8 Pro

    I just wanted to report my Touchsmart 600-1120 (BK139AA) was successfully upgraded from Win7 64 bit to Windows 8 Pro 64 bit, and I haven't run into any issues.   Here are the steps I went though. 1. Made disk image backup using Win7 Backup and Restor

  • Pdf files don't open in Chrome after Yosemite upgrade

    Trying to open a pdf or a ppt attachments on latest Chrome after the Yosemite upgrade, nothing happens. Please share your experience or a suggessted fix or a work around. I am using a macbook white early 2009

  • Anyone else seeing a peculiar type of freeze upon wake?

    I'm wondering whether other people are experiencing the following problem: 1. Occurs almost always after working from home with an Apple 20" Cinema Display as sole display (connected via wired ethernet) and then waking from sleep with no peripherals

  • Additional Tab Page in cProjects

    Hello, I just read this post http://forums.sdn.sap.com/thread.jspa?threadID=1646098 which is closed that's why I'm opening a new thread. I use the feature to add Additional Tab using custom component because I need drop down list, alv and input field