How to restrict the values in seach helps

Dear All,
               I am new to the BSP concept.I have a requirement
where in the BSP i need to restrict the values of the search help.i.e. 2 values are coming in the help i need to display only 1 value.
can anybody please explain how to do it.
Cheers,
Deepthee Kasal
Edited by: Craig Cmehil on Sep 2, 2008 8:21 AM

Hi,
I assume that you read values for the search help with function 'F4IF_FIELD_VALUE_REQUEST' and in a later step you display values with <htmlb:tableview>. If that is true and the function is delivering too many records as you mention, you could then restrict the output table of values like this:
TABLES mara.
DATA: mytable TYPE TABLE OF ddshretval WITH HEADER LINE.
DATA l_repid TYPE syrepid.
PARAMETERS p_mtart LIKE mara-mtart.
AT SELECTION-SCREEN ON VALUE-REQUEST
FOR p_mtart.
l_repid = sy-repid.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'MARA'
fieldname = 'MTART'
dynpprog = l_repid
callback_program = l_repid
callback_form = 'F4CALLBACK'
TABLES
return_tab = mytable
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
START-OF-SELECTION.
blah, blah, blah
* Form F4_form
* Exclude all material types that start with F & H
FORM f4callback
TABLES record_tab STRUCTURE seahlpres
CHANGING shlp TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
DATA: aux_struc TYPE ddshselopt.
MOVE: 'H_T134' to aux_struc-shlpname,
'MTART' TO aux_struc-shlpfield,
'E' TO aux_struc-sign,
'CP' TO aux_struc-option,
'F*' TO aux_struc-low.
append aux_struc to SHLP-SELOPT.
MOVE: 'H_T134' to aux_struc-shlpname,
'MTART' TO aux_struc-shlpfield,
'E' TO aux_struc-sign,
'CP' TO aux_struc-option,
'H*' TO aux_struc-low.
append aux_struc to SHLP-SELOPT.
ENDFORM. "F4_form
Mark points if helpful

