UDF - formatted search help using query
I've created a UDF for 'activities' called U_BP_Link - it has a formatted search query which simply displays all data in the OCRD business partner database. I wanted to also fill in a UDF which would display the 'description' of the BP that was selected in the U_BP_Link field. I'm having trouble coming up with the correct syntax for the query associated with the UDF name field. This is giving me a syntax error near $[$U_BP_Link]................
SELECT T0.CardName FROM OCRD T0 INNER JOIN OCLG T1 ON T0.CardCode = T1.U_BP_Link Where T0.CardCode = $[$U_BP_LINK.1.0]
Good Day,
I don't fully understand your situation.
I'm thinking you have 2 UDFs. One is OCLG.U_BP_Link and the second is the 'also fill in a UDF' and that is to be populated with OCRD.CardName based on data entry in OCLG.U_BP_Link
That being the case, I would create a FMS on OCLG.U_BP_Name field to:
1) Search in Saved Query - create query similiar to SELECT OCRD.CardName FROM OCRD, OCLG Where OCRD.CardCode = $[OCLG.U_BP_LINK] FOR BROWSE
Create and test the query and after results are generated as expected, substitue the $[OCLG.U_BP_LINK]. The query will error in SAP but is OK for use in FMS.
2) Auto refresh when Field Changes
3) Based on field OCLG.U_BP_Link - actually the description for this field.
4) Display saved values
It could work.
M
Similar Messages
-
Formatted Search Help required
Dear All,
I have a specific requirement by which I need to track out the Estimated Cost which is put in the Sales Order Row with a Udf vs the PO Cost been involved for a particular project in terms of Purchase Orders been raised in the system for that particular Sales Order No. Basically we want to know that if the Sales Order Estimated Cost is 100 then the PO should not be allowed to make for more than 100.
In the Sales Order row I have an Udf called Estimated Cost U_ ESTCOST and users fill in every line item the Estimated Cost for that particular Sales Order.
Now I have made the following Udf in Purchase Order Header as under :
Sales Order Estimated Cost as U_ORDESTCOST
PO Cost U_ POESTCOST
Now in the Sales Order Estimated Cost udf which is there in the PO header I want the sum up of the row which is been put in Sales Order Estimated Cost U_ ESTCOST for that particular BP project. Can formatted search be used wherein if while making the Purchase Order Sales Order Estimated Cost udf U_ORDESTCOST is updated when in the Purchase Order Accounting Tab BP Project Is put. The requirement is that if in the BP Project e.g 10001 is put then the formatted search should search the ORDR table which also has the same BP Project 10001 in the Accounting Tab selected and then from RDR1 its should sum up the Estimated Cost U_ ESTCOST.
Now in PO Cost U_ POESTCOST field I want to have the total sum means Document Total of all the PO been made in the system till date for that Particular BP Project e.g 10001
Kindly advise what best can be done so that we are properly able to control the system
Regards,
VenkyDear Gordon,
Thanks for bearing with me.
Let me just break the requirements.
Now a New Sales Order is booked which is as under
Sales Order Document Number - 10001
Row Details as under :
Items Qty Row Total Estimated Cost (U_ ESTCOST)
Item 1 1 100 20
Item 2 1 200 30
In Accounting Tab in BP Project its given 2000
Hence the the sum of U_ ESTCOST is 50 for order number 10001 whose BP Project is 2000
Now for the above Sales Order a Manual purchase Order is made in the system
Purchase Order No 90000
Row Detail as under :
Items Qty Row Total
Item 1 1 100
Header has a udf named U_ORDESTCOST which means Sales Order Estimated Cost
In Accounting Tab in BP Project its given 2000
Now if you notice the common data which is there both in Sales Order and Purchase Order is the BP Project Number
I want that whenever a Purchase Order is made in the U_ORDESTCOST field the Sum of Estimated Cost U_ ESTCOST should get filled automatically based on the BP Project which is been put in the Accounting Tab of Purchase Order.
Means everytime 50 should be updated in U_ORDESTCOST because in the Sales Order where project code is 2000 theEstimated Cost (U_ ESTCOST) = 50.
See if I want I can make a query but I am not able to use the same in the formatted Search. The query is as under :
SELECT sum(T1.[U_ESTCOST]) FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[Project] = [%0]
The above query if attached is working fine in the Formated Search but due to [%0] its asking me to put the BP project which I want should automatically pick or refresh based on what is put in BP Project in Account Tab in Purchase Order. I think I need the BP Project $ some number....
Regards,
Venkat -
How to assign search help using ovs for select options for ALV in web dynpr
how to assign search help using ovs for select options for ALV in web dynpro
Hi,
refer http://wiki.sdn.sap.com/wiki/display/WDABAP/InputhelpofObjectValueSelectioninWDABAP
http://www.****************/Tutorials/WebDynproABAP/OVS/page1.htm
and http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproAbap-OVSsearch+help
Thanks,
Chandra -
How to create Search Help using more than 1 table
Hi all,
I need to create a search help using more than 1 table.
Eq:- Itable1 contains the data and Table2 contains the description of a field.
In my search help i require A field from Table1 and For the corresponding field description from Table2.Hi,
You can do this with the help of collective search help.
Collective search helps:- Combination of elementary search helps. When we need to fetch data based on multiple selection criteriau2019s. More than one tables are Selection from multiple tables
Steps for creating collective search help.
1) Enter the search help name and click on create.
2) Choose Collective search help radio button option as the search help type.
3) Enter the search help parameters.
Note that there is no selection method to be entered for a collective search help.
4) Instead of the selection method, we enter the included search helps for the collective search help.
5)We need to assign parameters for each of the included search helps.
6) Complete the parameter assignment by clicking on the push button.
7) Collective search help offers the user to obtain F4 help using any of the included search helps.
Hope this will help you:
Reagrds:
Alok -
How do i deduct dates using formatted search with a query
Hi Experts,
I would like to know how to get the date difference using query and formatted search. Below are the details:
1. I have created 3 Header UDF's composed of 2 Date type fields and 1 Quantity field.
2. The first one is for the Original Date, the next one is for the Payment Date and the Last one is for the No. of Days Lapsed.
What I would like to do is automatically compute for the number of days from the original date to the payment date. What query syntax should i use to achieve this?
Thanks,
YvetteHi Yvette,
It should be something like;
DATEDIFF (day, T0.[createDate], T0.[closeDate] ) as 'Aging' This is just an example. You may add your udf's instead of dates.
Thanks,
Joseph
Edited by: Joseph Antony on Jul 2, 2010 1:53 PM -
hi,
I need to create a matchcode for the field kunnr whose search help is DEBI.
1. In the transaction FBL5N (Customer Line Item Display) include a new match code Active Account with Balance.
2. The search parameters will be similar to match code Customers(By Company Code) / Customers per sales group.
3. When the search is made by entering the name in the name field , the program logic would be as:
a. The table KNB1 will be used to search the customer based on company code.
a. The list of customers obtained will be queried in the table KNA1(General Data in Customer Master) to get the list of customers with name 1, postal code , city etc.
b. This list of corresponding customers is queried in the Table BSID (Accounting: Secondary Index for Customers) to check if the customers have an open item.
c. If there is an open item for any customers then they are considered as Active customers.
d. Display only the list of active customers for the name search with the details Name1, city, Postal code, Customer No. , company Code etc.
My query is in the view which i am gonna create, what would be the join condition for the above logic.Is this related to BSP? Are you needing help creating the SQL statement for the logic you described? I guess I'm not sure what you are asking for and how it is related to BSP.
-
Hi,
Kinda new to this formatted search. Can anyone help me with this question.
I want to make a formatted search to make a column in sales order 'U_ItemType' so that if it is not null/if it is gift or sample, it will enter the value 'Y' in U_FOC. How do i do this?
Also can anyone point me to any resource to learn up on formatted search.
ThanksYou will need to create a query something like:-
[code]SELECT CASE $[$38.U_ItemType.0] WHEN 'Gift' THEN 'Y' ELSE 'N' END[/code]
This will need to compare the value of the U_ItemType in the current row to any conditions you want (eg. = 'Gift'), and return appropriate Y/N value.
Next you need to define the FS on the U_FOC field. When defining it you probably want to set:-
-Search By Saved Query (select query created above)
-Auto Refresh = "Y"
-When existing column altered
-Column = "U_ItemType"
-Display Saved Values
You can find out more about formatted searches in some of the online training courses available on the service marketplace (http://service.sap.com/smb). The training courses are available in the Education section under the heading "Learning Maps / Development Consultants".
Regards,
John. -
Can Formatted search be used in this situation?
Dear Experts,
I have defined a row level UDF called DIA. I input dia values in goods issue. Hence it is stored in ige1 table. When I receive those items in Goods Receipt, the Dia Column found blank. I need to have the dia value entered in IGE1 in Goods Receipt form.
Its some what like this.
Itemcode Qty DIA
a001 10 12
b001 20 20
c001 10 22
When I receive these items after the specified process, I make entry in Goods Receipt based on PO No,. That time, the form
shows blank value in DIA field. I need the DIA values entered for the Items to appear automatically from IGE1. Can I do this using formatted search. Please advise.
Thanks in adv.
AnandAs I understand, you want to make a goods issue transaction entering these values into the document rows and in an independent transaction (I could not catch it is a goods receipt or a goods receipt PO) to get these values.
First you should make a reference in the second transaction to the original one. The best is to define a header level UDF where you can write the DocNum of the original goods issue transaction (assuming you are using unique document numbers). We can call it e.g. U_SourceDocNum.)
Then you make an FMS like this:
Select R.U_DIA from IGE1 R inner join OIGE I on R.DocEntry=I.DocEntry
Where I.DocNum=$[OIGN. U_SourceDocNum] and R.ItemCode=$[IGN1.ItemCode]
And set it autorefresh when SourceDocNum is changes.
(The user should fill the SourceDocNum after filling the document lines!)
In the code I used OIGN and IGN1. If you use goods receipt PO in the second steg, you should replace them with OPDN and PDN1. -
ME13 - IEMP vendors being displayed in search Help using F4 key
Hi All,
When we are trying to search any vendor using F4 key in ME13, it is showing the name, street address etc.
Kindly let us know, if there is any solution for restricting this.
Thanks,
SandeepHi,
If you do a search on this forum for the terms "search help exit" you will get a few threads that provide details on how you can achieve this. -
Modifications in standard personnel no search help using FM RH_OBJID_REQUES
Hi Experts ,
I am using the FM RH_OBJID_REQUEST for providing seacrh help of personnel No in ABAP HR.
The Standard Tabs which are displayed when pressing F4 helps are
1)Search Term
2)Structure Search
3)Organisation Assignment
4)Last name u2013 First name
5)Employee Application number
6)Personnel Numbers with trip data by organiz. Assignment
7)Personnel Numbers with trip data
8)Payroll correction run
9)Interface toolbox; Export Program.
Out of these search help criterions ( tabs ) the client for some unknown reasons is asking for only pts no 1) , 2), 3) & 4)only.
How to achieve this ...??
Thankshi,
use costomized search help.
Regards,
Tarun -
WD ABAP - Search help using Selection-options
Hi Experts
i am using interface IF_WD_SELECT_OPTIONS method ADD_SELECTION_FIELD for filling the selection parameters
add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = '/DMF/EXT_PROD_ID'
it_result = lt_range_table
i_read_only = read_only
*I_HELP_REQUEST_HANDLER = lt
i_value_help_type = 'SEARCHHELP'
i_value_help_id = '/DMF/PROD_SHLP' ).
I would like to like to pass the importing parameter to '/DMF/PROD_SHLP'
Is it possible through this interface .
thnks in advanceI assume this is a data dictionary based search help. You can't pass the importing parameter directly into the field creation. Data Dictionary Search Helps get their importing parameters from their relationship to other attributes in the same context node automatically.
This is from the online help:
If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
If the context node is not mapped to the structure, the data element's input help can be used if there is one.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm -
hi
i am creating an alv report using PNP
i created a Search Help based on pa0021 i am using only 2 files PERNR and FAVOR and i want this SEARCH HELP to show only the names of the people who belong to the pernr i chosed
i am using this SEARCH HELP at a selection screen in my reprt
thanksHi, Ami
Please Test the following Sample Report hope will solve out your problem,
REPORT zfsl_sdn_test.
TABLES: pa0021.
PARAMETERS: pernr LIKE pa0021-pernr,
favor LIKE pa0021-favor.
** Search Help for Pernr
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pernr.
TYPES: BEGIN OF ty_pernr,
pernr LIKE pa0021-pernr,
favor LIKE pa0021-favor,
END OF ty_pernr.
DATA: it_pernr TYPE STANDARD TABLE OF ty_pernr WITH HEADER LINE.
SELECT pernr favor FROM pa0021
INTO CORRESPONDING FIELDS OF TABLE it_pernr
WHERE endda = '99991231'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PERNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'PERNR'
value_org = 'S'
TABLES
value_tab = it_pernr.
** Search Help for Favor
AT SELECTION-SCREEN ON VALUE-REQUEST FOR favor.
TYPES: BEGIN OF ty_favor,
pernr LIKE pa0021-pernr,
favor LIKE pa0021-favor,
END OF ty_favor.
DATA: it_favor TYPE STANDARD TABLE OF ty_favor WITH HEADER LINE.
SELECT pernr favor FROM pa0021
INTO CORRESPONDING FIELDS OF TABLE it_favor
WHERE endda = '99991231'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FAVOR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'FAVOR'
value_org = 'S'
TABLES
value_tab = it_favor.
Kind Regards,
Faisal -
Hi,
I'm facing an issue related to the variable search help.
I have a query which has been recently migrated to 7.0. When I open the query on Analyzer and look for values in a variable it is throwing me the relevent values for that particular variable itself, which is perfect.
When I run the same query on portal, and look for variable input values, I'm getting all the master data entries along with the variable value. I do not want all these other master data entries.
Please help.Hi,
There are two possible read modes for the value help of variables:
- Read mode "M" means "Values in master data table".
- Read mode "D" means "Only values in InfoProvider".
Please set related setting in infoobject level it should resolved your issue.
Regards,
Venkat -
How to display our own selected data in a search help using a exit
Hello,
I had created a Search Help Exit to restrict the values to be displayed in the search help. This code was written under the event 'DISP' in the exit. But it is not giving the desired result. So I want to replace the RECORD_TAB of the exit with my own selected data. For this I had written code for selection under the event 'SELECT'. But when I try to overwrite RECORD_TAB with this, this create errors.
What should I do to overwrite the values of the RECORD_TAB field with my own values?
Regards,
AbijithHi,
This is how we implemented the code modify the values in search help exit.
Check if display process button is pressed
IF callcontrol-step = 'DISP'.
Read the parameter ID for company code.
GET PARAMETER ID 'BUK' FIELD lv_bukrs.
IF sy-subrc EQ 0.
lwa_bukrs-sign = 'I'.
lwa_bukrs-option = 'EQ'.
lwa_bukrs-low = lv_bukrs.
APPEND lwa_bukrs TO lr_bukrs.
ENDIF.
Check if any entry is made in Test account/Testity account name
LOOP AT shlp-selopt INTO lwa_selopt.
CASE lwa_selopt-shlpfield.
WHEN 'ZZTEST'.
lwa_roy-sign = lwa_selopt-sign.
lwa_roy-option = lwa_selopt-option.
lwa_roy-low = lwa_selopt-low.
APPEND lwa_roy TO lr_roy.
WHEN 'ZZTEST_NAME'.
lwa_roy_name-sign = lwa_selopt-sign.
lwa_roy_name-option = lwa_selopt-option.
lwa_roy_name-low = lwa_selopt-low.
APPEND lwa_roy_name TO lr_roy_name.
ENDCASE.
ENDLOOP.
Get customer in entered for a company code
SELECT kunnr
bukrs
FROM knb1
INTO TABLE lt_knb1
WHERE kunnr IN lr_roy
AND bukrs IN lr_bukrs.
IF sy-subrc EQ 0.
SORT lt_knb1 BY kunnr.
Get customer name for the customer.
SELECT kunnr
name1
FROM kna1
INTO TABLE lt_kna1
FOR ALL ENTRIES IN lt_knb1
WHERE kunnr EQ lt_knb1-kunnr
AND mcod1 IN lr_roy_name.
IF sy-subrc EQ 0.
SORT lt_kna1 BY kunnr.
ENDIF.
ENDIF.
Get Values for Testty account selected by standard search help
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
parameter = 'Ztest'
fieldname = 'Ztest' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
results_tab = lt_test_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
Get Values for Testty account Name selected by standard search help
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
parameter = 'Ztest1'
fieldname = 'Ztest1' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
results_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
LOOP AT lt_knb1 INTO lwa_knb1.
CLEAR lwa_kna1.
READ TABLE lt_kna1
INTO lwa_kna1
WITH KEY kunnr = lwa_knb1-kunnr
BINARY SEARCH.
IF sy-subrc EQ 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lwa_kna1-kunnr
IMPORTING
output = lv_kunnr.
lwa_roy_help-ztest1 = lv_kunnr.
lwa_roy_help-ztest = lwa_kna1-name1.
APPEND lwa_roy_help TO lt_roy_help .
ENDIF.
ENDLOOP.
SORT lt_ztest_help.
DELETE ADJACENT DUPLICATES FROM lt_roy_help COMPARING ZTEST1.
Finally transport the computed numbers into the search help data.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = 'ZTEST1'
fieldname = 'ZTEST1'" Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
source_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
Finally transport the computed numbers into the search help data.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = 'ZTEST''
fieldname = 'ZTEST'' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
source_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
ENDIF.
Nabheet -
Calling the advance search help using f4 help
Hi
I have a question.In Items assignemnt blcok of the opportunity page for product ID field there is an f4 help associated with it. When we click on f4 help it will open the standard product serach in a popup where we can serarch for the products. and select the product from results.
But my requirment is to call the advance search help of the products instead of standard serch help in the popup when we click f4 help and should beable to save the searches and retrive the saved sercahes.
Can any one help me out with this problem
Thanks,
SreekarHi,
If you do a search on this forum for the terms "search help exit" you will get a few threads that provide details on how you can achieve this.
Maybe you are looking for
-
How can i see my device on itunes
how can i see my device on itunes
-
Upload file to production portal
My task is to map a folder which is in local system into "KM Content" under the "Content Management" in "Production Portal." Please help me to solve this problem
-
Apple seems to only allow me to listen to their pre-selected radio choices now. Where is the listing of existing broadcasts???
-
Hello. I am trying to distribute a compiled labview program on Ubuntu linux machines. However, I can't seem to get the Labview Run Time Enviroment to install on Ubuntu in order to run the executable. Has anyone managed to do this? I have tried using
-
How to record video via built in isight in Tiger
Hi, A friend of mine wants to record video on his Intel MacBook but is only running Tiger. Is this possible and if so, what's the best app to do it in? NB He is a novice user. Thanks, JC