Want to sort the records based on non-base table item

I have a multi-record block and I am trying to sort the data based on nbt item
I have a table called X which has x_type,x_code fields.
The table on which the block is created is Y. the table Y has x_type and y_desc as its fields
form layout is like below .the x_type is key field on which I have to query the records
and x_code is a non-base item in the form.I want to sort the records by X_code.
x_code y_desc
A     xyz
c par
B     lmn
my pre-query has this code
select x_type from y
where
x_type := x_type;
post-query has this code
select x_code from x
where x_type = :x_type;     
It works fine in Enter-Queryand execute query mode. but when I am sorting the records on
nbt item x_code by SET-BLOCK-PROPERTY it doesn't do any thing

Hi Tony ,
I have created a function and in Pre-Query & have add this
SET_BLOCK_PROPERTY('b1', ORDER_BY, 'fn_get_code(x_type)');
and the function created is as below
Function fn_get_code (p_x_type in varchar2) return varchar2 is
v_code varchar2(40);
begin
select x_code into v_code
from X, Y
where X.x_type = Y.x_type
and y.x_type = p_x_type
return v_code;
end;
when I run the form and execute query it comes up with the error message
FRM-40505 and when I pressed display error it shows
SQL Statement error:
SELECT ROWID,X_TYPE,X_CODE
FROM Y order by fn_get_code(x_type)
Error:
"ORA-00904: "FN_GET_code": invalid identifier"
Is it that I need to create a function on the database?. As I have created function
in program unit section

