Fetching data using the method query

Hi experts
Using the class /scmtms/if_lcp and using the method query, how to fetch the data from the business objects.
my requirement is i need to fetch the data from the BO /SCMTMS/FRIEGHTORDER and  /SCMTMS/SHIPMENTREQUEST.
If any one can send the sample code for this, it will be very usefull for me.
Thanks in advance
sai
Edited by: sai sai on Jun 17, 2009 5:21 PM

report  z_fo_read.
data:
  lr_fro        type ref to /scmtms/if_lcp,
  lr_lcp_transaction type ref to /scmtms/if_lcp_transaction.
* step 1
lr_lcp_transaction = /scmtms/cl_lcp_factory_adapter=>get_lcp_transaction_handler( ).
* Schritt 2:
lr_fro = lr_lcp_transaction->/scmtms/if_lcp_facade~get_lcp( in_bo_name = /scmtms/if_freightorder=>co_bo_name ).
constants: co_do_prefix_root_tpcharges type string value 'TRANSPORTCHARGES.ROOT'.
* Schritt 3:
data:
  ls_params        type /scmtms/s_srq_rt_a_block value is initial,
  ls_root_data     type /scmtms/if_freightorder=>ty_root,
  ls_selection     type /scmtms/s_selection_parameter,
  lt_out_messages  type /scmtms/if_srvmgr_types=>ty_messages,
  lt_out_node_ids  type /scmtms/t_bo_node_id,
  lt_root_data     type /scmtms/if_freightorder=>tt_root,
  lt_items_data    type /scmtms/if_freightorder=>tt_transportchargesinfo,
  ls_items_data    type /scmtms/if_freightorder=>ty_transportchargesinfo,
  lt_selections    type /scmtms/t_selection_parameters,
  lv_action_name   type string,
*     Notification structure
  ls_change_notifications type /scmtms/if_srvmgr_types=>ty_change_notifications.
* A) Root-ID des SRQ holen, der ge-/entsperrt werden soll:
ls_selection-attribute_name = /scmtms/if_freightorder=>co_attr-root-for_id. " ID.
ls_selection-sign   = 'I'.
ls_selection-option = 'EQ'.
ls_selection-low    = '00000000000000000000000000000000800'.
*ls_selection-high   = '00000000000000000000000000000000427'.
append ls_selection to lt_selections.
call method lr_fro->query
  exporting
    in_bo_node_name         = /scmtms/if_freightorder=>co_bo_node-root
    in_query_name           = /scmtms/if_freightorder=>co_query-root-root
    in_selection_parameters = lt_selections
  importing
    out_node_ids    = lt_out_node_ids
    out_messages    = lt_out_messages.
* B) Daten holen:
call method lr_fro->retrieve
  exporting
    in_bo_node_name        = /scmtms/if_freightorder=>co_bo_node-root
    in_node_ids            = lt_out_node_ids
  importing
    out_data               = lt_root_data
    out_messages           = lt_out_messages.
read table lt_root_data into ls_root_data index 1.
The above code is a snippet, extract useful information for you.

