Pls help.. its urgent

hi,
select service_request srid,
       function_activity_id fid
from sop_service_request
Output currently getting:
srid                 fid
1001            1,2,3
1002              2,3
1003              1,2,3,4,5
desired output:
srid                 fid
1001            act1-s1,act2-s2,act3-s3
1002              act2-s2,act3-s3
1003              act1-s1,act2-s2,act3-s3,act4-s4,act5-s5
The activity/subactivity name will come from sop_function_activity_map(master table) whose data is as under:
function_acvitity_id           activity_name           sub_activity_name
1                    act1               s1
2                    act2               s2
3                    act3               s3
4                    act4               s4
5                    act5               s5
how do i pass each row of the query and compare function_activity_ids for each service request to master table and get the names of its act-subactivity and again join it comma seperated to get the output as desctibed abovehow do i pass each row of the query and compare function_activity_ids for each service request to master table and get the names of its act-subactivity and again join it comma seperated to get the output as desctibed above
so basically i have to seprate each function_activity_id from comma sep. function_activity ids for each row and check against the function_activity_id of master table and get names of them and again concate those names in comma sep fashion to display in that row... i need this to be done for each row of the result in above query
thx
pls help
thx

Hi,
The following should give you your required output.
create or replace
function get_transposed2( p_a in varchar2 )
return varchar2
is
l_str varchar2(2000) default null;
l_sep varchar2(1) default null;
begin
for x in ( Select t2.activity_name || '-' || t2.sub_activity_name as z
from sop_service_request t1, sop_function_activity_map t2
where t1.fid = t2.function_acvitity_id
and t1.srid = p_a ) loop
l_str := l_str || l_sep || x.z;
l_sep := ',';
end loop;
return l_str;
end;
select srid, get_transposed2( srid ) t
from sop_service_request
group by srid;
Going by the outputs you require in your original post.