Similar Messages

  • Restricting the Value of Search help in MIRO based on vendor

    Dear all,
    I had a problem in resticting the values of search help for vendor in the Po reference tab.  the Seach help is KRED  .  I had written a search help exit in it but i dont know how to restrict the vaues. I have to restict the Vendors Which starts with 1 series like 10000001,1000002 etc.
    Can any one help me out where to write the code in search help exit like CALLCONTROL-STEP = 'SELONE' or 'SELECT' or 'DISP' and what logic i need to use.
    Thanks & regards
    sreehari p

    Hi Sreehari,
    Write your Select query inside  IF callcontrol-step = 'DISP'.
    Use below code.
    *Types
      TYPES: BEGIN OF l_ty_tab,
             lifnr TYPE lifnr,
             END OF l_ty_tab.
      DATA: l_t_tab TYPE TABLE OF l_ty_tab,
            l_wa_tab TYPE l_ty_tab,
            l_wa_recordtab TYPE seahlpres.
    *Before displaying hitlist
      IF callcontrol-step = 'DISP'.
        REFRESH: record_tab[],l_t_tab[].
    SELECT LIFNR FROM lfa1 INTO TABLE l_t_tab WHERE lifnr LIKE '1%'.
    IF NOT l_t_tab[] IS INITIAL.
    *Pass hitlist to standard table record_tab
        LOOP AT l_t_tab INTO l_wa_tab.
          l_wa_recordtab-string = l_wa_tab.
          APPEND l_wa_recordtab TO record_tab.
          clear l_wa_recordtab.
        ENDLOOP.
      ENDIF.
      ENDIF.
    Thanks,
    Sap Fan

  • How to restrict the values during extraction?

    Hi everyone,
    I want to restrict the values while extracting data from R/3 Datasource... For example:
    I have MATNR, which have around 10 materials out of which i want to extract the data for only 5 materials. My Selection screen is disabled, i mean we cant do anything in selection screen... Can anyone plz tell me how to go abt this issue?
    Advance thanks,
    chintu..

    Hi KJ,
    Am saying that its not available in Selection screen in R/3 side.. am not talking abt the BW side.. Then also i want to extract the data.. How to do this? this is an interview question asked by HP today morning..
    Regards,
    Chintu.

  • How to restrict the values for selection in the search help..

    hi,
    i have a requirement regarding screen programming. i have added a i/o field in a screen and i linked a search help for that field.
    i used the standard search help it holds some 15 values for selection...
    when i click on the  search help i m getting some 15 values for selection. but i dont need all the 15 values. i need only 4 values for selection..can any one help me regarding this...
    waiting for ur reply...
    Uday.
    Edited by: uday13 on May 31, 2010 9:17 AM

    Hello,
    Refer the below code and you can provide your own search help to a parameter depending on the value in another parameter:-
    PARAMETERS : p_belnr TYPE belnr,
                 p_bukrs TYPE bukrs.
    DATA : BEGIN OF itab OCCURS 0,
             bukrs TYPE bukrs,
           END OF itab.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
      PERFORM f4_bukrs_help USING p_bukrs.
    *&      Form  f4_bukrs_help
    FORM f4_bukrs_help USING p_bukrs.
      DATA : itab TYPE STANDARD TABLE OF it WITH HEADER LINE,
             tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
             v_belnr TYPE belnr.
      CLEAR:   tb_dynpfields.
      REFRESH: tb_dynpfields.
      MOVE 'P_BELNR' TO tb_dynpfields-fieldname.
      APPEND tb_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname                               = 'Z_F4' "program name
          dynumb                               = '1000' "screen number
        TABLES
          dynpfields                           = tb_dynpfields
      IF sy-subrc NE 0.
      ENDIF.
    READ TABLE tb_dynpfields INDEX 1.
      IF sy-subrc EQ 0.
        v_belnr = tb_dynpfields-fieldvalue.
      ENDIF.
      SELECT bukrs from <db_table> INTO TABLE itab WHERE belnr = v_belnr.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield               = 'BURKS' "internal table field
          dynpprog               = 'Z_F4' "program name
          dynpnr                 = '1000' "screen number
          dynprofield            = 'P_BUKRS' "screen field name
          value_org              = 'S'
        TABLES
          value_tab              = itab "internal table
      IF sy-subrc NE 0.
      ENDIF.
    ENDFORM.                    " f4_bukrs_help
    Hope this helps you.
    Regards,
    Tarun

  • How to Restrict the values of Field TASKTYPE on a ALV Grid.?

    Hi;
    Let me explain my problem. I have report written by another abap developer who has gone now.
    On the ALV Grid there is a field called "Activity Process". By F1 F9 I can read that field depends on table TCATX_TASKTYPES and field TASKTYPE   . From se11 I can see that there is no search help related with the field.
    When the user press F4 all the data in the table is listed . The user want to filter some of the listed data according to same logic .
    When I debug the code after F4 on the field I found that the system finds Search Help: TCATX_TASKTYPES of type 'CT'. But unfortunately SE11 says that there in  no search help such as TCATX_TASKTYPES.
    The previous abap developer used BADI NETW_USER_FIELDS_F4 AT_F4 with class ZCL_IM_NETW_USER_FIELDS_F4 and interface IF_EX_NETW_USER_FIELDS_F4  for the transaction cj20n to filter the same field but this is not triggered by the F4 on the ALV Grid.
    What can I do ?
    Would you please help me ?

    I know i can do this using ADF Business Components as the business service but the problem is that the initial value for that attribute will be changed depending on the screen ... ill give u a simple example : lets say that I have employee table ( which include dept column) and under that table I have a table called "Emp_dept_movements" now in the main ADF page "employee entry" I have two blocks Employee data ( master view) employee dept data ( detail view ) now when the user press the create-insert button on the employee dept view the system should copy the dept no from the employee view to the dept no on the emp_dept_movements view... and the "Emp_dept_movements" will be used in another screen called " employee departement movements" without any initial value for the DeptNo
    I dont want to create more than one view and cant set the initial value for that attribute in the view , Can this be done through the UI by adding set action listener on that button and specifying from ( binding master_view.dept ) - to (binding of detail_view.dept) ..
    hope that am clear this time,
    Edited by: Delta on Jul 5, 2010 11:21 PM

  • How can I restrict the values obtained in a search help?

    Hi guys,
    The thing is that there is a function module that according to the user name, and a material number, it tells wheter the user has permission to see the material or not.
    It is possible to use that function module to restrict the values of the search help?
    Thanks

    Hello Raulie,
    1. If the function module is not much complex then copy the same Functionmodule into your custom name ,...
    Then you would have the control at your end,,,,
    2. If the funciton module is very complex then fetch the data manually and create a custom f4 help ... to fetch the data use the similar logic of the function module so that data does not get deleted.
    Thanks,
    M.Naveen Kumar

  • How to restrict the user to enter only numeric values in a input field

    How to restrict the user to enter only numeric values in a input field.
    For example,
    i have an input field in that i would like to enter
    only numeric values. no special characters,alphabets .
    reply ASAP

    Hi Venuthurupalli,
    As valery has said once you select the value to be of type integer,once you perform an action it will be validated and error message that non numeric characters are there will be shown. If you want to set additional constraints like max value, min value etc you can use simple types for it.
    On the project structure on left hand side under local dictionary ->datatypes->simple types create a simple type of type integer
    The attribute which you are binding to value property ;make its type as simple type which you made
    Hope this helps you
    Regards
    Rohit

  • HOW to Restrict the input Help for 0MATERIAL in the BPS Layout

    Hi,
    I have requirement to Restrict the input Help for 0MATERIAL  in the BPS Layout.
    For Example if the Planning Package is Restricted to SALES ORGANISATION ( 3000 )  then the system shuold  check the 0MAT_SALES  where SALES ORGANISATION IS "3000" )AND PASS THE Material Numbers to the 0material list.
    I have Copied the standard Funtcion group  "UPF_VARIABLE_USER_EXIT"  to Z fucttion and have attached to Z Variabe as User Exit .
    this Variable is  Attached to 0material in the Planning Pakage. So tha now the 0MATERIAL is restricted to the variable which is having the User Exit.
    But how to acces the Values of Planning Package for which the Layout is bein Executed from this Z User Exit ???
    I Know how to restrict the input help, but my only problem is that how to get the values of Planning package through this User Exit.
    Please suggest if it is possible.
    Regards,
    Nilesh Labde

    Hi Nilesh,
    As I understand from your question,you know how to restrict but the issue is to know the value in the package with which you need to restrict.
    There are two tables which can help you finding the value used in package for sales organisation:
    1. UPC_PACKAGE
    2. UPC_OPTIOS
    How to use ?
    From UPC Package you will get one GUID, Hit the second table UPC_OPTIOS with this GUID.
    In field "FIELDNAME" enter the name of the characteristic whose value is req (sales organisation in your case)
    Hope this helps you
    Mann

  • How to restrict the particular value in BEx?

    HI,
    I have added particular dimension in query prompt. While refreshing i got more value in particular dimension. How to restrict the the value in bobj or bex?
    Here i attached the screen shot. Please find the attachment.

    Hi Mani,
    Please make sure of your requirement. If you are using only one single query for multiple reports then i strongly recommend the below criteria or else it better to restrict the value in the BEx itself if you have no other reports on the same BEx query.
    If you are trying to restrict a report to a default prompt value then use equal to in query filter prompt or you can also restrict them to list of values i.e multiple values.Please follow as per the screens below. I am mentioning two ways.
    Method:1
    Step 1: Click on Prompt Options(Blue Questionmark Symbol)
    Step: 2 : Click on the Values after you check the prompt properties options as shown below.
    Step 3: Search for values if they are keys by checking the "Search in keys" or else not required.
    Method 2: Here is another Easy way is Just give the input in the value box as shown below.
    Let me know if you need any further help.
    Regards,
    Naveen

  • How to restrict the attribute values for the user in query designer

    Hi All,
    I have a requirment where certain user would see certain vailes in the query desiner of the attribute.
    The requirment is we have planing material which is attribute of material
    When X user want to restrict the  values for planning material ,where he is able to see all the planning material.But who is not authorized for all the value.
    Ex: X user has authorization for see planning material 100,101,102. of material But when he try to restrict the planning material in query designer where is getting all values of planing material.
    Or
    is there way to blank the restriction help.so that he can't able to see values while restricting
    Please some one can advise me on it..

    Hi,
    Let me sum up:
    you have an object ZPLNMAT for the planning material
    you have the object 0MATERIAL for material and this object has ZPLNMAT as attribute.
    If you can restrict in the query designer, I suppose this attribute is then as navigationnal and also added in the multi-provider.
    The object ZPLNMAT is checked as relevant for authorization, and you set up a role with the attached values of ZPLNMAT this user should have access to.
    Are you sure the users are restricting on the ZPLNMAT object and not 0MATERIAL, because you should have everything now
    PY

  • How to restrict the duplicate values in lov column of VO based Adv Table

    Hi Gurus,
    I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
    If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
    After the duplicate values have been removed, then the user can save all the values in the table.
    My Adv Table is based on a VO.
    The link how to restrict the duplicate values at form level
    talks about Adv Table based on a EoVO, which doesnot work in my case.
    My Approach,
    I am iterating through RowSetIterator and committing through PROCEDURE.
    I am able to avoid duplicate entry through a function checkRespId. (given below)
    Below code is for iterating and committing.
    public void saveline(String reqid,String userid)
    System.out.println("RequestId/saveline"+reqid);
    System.out.println("UserId/saveline"+userid);
    OAViewObject vo = (OAViewObject)getRespLineVO1();
    RespLineVORowImpl row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    System.out.println("Inside the for LOOP");
    row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
    String respoidid = row.getAttribute("ResponsibilityId")+"";
    String respname = row.getAttribute("ResponsibilityName")+"";
    String stdate = row.getAttribute("StartDate")+"";
    String enddate = row.getAttribute("EndDate")+"";
    String linestatus ="A";
    if(userid!=null)
    if(!(respoidid.equals("null")) && respoidid!=null)
    String checkingrespid=null;
    checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
    System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
    if(checkingrespid.equals("No"))
         String message, result = null;
    Connection txn = getOADBTransaction().getJdbcConnection();
    try
    calling PROC ...
    catch(Exception e)
    message = "Error in Inserting into line" + e;
    throw new OAException(message, OAException.ERROR);
    else
    throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
    else
    System.out.println("respoidid is null");
    break;
    deleteIter.closeRowSetIterator();
    public String checkRespId(String userid,String respoidid)
    String createRow="No";
    OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
    if (vo != null)
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0, userid);
    vo.setWhereClauseParam(1, respoidid);
    vo.executeQuery();
    System.out.println("ROW COUNT IS "+vo.getRowCount());
    if(vo.getRowCount()>0)
    createRow="Yes";
    else
    createRow="No";
    return createRow;
    Problem:
    I remove the duplicate entries and click on save and get this error.
    Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
    \nAction: Cancel the transaction and re-query the record to get the new data.
    Thanks,
    Sombit

    Hi Anil,
    I am trying out your code but stuck in inserting the rows
    using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
    I am always getting the same exception i.e COde blast in when I run.
    My modified code is:
    String[] as = null;
    Number[] vNumber = null;
    Number[] vNumberrespid = null;
    Number reqidnumber = null;
    reqidnumber = new Number(Integer.parseInt(reqid));
    Connection txn = getOADBTransaction().getJdbcConnection();
    String mCreateSearchRequestStatement = null;
    OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
    int j = vo.getFetchedRowCount();
    try
    System.out.println("abouce try");
    vo.reset();
    if (vo.getFetchedRowCount() > 0)
    System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
    int i = 0;
    as = new String[j];
    vNumber = new Number[j];
    vNumberrespid = new Number[j];
    while (vo.hasNext())
    vo.next();
    System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
    vNumber[i] = (reqidnumber);
    vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
    as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
    System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
    System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
    System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
    i++;
    CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
    ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
    cs.setArray(1, array);
    cs.setArray(2, arraynew);
    cs.setArray(3, array1);
    cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
    cs.execute();
    ARRAY error = null;
    error = (ARRAY)cs.getArray(2);
    if ((error != null) && (error.length() > 0))
    System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
    String[] retError = new String[j];
    retError = (String[])error.getArray();
    System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
    cs.close();
    catch (Exception exception)
    throw new OAException("code blast", OAException.ERROR);
    Thanks,
    Sombit

  • How to restrict the department to not user other departments' equipment?

    Dear SAPIENTS,
    How to restrict the department to not user other departments' equipment? If suppose any one creating order for equipment having different authorization group then system should not allow me to do this.
    Regards,
    Kaushal Rai

    Kaushal Rai,
    Use Authorization group for technical objects, create authorization gruops in IMG and assign the same to the Equipment master and block the other department with the same authorization group. For ristricting the authorization group to other departments after creating and assigning it to the equipment seek help from your BASIS team.
    goto the below path for cerating the Authorization group:
    IMG - PMCS - Master data in PMCS - Technical Objects - Define Authorization groups:
    Here you define the authorization groups, after completion of this step go to the Equipment master in General Data tab page there is a feild Authourization Group, mention the respective authorization group and provide this Authorization gruop value to the respective user in the user role with the help of BASIS Team.
    Regards,
    Praveen.

  • How to restrict the user in MIRO for not modifying  price

    Hi All 
    My requirement is How to restrict the users in MIRO screen for not modifying Material Prices  of only the for specific  ROH types .
    For example :
    Valuation class             RM description
      3021                             RM - A
      3022                             RM - B
      3024                             RM - C
    when ever we procure  the above Raw materials A,B and C and
    the Quantity of each Raw material @ 10 units  and value @ 1 INR  for each unit
    RM - A procured qty 10 @1 total price is INR  10
    RM - B procured qty 10 @1 total  price is INR 10
    RM - C procured qty 10 @1 total  price is INR 10
    total price of PO is INR 30
    when we received invoice material prices are  assume it INR 1 is excess for each material.Now the invoice price for each RM has become INR 11.
    in MIRO we want restrict the user to change the price from INR 10 to 11.
    suggest the best possible ways to restrict in MIRO screen
    Thanks & Regards
    Mala

    Dear:   
                      Take help of ABABPER fo implement exit using INVOICE_UPDATE or MRMH0003 Logistics Invoice Verification: Revaluation/RAP exit. If this does not help then seek help of MM functional who will help you to find exit for the required task.
    rEGARDS

  • How to restrict the upload file size in me21n/me22n/me23n?

    Hi Guru's,
    I have a requirement to restrict the user from attaching a local file more than 20MB in Purchase Order.
    In standard SAP system, the user can attach a file of any size in PO. How to restrict the size of the file?
    I have no clue how to achieve this? Any kind of help would be great...
    Thanks in Advance...
    Regards,
    Satyam

    Hi Guru's,
    The file size is now restricted in function GUI_UPLOAD. But this function module is used at many places. I want to restrict it only for Tcode: ME22n and ME23n.
    I thought of restricting it by sy-tcode field but sy-tcode value  is not passed to this function module in the run time.
    Could anyone help me on this how to restrict it for the above mentioned tcodes??
    Regards,
    Satyam

  • How to restrict Option values for a particular metadata in profile checkin

    How to restrict Option values (drop down) for a particular metadata in profile checkin-
    Metadata field Color is having options dropdown values (stored in table/views)-
    Display name - Blue, Value=1
    Display name - Red, Value=2
    Display name - Yellow, Value=3
    Display name - Green, Value=4
    Display name - Black, Value=5
    For a particular profile checkin form, for the metadata field Color I want the dropdown value consist of only top three options
    Display name - Blue, Value=1
    Display name - Red, Value=2
    Display name - Yellow, Value=3
    But this should be done on profile level only, should not impact the standrad checkin form and other profile checkin forms.
    Please help me if any one having any suggestion to implement the above secnario
    Thanks,
    Sumit

    Hi,
    Into the rule containing the Color metadata, you can restrict the values of the list.
    In "Has restricted list and pane", list the values 1, 2 and 3 (new line for each value) :
    1
    2
    3
    Romain.

Maybe you are looking for

  • ITS part of IAC view not showing content

    Hi,   We have installed ITS 6.20 patch level 19 (with hotfix applied). When we access the IAC iview(some z tran), we are getting page cannot be displayed in the top section(which is supposed to show Info abt the page) and report below it. when we dri

  • What to restore my macbook pro to factory setting

    what to restore macpro book to factory setting

  • Having trouble syncing with Itunes

    I'm trying to sync my Iphone 4s up to Itunes and it says my sync session has failed to start?  Never got this message before.  Just synced my phone up the day before and it worked fine.  Thanks for any help.

  • Will the Win 7 Upgrade work on a fresh install on an MBP?

    Hello, If I want to install Windows on a new partition on my MacBook Pro, will it work if I use the Microsoft Windows 7 Professional UPGRADE (found on this page http://www.microsoft.com/student/office/en-au/default.aspx)?   Meaning, do I need to have

  • Form Server

    Hello All, How does Adobe define its form server. Does that come integrated with Lifecycle designer? or Adobe Acrobat 7.0 pro? or do we have to configure an external application server to act as a form server? To be specific, I am trying to import PD