Similar Messages

  • Order by on Non-base table Item

    Hi,
    I have a base table block on Dept and some of the non-base table items(which are emp table and being populated through post-query).
    So, i have some base table items and non-base table items on the same block.
    No my problem is, i have to do ORDER BY on one of non-base table items..
    How can i do this ?
    Thanks in advance.

    The obvious answer is to create a view upon which to base the block, or alternatively you could use a FROM Clause Query so that you don't have to set the values in your POST-QUERY trigger.
    Richard

  • Sorting based on non-base table columns

    I have a form block based on X table. There are also some columns from Y table in the same block and the tables X and Y are joined through the appropriate columns. I want to sort the queried record in the block ( based on table X ) based on two columns that are present in the Y table. How do I do this? Any help would be highly appreciated. Ofcourse! we can create a view and achieve that. But I don't want to create a view. Also I can use select statement in the order by column. But it works if I select one column. But when I select two columns it says too many value. Any solutions

    why dont u create a function
    and sort by the returning values ?

  • Sorting the Records MDM JAVA

    Hi,
              I am using RetrieveRecordsByIdCommand to retrieve the records from MDM. I want to sort the records based on MDM ID.  I tried with SortDefinition which will be passed to the ResultDefinition, but it is not working. Please tell me any other way to sort the records based on a particular field values.
    Thanks,
    Sreenivasulu Thimmanapalli.

    Hi Sreenivasulu Thimmanapalli.
    Also, please check if the field to sort is with Sort-Index set to Normal. In your case, it could be set to None currently
    To confirm
    --Go to MDM Console, Select the Table > Select the Field (that you are trying to sort-on).
    --Look at Field Detail panel, the Sort Index properties should be set to Normal.
    -Wing
    Edited by: Wing Kee Chui on Jan 14, 2009 9:57 PM

  • Problem in sorting the records

    Hi All,
    I have to sort some records based on a key. If the key field is optional then how to sort the records. For example consider the follwing records.
    <row>
          <name>jaya</name>
          <address>hyd</address>
          <material>d</material>
          <units>4</units>
          <price>6</price>
    </row>
      <row>
          <address>ss</address>
          <material>wd</material>
          <units>7</units>
          <price>9</price>
       </row>
    <row>
          <name>radha</name>
          <address>pune</address>
          <material>g</material>
          <units>9</units>
          <price>3</price>
    </row>
    Here name field is used as a key in sorting the records. in the second record name field does'nt exists. All the records that doesnt have the name field shud come on the top and the rest with name field shud come sorted.
    Can anyone please helpout how to solve this problem??

    Jhansi,
    Did u solved the issue? The scenario is lil bit complicated, please consider my below suggestion, if you haven't achieved your results.
    I must really thankful to Michal and all my SDN friends,who guided me to use the logic-using multiple Mapping program in one Interface mapping.
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Ok, let us come to the logic.
    For your problem we need to use two mapping programs.
    <b>Mapping Program 1</b>
    http://www.flickr.com/photo_zoom.gne?id=897495319&size=o
    <b>Mapping Program 2</b>
    http://www.flickr.com/photo_zoom.gne?id=897495327&size=o
    http://www.flickr.com/photo_zoom.gne?id=897495341&size=o
    <b>UDF1 - Testing</b>
    http://www.flickr.com/photo_zoom.gne?id=897495429&size=o
    String temp;
    for(int i=0;i<Name.length;i++)
    for(int j=i1;j<Name.length;j+)
    if(Name<b>[</b>i<b>]</b>.compareToIgnoreCase(Name[j])>0)
               temp = Name<b>[</b>i<b>]</b>;
                Name<b>[</b>i<b>]</b>= Name[j];
                Name[j]=temp;
    for(int i=0;i<Name.length;i++)
    if(Name<b>[</b>i<b>]</b>.equals("0"))
    result.addSuppress();
    result.addContextChange();
    else
    result.addValue(""Name<b>[</b>i<b>]</b>"");
    result.addContextChange();
    <b>UDF 2 - Testin1</b>
    http://www.flickr.com/photo_zoom.gne?id=897495437&size=o
    String temp,temp1;
    for(int i=0;i<Name.length;i++)
    for(int j=i1;j<Name.length;j+)
    if(Name<b>[</b>i<b>]</b>.compareToIgnoreCase(Name[j])>0)
               temp = Name<b>[</b>i<b>]</b>;
                Name<b>[</b>i<b>]</b>= Name[j];
                Name[j]=temp;
          temp = Values<b>[</b>i<b>]</b>;
                Values<b>[</b>i<b>]</b>= Values[j];
                Values[j]=temp;
    for(int i=0;i<Values.length;i++)
    result.addValue(""Values<b>[</b>i<b>]</b>"");
    result.addContextChange();
    <b>Interface Mapping</b>
    http://www.flickr.com/photo_zoom.gne?id=897495361&size=o
    <b>Finally -Results:</b>
    http://www.flickr.com/photo_zoom.gne?id=897498639&size=o (My Data)
    http://www.flickr.com/photo_zoom.gne?id=897498659&size=o (Your Data)
    I hope it helps you!!!!
    I don't know whether this is the correct way or any other simplest way to do so. Also I request our friends to feedback their inpute regarding this logic.
    Jhansi,if you have any doubts in achieving the same, kindly reply back.
    Best regards,
    raj.

  • Retrieve the records based on date where date is not stored

    Hi,
    I have one table in Oracle.
    I want to retrieve the records which are added or modified after a particular date & time.(but the table does not contain any column for date & time )
    For example: Product table(pid number,pname varchar2)
    i am entering 10 records on date 21/07/2005
    i am entering 20 records on date 22/07/2005
    i am entering 15 records on date 23/07/2005
    i am entering 30 records on date 24/07/2005
    If i want to retrieve the records added after 22/7/2005
    (ie.) last 45 records
    But the table does not contain any date field.
    How will you know date & time of each record updated in the table.
    If any one knows, help me.
    bye.

    for 9iR2: check out online document of Oracle9i Application Developer's Guide - Fundamentals and search flash back query
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg08sql.htm#10851
    for 10G, flash back feature is enhenced to whole database level, you can still use flash back query though.

  • Do you want to save the record on detail block

    I have a master detail form. When i update the detail section and navigate to a different master item. I am getting do you want to save the record on my detail block.
    I want to post the changes everytime on the detail block. As i will rollback or commit depending if user saves the form or not on a button press.
    But I can not find any trigger that fires when i change the master record (after changing the detail block) any ideas?

    Hello all,
    I have problem to save list of records in stacked canvas block, that is it always save the record where current reocord indicator is indicating,
    can somebody help me out, how to save data on stacked canvas without having master-detail relationship.
    Regards,
    Ather Ali
    Edited by: user11972516 on Apr 17, 2011 1:27 AM

  • Sorting by non-base table fields - Is it possible?

    I have a form with a block that associated with a table.
    There are several base table fields and several non-base table fields displaying information in this block.
    I need to sort the data in this block by non-base table fields.
    Is this possible without rewriting the form so that the block is not associated with a base table, and then manually populating the block?

    This may help you.
    Example
    I have a customer_id in my base table, but I want the data ordered by customer_name which is from another table.
    Answer
    You need to create a function in the database with an associated
    pragma to specify the level of purity of the function
    WNDS (write no database state)
    WNPS (write no package state)
    PRAGMA RESTRICT_REFERENCES(fn_get_dname, WNDS, WNPS);
    Function fn_get_dname (p_empno in number) return varchar2 is
    v_dept_name varchar2(40);
    begin
    select dname into v_dept_name
    from dept, emp
    where dept.deptno = emp.deptno
    and emp.emp_no = p_emp_no;
    return v_dept_name;
    end;
    order by in a block based on the emp table (assuming you want a list of employees by department name)
    order by fn_get_dname(empno), empno

  • Can Shuttles be based non-base  table ViewObjects with transient attributes

    Hello,
    Users have to select records from a data collection and a Shuttle looks most appropriate/nice for this purpose. We can introduce technical intersection tables in order to generate the Shuttles with JHeadstart 10g R3 if necessary, but there is no “functional” need to update any data in the database and therefore it would be practical if the ‘right’ side from a Shuttle can be based non-base table ViewObjects with transient attributes only. So, our interested is to know which records have been selected, i.e. moved to the right side from the Shuttle.
    Hope that my question is clear enough.
    Greetings,
    Michael

    Michael,
    This cannot be generated out-of-the-box.
    It is easiest to add the shuttle post-generation to your page, and then create a custom template to generate your custom shuttle into the page. I suggest you take a look at an example of a generated shuttle in a page, and the JHeadstart IntersectionShuttleBean class. You will see that the value property of <af:selectManyShuttle> points to the selectedKeys method in the JHeadstart Shuttle bean. In your case, you can create your own managed bean and bind the value property to your own method which will provide you access to the selected rows. The value property of the selectItem within the af:selectManyShuttle determines the property that is used to identify the selected row (which is the row key in case of Jhs-generated shuttles).
    Steven Davelaar,
    JHeadstart Team.

  • Sorting by non-base table fields in Oracle Forms

    I have a form with a block that associated with a table.
    There are several base table fields and several non-base table fields displaying information in this block.
    I need to sort the data in this block by non-base table fields.
    Is this possible without rewriting the form so that the block is not associated with a base table, and then manually populating the block?

    Hi mark
    You could do the following
    Create a database function on the server,
    The function should return the value that you want to order by.
    In your form update the ORDER BY clause to use the function
    Example:
    Assume you have a block base on the employee table,
    and you want to order by the department name not the department no (The employee table only contains the department no)
    The function will be
    CREATE OR REPLACE FUNCTION "TEST_ORDER" (pDEPT_NO NUMBER) RETURN VARCHAR2 AS
    DptName VARCHAR2(100);
    BEGIN
    SELECT DEPT_NAME
    INTO DptName
    FROM DEPT
    WHERE DEPT_NO = pDEPT_NO;
    RETURN DptName;
    END;
    The form block ORDER BY Clause will be
    TEST_ORDER(DEPT_NO)
    Hope this will solve your problem
    Regards

  • Insert records into non base table

    Hi
    I would like to insert records into a table when a button is clicked. The table is a non base table. I am trying to save records displayed in a form into a history table which is not part of the form. I am using the following code stored in a program unit then called when the button is pressed. It doesn't generate any error but the records are not inserted. Can anyone please help.
    hist_id := 1;
    cust_name := :CUSTOMER.cust_name;
    loan_date := :LOAN.loan_date;
    return_date := LOAN.return_date;
    FORMS_DDL('INSERT INTO LOAN_HISTORY VALUES'||hist_id||','||cust_name||','||loan_date||','||return_date);

    Why do you need forms_ddl built in for a DML statement to be used in form?
    U can directly use insert.
    hist_id := 1;
    cust_name := :CUSTOMER.cust_name;
    loan_date := :LOAN.loan_date;
    return_date := LOAN.return_date;
    INSERT INTO LOAN_HISTORY VALUES (hist_id,cust_name,loan_date,return_date);
    It should work perfectly.

  • I can't save the record in a new/empy table of sqlserver in the entity Framework 5.0

    Hi guys ,
    I have tried to become a database expert in Entity Framework but I can't. because I am not able to save the record in a fresh/ empty table of sql server 2008 r2 database. for that I have watched the video tutorials step by steps that how to save the record.
    I followed the tutorials step by step and at the end the result is negative.
    I tried a simple way given below. please some one help me that where and what I missing the.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using EmployeesLib;
    namespace EmpApplication
    public partial class Form1 : Form
    private EMPEntities _dbContext;
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    _dbContext = new EMPEntities();
    var sql = _dbContext.Employees;
    this.employeeBindingSource.DataSource = sql.ToList();
    private void employeeBindingNavigatorSaveItem_Click(object sender, EventArgs e)
    this.Validate();
    _dbContext.SaveChanges();
    I have used datagrid addid a row by Click Add button on the NavigationBindingsource entered an employee name
    and clicking the save button on the NavigationBindingSource. When I am restarting the application I nothing founding on the Datagrid I am saving before.
    below is the Connection String in the App.config file both in the project.
    APP.CONFIG connection string
        <add name="EMPEntities" connectionString="metadata=res://*/EmpModal.csdl|res://*/EmpModal.ssdl|res://*/EmpModal.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=Inventory;integrated
    security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

    humm, I falling the ball to the batsman(sqlserver) but it getting "NOBALL" in response(not saving). Ok it my be problem in visual studio I am struggling to remove my operating System, VS2013 and sql server, by reinstalling it might works.
    because i havent any other computer where these application are installed for the test.
    If you create and send me a small project that contain minimum of two columns of table( in sql server ) which can saving new data from datagrid so i will thankfull of you.
    it is just for confirmation that either the problem is in OS or VS.
    I doubt that any of it has anything to do with the issue. If you think it does, then you can post to the forums.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
    I think you are riding a bad horse (that tutorial) you are using, and you need to change horses. I think the 'modified' state is not being rasied on the entity bound to the grid when it has changed, and EF is not going save any entity that's not in a modified
    state.

  • Hi All, Pls send me the recording for va01 by handling table control

    Hi All, Pls send me the recording for va01 by handling table control with 3 or more materials. Pls send me a flat file and code ASAP.
    Thanks&regards.
    Bharat

    Here is a example of similar kind ..plz go through this doc..it will be help hul 4 u
    How to deal with table control / step loop in BDC?
    Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen,
    our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
    Now, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
    Demo ABAP code has two purposes:
    1. how to determine number of visible lines and how to calculte page number; (the 'calpage' routine has been modify to meet general purpose usage)
    2. using field symbol in BDC program, please pay special attention to the difference in Static
    ASSIGN and Dynamic ASSIGN.
    Now I begin to describe the step to implement my method:
    (I use transaction 'ME21', screen 121 for sample, the method using is Call Transation Using..)
    Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.
    Then have a look at steploop itselp, one entry of it will occupy two lines.
    (Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
    Now we have : FixedLine = 9
    LoopLine = 2(for table control, LoopLine is always equal to 1)
    Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
    Now we have: FirstLine = 0
    or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
    Step3: write a subroutine calcalculating number of pages
    (here, the name of actual parameter is the same as formal parameter)
    global data: FixedLine type i, " number of fixed line on a certain screen
    LoopLine type i, " the number of lines occupied by one steploop item
    FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new
    " scrolling screen is empty, otherwise is 1
    Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
    pageno type i, " you need to scroll screen how many times.
    line type i, " number of lines appears on the screen.
    index(2) type N, " the screen index for certain item
    begin type i, " from parameter of loop
    end type i. " to parameter of loop
    *in code sample, the DataTable-linindex stands for the table index number of this line
    form calpage using FixedLine type i (see step 1)
    LoopLine type i (see step 1)
    FirstLine type i (see step 2)
    DataLine type i ( this is the item number you will enter in transaction)
    changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
    changing line type i.(visible lines one the screen)
    data: midd type i,
    vline type i, "visible lines
    if DataLine eq 0.
    Message eXXX.
    endif.
    vline = ( sy-srows - FixedLine ) div LoopLine.
    *for table control, you should compare vline with maximum line of
    *table control, then take the small one that is min(vline, maximum)
    *here only illustrate step loop
    if FirstLine eq 0.
    pageno = DataLine div vline.
    if pageno eq 0.
    pageno = pageno + 1.
    endif.
    elseif FirstLine eq 1.
    pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
    midd = ( DataLine - 1 ) mod ( vline - 1).
    if midd = 0 and DataLine gt 1.
    pageno = pageno - 1.
    endif.
    endif.
    line = vline.
    endform.
    Step4 write a subroutine to calculate the line index for each item.
    form calindex using Line type i (visible lines on the screen)
    FirstLine type i(see step 2)
    LineIndex type i(item index)
    changing Index type n. (index on the screen)
    if FirstLine = 0.
    index = LineIndex mod Line.
    if index = '00'.
    index = Line.
    endif.
    elseif FirstLine = 1.
    index = LineIndex mod ( Line - 1 ).
    if ( index between 1 and 0 ) and LineIndex gt 1.
    index = index + Line - 1.
    endif.
    if Line = 2.
    index = index + Line - 1.
    endif.
    endif.
    endform.
    Step5 write a subroutine to calculate the loop range.
    form calrange using Line type i ( visible lines on the screen)
    DataLine type i
    FirstLine type i
    loopindex like sy-index
    changing begin type i
    end type i.
    If FirstLine = 0.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loopindex gt 1.
    begin = Line * ( loopindex - 1 ) + 1.
    end = Line * loopindex.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    elseif FirstLine = 1.
    if loopindex = 1.
    begin = 1.
    if DataLine <= Line.
    end = DataLine.
    else.
    end = Line.
    endif.
    elseif loop index gt 1.
    begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
    end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
    if end gt DataLine.
    end = DataLine.
    endif.
    endif.
    endif.
    endform.
    Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index
    form creat_bdc.
    field-symbols: <material>, <quan>, <indicator>.
    data: name1(14) value 'EKPO-EMATN(XX)',
    name2(14) value 'EKPO-MENGE(XX)',
    name3(15) value 'RM06E-SELKZ(XX)'.
    assign: name1 to <material>,
    name2 to <quan>,
    name3 to <indicator>.
    do pageno times.
    if sy-index gt 1
    *insert scroll page ok_code"
    endif.
    perform calrange using Line DataLine FirstLine sy-index
    changing begin end.
    loop at DataTable from begin to end.
    perform calindex using Line FirstLine DataTable-LineIndex changing Index.
    name1+11(2) = Index.
    name2+11(2) = Index.
    name3+12(2) = Index.
    perform bdcfield using <material> DataTable-matnr.
    perform bdcfield using <quan> DataTable-menge.
    perform bdcfield using <indicator> DataTable-indicator.
    endloop.
    enddo.
    Sample code
    Following is a sample code of handling table control in BDC.
    REPORT Y730_BDC5 .
    *HANDLING TABLE CONTROL IN BDC
    DATA : BEGIN OF IT_DUMMY OCCURS 0,
    DUMMY(100) TYPE C,
    END OF IT_DUMMY.
    DATA : BEGIN OF IT_XK01 OCCURS 0,
    LIFNR(10) TYPE C,
    BUKRS(4) TYPE C,
    EKORG(4) TYPE C,
    KTOKK(4) TYPE C,
    NAME1(30) TYPE C,
    SORTL(10) TYPE C,
    LAND1(3) TYPE C,
    SPRAS(2) TYPE C,
    AKONT(6) TYPE C,
    FDGRV(2) TYPE C,
    WAERS(3) TYPE C,
    END OF IT_XK01,
    BEGIN OF IT_BANK OCCURS 0,
    BANKS(3) TYPE C,
    BANKL(10) TYPE C,
    BANKN(10) TYPE C,
    KOINH(30) TYPE C,
    LIFNR(10) TYPE C,
    END OF IT_BANK.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = 'C:\VENDOR.TXT'
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = IT_DUMMY.
    LOOP AT IT_DUMMY.
    IF IT_DUMMY-DUMMY+0(2) = '11'.
    IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
    IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
    IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
    IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
    IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
    IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
    IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
    IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
    IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
    IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
    IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
    APPEND IT_XK01.
    ELSE.
    IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
    IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
    IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
    IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
    IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
    APPEND IT_BANK.
    ENDIF.
    ENDLOOP.
    LOOP AT IT_XK01.
    REFRESH IT_BDCDATA.
    perform bdc_dynpro using 'SAPMF02K' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02K-REF_LIFNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02K-LIFNR'
    IT_XK01-LIFNR.
    perform bdc_field using 'RF02K-BUKRS'
    IT_XK01-BUKRS.
    perform bdc_field using 'RF02K-EKORG'
    IT_XK01-EKORG.
    perform bdc_field using 'RF02K-KTOKK'
    IT_XK01-KTOKK.
    perform bdc_dynpro using 'SAPMF02K' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'LFA1-TELX1'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'LFA1-NAME1'
    IT_XK01-NAME1.
    perform bdc_field using 'LFA1-SORTL'
    IT_XK01-SORTL.
    perform bdc_field using 'LFA1-LAND1'
    IT_XK01-LAND1.
    perform bdc_field using 'LFA1-SPRAS'
    IT_XK01-SPRAS.
    perform bdc_dynpro using 'SAPMF02K' '0120'.
    perform bdc_field using 'BDC_CURSOR'
    'LFA1-KUNNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02K' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'LFBK-KOINH(02)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    DATA : FNAM(20) TYPE C,
    IDX TYPE C.
    MOVE 1 TO IDX.
    LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
    CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
    perform bdc_field using FNAM
    IT_BANK-BANKS.
    CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
    perform bdc_field using FNAM
    IT_BANK-BANKL.
    CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
    perform bdc_field using FNAM
    IT_BANK-BANKN.
    CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
    perform bdc_field using FNAM
    IT_BANK-KOINH.
    IDX = IDX + 1.
    ENDLOOP.
    perform bdc_dynpro using 'SAPMF02K' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'LFBK-BANKS(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02K' '0210'.
    perform bdc_field using 'BDC_CURSOR'
    'LFB1-FDGRV'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'LFB1-AKONT'
    IT_XK01-AKONT.
    perform bdc_field using 'LFB1-FDGRV'
    IT_XK01-FDGRV.
    perform bdc_dynpro using 'SAPMF02K' '0215'.
    perform bdc_field using 'BDC_CURSOR'
    'LFB1-ZTERM'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02K' '0220'.
    perform bdc_field using 'BDC_CURSOR'
    'LFB5-MAHNA'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02K' '0310'.
    perform bdc_field using 'BDC_CURSOR'
    'LFM1-WAERS'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'LFM1-WAERS'
    IT_XK01-WAERS.
    perform bdc_dynpro using 'SAPMF02K' '0320'.
    perform bdc_field using 'BDC_CURSOR'
    'WYT3-PARVW(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    CALL TRANSACTION 'XK01' USING IT_BDCDATA
    MODE 'A'
    UPDATE 'S'
    MESSAGES INTO IT_BDCMSGCOLL.
    ENDLOOP.
    FORM BDC_DYNPRO USING PROG SCR.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-PROGRAM = PROG.
    IT_BDCDATA-DYNPRO = SCR.
    IT_BDCDATA-DYNBEGIN = 'X'.
    APPEND IT_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-FNAM = FNAM.
    IT_BDCDATA-FVAL = FVAL.
    APPEND IT_BDCDATA.
    ENDFORM.
    Reward if helpful

  • Order by on a non-base table field

    I want to order by on a non-base table field in a form. Can any body help how to do this in a form.
    Thanks

    Ramesh,
    I am not sure of ver 4.5. But in v6i, I did something similar.
    What I did was :-
    1. Based the Block's datasource on a stored procedure and
    not TABLE
    I'm not sure if it can be achieved in 4.5. First check if the block data source can be based on a stored procedure.
    Here's a sample code of what i did :-
    /* Description : Using a stored procedure as a block datasource.
    Author : Shailender Mehta
    Create Or Replace PACKAGE my_datasource Is
    /* Shailender Mehta */
    TYPE outrec is RECORD (comp_id tbgp_gl_detail.comp_id%Type
    ,cc_id tbgp_gl_detail.cc_id%Type
    ,journal_no tbgp_gl_detail.journal_no%Type
    ,account_code tbgp_gl_detail.account_code%Type
    ,debit_amt tbgp_gl_detail.debit_amt%Type
    ,credit_amt tbgp_gl_detail.credit_amt%Type
    ,sort_order Number(1)
    TYPE outcur is REF CURSOR RETURN outrec;
    PROCEDURE outquery (resultset In Out outcur
    ,p_journalno In Number);
    END;
    Create Or Replace PACKAGE BODY my_datasource IS
    PROCEDURE outquery(resultset In Out outcur
    ,p_journalno In Number)
    Is
    BEGIN
    OPEN resultset FOR
    SELECT comp_id
    , cc_id
    , journal_no
    , account_code
    , debit_amt
    , credit_amt
    , Decode(substr(account_code,6,1), 'g', 1,
    'd', 2,
    'b', 3,
    'h', 4,
    'f', 5,
    'a', 6,
    'c', 7, 8) sort_order
    FROM tbgp_gl_detail
    WHERE journal_no = p_journalno
    ORDER BY 7;
    END;
    END;
    Use the Block Data Wizard, which will guide you step by step what next to be done.
    In my example, I'm sorting the resultset by the 6th character of the string Account Code.
    In your case, you could join the main table by the one used in your POST-Query in the stored procedure and sort the resultset.
    - Shailender -

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

Maybe you are looking for

  • How to enable repetitive values in report.

    hi, I dont want to supress values in my report. my report is being displayed  in following way. plant     price 1000     200 blank    300 blank    400 2000     500 blank    600. But i want to display the report in following way. I want plant (charact

  • Sold-to Party (Document header)

    Hi, when i create a sales order by a certain type and if in sold-to-party field i write a certain customer, a popup dialog Sold-to Party (Document header) appears with some information fields: Postal code, Email, Fax, Street adress,PO Box addres,Comm

  • Is this a bug in __env_close_pp?

    I'm using Berkeley DB 4.6.21. in __env_close_pp, this function calls __repmgr_close, then __env_close, and __env_close calls __rep_env_close. __repmgr_close will join any replication threads(selector, messengers, and elect_thread). But __rep_env_clos

  • TDS and Excise in MRNB

    Hi I have used MRNB for revaluation of GRs. The TDS amounts are not calculated. How can i post this? Also how can excise be posted? Thanks Rahul

  • Cotent Conversion Parameters at reciver side

    hi, i have file stucture like, <node>     <field1>aaa</field1>     <field2>bbb</field2>     <field3>ccc</field3>     <field4>ddd</field4>     <subnode1>          <field5>dd</field5>          <field6>ee</field6>     </subnode1>     <subnode2>