Skip to Content

generate query at a time & connect two database ?

Hi

Could u help me? it is necessary that

I have two database ( RSHPL,RSPL) and both data base have same table name and same fieldname (Table Name :-OITM, Fieldname :ONHAND ,pk- ITEMcode,)

At first I tell u what I want?

I want to generate query at a time & connect two database and same table name(OITM) to select the TOTAL VALUE of this field(ONHAND) and pk-key is Itemcode.

Is it Possible? If Possible plz write this query and send me.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 18, 2008 at 09:43 AM

    here is the solution - copy it in your query analyzer and replace the database name

    select x.itemcode, sum(x.onhand) from

    (select itemcode, sum(onhand) as 'onhand' from [databasename1].dbo.oitm group by itemcode

    union all

    select itemcode, sum(onhand) as 'onhand' from [databasename2].dbo.oitm group by itemcode) as x

    group by itemcode

    please reward points - it cost me 5 minutes of my live 😊

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 09:34 AM

    Hi,

    I don't think its possible to write a query from within SAP that allows you to get data from another SAP database.

    I have used SQL Reporting Services to report on data from multiple databases, and this works very well for many of my clients. It depends on what you want to do with the data, do you need to display it on the screen in SAP and it to a field or will a report suffice?

    Regards,

    Adrian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I also want to ask u smethng related to query,i hve created 1 UDF at row level of outgoing payment now my problem is i want to do FMS i.e formatted search at row level suah that Customer/vendor reference no. should get displayed........

      i know its already there but what the problem is in layout PLD i am unable to pick up that value...what i must do in such case.let me know its actualy an urgent requirment..........so let me know asap.

      mona

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.