Similar Messages

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

  • Lightswitch html use the 'any' query method

    Hi
    Can someone please tell me how i can use the "any" query method for entity collections in lightswitch html?
    Thanks

    Hi Xpert360
    It's for a type of EntityCollection this is the code from the msls-2.5.2.vsdoc.js line 2220
    any: function any(predicate) {
    /// <summary>
    /// Determines whether this sequence contains any
    /// items that optionally satisfy a condition.
    /// </summary>
    /// <param name="predicate" type="Function" optional="true">
    /// A function to test each item for a condition.
    /// <br/>Signature: Boolean item.predicate(item)
    /// </param>
    /// <returns type="Boolean">
    /// True if this sequence contains any items that
    /// satisfy the condition, if any; otherwise, false.
    /// </returns>
    var result = false;
    this.each(function (item) {
    if (!predicate || predicate.call(item, item)) {
    result = true;
    return false;
    return true;
    return result;
    Check it out and let me know if you know how to use it, my problem is how to use the call back function.
    Thanks

  • Not getting 'actual data' in the planning query

    Hi all,
    I am debug other's query. This cube stores 'actual' and 'plan' data and I loaded 'actual' and can see it in the cube. But I cannot see 'actual data' when I run the planning query.
    I checked all restrictions in the KFs and CHARs and fliters in the query. There are only 'value type 10', 'fiscal year variant Z1', and 'currency CAD' restricted and actual data does contain those values in all line items.
    Can someone point it out what it could be the issue? Thank you.
    R.

    Hi,
    if you enter some data (plan data) you cannot see it again. Is that correct?
    are you using the same query to enter and to see plan data?
    Because if you are entering data in an aggregate level and you are executing your query over the infocube you will not see the data from the yellow request. If you execute query over the aggregate you should be able to see all data in the cube (yellow and green requests).
    Also check if your query is defined as per note 1136163.
    I hope this helps.
    Lucimar

  • How to resolve error while importing data using IDoc method in LSMW ?

    Hi
    I am trying to import my data using IDoc method in LSMW.
    But after completing the whole LSMW process, when I look into the IDOC generated, the error description is as this.
    It talks about the process code and other stuff.
    Function module not allowed : APPL_IDOC_INPUTI
    Message No. B1252
    Diagnosis :
    The function module APPL_IDOC_INPUTI and the application object type which were determined are not valid for this IDoc.
    I am not able to resolve the problem.
    Please help.
    Regards,
    Rachesh Nambiar

    check the below link.
    /people/stephen.johannes/blog/2005/08/18/external-data-loads-for-crm-40-using-xif-adapter

  • Fetch data using structure with full working example

    does any body tell me how to fetch data using structure with full working example
    the structure name is RSTXT and the field is TXLINE
    the data in the form of text is entered from the functional side using t-code ME52N
    from there i have to fetch the data
    in smartform or in report

    using this code to get text from ME52N  this is a structure still not getting output  
    DATA:BEGIN OF TA_ROW occurs 0,
          TXZ01(1000) TYPE C,
          END OF TA_ROW.
      DATA:BEGIN OF IT_ROW OCCURS 0,
          TXZ01(1000) TYPE C,
          END OF IT_ROW.
       DATA: thread LIKE thead.
       DATA: headerid TYPE char24.
       DATA: it_text LIKE tline OCCURS 0 WITH HEADER LINE.
       data:wa_banfn like eban-banfn.
       thread-tdid = 'B01'.
       thread-tdname = headerid.
       thread-tdobject = 'EBAN'.
         select txz01 from eban into corresponding fields of table ta_row
          where banfn = wa_banfn.
       headerid = '  '.
       CALL FUNCTION 'READ_TEXT'
         EXPORTING
      CLIENT                        = SY-MANDT
           id                            = thread-tdid
           language                      = sy-langu
           name                          = thread-tdname
           object                        = thread-tdobject
      ARCHIVE_HANDLE
                                    = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
         TABLES
    lines                         = it_text
        EXCEPTIONS
          id                            = 1
          language                      = 2
          name                          = 3
          not_found                     = 4
          object                        = 5
          reference_check               = 6
          wrong_access_to_archive       = 7
          OTHERS                        = 8.
         LOOP AT it_text.
         CLEAR ta_row.
       BREAK-POINT.
      FROM THIS POINT TEXT IS COMING
         ta_row-txz01 = it_text-tdline.
         APPEND ta_row TO it_row.
         ENDLOOP.

  • Creating multiple tab reports using the same query in Web intelligence

    Hi All,
    I have created a Universe on a BW Query which has fields as below
    AGE  Depaatment  Gender  Grade
    25       FIN                M            A
    27       LES               F            A+
    60       SWS            M             A++
    Based on this data i have created a WEbi report which shows all of these data under one tab.
    Now i create a new report tab in the same Webi Document by right cliicking the existing report and going to inset report and saving it.
    Similarly i create two more new report tabs.
    in each of these tabs i want to show data only for the concened departments.ie =1st report contains all the departments.
    2nd report contains only finance data, third contains only Les data  and fourth only SWs Data.
    Is it possible to create this report using the same query?
    Regards,
    Raj.

    You should use report filters, not query filters.
    A query filter will affect the entire document. Every report tab that pulls data from that query will be impacted. If you start with a single report, by default it shows the data from the query. If you duplicate that report tab, then it's still attached to the first query. There are various ways to create report filters (input controls, quick filter, invoking the filter area from the toolbar) and a report filter impacts only blocks on that report tab. You can even create block filters by clicking on the block first, then creating your filter.
    This is a fairly confusing bit for folks that are new to Web Intelligence.

  • How use the method hasPermission in weblogic server 6.1

    Hello everybody !
    In my application web ,i restrict access to some ressources (some jsp)
    to some specified groups .
    So,i create permissions in the file web.xml , as indicated in the doc
    6.0 .
    For example only the user : system can access to all the jsp , and the
    others users no .
    Now ,in my code ,I would like to use the method hasPermission in order
    to modify my application according to the differents groups of users .
    But my problem is that i don't know the parameter aclName !
    For the parameter permission I use the syntax "new
    weblogic.security.acl.PermissionImpl(".../x.jsp") .
    For the parameter sep (char),i use : '.' .
    But i don't find the parameter aclName .
    When i was in weblogic 5.1 ,i created permission in the file
    weblogicURL.policy with the syntax : " Permission
    weblogic.security.acl.URLAcl "weblogic.url",".../x.jsp" " and after
    i gave "weblogic.url" as parameter for aclName .
    But in version 6.0, I try web.xml, web ? but nothing is good .
    Is there any person which have an idea or the solution ?
    All the sugestions are welcome !
    Thanks by advance !
    Good bye .

    hi,
    maybe a better approach could be to use roles instead of permissons.
    Your menu.jsp could look like this:
    <%
    if(request.isUserInRole("super-user"))
    %>
    ... code HTML where the button "Creation" is created
    <%
    %>
    You can map the role 'super-user' to an individual principal or a
    user group in weblogic.xml. In that case only users that are in
    the mapped group/principal will see the 'creation' link. So simply
    add user 'system' to a group 'super-user'.
    regards,
    przemek
    Marc Alfonsi schrieb:
    Hi Kirann and everybody!
    Thanks for your message .
    I'm going to explain better than the first time .
    I set up security-constraints in my web.xml .
    For example only "system" can access to the directory Creation and
    all its .jsp , and the others users no .
    Now ,in my code , there is a jsp : menu.jsp which displays some
    possibilities : creation of an employee , visualisation ...with HTML
    code : button "Creation" which call a .jsp of the directory Creation .
    Actually , if a user different of "system" try to click on the button
    "Creation" there is a dialog box of login . The user writes its loggin
    but the access is prohibited ( because security-constraint in web.xml
    ).It's normal but not very well .I would like that a user who don't
    have access to the functionality "Creation" don't see the button
    "Creation" !
    So in menu.jsp , i would like to use the method hasPermission at the
    location of the button "Creation" is created with HTML code :
    <%
    if weblogic.security.acl.Security.hasPermission(.....,new
    weblogic.security.acl.PermissionImpl("/Creation/x.jsp"),'.')
    %>
    code HTML where the button "Creation" is created
    <%
    %>
    But my problem is that i don't know the first parameter which
    correspond
    to aclName .
    Any suggestions are welcome .
    Thanks for help .

  • Can we use Data Pump to export data, using a SQL query, doing a join

    Folks,
    I have a quick question.
    Using Oracle 10g R2 on Solaris 10.
    Can Data Pump be used to export data, using a SQL query which is doing a join between 3 tables ?
    Thanks,
    Ashish

    Hello,
    No , this is from expdp help=Y
    QUERY                 Predicate clause used to export a subset of a table.
    Regards

  • How to use the method getParameterValues() of request object in JSP?

    I'm trying to use the method
    String a[]=request.getParameterValues("ch_box");
    to retrieve the values from the form
    but it gives the error
    "Method getParamaterValues(java.lang.String) not found in interface javax.servlet.http.HttpServletRequest."
    so plz tell me how to overcome this hurdle?
    thanx

    Well, just one note... either you have a typo in your code, or else in your post.
    If you cut and pasted the error message (which it looks like you did), then the method getParamaterValues() should be getParameterValues() instead (notice the spelling difference), so you probably just have a typo in your code.

  • How to use the method "getChildrenRemoved()" declared in ElementChange?

    How to use the method "getChildrenRemoved()" declared in DocumentEvent.ElementChange?

    I have tried to use it,but the code below alway say "Yes"....
    I really have no ideas about why ec is always a null.
    public void removeUpdate(DocumentEvent ee) {
           DocumentEvent.ElementChange ec = ee.getChange(doc.getDefaultRootElement());
           if(ec == null)
              System.out.println("Yes");
                     }

  • Problem in finding Exact result by using the following Query

    Hello,
    I am finding difficulty in producing the required result by using the following Query in Reports 6i
    (Note: - The query actual output and the required output are as follows: -)
    SELECT
    DISTINCT
    SH.S_HEAD_CODE,
    B.BILL_ID,
    B.SANCTION_DATE,
    E.EMP_NAME,
    E.EMP_DESIGNATION,
    B.TOTAL_BILL,
    NVL((SH.INITIAL_ALLOCATION-B.TOTAL_BILL), 0) BALANCE
    FROM BILL B, PARAMETERS P,SUB_HEAD SH, EMPLOYEES E, BILL_DETAIL BD
    WHERE
    SH.S_HEAD_CODE=B.S_HEAD_CODE
    AND B.S_HEAD_CODE=BD.S_HEAD_CODE
    AND B.EMP_ID_NO=E.EMP_ID_NO
    AND B.BILL_ID=BD.BILL_ID
    The Output of the above query is as follows: -
    Let say we have Total Amount Sanctioned Rs. 15,000,00/-
    Name Total Bill (Rs.) Balance (Rs.)
    Sohail 7147 1492853
    Saqib 2131 1497869
    Amir 6802 1493198
    Shafiq 1214 1498786
    Note:- In the above output the above query is subtracting the current balance from Total Sanctioned Amount (Rs. 1500000) each time, but
    it should actually subtract the current bill amount from the previous balance like the below said result.
    Name Total Bill (Rs.) Balance (Rs.)
    Sohail 7147 1492853 {Previous Balance - Current Bill Amount (1500000-7147) }........ The previous balance was actual amount Rs. 1500000
    Saqib 2131 1490722 {Previous Balance - Current Bill Amount (1492853 - 2131)}
    Amir 6802 1483920 {Previous Balance - Current Bill Amount (1490722 - 6802)}
    Shafiq 1214 1482706 {Previous Balance - Current Bill Amount (1483920 - 1214)}
    Results Continue...........................
    Please help me to solve this problem.
    Thank you in advance

    just check if this meets your requirements,
    SQL>
    SQL> With t As
      2  (
      3  Select 'Sohail' c1 ,7147 c2 ,1492853 c3 From dual Union All
      4  Select 'Saqib'   ,2131 ,1497869         From dual Union All
      5  Select 'Amir'    ,6802 ,1493198         From dual Union All
      6  Select 'Shafiq' ,1214 ,1498786          From dual
      7  )
      8  Select c1,
      9         c2,
    10         prv_amt - c2 current_amt
    11  From
    12  (
    13  Select c1,
    14         c2,
    15         c3,
    16         lag(c3,1,1500000) over(Order By c3) prv_amt
    17  From t
    18  );
    C1             C2 CURRENT_AMT
    Sohail       7147     1492853
    Amir         6802     1486051
    Saqib        2131     1491067
    Shafiq       1214     1496655
    SQL>

  • HT1338 Dear all, I have just bought a MacBook pro with osx lion on 25thast month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Dear all, I have just bought a MacBook pro with osx lion on 25th last month. I wanted to know if I can use the methods described above to update to osx mountain lion or I have to buy osx mountain lion from the app store?

    Here are the rules to qualify for the free upgrade:
    http://www.apple.com/osx/uptodate/
    (has to be purchased from Apple or authorized reseller).

  • I can't see my external disk source when trying to migrate data using the Migration Assistance.

    I have an external hard disk (Lacie) with all my backed up data. After doing a clean install of Mavericks I now want to migrate my data using the Migration Asistance but it is not able to find the source.
    Can anyone help please?
    Thanks.

    Is the layer's visibility check box turned on or off?  What is the layer's Blend Mode?  What is the format of the original file?

  • How can we publish Labview data using the web

    how can we publish Labview data using the web?
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [email protected] wrote:
    how can we publish Labview data using the web?
    You could use shared variables and publish them to the network or use data sockets.
    Kudos always welcome for helpful posts

Maybe you are looking for

  • Audio only with Airplay on iPhone

    Why can't I airplay videos directly from my iPhone 4S (on iOS 6) to my Apple TV. I only get audio and need to enable mirroring to see it, but the quality is poor this way. I can airplay videos from my iPad 3 directly. Help please...

  • Invisible junk mail

    when something goes in my junk mail folder, you can't see it. you open the folder and it says 0 messages, even though in next to the mailbox it says i have 20, or whatever. this does not matter most of the time, of course, since it is junk mail. EXCE

  • Adaptec 3405 / Quantum LTO-4 abend

    I am running netware 6.5 Sp6 with Backup Exec 9.2. I am replacing an Quantum LTO-2 drive with an Quantum LTO-4 SAS drive with an Adaptec 3405 controler. I am able to get about 10GB into the backup and then it abends the server. Here is some of the ab

  • Having trouble installing the trial version of fireworks

    I have a problem where i'm trying to install creative cloud so i can download the trial version of fireworks but the installer for creative cloud wont work. so i tried a direct link methods and downloaded fireworks but when the installer gets to the

  • Cannot access a website, from one interface, that is hosted behind a different interface; on same appliance

    Hello, I’m working with a network that has been setup with a wireless interface for wifi, an inside interface for a staff lan and of course the outside interface. There is a webserver hosting a website on the inside of the staff network/subnet. For t