Similar Messages

  • Bapi - pls help its urgent

    Hi friends,
    Is there any BAPI for uploading data of CC02 ?
    Regards..
    Balaji

    Hi,
    Use this FM.
    BDS_BUSINESSDOCUMENT_CREATEF
    BAPI_ECMORD_CREATE BAPI
    RFC_CREATE_CHANGE_MASTER
    <b>Reward points</b>
    Regards

  • Lsmw issue plz help its urgent

    Hi Experts ,
    i need to create a LSMW using batch input .
    but the requirement is on the basis of conditions my recording need to be changed .
    dat means
    3127POL09 3127POL09-1 CTR 3127-1003E 100 FUL
    3127POL09 3127POL09-2 WBS 3127POL01 60 FUL
    for ctr i ill have to post data in screen number 200
    and for wbs i ill have to post data in screen number 400 .
    can we put some conditions in recording in lsmw ?
    i no we can create multiple recording but how can we use them to fullfill my requirement .
    plz help its urgent
    thanx in advance

    Hi,
    Within LSMW, there is an option to write our own code wherein this code can be incorporated.
    This is in the Field Mapping Option...
    Just go to the Menu Extras->Layout
    and click on the check box Form Routines
    Global Data.
    Here you can define Global Variables and also perform your ABAP Coding.
    Regards,
    Balaji.

  • How to enable java script in my Firefox browser? help its urgent.

    how to enable java script in my Firefox browser? help its urgent.

    go to '''about:config''' and search for '''javascript.enabled''' change its value to '''true'''
    *[http://kb.mozillazine.org/About:config about:config]

  • Routine--- help its urgent.

    hai gurus,
    Here is the scenario.
    I am extracting the data from r/3.There is one field called "ITM_DESCRIPTION" in this i am gettting an # char only for single record and due to this delta loads are getting failed.
    we had already wriiten the code for eliminating # for that field but dont know its not working. So i am planning out to skip that particular record for a particular Purchase order number.
    Is there any such code to eliminate the particular record.
    Many thanks in advance.
    any one has the code plz send the code.
    Help its urgent.
    full points assured
    regards
    KP

    hai Oscar,
    I had already done this one.
    still geting the same problem.
    can u send me any code that i can add in SR of TR.
    regards
    Kp

  • My iphone 4 had been stolen on Tuesday morning in Shanghai .Pls help.Its imei 013130006352074

    My iphone 4 had been stolen on Tuesday morning in Shanghai .Pls help.Its imei 013130006352074

    No one here can do anything about it. If you can't locate it with Find my iPhone, then it's gone. Probably for good.
    Report it to your carrier and the police. If you did not have it locked with a passcode, change all of your passwords.

  • Pls help its really urgent

    hi friends
    i am making a jsp site on music lovers.i which i would have collection of cd's through which client can buy them and listen them too.i need ur help as to how to start the making of it and some recomended books that may help me in that.plz help its my project work and my marks r dependent on it
    thank u , shikha

    I'm currently getting in to JSP development and I'm using the following books, which I am finding to be very helpful:
    JavaServer Pages by Hans Bergsten, Published by O'Reilly.
    Java Servlet Programming, by Jason Hunter with William Crawford, published by O'Reilly.
    Using Java Server Pages and Servlets, by Mark Wutka, published by Que.
    The first two books are the better I would say.
    HTH.

  • LR from CC, but asking for Serial Number! Pls help! URGENT!!!

    I have LR and PS as part of my Photography Subscription to Adobe CC.
    I was having a problem with LR, so I downloaded a trial version from the site and installed.
    Now LR asks me for a Serial Number when I run the software. I don't have a Serial Number since this was part of the CC Subscription!
    How do I revert my LR back to the normal - running from CC.
    Pls help urgently! I have aclient deliverable tomorrow morning ...

    Thanks for the guidance.
    Uninstalling and re-installing thorugh CC was the plan that came to my mind as well. But I'm reluctant to go that path coz I'm thinking I will lose all my collections etc that I've created over a period of time once I uninstall the current LR. And therefore I'll lose the thread of edits I've made to my pictures, the selections etc. How can I avoid that loss?
    I have backed up my catalog though - I think I should be able to retrieve all those collection/selection information from that catalog?
    Another question.
    Broadband at home has been down for the last couple of days. So I'm not able to download the LR from CC on my desktop at home.
    Can I login to CC from another computer at a friends place, download LR and take it home on USB and install on my desktop? I could sign in to CC once my Internet is back and running.
    Is that an option?
    Thanks for all the help once again. Look forward to some more guidance pls.

  • Sql  Query . Please help its urgent.

    Suppose in table EMP there are 2 columns (Roll_no and Name)
    Roll NO Name
    00001 A
    00002 B
    00010 X
    My requirement is to trunc preceding Zero's. For ex : for Roll no: 00001 the output should be 1 and for 00002 --> 2 .
    Please help its very urgent.

    try this
          select
                  to_number(roll_no) roll_no,
                  name
          from
                  emp;
         Regards
    Singh

  • PLEASE I NEED HELP its URGENT

    ...i just met someone on the net we talked for a while and he asked me for my # i wasn't sure to give him my # so i ask him his and he gave me his # then i called him by an app called magic jack then after 7 minute he hang up all of a sudden...and i am scared can he access my phone? why did he hang up soon? i was using a wi fi internet...pls help i have my password and everything in my cell...my cell is IPHONE 4 IOS 6.1.3

    no he can't
    ios devices does not support being remote controlled
    ios devices does not support having program transfered over a phone call
    ios devices does not support having it's file system accessed

  • Sync Message Error. Pls help very urgent.

    Hi,
    When I ma sending sync messages in XI I am getting error
    <SAP:Code area="PERSIST">MSG_NOT_FOUND</SAP:Code>
    <SAP:P1>4871E583B6C24C3CE1000000AC140A3B</SAP:P1>
      <SAP:P2>PE_ADAPTER</SAP:P2>
    Pls help.

    Http sender  and Http Receiver so no adapter is used..

  • Logic needed - pls help me urgent

    Hi
    p_werks , p_vstel, s_vbeln are my selection screen.
    I want to extract following fields into one internal table.
    How to extract the fields using inner join or outer join?
    LIKP  ---  vkorg,vstel, kunag, lfdat,wadat,lifnr
    LIPS  ---  vbeln,posnr,werks,matnr,lfimg,meins,
    VBKD ---  bstkd, posex_e  (vbkd -vbeln = lips-vgbel)
    sydatum, ernam,rundate, runtime.
    Pls help me

    hi,
    Select vkorg vstel  kunag lfdat wadat lifnr from likp into table t_likp where
    Vbeln = p_vbeln and werks = p_werks.
    If not t_likp [] is initial.
    Select vbeln posnr werks matnr lfimg meins into table t_lips fronm lips  for all entries in table t_likp where vbeln = t_likp-vbeln.
    Endif.
    If not t_lips [] not initial.
    Select bstkd  posex_e into table t_vbkd from vbkd for all entries in t_lips where vgbel = t_lips-vbeln.
    Endif.
    check with this code.
    Regards,
    Narasimha
    Edited by: narasimha marella on Jun 11, 2008 6:14 AM
    Edited by: narasimha marella on Jun 11, 2008 6:18 AM

  • Pls help me urgently

    recently i try to find a way to solve the problem that upload retrieve and download the audio file (BLOB or ordaudio) into oracle database 9i by pure ASP, unfortunatly i just implement the operation of text. is there anyone know how to solve the problem. thanks a lot!

    Hi,
    Everytg is attacehd fine...
    they are getting ouput..
    but the problem is in the output .my smartform output is not coming.
    they are getting some other forms output.
    the form that i developed and executed seprtly when they are putting that smartform there in the nace ...they are nort getting ouput..
    will there be problem in the routine.
    or driver progarm problem
    dribver poprogrtam is 'SAPFM06P'
    pLS HELP PLS

  • Bundling of IDOCs using BPM.PLS Help .Its very very URGENT

    Hi all,
    I have a IDOC to file scenario in which I have to bundle some number of INVOIC02 IDOCs.
    For this I have an IDOC whosw occurance is 1...1.
    I have an XSD for the same IDOC whose max occurance is 1.....9999999999.
    Si I have created one mapping for these two(i.e IDOC with max occurs 1 and IDOC with max occurs 9999999999.)
    I created one more mapping  for IDOC XSD and the target file structure.
    For this scenario how many abstract interfaces and interface mappings do I need to create?
    Can anybody explain the BPM flow in detail in this case?
    Thanks in advance.

    Hi  Rambabu Mujja  ,
    The following websites wil solve u'r problem:
    A Step-by-Step Guide on IDoc-to-File Using Business Service in the XI Integration Directory
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07dcaa0-a92b-2a10-3a96-b3d942bd1539
    How to convert an IDoc-XML structure to a flat file and vice-versa in XI 3.0
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    Introduction to IDoc-XI-File scenario and complete walk through for starters.
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    IDOCs (Multiple Types) Collection in BPM
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    cheers!
    gyanaraj
    ****Pls reward points if u find this helpful

  • Pls help.Its very urgent

    Hi,
    We have upgraded to oracle11g from oracle10g and the query which was executing fine in 10g is giving the following error in oracle11g.
    java.sql.SQLException: ORA-00910: specified length too long for its datatype
    The same query is working fine in plsql developer or Toad but is throwing an error when executed through application code. so,I thought this will be because of drivers. I used the same classes12.jar that comes with 10g and I copied ojdbc5.jar into my classpath, the manifest file in the ojdbc jar specifies it as being driver for oracle 11 with jdk1.5.Still,I am getting same error.
    My query is a simple SELECT statement and is as follows and i have no idea which datatype the error is referring to. There is no BLOB or CLOB object type in the columns I am selecting. The query when executed in PL/SQL developer returns 200 records.
    SELECT * FROM (SELECT DISTINCT ValidFolder.Colour, f_FolderNumber2(NVL(Folder.FolderCentury, ''), Folder.FolderYear,Folder.FolderSequence,Folder.FolderSection ,Folder.FolderRevision,Folder.FolderType) FolderNumber, Folder.ReferenceFile, Folder.InDate, Folder.IssueDate, Folder.StatusCode StatusCode1, Folder.FolderName, Folder.FolderDescription, Folder.IssueUser IssueUser1, Folder.ExpiryDate, Folder.FinalDate, ValidFolder.FolderGroupCode, Folder.SubCode SubCode1, Folder.WorkCode, Folder.FolderType FolderType1, Folder.Priority, Folder.FolderRSN, Folder.PropertyRSN, Folder.ParentRSN, Folder.StatusCode, ValidFolder.FolderGroupCode FolderGroupCode1, Folder.IssueUser, Folder.SubCode, Folder.FolderType, ValidFolder.TabMask, Folder.FolderCentury, Folder.FolderYear, Folder.FolderSequence, Folder.FolderRevision, ROW_NUMBER() OVER (ORDER BY Lower(NVL(Folder.FolderDescription, '')) ASC ) r FROM Folder, ValidFolder, ValidFolderGroup, Property, ValidProvince WHERE ValidProvince.ProvinceType (+)= Property.PropProvince AND Folder.PropertyRSN = Property.PropertyRSN and ValidFolder.FolderType = Folder.FolderType and ValidFolderGroup.FolderGroupCode = ValidFolder.FolderGroupCode and ValidFolderGroup.GroupTypeCode = 3 and Folder.FolderType = 'B1' and ValidFolder.FolderGroupCode = 21 ) t where r between 0 and 200 ORDER BY Lower(NVL(t.FolderDescription, '')) ASC
    Please advise on how to proceed with this issue. I am currently in the process of having Oracle 11g client installed in my machine but the point is that it needs to work with 10g client as well per my understanding.

    I would suggest that your NLS settings are different between the tools that you are using.
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • PLEASE HELP ITS URGENT (PROBLEM IN INCLUDE)

    IF I EXECUTE IN 4.6C ITS NOT GIVIN NY ERROR BUT THE SAME CODE IN 6.0 IS GIVING ERROR
    IF NOT ( ( text_flag = 'X' AND tcode_level > 0 ) OR
                 ( text_flag_level0 = 'X' AND
                   tcode_level      = 0   AND          )    ).
    ERROR IS:
    Incorrect logical expression: "AND" or "OR" must be preceded by an          
    expression (e.g. a comparison).          
    PLZ HELP ME AS IT IS VERY URGENT.
    THANX IN ADVANCE

    Hi anit,
    1. minor mistake
    2. remove this AND in bold.
    IF NOT ( ( text_flag = 'X' AND tcode_level > 0 ) OR
    ( text_flag_level0 = 'X' AND
    tcode_level = 0 <b>AND</b> ) ).
    regards,
    amit m.

Maybe you are looking for

  • Problem on my Nvidia Geforce 4TI 4800 SE

    I recently posted here [MSI Forum] about how I messed up my BIOS and I have just recently bought a new motherboard. My original motherboard was a: 865PE Neo2 Now, I just bought a: 865PE Neo2-P [platinum Edition] I have: Intel Pentium IV 2.4 1 gig of

  • PR to PO Converted on a Date

    Dear All, Please help me in the issue. There is a Automatic Program created in system which if there is no Stock then with the PR's Available it converts into STO. I want to identify why did the system convert the PR's to PO's on that Date. Is there

  • Continued wrong charges and unwanted renewed contr...

    I am very unhappy with the way the problems I have had with my account have been dealt with.  I have had continuous promises of my account being credited for the mistakes that bt have made for charges.  The mistakes have been continuous from my first

  • Customized dial script for conference bridge meeting ID

    Hello, first time poster, here. I have the 8830 and want to peform the following actions: open an apointment which contains a meeting ID for a conference call (when you dial into a bridge) have an option with the 'blackberry' button to 'copy' that va

  • PDF has black background

    When I import a PDF, all of the text areas are black. Images are fine. Same with more than 75 PDF files. Perhaps I am doing something wrong?