Insert default value into account in AP/Invoice service

How I can insert a default value in account in AP/Invoice ?
I try use a Formated Search this is an better way?
declare @conta varchar(20)
set @conta= '62298000'
If  $[OPCH.DocType]='S'
SELECT @conta  FROM [dbo].[PCH1] T0
   WHERE T0.DocNum = $[$20.1.0]

IF $\[OPCH.DocType] = 'S'
SELECT '62298000'

Similar Messages

  • How to insert a default value into MS server in java - help please

    hi
    suppose if i have a table and one of the column has a default value when the table was created. how can i insert the default value into this column? assuming that the column is the second column and i can't specify the column name when inserting. thanks.

    thanks for ur response, so if i have insert statement as follow
    insert into someTable values (1,'val1', 'val2', 'val3', 'val4')
    and column 3 has default value = DEFAULT
    then, to insert default value, my insert statement will look like this
    insert into someTable values (1,'val1', 'val3', 'val4')
    but the number of values will not match the number of columns.

  • How to insert column values into database as rows

    Hi,
    I have 8 columns and some not null columns. Based on not null columns I want to insert into table as rows. The 8 columns may contain values or no value. If the first column contains data, then I have to insert into one row. if the second column contains data I have to insert a row and in second column. respectively...So How can I insert column values into rows. Can I write 8 insert statements. (OR) is it possible to insert data from columns using where clause.
    Please help me out....
    Thanks in Advance

    Lines Table:
    line_id, orcl_bank_account_num, product_type, service_type, lease_type,
    funding_type, cpi, billing_frequency_unit_cd , annual_due_date ,
    pricing_start_date, pricing_end_date, install_date, contract_end_date ,
    prdct_replacement_cost_amt, cradle_replacement_amt, supranet_contract,
    issuance_fee, board_inactive_date, header_id, creation_date, last_modified_date,
    created_by_nam, modified_by_nam, activeinactive_flg, prdct_bill_amt_yr1,
    prdct_bill_amt_yr2, prdct_bill_amt_yr3, prdct_bill_amt_yr4, prdct_bill_amt_yr5,
    prdct_bill_amt_yr6, prdct_bill_amt_yr7, prdct_bill_amt_yr8, activation_fee_yr1,
    activation_fee_yr2, activation_fee_yr3, activation_fee_yr4, activation_fee_yr5,
    activation_fee_yr6, activation_fee_yr7, activation_fee_yr8,
    In this table the columns structure is :
    -- PRDCT_BILL_AMT_YR (1 to 8) NUMBER(14,4)
    -- ACTIVATION_FEE_YR (1 to 8) NUMBER(8,2)
    I have one more table:
    PRDCT_INS_AMT               NUMBER(14,4)
    ACTIVATION_FEE_AMT          NUMBER(14,4)
    I want to insert prdct_bill_amt_yr (1 to 8) columns data into PRDCT_INS_AMT column. similarly activation_fee (1 to 8) columns data.
    But the data should be inserted based product_type, service_type, lease_type columns values. (These 3 columns may contain upto 45 combinations).

  • Inserting a Value into otherTable using an App. Proc. from a Date Picker

    I'm trying to call an Application Process that will insert an Attribute of a Row, into another table, after selecting a date from a Date Picker cell.
    I don't know why this shouldn't be possible. I think I've got all of my "Ducks in a Row", so to speak,
    but the Value that is being inserted into the other table is this:.. [object HTMLTableCellElement]
    (Ultimately, I'd like my Application Process to include Page element values with the insert as well, but I'm trying to handle one problem at a time)
    Here's a list of all the steps I've covered:
    1. I've Created an Application Process, (popDevices). The Process Point is "On-Demand". The Type is "PL/SQL Anonymous Block".
    The Process is defined as such:
    BEGIN
    Insert into P_DEVICES
    NAME,
    IP_ADDRESS,
    MODEL
    ) values
    'Unassigned',
    'Unassigned',
    :P153_MODEL
    COMMIT;
    END;
    2. I've Included the Javascript in the Page HTML Header.
    The Javascript is written as such: (minus the tags)
    function popDevices(PART_NO)
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=popDevices',0);
    get.add('P153_MODEL',PART_NO);
    gReturn = get.get();
    get = null;
    3. I've included the following in the "Element Attributes" field of the Date-Picker Item (Date_Delivered).
    The Region Type is "SQL Query (Updatable Report)"
    onChange="javascript:popDevices(PART_NO);"
    THE RESULTS
    A. A row does get inserted into the other (P_Devices) table,
    But the value of the Attribute from the Page Region is not valid.
    The Inserted value is this: [object HTMLTableCellElement]
    B. I have tried Every conceivable combination of characters in the "Element Attributes" field, such as:
    ...(PART_NO), (#PART_NO#), (||PART_NO||), (+PART_NO+)
    C. The Javascript in the Page HTML Header appears to be correct, since I have written it this same way for other applications without any problems.
    D. If this simply cannot be done by referencing the "onChange" Javascript from the "Element Attributes" field,
    Then can you help me to write the code into the Select statement of the region.
    Thanks for any help you can give me.
    -Gary

    This may not be the most direct approach to the solution. But, none the less, it is a solution.
    For those other novices, like myself, I hope this can be useful at some point in your development:
    MY DESIRED RESULT:
    A. To Insert into another tablle values derived from both; Page Item (i.e. P153_x) and Attributes of a Row in an Updatable Report from which I have selected the Date-Picker.
    B. I want the insert to occur automatically after the user Selects the date from the Date-Picker.
    SOLUTIONS:
    1. I usea Javascript prompt window to prompt for information and store the information in Pre-Created Page Items.
    This is the Javascript as I've entered it into the Page HTML Header region: (Minus the Tags)
    function received_javaprompt () {
    var Serial_Number = prompt("Enter the Serial Number");
    var Bldg_Id = prompt("Enter the Bldg_Id");
    var Clst_Id = prompt("Enter the Clst_Id");
    $x('P153_SERIAL_NO').value = Serial_Number;
    $x('P153_BLDG_ID').value = Bldg_Id;
    $x('P153_CLST_ID').value = Clst_Id;
    2. I needed to identify the (Manufacturer and Part_No) Column Attribute in the Row from which I selected the Date-Picker.
    A. To do this, I enumerated the Columns in the order they were listed in the Select Statement of the region (Click on the Region Definition Tab).
    B. Then (Click on the Report Attributes Tab). Count, In the numerical order which these columns are selected, ONLY the columns that are Editable.
    C. When I counted down as far as the Column I wanted to capture the value of, Then I made a mental note of that number and used it in the following (2) Javascripts (findMaker and findModel).
    3. findMaker (Minus the tags)
    function findMaker (pThis) {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    var Maker = html_GetElement('f15_'+vRow).value
    $x('P153_MAKER').value = Maker;
    4. findModel (Minus the tags)
    function findModel (pThis) {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    var Model = html_GetElement('f16_'+vRow).value
    $x('P153_MODEL').value = Model;
    5. I added one more Javascript, to the Page HTML Header, that references the Application Process which will Insert the values into the "Other" table:
    function popDevices(P153_SERIAL_NO,P153_BLDG_ID,P153_CLST_ID,P153_MAKER,P153_MODEL)
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=popDevices',0);
    get.add('P153_SERIAL_NO',P153_SERIAL_NO);
    get.add('P153_BLDG_ID',P153_BLDG_ID);
    get.add('P153_CLST_ID',P153_CLST_ID);
    get.add('P153_MAKER',P153_MAKER);
    get.add('P153_MODEL',P153_MODEL);
    gReturn = get.get();
    get = null;
    6. I added the "onChange" process to the Element Attributes field of the Table item which utilizes the Date-Picker:
    A. Click on the Report Attributes Tab of the Region.
    B. Click on the Edit icon of the column which utilized the Date-Picker
    C. I added this "onChange" reference to the Element Attributes field, which is found in the Tabular Form section.
    onChange="javascript:received_javaprompt();findModel(this);findMaker(this);popDevices((P153_SERIAL_NO).value,(P153_BLDG_ID).value,(P153_CLST_ID).value,(P153_MAKER).value,(P153_MODEL).value);"
    7. The Application Process which inserts the collected data into the table is as follows:
    (Name= popDevices: Process Point= On-Demand: Type= PL/SQL Anonymous Block)
    BEGIN
    Insert into P_DEVICES
    BLDG_ID,
    CLST_ID,
    NAME,
    IP_ADDRESS,
    SERIAL_NO,
    MAKER,
    MODEL
    ) values
    :P153_BLDG_ID,
    :P153_CLST_ID,
    'Unassigned',
    'Unassigned',
    :P153_SERIAL_NO,
    :P153_MAKER,
    :P153_MODEL
    COMMIT;
    END;
    Well, I hope this may help someone else like me.
    I usually arrive at my solutions by getting help here on the Discussion Forum and also Google. Google inevitably points me to a previous Apex Discussion Forum session.
    Edited by: garyNboston on Mar 15, 2010 10:55 AM

  • An incorrect default value of account assignment group in sales order

    I created a new sales order; however, the default value for account assignment group is not the same value maintained in customer master.
    Any idea how could this happen?

    have you checked user exit MV45AFZZ? Maybe there is a coding inside, changing the default value when creating a new sales order.
    regards
    Ralf

  • Default values in Account creation page

    Hello.
    I'm new to CRM and this forum too.
    I need some guidance. I have to set default values in account creation page. For this, I thought to use DO_INIT_CONTEXT method. And, when I searched this forum, I see a lot of threads about BADI CRM_BP_UIU_DEFAULTS.
    Can someone explain if there is any difference if we implement that using DO_INIT_CONTEXT method?
    Thanks to all!

    Hello,
    Actually, some BADI are WebUI specific.
    BADI CRM_BP_UIU_DEFAULTS only gets trigerred in WebUI BP screens.
    DO_INIT_CONTEXT method will be triggered every time you open a window wich contains the view considered. So not only during BP creation.
    Chris Evans, This is the way to go to initialize some fields during BP creation : use of BADI CRM_BP_UIU_DEFAULTS.
    Hope this helps.
    Best regards,
    Sylvain AGUETTAZ

  • Default value at Account Object Field setup

    Hi,
    How to give default value as ‘On Demand’ for the Source field at the time of Account creation and also we need to bypass this default value if the channel is web service and data import. This default should only effect if it is being done from OD UI.
    I added below expression in DefaultValue
    ([<IndexedPick5>] = LookupValue("OCC_INDEX_CUST_LOV_ACCOUNT_5","On Demand")) AND (ExcludeChannel(‘Web Services’)) AND (ExcludeChannel(‘Import’))
    but it giving an error as below when clicking New button in Account Object:
    1] An error occurred calculating the default value for field 'Indexed Pick 5' in business component
    'Account'.(SBL-DAT-00412) [2] Could not evaluate expression 'Expr: 'LookupValue([<IndexedPick5>],"On Demand") OR (ExcludeChannel(‘Web Services’))'' for field 'Indexed Pick 5' in business component 'Account'.(SBL-DAT-00394) [3] CSSString doesn't support operator 'OR'(SBL-DAT-00479)
    Thanks
    Bob

    Try the following.
    IIf(ExcludeChannel(‘Web Services’) or ExcludeChannel(‘Import’), 'On Demand', '')
    Cheers!
    Shilei G

  • Insert a value into bol attribut

    Hiii,
    I will insert a value into a bol attribut with the method "SET_PROPERTY".
    Here is my code so far.
    lr_entity ?= me->typed_context->builheader->collection_wrapper->get_current( ).
    if lr_entity is bound.
          lr_entity->set_property( EXPORTING
                                   iv_attr_name = 'TITLE_KEY'
                                   iv_value = '0100'
    endif.
    The problem here is, I can the in the debug mode, that the value is inserted.
    But by running the debug mode again, the value of the attribut 'TITLE_KEY' is empty.
    My question here is, how can I save the value of attribut?
    Can anybody help me please?
    regards,
    John

    Hallo Ashish,
    I already tried to do this with
    DATA lr_core TYPE REF TO cl_crm_bol_core.
    lr_core = cl_crm_bol_core=>get_instance( ).
    lr_core->modify( ).
    It is also interessting that, after
    lr_core->modify( ).
    I cann't look into the bol entity builheader during debugging.
    Durring debugging, ATTRIBUTE_REF(Container Proxy->DATA REF-> ATTR_REF)
    Do you have any other idea?
    reagards,
    John

  • Defaulting values into infotype

    Hi all,
    Is there a way to default vaules into infotypes?
    For Eg: if i have a hiring action in place for company code XXX, can i set it somewhere that all employees hav the same personnel area yy or sub area zz ?

    Hi Suker,
    For Payroll Area, you can use Feature ABKRS. Use Transaction Code PE03 to access the initial features screen, then input ABKRS.
    For the other infotypes, try maintaining your org structure, using the Org and staffing interface. Defaulting these infotypes can be done in org assignment interface, and default your values through the Account Assignment tab.
    In the Account Assignment tab, enter the CoCode, and click on the default icon to the right so you can input your Personnel and sub areas as well as cost centers etc.
    Good Luck and lets know if this helps.
    Tata

  • Does JDBC insert a value into the Primary Key?

    Hi,
    I'm using a servlet to input data froma n html form ,into an ACCESS Database.I'm using SQL statements i t he servlet ,and i'm confronted with the question:
    ALL database records are indexed with B_ID as the "Primary Key".
    I want to know: If I add the fields without a B_ID ..will SQL/JDBC/Access automatically add one for me?
    Or must I create the system that will count the records before adding a new B_ID?
    Hope you can help me.Thanks!
    Aesh83

    Access has a datatype claus for this autoincrement feature.
    I just can't remember its name.
    If you have such a primary key column in your table, you would simply insert values in each column except that, so this would automatically generate its value by incrementing the key.
    Your INSERT had to enumerate all columns you explicitely fill with values and skip this key column and those ones which shall be set to NULL btw. the defined default value (is there a DEFAULT clause in Access?)

  • How to insert parameter value into multiple columns and rows

    Hi All,
    I have one procedure insert_tab and I am passing
    100~101~102:103~104~105:106~107~108 as a parameter to that procedure. I wanted to insert each numeric value into one column. The output of the table should contain
    Table:
    Col1 Col2 Col3
    100 101 102
    103 104 105
    106 107 108
    Awaiting for your reply..

    That's not more clear for me...
    Anyway, if you really want a procedure for that, try :
    SQL> create table tblstr (col1 number,col2 number,col3 number);
    Table created.
    SQL>
    SQL> create or replace procedure insert_fct (p_string IN varchar2)
      2  as
      3  v_string     varchar2(4000):=p_string||':';
      4  v_substring  varchar2(4000);
      5 
      6  begin
      7      while instr(v_string,':') > 0 loop
      8            v_substring := substr(v_string,1,instr(v_string,':')-1)||'~';
      9            insert into tblstr(col1,col2,col3)
    10            values (substr(v_substring,1,instr(v_substring,'~',1,1)-1),
    11                    substr(v_substring,instr(v_substring,'~',1,1)+1,instr(v_substring,'~',1,2)-instr(v_substring,'~',1,1)-1),
    12                    substr(v_substring,instr(v_substring,'~',1,2)+1,instr(v_substring,'~',1,3)-instr(v_substring,'~',1,2)-1));
    13            v_string:=substr(v_string,instr(v_string,':')+1);
    14      end loop;
    15  end;
    16  /
    Procedure created.
    SQL>
    SQL> show err
    No errors.
    SQL>
    SQL> select * from tblstr;
    no rows selected
    SQL> exec insert_fct('100~101~102:103~104~105:106~107~108')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
    SQL> exec insert_fct('109~~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~110~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~~111')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
           109
                      110
                                 111
    6 rows selected.
    SQL> Nicolas.

  • How do I insert multiple values into different fields in a stored procedure

    I am writing a Stored Procedure where I select data from various queries, insert the results into a variable and then I insert the variables into final target table. This works fine when the queries return only one row. However I have some queries that return multiple rows and I am trying to insert them into different fields in the target table. My query is like
    SELECT DESCRIPTION, SUM(AMOUNT)
    INTO v_description, v_amount
    FROM SOURCE_TABLE
    GROUP BY DESCRIPTION;
    This returns values like
    Value A , 100
    Value B, 200
    Value C, 300
    The Target Table has fields for each of the above types e.g.
    VALUE_A, VALUE_B, VALUE_C
    I am inserting the data from a query like
    INSERT INTO TARGET_TABLE (VALUE_A, VALUE_B, VALUE_C)
    VALUES (...)
    How do I split out the values returned by the first query to insert into the Insert Statement? Or do I need to split the data in the statement that inserts into the variables?
    Thanks
    GB

    "Some of the amounts returned are negative so the MAX in the select statement returns 0 instead of the negative value. If I use MIN instead of MAX it returns the correct negative value. However I might not know when the amount is going to be positive or negative. Do you have any suggestions on how I can resolve this?"
    Perhaps something like this could be done in combination with the pivot queries above, although it seems cumbersome.
    SQL> with data as (
      2        select  0 a, 0 b,  0 c from dual   -- So column a has values {0, 1, 4},
      3  union select  1 a, 2 b, -3 c from dual   --    column b has values {0, 2, 5},
      4  union select  4 a, 5 b, -6 c from dual ) --    column c has values {0, -3, -6}.
      5  --
      6  select  ( case when max.a > 0 then max.a else min.a end) abs_max_a
      7  ,       ( case when max.b > 0 then max.b else min.b end) abs_max_b
      8  ,       ( case when max.c > 0 then max.c else min.c end) abs_max_c
      9  from    ( select  ( select max(a) from data ) a
    10            ,       ( select max(b) from data ) b
    11            ,       ( select max(c) from data ) c
    12            from      dual ) max
    13  ,       ( select  ( select min(a) from data ) a
    14            ,       ( select min(b) from data ) b
    15            ,       ( select min(c) from data ) c
    16            from      dual ) min
    17  /
    ABS_MAX_A  ABS_MAX_B  ABS_MAX_C
             4          5         -6
    SQL>

  • Insert float value into ms sql server

    Hi.
    How do I insert a float value into my ms sql db.
    The Code:
    select.setFloat( 4, theForm.getVaerdi() );ERROR:
    "MakeClapetInsertAction.java": Error #: 300 : method setFloat(int, java.lang.Float) not found in interface java.sql.PreparedStatement at line 89, column 12

    setFloat takes a float primitive, not a Float object.
    select.setFloat( 4, theForm.getVaerdi().floatValue() );

  • Reading BFile datatype value to insert corresponding value into blob

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

  • How can I insert a value into the Oracle Date column using JDBC?

    Suppose I have a table TEST created by "create table TEST (c1 INT, c2 Date);"
    Now I want to insert some proper value into the table TEST's column c2. I couldn't do that by TRYing using Java.sql.Date, Java.Util.Date, Java.String.
    Could anyone give me some suggestions by providing the sample code?
    Many thanks for your help!
    Wendy

    What about building the java string:
    "Insert into test (c1,d1) values ("+
    Integer.toString(var)+
    ", TO_DATE("
    formatYourDateVariableWithCalendarMethods
    ",'DD-MON-YYYY')"
    and executing it ??

Maybe you are looking for