How to default field values based on a sql query?
I have a create form that has employee_id and supervisor_id fields. I am defaulting the employee_id based on the login info (no problem there). Now I want to default the supervisor_id also. Supervisor id is based on a sql query that takes the employee_id as a parameter for the where clause.
How do I implement this in jDeveloper?
I figured how to do this. I created a new EO, associated it to my base EO via association. Then put this code in the base EO's create() method:
// Set supervisor id based on SupervisorEO
SupervisorEOImpl supEO = getSupervisorEO();
Number newSupId = supEO.getSupervisorId();
setSupervisorId(newSupId);
This seems to be the simplest.
Similar Messages
-
How to Handle Blank Field Value based Condition in SmartForms
Dear Sir,
In SMARTFORM , we need to define a Condition that incase Field Value is not equal to BLANK value (blank means that field is empty) then a specific text gets printed .
Our problem is that We do not know as how to define Empty Field Value based condition .
Had it been Non Empty Field value based condition then solution was simple and could be done in following way :
Field Value R Comparision Value
WA_KZDKZ = 'X'
In our case , we need to give Blank (Empty Value) instead of 'X' .
Kindly help us pl .
Rgds
B MittalHi,
To handle blank field values in SMARTFORMS,
Go to the conditions tab in your SMARTFORM and give condition there
Field Comparision operator value
<Field name> <> Here symbol is diff space.
eg:
wa_mara-matnr =/ space.
Regards,
Santosh Kumar M. -
Set the default field value to transaction code field, when calling from WD
Hi all,
Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
Is there any way to set the default field value to transaction code field, when calling from WD?
Please suggest, if anyone have any idea.
Thanks
SanketHi,
I am using the below code to open a standard transaction. It will help you to explain my point more easily.
DATA: url TYPE string,
host TYPE string,
port TYPE string.
*Call below method to get host and port
cl_http_server=>if_http_server~get_location(
IMPORTING host = host
port = port ).
*create URL
CONCATENATE 'http'
'://' host ':' port
'/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
INTO url.
*get the window manager as we are opening t code in external window.
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
call the url which we created above
lo_window_manager->create_external_window(
EXPORTING
url = url
RECEIVING
window = lo_window ).
lo_window->open( ).
Note*
One more query I want to add to this thread, that is there any possibility to call a custom transaction as well? -
Can you mask a field value based on another?
In XML publisher, is it possible to not display field values based on a value from another field? If so, how can this be accomplished?
For example, I have a field value for Address Line 1 as "123 Main Street". I don't want the City, State, Zip, County and Country to be be displayed in the pdf output. However, all other Address Line 1 values should be displayed.
Thanks in advance,
-joePLD is a very basic tool. The goal you try to achieve may not be available as I know of.
Thanks,
Gordon -
How To Print Field Value in TOP-OF-PAGE During Line Selection.
How To Print Field Value in TOP-OF-PAGE During Line Selection when double click on field.
(If my memory serves me well (not used for long time ago)
Assign values to system fields sy-tvar0 - sy-tvar9, they will replace the placeholders "&0" through "&9" in the list headers and column headers.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE: / 'Interactive Report &3'.
WRITE record-vbeln TO sy-tvar3.
Regards,
Raymond -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya -
How to add field value to the standard table
Hi,
How to add field value to the standard table?
for example:
when we go to TCODE SE16-> VBAK table -> on the selection screen if we press F4 against VBTYP we get all the available values for that field. How to add a new document Category value to this field so that it shows up in F4 help for that field.Hi Asif,
I don't think it is possible and feasible for adding new field value to the field VBTYP because it is not possible through SPRO.
If u see the domain of this field VBTYP we have fixed values provided by SAP. There is no value table for this. If u have value table then it will be updated through SPRO. But still if u really want to add some value u can do that by getting access key and add the value in the fixed values of the domain. But of no use other than simply displaying in F4. Because for what ever value u created here there will be no documents in VBAK or any table using this domain.
Hope this is clear for u.
Thanks,
Vinod. -
How to set field value in workflow SPD2013?
Hi All,
how to set field value in workflow SPD2013? Actually using Infopath, i need to update a field value through workflow.(Little differnt from SPD2010). How to do this?As Amit says, some elaboration here would be good. You can use InfoPath as a form for either a list or a library and then set it to trigger a workflow upon item creation. The workflow will consist a number of actions, one of which is the Update
Field Item.
More information on the available steps can be seen here.
http://msdn.microsoft.com/en-us/library/office/jj164026.aspx
Steven Andrews
SharePoint Business Analyst: LiveNation Entertainment
Blog: baron72.wordpress.com
Twitter: Follow @backpackerd00d
My Wiki Articles:
CodePlex Corner Series
Please remember to mark your question as "answered" if this solves (or helps) your problem. -
Problem in populating lookup values based on the lookup query from database
HI all
I have problem of population look-up values based on look-up query
I am giving the details what i am trying
I need to populate the values from the UD_LDAP_USR table into the field of UD_USRGRPC_NisNetTriple of type lookup
i planned to set the properties of lookup as like this
look up query as select UD_LDAP_USR_COMMON_NAME as NisNetTriple from UD_LDAP_USR
ColumnNames as UD_LDAP_USR_COMMON_NAME
Column captions as UD_LDAP_USR_COMMON_NAME
Column width as 30
Lookup Column Name as UD_LDAP_USR_COMMON_NAME
But when i try to add ColumnName as wht i mentioned above i m getting invalid property exception,update failed
I am not sure about that are we able to use other Connector table prefix with UD into the another processFrom
Let me give update on this issue
Urgent,struck my work here
thanks
NagarajThanks for the reply raghav
I tried but it was not working
I gave like what u specified but no use
It is throwing exception like set look-up query for the field
Any one help me out on this issue
Edited by: Nagaraju Chowdary on Jan 21, 2013 3:41 AM
Edited by: Nagaraju Chowdary on Jan 21, 2013 3:42 AM -
How to change characterics values in a ready input query ?
How to change characterics values in a ready input query base on a real time infocube?
when I use IP to planning I want to change characterices values that have exit in query?Hi,
On the properties tab of the characteristics (within input query) you can decide what values need to be populated when the query opens.
Is your exit written on char relationship?
regards,
Lokesh Nandula -
Showing column value as counter in sql query - report
I created a classic report with search bar based on an sql query. I would like to show the "notes" column in this query using some sort of counter and as a hyperlink to another section on the page (same idea as footnotes in a book). So if I have 10 rows and 5 have "notes". I should show 1,2,3,4,5 in the notes column for those rows and the number gets displayed as a link to another section listing the notes 1 through 5.
I was thinking of creating a hidden page item as the counter with value of 0 and then in my query doing counter+1 but i'm not sure how to do this or if i can do that...
If anyone can help or have any other ideas I would really appreciate it!!
Thanks,
HindyWell, I'm doing this in VB and the subquery is dynamic. I'm passing an ADO recordset to a routine that sets up a listview to display the results. The number of columns selected can vary. My idea was to size the columns appropriately based on the size of the data. Within the display routine I could:
sql = "SELECT "
for i = 0 to oRS.Fields.Count - 1
sql = sql & "MAX(LENGTH(" & i & ")), "
next 'i
sql = sql & "FROM (" & oRS.Source & ")" -
How to handle large result set of a SQL query
Hi,
I have a question about how to handle large result set of a SQL query.
My query returns more than a million records. However, the Query Template has a "row count" parameter. If I don't specify it, it by default returns only 100 lines of records in the query result. If I specify it, then it's limited to a specific number.
Is there any way to get around of this row count issue? I don't want any restriction on the number of records returned by a query.
Thanks a lot!No human can manage that much data...in a grid, a chart, or a direct-connected link to the brain.
What you want to implement (much like other customers with similar requirements) is a drill-in and filtering model that helps the user identify and zoom in on data of relevance, not forcing them to scroll through thousands or millions of records.
You can also use a time-based paging model so that you only deal with a time "slice" at one request (e.g. an hour, day, etc...) and provide a scrolling window. This is commonly how large datasets are also dealt with in applications.
I would suggest describing your application in more detail, and we can offer design recommendations and ideas.
- Rick -
How does Index fragmentation and statistics affect the sql query performance
Hi,
How does Index fragmentation and statistics affect the sql query performance
Thanks
Shashikala
ShashikalaHow does Index fragmentation and statistics affect the sql query performance
Very simple answer, outdated statistics will lead optimizer to create bad plans which in turn will require more resources and this will impact performance. If index is fragmented ( mainly clustered index,holds true for Non clustred as well) time spent in finding
the value will be more as query would have to search fragmented index to look for data, additional spaces will increase search time.
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
My TechNet Wiki Articles -
How to get ATINN value based on material number and Class Type ?
I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
-Obtain the batch characterstic value for the Material******************
SELECT atwrt
UP TO 1 ROWS
INTO v_charvalue
FROM ausp
WHERE objek = mcha-matnr
AND atinn = '0000000381' " 'US80_FRENCH_ON_LABEL'
AND klart = '001'.
THANKS N ADVANCE.Hi SAm,
use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
classtype = '023' "Class type
object = w_object "Material number with Leading zeros
no_value_descript = 'X' "Default X
objecttable = 'MCH1' "Table name Mara or MCH1 or MARC
TABLES
t_class = t_class "It return the Batch class available for the above combination
t_objectdata = t_char "Return Batch characteristics(ATWRT) and their value ATINN in this table
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
Regards,
Prabhudas -
Default a value based on the selection in the pop up
Hi Experts,
My requirement goes like this:
We have a custom pop-up to display plant fields for a component at the item level. If the user selects the plant in the pop-up, then the plant should get defaulted at the item level plant field. The plant field is also a custom field.
While creating the pop-up component, the binding has already been established between the two components.
My question is:
The pop-up component is different from the item view component. SO how to capture the event from the pop-up and code it to default the plant at the item level. How the code will be to call the value of one component from another.
How to default the plant value at the item block.
Thanks,
Sangeeta.Sangeetha,
Incase of pop ups, we need to specify a CLOSE EVENT HANDLER at the
very same place where we call the pop up.
gref_popup = me->comp_controller->window_manager->create_popup(
iv_interface_view_name = 'xxx/MainWindow'
iv_usage_name = 'Cuxxxx'
iv_title = lv_popup_title ).
gref_ppg_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
ENDIF.
* Set the callback event on the imported controller
gref_ppg_popup->set_on_close_event( iv_view = me
iv_event_name = 'POP_CLOSED' ).
In this event handler(it will be created in the source component itself) , you need to capture the outbound plug information and the data on the pop up
ASSIGN me->context->('AGREEMENT') TO <pointer>. "#EC NOTEXT
lr_target_node ?= <pointer>.
IF sy-subrc NE 0.
RAISE EXCEPTION TYPE cx_bsp_wd_incorrect_implement.
ENDIF.
CHECK lr_target_node IS BOUND.
IF account_popup IS BOUND.
* get the result (list) from the search
lv_fired_outbound = gref_popup->get_fired_outbound_plug( ).
CHECK lv_fired_outbound IS NOT INITIAL.
lr_node = gref_popup->get_context_node( 'PARTNER' )."#EC NOTEXT
You can refer to any standard UI F4 value help and understand the logic behind.
Regards,
Masood Imrani S.
Maybe you are looking for
-
Error while installing NW CE 7.1 ,databse instance on racle10g windows
Hi , I am facing this error when i am trying to install NW CE7.1 Data base instance on oracle 10g ,on windows ..please help me out Execution of the command " xxxxx\sapmnt\SID\SYS\exe\uc\NTAMD64\brconnect.exe -u / -c -o summary -f stats -o SAPSR3DB -t
-
Moving settings for LR5.2 to a new computer
Hi All, My computer HDD died :-( Luckily, I have made full HDD backups quite regularly and haven't really lost anything. However, I'm making a clean install of everything to get a fresh start. Over the years, I have built up quite a large set of L
-
I am using Lightrrom 4 and have just started seeing this error message with previously cataloged images and on new catalog imports. I can open the same images from the CF card in Bridge with no problem. How can I remedy this new problem?
-
Removing the database from Linux
What I have to delete (files) in order to remove my database from my computer (Linux) ? Thanks, Paul
-
Hi, I have a probook 4510s with Windows Vista and I had reset my password for the Administrator account and i can't remember my password. How can I get back on the account to change the password, but it has multiple accouts on it so when i tried the