Using URL variable to set initialy selected ds row

Hello everyone,
Could anybody suggest a solution or point me to a working
demo of a script that processes a URL variable and set the current
row accordingly. I am trying to pass a @id of a particlar row in a
URL variable to identify a particluar row, I want to be selected
initially.
Thanks,
Nick

Hy guys,
Just figured it out myself. Here is the script:
<script type="text/javascript">
// define your datasource. I have called it dsGallery. This
name is used later in the script a few times
var dsGallery = new Spry.Data.XMLDataSet("gallery.xml",
"/gallery/photos/photo");
dsGallery.addObserver({ onPostLoad: function(ds, type) {
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString =
strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length;
iParam++ ){
if (
aQueryString[iParam].indexOf('id' + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
// look if a row with a matching @id is present in the
datasource
var row = dsGallery.findRowsWithColumnValues({"@id":
strReturn}, true);
// If we have a matching row, make it the current row for the
data set.
if (row) dsGallery.setCurrentRow(row.ds_RowID);
break;
</script>
Thanks to the folks whose scrips were really helfull in
building this one.
Nick

Similar Messages

  • Dynamic XML content displayed in HTML using url variable

    Hi guys,
    The following is code i am having issues with:
    <script type="text/javascript">
    <!--
    var xml_connect_00 = "new Spry.Data.XMLDataSet(";
    var xml_connect_01 = "assets/xml/toolkit.xml\",
    \"toolkit/section/";
    var xml_connect_02 =
    "/product\",{sortOnLoad:\"product_name\",sortOrderOnLoad:\"ascending\"";
    var xml_connect_03 = ")";
    // Create variable to see if there is a ? in the url
    var url_input = document.URL.indexOf('?');
    // Create variable from ? in the url to the end of the string
    var xml_category = document.URL.substring(url_input+1,
    document.URL.length);
    var dsSoftware =
    document.write(xml_connect_00,xml_connect_01,xml_category,xml_connect_02,xml_connect_03);
    --->
    </script>
    dsSoftware is my XML Data set connection string, and by using
    document.write, the correct string i want is displayed (in my
    html), but - as you can probably guess by now(!) - i want it to
    display in the actual Javascript code so i can connect to the xml
    file and display the contents depending on the url variable sent.
    Is this possible, and if so, am i going about it the right
    way? I am not the most proficient at JavaScript, so may have some
    ugly code (and not even 100% that this can even be done)!!
    Just to give you an outline as to why i am doing this - my
    XML file has different categories within it for different products.
    I send the category name via a url variable to another page
    (containing the above code) that will display the appropriate
    category information depending on what url variable is sent.
    Cheers in advance for any help.

    Me again!
    Sorry to keep updating, but i have now surpassed my last
    question and got the alert to work correctly. The question i have
    now regards the following code:
    <script type="text/javascript">
    <!--
    var params = Spry.Utils.getLocationParamsAsObject();
    var dsSoftware = new
    Spry.Data.XMLDataSet("assets/xml/toolkit.xml", "toolkit/section");
    //If the URL parameter 'software' has a value, set the XPath
    that includes a filter and then load the data.
    if (params.software){
    dsSoftware.setXPath("toolkit/section[name =
    '"+params.software+"']/product");
    dsSoftware.loadData();
    //alert(params.software);
    //-->
    </script>
    Everything seems to work without error, but i cannot load my
    xml file. The problem, i think, is that my xml heirachy is as
    follows:
    "toolkit/section/section_name/product"
    section_name is unique for each section, and that is what i
    am trying to pass through the url variable, so i can display all
    the products from that section.
    Can anyone tell me what i am doing wrong?
    Cheers in advance - again!!

  • How to use a variable value set from custom dll in dataset

    Hi,
    I've inherited a SSRS report that I need to add some functionality to.  I'm setting a variable, ADAuthorizations, from a custom dll 
    ADAuthorizations is a string of all AD groups a user is a member of and I need to use this as a filter in a dataset.  I've tried using this variable as shown in the query below but I'm getting an error "The expression used for the parameter 'Unit_Permissions"
    in the dataset "Unit_Permissions" includes a variable reference.  Variable values cannot be used in query parameter expressions."  Is there another way I should go about doing this?   
    = "SELECT UnitCode, UnitName " &
      "FROM dbo.VW_Unit_Permissions " &
      "WHERE UserId in (" & Variables!ADAuthorizations.Value & ")" &
      "ORDER BY UnitName "
    Thanks,
    Robert

    Please follow below steps,
    1. Create a custom code to get all the users in an array,
    Public Function getUserName() As String()
       dim Users(1) as string
       Users(0) = "user1"
       Users(1) = "user2"
    return Users
    End Function
    2. Create dataset using the below query,
    SELECT UnitCode, UnitName FROM dbo.VW_Unit_Permissions ORDER BY UnitName
    3. Add a parameter @User and set properties : (Datatype as text, Allow multiple values, Visible)
    Under "Available Values" select specify values and set the label and values as expression.
    =Code.getUserName()
    4. Similarly for "Default values" as
    =Code.getUserName()
    5. Go to tablix properties and select the filter tab and set the properties as below,
    - Select Expression "UserId" i.e =Fields!UserId.Value
    - Operator as "IN"
    - Value as =Parameters!User.Value
    6. Preview the report.
    Regards, RSingh

  • How do I use a variable to set movie clip properties?

    I'm building a simple contact page that allows users to
    select a city from a comboBox. I'd like to pass the selected
    comboBox data through a variable that controls a movie clip with
    the same name. (already on the stage)
    locationListener.change = function (loc_obj:Object) {
    var loc_mc = loc_obj.target.selectedItem.data;
    loc_mc._visible = true;
    So far this hasn't worked. I've tested hardcoding the movie
    clip instance name (Atlanta._visible = true) and it works, but I
    can't figure out why using the variable loc_mc won't trigger
    interaction with the movie clip.
    Something simple, I assume. Thanks in advance for any
    help.

    clbeech:
    I tried using your suggestion, but for some reason it doesn't
    recognize it as naming the movie clip instance. I traced the
    variable and confirmed that the correct value (Atlanta) is being
    passed.
    I assume this is because the variable is not declared as a
    MovieClip, but I can't figure out how to convert it inside the
    function.

  • How to use url variables?

    for example: www.blah.com/blah.php?id=1
    in this case, the url variable passed is id with a default value 1.
    what I am trying to do is to make the webpage display different things depend on the id value.
    so, a basic syntax problem... is this the correct way to do this?
    <body>
         switch (id)
              case 1: echo("something");
              case 2: echo("something else");
    etc
    (or am I missing some dollar sign or something?)
    also, how do i declare a variable in the body?
    just...
    int someVar;
    like in java?  or?

    Just so you'll know, such questions are more suited for the AppDev forum -
    http://forums.adobe.com/community/dreamweaver/dreamweaver_development
    I'll answer here, but in the future, new threads should be begun over there.
    Assuming PHP, in the head of the page you would have -
    <?php
    $id = isset($_GET['id'])?$_GET['id']:FALSE; // This loads the variable $id with the value of the URL variable
    ?>
    Then you could have -
    <body>
    <?php
    switch ($id) {
              case '1':
                   echo("something");
                   break;
              case '2':
                   echo("something else");
                   break;
    ?>
    (I forget whether that value is passed as a string or a number, so you may have to adjust the case statements.)

  • Using a variable to set decimal place in SAPScript

    Hi Freinds,
    is it possible to use variable as decimal indicator anf if yes please how.
    &symbol(E.2)& = two decimal
    my intension:
    &symbol(E.2)& = to replace 2 with variable e. g. &QAMV-STELLEN&
    Thanks,
    Blacky

    Hi Uma,
    For Example
    If the output of &EDIDC-DOCNUM& = 50000.231
    Then:
    &EDIDC-DOCNUM(.2)& = 50000.23
    Now my intension:
    &EDIDC-DOCNUM(.<variable>)& where <variable> = 2
    &EDIDC-DOCNUM(.<variable>)& = 50000.23

  • How to create Form page using a query-like filter to select editable rows

    Hi!
    Does anyone knows how can I create a Tabular Form page to update a table's data, but using the capabilities offered when creating an Interactive Report page (that is, having the "Search Bar" filtering tool at the top of the form)?
    I mean, is that possible without customizing the page? I ask this because I still don't have that much APEX knowledge and I would prefer to accomplish this by just using the "Create Page" wizard but without doing too much programming afterwards.
    Thanks a lot.

    Try this method,
    1. Creat a Master Detail Form (Custom Layout and not tabular)
    and in the master block select one field.
    2. In the HTML layout for master remove the reference for
    that field(so that nothing will appear in the master block
    of the form).
    3. Before the update (in the Pl/SQL event handler select the 'Save' event and write the following code to avoid updating master block).
    p_session.set_value(p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'MASTER_ACTION',
    p_value => 'None');
    doSave;
    For eg, let's say
    Master is from 'Dept' table and Detail is from 'Emp' table(with join condition Dept.dept_id = Emp.dept_id). In the master remove everything except dept_id field and in the HTML layout for master remove the reference of the dept_id field(you cannot remove this field physically from the master layout). Now the form will look like multirow form rather than master detail form but only problem with this workaround is 'Detail Action' will be present in the detail block.
    I hope this will help you.
    Thanks
    -Krishnamurthy

  • Using a variable in netsh command to set ip address on NIC

    hi friends
    i wrote an script which gets an input & use that variable to set ip address on NIC. but actually it doesn't set ip address. may you please help me.
    my script contains:
    $VMNumber=Read-Host "please enter your VM number (for example 2)"
    Netsh interface ipv4 set address NIC static 192.168.1.$VMNumber

    1. I do not thing that the use of netsh is a right way.
    2. You will need a table with MAC address in first column and IP address in second to correctly map IP address to computer. MAC addresses are unique identification.
    3. Follow this article including comments and adapt scripts to your task
    http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/
    HTH
    Milos
    hi Milos
    thank a lot for your useful answer.
    but let me say that my need has nothing to do with MAC address.
    in my test lab, i need an script which asks the administrators to enter their VM number & it saves this input as a variable & set is as the last octet in their VM IPV4 Address.
    so can we tell it as a rule that variables we create in powershell, can't be used inside non cmdlets (inside legacy cmd commands) ?

  • Passing multiple ID's in URL variable

    How can I show results from a mysql database from selected ID's using URL variables?
    Showing results from one ID works fine:
    mypage.php?id=1
    But,
    My table has 10 rows and I want to show 3 of those rows:
    mypage.php?id=1&id=3&id=4
    Thanks for a point in the right direction.

    Are any of you original participants in this thread still around? I'm a bit of a "Jack of all trades, master of none" and I'm having a hell of time. I'm pretty sure this post relates to what I'm trying to do, but I'm just starting in dynamic site building with PHP and I can't seem to translate this situation into my situation.
    What I'm trying to do is set up a series of menu items for categories of merchandise (rugs), with subcategories for size. I've succeeded in making links where the user can choose ALL sizes within a category and (separately) I've succeeded in making links where the user can choose a size within a specific category, but I'm not able to create links where the user can choose a specific size OR see all sizes out of a single menu.
    Here's what I've got:
    3 tables: products, categories & size
    The size table has 2 columns - sizeName, and SizeID - the sizeID column is an integer and it links to products table.
    The categories table also has 2 columns - categoryName and categoryID - the categoryID column is also an integer which links with the product table
    I also built a menu with categories, and each category has a drop down menu where the viewer can choose a size.
    Each size link has a parameter which includes the categoryID as well (in following example, all the sizes are within one category):
    small - products.php?categoryID=8&sizeID=1
    medium - products.php?categoryID=8&sizeID=2
    large - products.php?categoryID=8&sizeID=3
    On the receiving page (products.php) I created a recordset which looks like this (I'm looking at the recordset dialog box within Dreamweaver CS4):
    SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
    FROM products
    WHERE categoryID = colname AND sizeID = varSize
    ORDER BY price ASC
    the variables look like this:
    Name: colname
    type: Integer
    default value: -1
    Runtime value: $_GET['categoryID'}
    Name: varSize
    Type: Integer
    Default value: 1
    Runtime value: $_GET['sizeID']
    (Dreamweaver created colname and I created varSize. I'm not really sure why the default values are as they are).
    This works, but it doesn't give the "all sizes" option. So I've tried applying what I saw in the thread, by creating this link instead:
    products.php?categoryID=8&sizeID=1&sizeID=2&sizeID=3
    In the recordset I created the new variables like this (all as integers with 1 as default value):
    varSmall = $_GET['sizeID_1']
    varMedium = $_GET['sizeID_2']
    varLarge = $_GET['sizeID_3']
    And I wrote this code:
    SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
    FROM products
    WHERE categoryID = colname AND sizeID = varSize
    OR
    WHERE categoryID = colname AND sizeID = varSmall AND sizeID = varMedium AND sizeID = varLarge
    But within the recordset dialog box, I hit the test button and I got a message about a syntax error.
    Am I anywhere near the solution? Any help would be greatly appreciated.
    Thanks,
    Dave

  • Using bind variables with sql statements

    We connect from a VB 6.0 program via OO4O to an Oracle 8.1.7 database, using bind variables in connection with select statements. Running ok, but performance again by using bind vars not as good as expected!
    When looking into the table v$sqlarea, we were able to detect the reason. We expected that our program submits the sql statement with bind vars, Oracle parses this once, and with each select statement again, we do not have a reparse. But: It seems that with each new session Oracle reparses the sql statement, that is, Oracle is not able to memorize or cache bind vars and statements. Even more worrying, this kind of behaviour was visible with each new dynaset, but the same database/session.
    Is there anybody our there with an idea of what is happening here?
    Code snippet:
    Dim OraSession As OracleInProcServer.OraSessionClass
    Dim OraDatabase As OracleInProcServer.OraDatabase
    Set OraSession = CreateObject("OracleInProcServer.XOraSession")
    Set OraDatabase = OraSession.OpenDatabase(my database", "my connect", 0&)
    OraDatabase.Parameters.Add "my_bind", 0, ORAPARM_INPUT
    OraDatabase.Parameters("my_bind").DynasetOption = ORADYN_NOCACHE
    OraDatabase.Parameters("my_bind").serverType = ORATYPE_NUMBER ' Bind Var Type
    Dim RS As OracleInProcServer.OraDynaset
    strSQLstatement= "Select * from my_table where igz= [my_bind] "
    Set RS = OraDatabase.CreateDynaset(strSQLstatement, &H4)
    OraDatabase.Parameters("my_bind").Value = myValue
    RS.Refresh
    Cheers and thanks a lot :)
    Michael Sonntag

    We connect from a VB 6.0 program via OO4O to an Oracle 8.1.7 database, using bind variables in connection with select statements. Running ok, but performance again by using bind vars not as good as expected!
    When looking into the table v$sqlarea, we were able to detect the reason. We expected that our program submits the sql statement with bind vars, Oracle parses this once, and with each select statement again, we do not have a reparse. But: It seems that with each new session Oracle reparses the sql statement, that is, Oracle is not able to memorize or cache bind vars and statements. Even more worrying, this kind of behaviour was visible with each new dynaset, but the same database/session.
    Is there anybody our there with an idea of what is happening here?
    Code snippet:
    Dim OraSession As OracleInProcServer.OraSessionClass
    Dim OraDatabase As OracleInProcServer.OraDatabase
    Set OraSession = CreateObject("OracleInProcServer.XOraSession")
    Set OraDatabase = OraSession.OpenDatabase(my database", "my connect", 0&)
    OraDatabase.Parameters.Add "my_bind", 0, ORAPARM_INPUT
    OraDatabase.Parameters("my_bind").DynasetOption = ORADYN_NOCACHE
    OraDatabase.Parameters("my_bind").serverType = ORATYPE_NUMBER ' Bind Var Type
    Dim RS As OracleInProcServer.OraDynaset
    strSQLstatement= "Select * from my_table where igz= [my_bind] "
    Set RS = OraDatabase.CreateDynaset(strSQLstatement, &H4)
    OraDatabase.Parameters("my_bind").Value = myValue
    RS.Refresh
    Cheers and thanks a lot :)
    Michael Sonntag

  • Help Working With Variable Data Sets (PS CS3)

    I have two different projects for which I believe the Variable Data Sets would / could work.
    Project 1:
    I have created a student badge for our TV Media class and I would like to be able to use a Variable Data Set to automatically read a data file with First and Last names and then place them in the locations of my choosing. I would like to be able to import the list and have it automatically create the 30 ID cards I need and/or print them too.
    Project 2:
    I have created a really nice looking school dance ticket. Currently they are about 1.5" x 6". I would like to be able to use a Variable Data Set to automatically add a couple of different pieces of information: Date, Ticket Number (sequential).
    In each case, I have been able to successfully create a data set and replace a single variable, but I have not been able to modify more than one variable in a file.
    Each text selection is on its own layer. I have tried to create a text file that looks like this:
    FName, LName
    Joe, Smith
    Barney, Jones
    Thalia, Chamoix
    I have also tried to create two different files, such as for project two:
    Date
    January 04
    February 12
    March 19
    Number
    1001
    1002
    1003
    No matter what I have tried, I still cannot seem to get more than one variable to function at a time.
    Any assistance would be greatly appreciated.
    Thank you!

    I don't hink Data Merge is sophisticated enough to skip a page if the entire record is null, but it will skip blank lines if there is a null field and nothing else on the line.

  • URL variables in WAD

    Hi Experts
    I'm using a query with variables and in my WAD report I let the user change the variables and then by using URL variables I re-call my template with the changed variables value. The issue is that, by working like that whenever the user change a variable, I re-call the template with it's original settings and I loose all drilldowns that the user already done in the report.
    Is there any way to transfer the current drilldowns in the URL?
    Or is there any other way to change variables and affect the report without re-calling the template through URL?
    Is there anything new in BI7 for that matter?
    Thanks
    Shlomi

    Hi Arun
    Sorry for the multiple postings.
    In any case maybe I didn't explain myself well.
    I'm not using the original variable screen, I have created one of my own and I refresh the data by calling the web template again with the new variables value in the URL.
    In that case the original template comes up without saving the current navigation.
    Shlomi

  • Date prompt using repository variables adds "DATETIME" literal to narrative

    We are using repostiory variables to set initial date prompt filter values for our report. When we do that we get the "DATETIME" literal string show up on our report as in TIMESTAMP &#39;2011-08-18 00:00:00&#39 (I am posting the exact literals from the report.
    Is there any way to fix this so "TIMESTAMP" does not show?
    by the way the following procedure was followed in trying to create this narrative.
    http://bischool.wordpress.com/2009/06/17/set-yesterday-or-some-date-value-as-default-in-obiee-dashboard-prompt/
    We are doing this in OBIEE 10.1.3.4.1

    Double click on the connection pool and got to General tab.
    In the excute on the connect field add the following Script.
    ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'.
    Thant will solve the problem of time stamp.
    I tried this in my recent project and it works. Let me know if you have any issues
    Thanks
    If it is the only issue coming up in the narrative view then follow Ashish method.
    If the date problem persists for prompts and everywhere in the answers follow my method
    Edited by: Venkat Krishna on Aug 19, 2011 11:01 AM

  • Pressing cntrl+left mouse click doesn't select multiple rows.

    Hi,
    I've got this problem after i migrated my form from 6i to 10g.
    In 6i version, cntrl+left mouse click used to work in order to select multiple rows on the screen. But, it's not working in 10g.
    Instead, Shit + left mouse click is working to select multiple rows in 10g.
    Please can someone help me out with this. I want cntrl + left mouse click to work.
    Any help will be appreciated.
    Regards
    Navnit

    Hi Pradeep,
    Thanks for your reply.
    Do you mean fmrweb.res file?
    This is the content of my res file
    9 : 0 : "Tab" : 1 : "Next Field"
    9 : 1 : "Shift+Tab" : 2 : "Previous Field"
    116 : 0 : "F5" : 3 : "Clear Field"
    38 : 0 : "Up" : 6 : "Up"
    40 : 0 : "Down" : 7 : "Down"
    33 : 0 : "PageUp" : 12 : "Scroll Up"
    34 : 0 : "PageDown" : 13 : "Scroll Down"
    69 : 2 : "Ctrl+E" : 22 : "Edit"
    10 : 0 : "Return" : 27 : "Return"
    76 : 2 : "Ctrl+L" : 29 : "List of Values"
    115 : 0 : "F4" : 32 : "Exit"
    75 : 2 : "Ctrl+K" : 35 : "Show Keys"
    83 : 2 : "Ctrl+S" : 36 : "Commit"
    118 : 1 : "Shift+F7" : 61 : "Next Primary Key"
    117 : 0 : "F6" : 62 : "Clear Record"
    38 : 2 : "Ctrl+Up" : 63 : "Delete Record"
    117 : 1 : "Shift+F6" : 64 : "Duplicate Record"
    40 : 2 : "Ctrl+Down" : 65 : "Insert Record"
    119 : 1 : "Shift+F8" : 66 : "Next Set of Records"
    1005 : 0 : "Down" : 67 : "Next Record"
    1004 : 0 : "Up" : 68 : "Previous Record"
    118 : 0 : "F7" : 69 : "Clear Block"
    66 : 2 : "Ctrl+B" : 70 : "Block Menu"
    34 : 1 : "Shift+PageDown" : 71 : "Next Block"
    33 : 1 : "Shift+PageUp" : 72 : "Previous Block"
    116 : 1 : "Shift+F5" : 73 : "Duplicate Field"
    119 : 0 : "F8" : 74 : "Clear Form"
    122 : 0 : "F11" : 76 : "Enter Query"
    122 : 2 : "Ctrl+F11" : 77 : "Execute Query"
    69 : 3 : "Shift+Ctrl+E" : 78 : "Display Error"
    80 : 2 : "Ctrl+P" : 79 : "Print"
    123 : 0 : "F12" : 80 : "Count Query"
    85 : 2 : "Ctrl+U" : 81 : "Update Record"
    121 : 3 : "Shift+Ctrl+F10" : 82 : "Function 0"
    112 : 3 : "Shift+Ctrl+F1" : 83 : "Function 1"
    113 : 3 : "Shift+Ctrl+F2" : 84 : "Function 2"
    114 : 3 : "Shift+Ctrl+F3" : 85 : "Function 3"
    115 : 3 : "Shift+Ctrl+F4" : 86 : "Function 4"
    116 : 3 : "Shift+Ctrl+F5" : 87 : "Function 5"
    117 : 3 : "Shift+Ctrl+F6" : 88 : "Function 6"
    118 : 3 : "Shift+Ctrl+F7" : 89 : "Function 7"
    119 : 3 : "Shift+Ctrl+F8" : 90 : "Function 8"
    120 : 3 : "Shift+Ctrl+F9" : 91 : "Function 9"
    113 : 0 : "F2" : 95 : "List Tab Pages"
    72 : 2 : "Ctrl+H" : 30 : "Help"
    112 : 0 : "F1" : 30 : "Help"
    I don't know what value should i enter for cntrl + left mouse click ?
    Even for shift + left mouse click, row is not there but it's working.
    Please tell if you know what row should i enter for cntrl + left mouse click in order for it to select mutliple rows?
    Regards
    Navnit

  • Selecting Multiple rows in an ALV

    Hi Experts,
    Using 'REUSE_ALV_GRID_DISPLAY' is it possible to select multiple rows, WITHOUT using CTRL OR SHIFT keys ?
    thanks in advance.

    I have done an application for multiple selection in ALV using check box concept. Please find that code below.
    *& Report  ZATL_DELIVERY
    REPORT  zatl_delivery.
    INCLUDE zatl_delivery_declarations.
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_vbeln FOR vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK a.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION .
    SET PF-STATUS 'ABC'.
    SET PF-STATUS 'BCD'.
    get the sales order numbers thru given
    selection-screen parameters
      SELECT vbeln FROM vbak INTO TABLE it_data
              WHERE vbeln IN s_vbeln.
              AND  ERDAT = P_DATE.
      IF NOT it_data[] IS INITIAL.
        SELECT vbeln vstel FROM vbap INTO TABLE it_vstel
                 FOR ALL ENTRIES IN it_data
                   WHERE vbeln = it_data-vbeln.
      ENDIF.
      LOOP AT it_data INTO wa_data.
        CALL FUNCTION 'ZBAPI_GET_MATERIAL_PLANT_DTL'
          EXPORTING
            v_vbeln = wa_data-vbeln
          TABLES
            it_bapi = it_result.
        LOOP AT it_result INTO wa_result.
          READ TABLE it_vstel INTO wa_vstel WITH KEY
                           vbeln = wa_result-vbeln.
          wa_final-vbeln = wa_result-vbeln. " SALES ORDER NO
          wa_final-matnr = wa_result-matnr.
          wa_final-vstel = wa_vstel-vstel.
          wa_final-werks = wa_result-werks.
          wa_final-labst = wa_result-kwmeng.
          APPEND wa_final TO it_final.
          CLEAR wa_result.
        ENDLOOP.
        REFRESH it_result.
        CLEAR wa_data.
      ENDLOOP.
      PERFORM build_fldcat.
      PERFORM disp_output.
    *SET PF-STATUS 'ABC'.
    *&      Form  ABC
          text
         -->EXTAB      text
    FORM abc USING extab TYPE slis_t_extab.
      SET PF-STATUS 'ABC'. " excluding extab.
    ENDFORM.                    "ABC
    read
    *&      Form  build_fldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fldcat .
      wa_fldcat-col_pos = '1'.
      wa_fldcat-fieldname = 'MARK'.
      wa_fldcat-checkbox = 'X'.
      wa_fldcat-edit = 'X'.
      wa_fldcat-seltext_m     = 'MARK'.
      APPEND wa_fldcat TO i_fldcat.
      CLEAR wa_fldcat.
      wa_fldcat-col_pos = '2'.
      wa_fldcat-fieldname = 'VBELN'.
      wa_fldcat-tabname = 'IT_FINAL'.
      wa_fldcat-seltext_m     = 'SALES ORD NO'.
      APPEND wa_fldcat TO i_fldcat.
      wa_fldcat-col_pos = '3'.
      wa_fldcat-fieldname = 'MATNR'.
      wa_fldcat-tabname = 'IT_FINAL'.
      wa_fldcat-seltext_m     = 'MAT NO'.
      APPEND wa_fldcat TO i_fldcat.
      wa_fldcat-col_pos = '4'.
      wa_fldcat-fieldname = 'WERKS'.
      wa_fldcat-tabname = 'IT_FINAL'.
      wa_fldcat-seltext_m     = 'PLANT'.
      APPEND wa_fldcat TO i_fldcat.
      wa_fldcat-col_pos = '5'.
      wa_fldcat-fieldname = 'LABST'.
      wa_fldcat-tabname = 'IT_FINAL'.
      wa_fldcat-seltext_m     = 'QNTY'.
      APPEND wa_fldcat TO i_fldcat.
    ENDFORM.                    " build_fldcat
    *&      Form  disp_output
          text
    -->  p1        text
    <--  p2        text
    FORM disp_output .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'ABC'
          it_fieldcat              = i_fldcat
          i_callback_user_command  = 'CHECKED'
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " disp_output
    *&      Form  CHECKED
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM checked USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
      DATA: gd_repid LIKE sy-repid, "Exists
      ref_grid TYPE REF TO cl_gui_alv_grid.
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data .
      ENDIF.
      CASE r_ucomm.
        WHEN 'DELIVERY'.
          IF rs_selfield-fieldname = 'MARK'.
            DATA : date_external(10) TYPE c.
            DATA: temp_date TYPE sy-datum.
            temp_date = sy-datum.
            temp_date = temp_date + 1.
            CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
              EXPORTING
                date_internal            = sy-datum
              IMPORTING
                date_external            = date_external
              EXCEPTIONS
                date_internal_is_invalid = 1
                OTHERS                   = 2.
            LOOP AT it_final INTO wa_final WHERE mark EQ 'X'.
              PERFORM bdc_dynpro      USING 'SAPMV50A' '0100'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'LV50C-VBELN'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'LIKP-VSTEL'
                                            wa_final-vstel. " 'HLL'.
              PERFORM bdc_field       USING 'LV50C-DATBI'
                                            date_external. "
              PERFORM bdc_field       USING 'LV50C-VBELN'
                                            wa_final-vbeln.     " '34'.
              PERFORM bdc_dynpro      USING 'SAPMV50A' '0200'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'LIPS-MATNR(02)'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '=SICH'.
              PERFORM bdc_field       USING 'LIKP-BLDAT'
                                            date_external. " '19.09.2008'.
                CLEAR date_external.
              CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
                EXPORTING
                  date_internal            = temp_date
                IMPORTING
                  date_external            = date_external
                EXCEPTIONS
                  date_internal_is_invalid = 1
                  OTHERS                   = 2.
              PERFORM bdc_field       USING 'LIKP-WADAT'
                                            date_external ." '19.09.2008'.
                CLEAR date_external.
              PERFORM bdc_field       USING 'LIKP-BTGEW'
                                            wa_final-labst.     " -'12'.
              PERFORM bdc_field       USING 'LIKP-GEWEI'
                                            'wa_likp-GEWEI'.
              PERFORM bdc_transaction USING 'VL01'.
              PERFORM msg_get  TABLES it_msg.
              CLEAR wa_final.
              REFRESH it_msg.
            ENDLOOP.
            PERFORM disp_msg.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "CHECKED
    *&      Form  BDC_DYNPRO
          text
         -->P_0443   text
         -->P_0444   text
    FORM bdc_dynpro  USING    value(p_0443)
                              value(p_0444).
      wa_bdc-program = p_0443.
      wa_bdc-dynpro =  p_0444.
      wa_bdc-dynbegin = 'X'.
      APPEND wa_bdc TO it_bdc.
      CLEAR wa_bdc.
    ENDFORM.                    " BDC_DYNPRO
    *&      Form  BDC_FIELD
          text
         -->P_0448   text
         -->P_0449   text
    FORM bdc_field  USING    value(p_0448)
                             value(p_0449).
      wa_bdc-fnam = p_0448.
      wa_bdc-fval =  p_0449.
      APPEND wa_bdc TO it_bdc.
      CLEAR wa_bdc.
    ENDFORM.                    " BDC_FIELD
    *&      Form  BDC_TRANSACTION
          text
         -->P_0508   text
    FORM bdc_transaction  USING    value(p_0508).
      CALL TRANSACTION p_0508 USING it_bdc
                           MODE 'N'
                           UPDATE 'S'
                           MESSAGES INTO it_msg.
    ENDFORM.                    " BDC_TRANSACTION
    *&      Form  msg_get
          text
         -->P_IT_MSG  text
    FORM msg_get  TABLES   p_it_msg STRUCTURE bdcmsgcoll.
      LOOP AT p_it_msg INTO wa_msg.
        v_msgid = wa_msg-msgid.
        v_msgnr = wa_msg-msgnr.
        v_msgv1 = wa_msg-msgv1.
        v_msgv2 = wa_msg-msgv2.
        v_msgv3 = wa_msg-msgv3.
        v_msgv4 = wa_msg-msgv4.
        IF wa_msg-msgtyp = 'E' OR
           wa_msg-msgtyp = 'A' OR
           wa_msg-msgtyp = 'X'.
          PERFORM build_msg USING v_msgid
                            v_msgnr
                            v_msgv1
                            v_msgv2
                            v_msgv3
                            v_msgv4
                      CHANGING msg_text_e.
      Build the text for successful records getting created
        ELSEIF wa_msg-msgtyp = 'S' OR
               wa_msg-msgtyp = 'W' OR
               wa_msg-msgtyp = 'I'.
          PERFORM build_msg USING v_msgid
                                  v_msgnr
                                  v_msgv1
                                  v_msgv2
                                  v_msgv3
                                  v_msgv4
                             CHANGING msg_text_s.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " msg_get
    *&      Form  build_msg
          text
         -->P_V_MSGID  text
         -->P_V_MSGNR  text
         -->P_V_MSGV1  text
         -->P_V_MSGV2  text
         -->P_V_MSGV3  text
         -->P_V_MSGV4  text
         <--P_MSG_TEXT_E  text
    FORM build_msg  USING    p_v_msgid
                             p_v_msgnr
                             p_v_msgv1
                             p_v_msgv2
                             p_v_msgv3
                             p_v_msgv4
                    CHANGING p_msg_text_s.
      CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
        EXPORTING
          langu = sy-langu
          msgid = p_v_msgid
          msgno = p_v_msgnr " wa_msgcoll-msgnr
          msgv1 = p_v_msgv1
          msgv2 = p_v_msgv2
          msgv3 = p_v_msgv3
          msgv4 = p_v_msgv4
        IMPORTING
          text  = p_msg_text_s.
      wa_mess-v_msg = p_msg_text_s .
      APPEND wa_mess TO i_mess.
      CLEAR wa_mess.
    ENDFORM.                    " build_msg
    *&      Form  disp_msg
          text
    -->  p1        text
    <--  p2        text
    FORM disp_msg .
      PERFORM build_fieldcat_secandary.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'BCD'
          it_fieldcat              = i_fldcat1
          i_callback_user_command  = 'SECANDARY'
        TABLES
          t_outtab                 = i_mess
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " disp_msg
    *&      Form  build_fieldcat_secandary
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat_secandary .
      wa_fldcat1-col_pos = '1'.
      wa_fldcat1-fieldname = 'V_MSG'.
      wa_fldcat1-tabname = 'I_MESS'.
      wa_fldcat1-seltext_m     = 'MESSAGE'.
      APPEND wa_fldcat1 TO i_fldcat1.
    ENDFORM.                    " build_fieldcat_secandary
    *&      Form  SECANDARY
          text
         -->R_UCOMM    text
    FORM secandary USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN 'BCK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDFORM.                    "SECANDARY
    *&      Form  ABC
          text
         -->EXTAB      text
    FORM bcd USING extab TYPE slis_t_extab.
      SET PF-STATUS 'BCD'. " excluding extab.
    ENDFORM.                    "ABC
    Hope this will help you,
    Murthy.

Maybe you are looking for