Split without delimiter based on position

Hi,
I am having a query i need to split the query based on the position i specify
Say
string is 123456789101112
am having position as 1,1,2,5,4,2
i need as
1
2
34
56789
1011
12
I need to insert this in to my table
create test table (col1 number(10),col2 number(10),col3 number(10),col4 number(10),col5 number(10),col6 number(10));
col1,col2,col3,col4,col5,col6
1,2,34,56789,1011,12
Thanks

i'm having some 80 columns in my table how to do for 80 columns Will data inserted into all 80 columns ?
Will there any change in order of insertion i.e. suppose data will be in col1,col2,col10,col11,col15,col23,col45,col80,col14,col68,col5... ?
How you will calculate the number of columns in which that number string is going to inserted ?
If there are fix 80 columns then rather than writing block of code for 80 times, you can use varray type variable and then proceed ahead. Since, in the above code, I have not handled exception(s), so exception handling will be another part of code to make it smooth.
Between, at the moment, I am not getting why there is error which is in the end :
create type np_type is varray(80) of number
create type cn_type is varray(80) of number;
create type cxn_type is varray(80) of varchar2(100)
I created TEST table by below pl/sql block :
declare
execstr varchar2(2000) :='create table test(';
begin
for i in 1..80 loop
execstr:=execstr || 'col' || to_char(i) || ' number,';
end loop;
execstr:=substr(execstr,1,length(execstr)-1);
execstr:=execstr || ')';
dbms_output.put_line(execstr);
execute immediate execstr;
end;
create or replace procedure myproc1
strx in varchar2, delarray in np_type)
as
execstr varchar2(200);
cn cn_type;
cxn cxn_type;
xpos number:=1;
begin
for i in 1..80 loop
select Delimiterlength into cn(i) from sp_table where Splitid = delarray(i);
select substr(strx,xpos,cn(i)) into cxn(i) from dual;
execstr:='insert into test values(' || cxn(i) || ',';
xpos:=length(cxn(i));
end loop;
execstr:=substr(execstr,1,length(execstr)-1);
execstr:=execstr || ')';
dbms_output.put_line(execstr);
--execute immediate execstr;
end;
/SQL> declare
2 v np_type:=np_type(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
3 begin
4 dbms_output.put_line(v(80));
5 --exec myproc1('11111111111111111111111111111111111111111111111111111111111111111111111111111111',v);
6 end;
7 /
4
PL/SQL procedure successfully completed.
SQL>
SQL> declare
2 v np_type:=np_type(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
3 begin
4 --dbms_output.put_line(v(80));
5 exec myproc1('11111111111111111111111111111111111111111111111111111111111111111111111111111111',v);
6 end;
7 /
exec myproc1('11111111111111111111111111111111111111111111111111111111111111111111111111111111',v);
ERROR at line 5:
ORA-06550: line 5, column 6:
PLS-00103: Encountered the symbol "MYPROC1" when expecting one of the
following:
:= . ( @ % ;
The symbol ":=" was substituted for "MYPROC1" to continue.
SQL>
Try to remove this error. Here '1111...' is the string which is going to be entered and '44444...' is the Splitid of sp_table.
Now, its your turn to help me.... :)
Regards
Girish Sharma

Similar Messages

  • Splitting a file based on the payload field - multimapping

    HI Everyone,
    I have a requirement of splitting a file based on the field .
    e.g When I am a file as :
    row1  David    US
    row2  Cindra   US
    row3   Peeru   CA
    row4   Jay       CA
    Then, I have to split the file into two files, one file with the US rows and  another file with the CA rows.
    There can be many countries in the input file, so number of target files need to be generated is not fixed.
    I have gone through the below links :
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible   ( in the blog we know that there are two receivers but in my case I dont know that )
    https://bond.newellco.com/irj/scn/,DanaInfo=www.sdn.sap.com,SSL+thread?messageID=6449801#6449801
    ( Everyone is providing JAVA mapping as a solution....)
    Is Java mapping the only option to resolve the problem case I have ?
    Thx
    PEERU IN

    Hi Peeru,
    I don't have access to the any FTP or file server of XI to check the file adapter as i am travelling right now(I am 100% sure that the file adapter splitting will work as i have done this for one of my requirement).
    Coming to your requirement:
    I wrote an java map which will read the XML file and create the multiple recordset based on number of different country exists in the file, then i am printing the final structure in an multi mapping layout (please see the attached input file Country.xml and out put file which the java map generated Final.XML) if we do this i think the file adapter will create the different files based on the number of recordset we have as you can see the output file is generated with the 3 recordset (<Country>) tag each country tag has its own records, now if i give the filename in variable substuition pointing to region then i think i should get 3 files with names
    us.xml
    us01.xml
    us02.xml
    i think by using the multi mapping i can generate 3 files and by using the variable substution i can give the 3 different names from the payload of each file and also can add the timestamp for each of the file, again i didn't have access to the file adapter in the project i am working on so i couldn't verify in XI server, but if you still looking for solution then let me know i will give the map details.
    Input File: Country.xml
    <?xml version="1.0"?>
    <check>
         <order>
              <name>Nisar1</name>
              <region>US</region>
         </order>
         <order>
              <name>Nisar2</name>
              <region>US</region>
         </order>
         <order>
              <name>Nisar3</name>
              <region>US</region>
         </order>
         <order>
              <name>Nisar4</name>
              <region>US01</region>
         </order>
         <order>
              <name>Nisar5</name>
              <region>US01</region>
         </order>
         <order>
              <name>Nisar6</name>
              <region>US01</region>
         </order>
         <order>
              <name>Nisar7</name>
              <region>US</region>
         </order>
           <order>
              <name>Nisar8</name>
              <region>US</region>
         </order>
           <order>
              <name>Nisar8</name>
              <region>US02</region>
         </order>
    </check>
    Output File : Final.XML
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <country>
                   <Order>
                        <name>Nisar1</name>
                        <region>US</region>
                   </Order>
                   <Order>
                        <name>Nisar2</name>
                        <region>US</region>
                   </Order>
                   <Order>
                        <name>Nisar3</name>
                        <region>US</region>
                   </Order>
                   <Order>
                        <name>Nisar7</name>
                        <region>US</region>
                   </Order>
                   <Order>
                        <name>Nisar8</name>
                        <region>US</region>
                   </Order>
              </country>
              <country>
                   <Order>
                        <name>Nisar4</name>
                        <region>US01</region>
                   </Order>
                   <Order>
                        <name>Nisar5</name>
                        <region>US01</region>
                   </Order>
                   <Order>
                        <name>Nisar6</name>
                        <region>US01</region>
                   </Order>
              </country>
              <country>
                   <Order>
                        <name>Nisar8</name>
                        <region>US02</region>
                   </Order>
              </country>
         </ns0:Message1>
    </ns0:Messages>
    regards
    Nisar Khan

  • Anyone have an example of a delimiter-based eText template?

    Would REALLLLY appreciate it. We are trying to get eText out of Bi Publisher and want a delimited format. I have only done fixed position.

    can you please post an example for both - delimiter based and fixed position based. I am not able to process the output. You can mail at [email protected]
    Thanks,
    sbedi

  • Message Split without BPM - Error

    Hi,
    I am creating a message split scenario without BPM as per weblog <a href="/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible Split without BPM</a>
    I am able to receive message in XI but after that it shows error in Integration engine.
    Error Category : MAPPING
    Error Code : GENERIC
    I am able to see the message in SXMB_MONI with error
    <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>No messages created from split mapping</SAP:P1>
    Please advice.
    Thanks,
    Sri.

    Hi Venkat,
    I am not able to see sub-groupid in sxmb_moni.
    Please see below the contents from sxmb_moni trace.
    ============================
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Trace xmlns:SAP="http://sap.com/xi/XI/Message/30">
      <Trace level="1" type="T">Party normalization: sender</Trace>
      <Trace level="1" type="T">Sender scheme external = XIParty</Trace>
      <Trace level="1" type="T">Sender agency external = http://sap.com/xi/XI</Trace>
      <Trace level="1" type="T">Sender party external =</Trace>
      <Trace level="1" type="T">Sender party normalized =</Trace>
      <Trace level="1" type="T">Party normalization: receiver</Trace>
      <Trace level="1" type="T">Receiver scheme external =</Trace>
      <Trace level="1" type="T">Receiver agency external =</Trace>
      <Trace level="1" type="T">Receiver party external =</Trace>
      <Trace level="1" type="T">Receiver party normalized =</Trace>
      <Trace level="1" type="B" name="CL_XMS_HTTP_HANDLER-HANDLE_REQUEST" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">XMB was called with URL /sap/xi/engine?type=entry</Trace>
      <Trace level="1" type="T">COMMIT is done by XMB !</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-ENTER_XMS" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-SET_START_PIPELINE" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="SXMBCONF-SXMB_GET_XMB_USE" />
      <Trace level="1" type="B" name="CL_XMS_TROUBLESHOOT-ENTER_PLSRV" />
      <Trace level="1" type="T">****************************************************</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">XMB entry processing</Trace>
      <Trace level="1" type="T">system-ID = QN7</Trace>
      <Trace level="1" type="T">client = 100</Trace>
      <Trace level="1" type="T">language = E</Trace>
      <Trace level="1" type="T">user = XIAFUSER</Trace>
      <Trace level="1" type="Timestamp">2006-04-18T05:51:20Z CET</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">****************************************************</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_UC_EXECUTE" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Message-GUID = 67F58830CE9E11DA91CD00111120E6DB</Trace>
      <Trace level="1" type="T">PLNAME = CENTRAL</Trace>
      <Trace level="1" type="T">QOS = EO</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PIPELINE_ASYNC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Get definition of external pipeline = CENTRAL</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-LOOKUP_INTERNAL_PL_ID" />
      <Trace level="1" type="T">Get definition of internal pipeline = SAP_CENTRAL</Trace>
      <Trace level="1" type="T">Queue name : XBTI0002</Trace>
      <Trace level="1" type="T">Generated prefixed queue name = XBTI0002</Trace>
      <Trace level="1" type="T">Schedule message in qRFC environment</Trace>
      <Trace level="1" type="T">Setup qRFC Scheduler OK!</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Going to persist message</Trace>
      <Trace level="1" type="T">NOTE: The following trace entries are always lacking</Trace>
      <Trace level="1" type="T">- Exit WRITE_MESSAGE_TO_PERSIST</Trace>
      <Trace level="1" type="T">- Exit CALL_PIPELINE_ASYNC</Trace>
      <Trace level="1" type="T">Async barrier reached. Bye-bye !</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-PERSIST_READ_MESSAGE" />
      <Trace level="1" type="T">Note: the following trace entry is written delayed (after read from persist)</Trace>
      <Trace level="1" type="B" name="SXMS_ASYNC_EXEC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Starting async processing with pipeline CENTRAL</Trace>
      <Trace level="1" type="T">system-ID = QN7</Trace>
      <Trace level="1" type="T">client = 100</Trace>
      <Trace level="1" type="T">language = E</Trace>
      <Trace level="1" type="T">user = XIAFUSER</Trace>
      <Trace level="1" type="Timestamp">2006-04-18T05:51:20Z CET</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PIPELINE_SYNC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Get definition of external pipeline CENTRAL</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-LOOKUP_INTERNAL_PL_ID" />
      <Trace level="1" type="T">Corresponding internal pipeline SAP_CENTRAL</Trace>
    - <Trace level="1" type="B" name="PLSRV_RECEIVER_DETERMINATION">
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL">
    - <Trace level="1" type="B" name="CL_RD_PLSRV-ENTER_PLSRV">
      <Trace level="1" type="T">R E C E I V E R - D E T E R M I N A T I O N</Trace>
      <Trace level="1" type="T">Cache Content is up to date</Trace>
      </Trace>
      </Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
    - <Trace level="1" type="B" name="PLSRV_INTERFACE_DETERMINATION">
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL">
    - <Trace level="1" type="B" name="CL_ID_PLSRV-ENTER_PLSRV">
      <Trace level="1" type="T">I N T E R F A C E - D E T E R M I N A T I O N</Trace>
      <Trace level="1" type="T">Cache Content is up to date</Trace>
      </Trace>
      </Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
      <Trace level="1" type="B" name="PLSRV_RECEIVER_MESSAGE_SPLIT" />
    - <!--  ************************************
      -->
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_PLSRV_RECEIVER_SPLIT-ENTER_PLSRV" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">number of receivers: 1</Trace>
      <Trace level="1" type="T">Single-receiver split case</Trace>
      <Trace level="1" type="T">Post-split internal queue name = XBTO6___0000</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Persisting single message for post-split handling</Trace>
      <Trace level="1" type="T" />
      <Trace level="1" type="T">Going to persist message + call qRFC now...</Trace>
      <Trace level="1" type="T">NOTE: The following trace entries are always lacking</Trace>
      <Trace level="1" type="T">- Exit WRITE_MESSAGE_TO_PERSIST</Trace>
      <Trace level="1" type="T">Async barrier reached. Bye-bye !</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-PERSIST_READ_MESSAGE" />
      <Trace level="1" type="T">Note: the following trace entry is written delayed (after read from persist)</Trace>
      <Trace level="1" type="B" name="SXMS_ASYNC_EXEC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Starting async processing with pipeline CENTRAL</Trace>
      <Trace level="1" type="T">system-ID = QN7</Trace>
      <Trace level="1" type="T">client = 100</Trace>
      <Trace level="1" type="T">language = E</Trace>
      <Trace level="1" type="T">user = XIAFUSER</Trace>
      <Trace level="1" type="Timestamp">2006-04-18T05:51:20Z CET</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PIPELINE_SYNC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Get definition of external pipeline CENTRAL</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-LOOKUP_INTERNAL_PL_ID" />
      <Trace level="1" type="T">Corresponding internal pipeline SAP_CENTRAL</Trace>
      <Trace level="1" type="T">Start with pipeline element PLEL= 5EC3C53B4BB7B62DE10000000A1148F5</Trace>
      <Trace level="1" type="B" name="PLSRV_MAPPING_REQUEST" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Mapping-Object-Id:29EB87F0231C357A8336DDEBD574EEAB</Trace>
      <Trace level="1" type="T">Mapping-SWCV:0CF1E1E0C5FC11DABCB9E4A50A07012B</Trace>
      <Trace level="1" type="T">Mapping-Step:1</Trace>
      <Trace level="1" type="T">Mapping-Type:JAVA</Trace>
      <Trace level="1" type="T">Mapping-Program:com/sap/xi/tf/_MM_filesplit_without_bpm_</Trace>
      <Trace level="1" type="E">CL_XMS_PLSRV_MAPPING~ENTER_PLSRV</Trace>
      </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
      <Trace level="1" type="System_Error">Error exception return from pipeline processing!</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--  ************************************
      -->
      </SAP:Trace>
    Thanks,
    Sri.

  • Message splitting without bpm

    Could anyone please give any idea or links about end to end configuration for  message splitting without using bpm.
    Thanks
    sabyasachi
    Edited by: Sabyasachi Mohapatra on Apr 7, 2009 11:50 AM

    Hi Sameerr
    .i have one sender  &  2 receivers.Please guide how to configure end to end in the receiver determination step & interface determination step.How many sender & receiver agreements need to be configured.
    Thanks & Regards
    Sabyasachi

  • About invoice verification without GR-based indicator set in PO

    Dears,
    As I know, when carry out invoice verification for a PO without GR-based IV set in PO/Vendor/PIR, there will be no reference invoice quantity and value in item lines of the invoice. User must input them manually according to real values in the invoice paper sheet delivered by Vendor.
    Now our client want the system sets the default value from PO in invoice verification, and they don't want to tick GR-based IV indicator,  how to realize it?
    Thanks all for your reply!

    Dear,
    1) At the time of time of Vendor master - XK01.
    In purchasing view tick on GR Bsd Inv.
    So due to this, at the time of purchase order creation this indicator is autometically put from vendor master.
    2) Quantity of purchase order is autometucally pur from good receipt.
    So create good receipt first than create invoice verification.
    So due to this at the time of invoice verification system take quantity from good receipt
    Regards,
    Mahesh Wagh.

  • How to split the IDOCS based on document number change whit out BPM

    Hi all,
    Thanks,for giving the responce..
    Scenario:File to IDoc.
    Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
    20000092
    20000092
    20000092
    50000050
    50000050
    50000065
    I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
                                                       2 for 50000050,50000050
                                                       3 for 5000006
    By using external definations i am getting 6 IDOCs insted of 3.
    Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
    Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
    Thanks in advance.
    Regards,
    KP

    HI,
    for this no need of BPM.
    You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
    For this e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    Regards,
    Moorthy

  • How to split the data based on one column

    Dear All,
    I have the table data like this.
    type quantity revenue_mny count country
    a 10           10          2 India
    a 20          12          3 India
    b 30          15          1 India
    a 35          20          2 US
    b 20          10          1 US
    b 60          15          1 US
    I woulkd like to split the date based on type column.
    For each country, for Type "a" get the sum of revenue count quanity ans same for b
    and all shuld come in on row for each country.
    output should be like
    country revenue_mny(For a) quantity(for a) count(For a) revenue_mny(for b) quantity(for b) count(For b)
    India 22 30 5 15 30 1
    US 20 35 2 25 80 2
    I tried the below query . its not splittng the date for each country in one row.
    select country,
    sum(case when type='a') then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='b' then quantity else 0 end) quantity_b from
    test
    group by country
    Please need your helo

    Like this?
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(case when type='a' then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='a' then cnt else 0 end) cnt_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b,
    sum(case when type='b' then quantity else 0 end) quantity_b ,
    sum(case when type='b' then cnt else 0 end) cnt_b
    from t
    group by country;result:
    COUNTRY  REVENUE_MNY_A QUANTITY_A CNT_A REVENUE_MNY_B QUANTITY_B CNT_B
    India    22            30         5     15            30         1
    US       20            35         2     25            80         2Or you can do it with a decode instead of case. The result will be the same:
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(decode(type,'a',revenue_mny,0)) revenue_mny_a,
    sum(decode(type,'a',quantity,0)) quantity_a,
    sum(decode(type,'a',cnt,0)) cnt_a,
    sum(decode(type,'b',revenue_mny,0)) revenue_mny_b,
    sum(decode(type,'b',quantity,0)) quantity_b,
    sum(decode(type,'b',cnt,0)) cnt_b
    from t
    group by country;(I changed tablename from TEST to T and columnname from COUNT to CNT, because you should not use reserved words as tablename or columnname.)
    Edited by: hm on 09.10.2012 06:17

  • Budgetary Ledger is used without Periodic Based Encumbrance Tracking

    Hello dear experts,
    If I post any budget document as a fund reservation (FMX1) a fund precommitment (FMY1) or a fund commitment (FMZ1) the systems shows the following error message:
    Message no. FMFG_BLCORE030
    "Budgetary Ledger is used without Periodic Based Encumbrance Tracking".
    After the systems show that message, error message (in red), is extrange because the systems lets save. This happen in the different transaction before written.
    The great problem comes at the moment that I want to post the payment request because the systems in this point does not let me save the document.
    Does any body know how can I repair this error message.
    Thank you very much for your help.
    Best regards.
    Rubé

    Hello Ruben,
    I am sorry because my previous reply may not be useful for you.
    With "BL"  I meant "Budgetary Ledger"
    PBET is Period Based Encumbrance Tracking.
    In other words, you should use an update profile being period-based and not fiscal year-based.
    As a general rule, Spanish customers use update profile 109 or 359. So maybe update profile 350 would not help you as it works as fiscal year-based and you should override many value types in order to get Period-based (PBET) active.
    You can find how your update profile will work by using report RFFMMONI. This report shows the basic settings of your FM Area and how the relevant value types will update FM depending on the assigned update profile.
    Regarding to PBET:
    If you are not familiar with this functionality, let me suggest you to visit this link:
    <a href="http://help.sap.com/erp2005_ehp_01/helpdata/en/9b/9e2a39b487605fe10000000a114084/content.htm">PBET</a>
    I understand the fact that probably the help.sap.com may not look as useful as you expect since probably you may not find all answers "in the next 2 seconds". But I think it is a really good start point...
    Hope it is useful for you
    Kind regards,
    Mar

  • Without GR-Based IV, No PO History

    Dear all,
    I've created a PO without GR-based IV setting, when I posted the invoice verification (MIRO), why is it that it did not show in the PO history? Is there anyway to reflect the posting of IV has been done in the PO?
    Thank you.
    Regards,
    Edwin

    HI
    Please check if this Purchase order is present in the Table EKBE.
    If you do not find, then please check table RBKP, using the invoice number.
    If it is present then Check table RSEG, using the invoice number, in the table also check if the Purcahse order number & item are present in the Invoice line.
    If you dont find any doucments in any of the tables, then repost the invoice using MIRO
    Thanks & Regards
    Kishore

  • Can a PM work center operation be split without assigning to individuals?

    We have a requirement to split the work time of a PM operation into more than one non-consecutive time period.  For example a maintenance trade work center containing 3 individuals is required to perform an operation that takes 40 hours.  Due to the plant schedule the work will be carried out in 20 hour segments.  20 hours in week 5 and 20 hours in week 7.  Can this operation be dispatched as a split without assigning the splits to individuals in the work center?
    We are using:  SAP Appl Release 470 and
    SAP R/3 Enterprise PLM, SCM, Financials  Release 110 and the latest support packs.

    Question is being posted to EAM Forum.

  • Need to show Counter at report level based on Position

    Chaps,
    one of my HR report requires a counter value based on Position. exactly what i required is want to show the no. of positions count based on Resource type. ( Resource type is a navig. attr of Position). How to define counter for this?
    Thanks.
    Rgds,
    ST.

    Hi Sathish,
       Create a formula variable with replacement with position and attribute resource type. Here write formula.
       Example: (formula variable >= 0)*1+0
    Regards
    Prasad

  • WF based on "Positions" instead of "Users" ?

    Hi guys,
    Is somebody using any WF in SRM that is based on positions instead of users ? 
    For example, if the user A leaves the company, I delete his/her user but not his/her position.
    After, I move the user B (object) into the Position A and this user (b) inherit the pending authorization tasks.
    Thanks for you help guys !!!! =)
    Kind regards,
    Diego

    Hello Diego,
    It is technically correct SAP Business Workflow works with Positions but it is difficult to maintain the Org. objects in SRM and CRM applications. Because SRM and CRM have enhanced objects BP: Business Partner and CP: Central Person objects.
    You can check object relationship with infotype 1001 in PP02 transaction.
    Organization Unit - O 50000608
       -> Position - S 50000621
            -> Central Person - CS50006622
                -> Business Partner BP0000000111
                -> User USPURCHASER
    Regards,
    Masa

  • Find  job  descp  based on  position

    Hi ,
      In  HR  ,  I  want to find  Job  Desp  based on Position.
    Thanks,
    Asha

    Hi
    Check this FM
    HR_HCP_SEL_POSITION_OF_PERSON
    HR_HCP_GET_EMPL_FOR_POSITION
    HR_HCP_GET_JOB_FOR_POSITION
    HR_HCP_GET_ORGA_FOR_POSITION
    HR_HCP_GET_POSITION_FOR_EMPL

  • Split Comma Delimited String Oracle

    I want to Split Comma Delimited string in oracle9i into rowwise data.i do not want to use Functions or connect by level...
    is there any other way from which we can split strings.???
    if we use Connect by level method the problem im facing is we cannot use suqueries in Connect by clause...
    Edited by: user11908943 on Sep 16, 2009 8:37 AM

    michaels2 wrote:
    I prefer using XMLTABLE which has superceded XMLSEQUENCE and I personally find it easier to read...Agree, but that would be hard in 9i since it is not implemented ;)Ah! missed that bit (gawd I wish people would upgrade to supported versions)
    In still later versions (11g) I prefer
    SQL>  with t as
    select 'a,b,c,d,e' str from dual
    select trim(column_value) str
    from t, xmltable(('"' || replace(str, ',', '","') || '"'))
    STR                                                                            
    a                                                                              
    b                                                                              
    c                                                                              
    d                                                                              
    e                                                                              
    5 rows selected.
    Natty! But completely illogical (I mean creating an XMLTABLE from a non-XML string). I'm guessing that's a development of XQuery?

Maybe you are looking for

  • USER PREFERENCES LOST!  HELP!

    I renamed my user icon (the little house icon in the finder menu). When I restarted my laptop all of my preferences were lost. This included my screensaver, bookmarks for Sarfari, settings for my Mail account, widgets and more. All the preferences ar

  • Can we create DBI dashboards, reports, etc. in Arabic text?

    Hi! Can we create DBI dashboards, reports, etc. in Arabic text? If we can create forms in Arabic, does it mean we can also do the same in DBI? Thanks.

  • File formats for uncompressed video import

    Hello all, I am currently trying out FCPX for a project I'm doing at work and am having trouble with import that I hope someone can help me with. I am creating video test pattern streams using a Python app, with the aim of then converting the raw, un

  • Outgoing server problem

    Why can't I use Mail (8.2) to send mail from an account that is hosted with Adobe's Business Catalyst. I set up the outgoing server as mail.imageprep.net but cannot ever send email from this account. The outgoing server is always offline. I also don'

  • Useless--you are without a doubt

    This is totally useless.  All it says it that Flash Player has got a lot of problems and you don't want to do ANYTHING TO HELP!!  You make it damn near impossible to contact you.  Your various response systems don't work, you can't login to report a