Remove Blanks by using start routine

InfoObject A: lengh 12 char  Conversion routine = blank
InfoObject B: Lengh 15 char Conversion routine = blank
The source file Item.csv contain 10 blanks for InfoObject A, for example "          02"
and 12 blanks for InfoObject B. "            898"
Is any way to remove those blanks? Thanks!

How about this...
Global Declarations
CONSTANTS: c_gbp(3)  TYPE c VALUE 'GBP',
           c_rub(3)  TYPE c VALUE 'RUB',
           c_teru(4) TYPE c VALUE 'TERU'.
DATA: t_tcurr        TYPE HASHED TABLE OF tcurr
                     WITH UNIQUE KEY mandt kurst fcurr tcurr gdatu,
      wa_tcurr       TYPE tcurr,
      l_datc(8)      TYPE c.
Routine
LOOP AT source_package
  ASSIGNING <source_fields>.
  CONVERT DATE <source_fields>-posting_date
    INTO INVERTED-DATE l_datc.                                 "Converts Posting Date into 9s Complement Date
  SELECT SINGLE
  FROM
    tcurr
  INTO
    wa_tcurr
  WHERE
    kurst EQ c_teru
    AND fcurr EQ c_gbp
    AND tcurr EQ c_rub
    AND gdatu GE l_datc.
  IF sy-subrc EQ 0.
    <source_fields>-amount_b = <source_fields>-amount_a * wa_tcurr-ukurs.
  ENDIF.
ENDLOOP.

Similar Messages

  • How to set request number of info package using start routine

    Hi All,
    I have a specific requirement in which I need to upload only selective request nos from PSA to DSO.
    Any one can suggest how to set request number of info package using start routine or any other mode so that only selective request should proceed using DTP?
    Thanks
    Sangita

    You'll probably want to do this in a start routine.  It is probably not advisable to hard-code the technical name of the InfoPak.  They seem to remain the same upon transport, unlike DTP technical names which are locally generated.
    I would do a SQL select like this in a start routine, and then filter based on the results of the SQL.  You'll probably want to sort the results by date and time, both descending.  Or do a MAX in the SQL.
    Please let me know if this isn't clear.
    select q~rnr q~logdpid q~tdatum q~tuzeit
    from rsreqdone as q
      inner join rsldpio as p
        on p~logdpid = q~logdpid
    where p~objvers = 'A'
    and p~logdpid like 'ZPAK%'
    and p~source = 'your data source'

  • How to use Start Routine for this requirement

    Hello,
    I am having data in 2 ods and should load that data into cube, but there isn't any common object in both the ods's. I need to analyze based on these ods objects. so I thought of pulling some objects into 1ods which are used for analysis and added some objects to ods and cube. Now I have to write a start routine in update rules to fetch the data from the info objects which are present in another ods. Can any one help me in this?
    Rajesh.

    Hi Surya,
    Extract all info from table BKPF
    select * into it_bkpf
    from bkpf
    where gjahr = p_fisyr.
    Select record based on internal table it_BKPF
    The reason why FOR ALL ENTRIES syntax is used because of its cluster table.
    select * into it_bseg
    from bseg
    for all entries in it_bkpf
    where bukrs = it_bkpf-bukrs
    and belnr = it_bkpf-belnr.
    Delete duplicate record based on Company Code and GL No.
    delete adjacent duplicates from it_bseg
         comparing bukrs belnr.

  • Restricting data in cube using start routine

    Hi,
    Can anyone help me with my scenariou2026.I am trying to restrict the absence data being loaded into the cube where the absence is less than or equal to twenty.
    Firstly I put in a start routine in the update rules against actual time.
    DELETER DATA_PACKAGE WHERE  DUR_ACTUAL GT 20
    But this didnu2019t work.
    Secondly I put this code in the change routine for the key figure actual time
    IF RESULT GT 20.
      RETURNCODE = 1.
    ELSE.
      RETURNCODE = 0.
    ENDIF.
    But all the actual time fields were set to 0.
    Can anyone please help with the correct code.
    Thanks
    Forhad

    It is hard to say without debugging your code, and inspecting the input package.  Maybe you just need quotes around your values, or something simple like that.
    But did you know that it is faster to put a filter in a DTP?  Using a filter, you're pushing the criteria down to the SQL WHERE clause, and limiting the amount of data.
    And, you're eliminating the need for ABAP.
    Sorry, if you're not on BI7, disregard, because you don't have DTPs.
    Edited by: Jerry Coleman on Jan 29, 2009 10:05 AM

  • Filter data in transfer rules using start routine

    Hi all!
    I am an absolute newbie here, but I have a question regarding start routines and I noticed many questions get solved around here. My situation is the following: I have to create a start routine where the data to be transferred is filtered on an attribute "DESTINAT" in info object "0BILL_TYPE". DESTINAT can be 'M' or 'D' and depending on that letter, data must flow to a separate ODS.
    Well,I came up with the following:
    somewhere in my start routing I guess I'll have to put:
    loop at data_pak.
    DELETE DATAPAK Where DESTINAT = 'D'
    endloop.
    When I place this in my start routine of my transfer rules leading to the ODS where data must be of DESTINAT type 'M', will this do the trick?
    I want to put the following code in the transfer rules leading to my other ODS, where data must be of type DESTINAT = 'D':
    loop at data_pak.
    DELETE DATAPAK Where DESTINAT = 'M'
    endloop.
    I'm sorry that this is a very basic question, but like I said: I'm a newbie in SAP...

    hi Joris,
    have a lok at the foll  help docs.:
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/0ef3e8396111d5b2e80050da4c74dc/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/21/894eeee0b911d4b2d90050da4c74dc/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a62bfe07211d2acb80000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/content.htm
    cheers
    shameem

  • Update two ODS using Start routine

    Hi Experts,
    I have two DSOs, One for 0MATERIAL_ATTR and another for 0MAT_SALES_ATTR. My requirement is to write a start routine while updating to YMAT_SALES_ATTR DSO which has a reference of Material from the YMAT_ATTR DSO. The material DSO is already loaded.
    I have a written the Start routine for it. Now I have to Load the Materials to another Error DSO(YSALES_ERR) when the reference is not found. I have to rewirite the same start routine to update another DSO with the above condition.
    I would appreciate some help.
    Thanks,
    Seema

    Hi Brian,
    The Data is already in the first DSO layer where it just acts as a Passthrough. The scenario here is the Material master data and  Materials with sales master data are loaded to the first layer . Then the Materials are loaded to the second layer. We must load the Material sales to the second layer only when it has reference  to  Material(2nd layer) . I have written the Start routine. But still the start routine misses to catch the bad ones.
    Please help me with the code..
    Thanks,
    Seema

  • Diff between the Start routine and Update rules?

    Hi Gurus
    Diff between the Start routine and Update rules?
    Thanks in advance
    Raj

    Hi,
    Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and  write your start routine.
    There are 4 types of routines
    1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
    This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
    For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
    The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to 
    different data targets.  For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on.  This can be achieved by using Start routine at the Update rule level
    2. Transfer Routine: This feature is available at the transfer rule levels
    While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
    1. You could do a one to one mappping of the Infoobject
    2. Provide a constant value
    3. Include a formula
    4. Write an ABAP routine.
    These 4 options refers to the transfer routine
    3. Update Routine:
    The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other 
    sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
    4. Conversion Routine: It provides functionality to do Currency and unit conversion.
    Regards.

  • Can we use Perform statement in start routine ,Form and endform.

    Hi,
    Can we use Perform statement in start routine ? Then write the ABAP code between Form and Endform.
    Example : Can I use Perform ABC in start routine. Then define ABC at the end of start routine.
          Form ABC,
          ......<ABAP> code .....
          Endform.

    Hi,
    In BI 7.0 we have start routines defined using Class where you might be able to create your own performs, but in case of BW3.5 Start routines are defined using Form so there I don't think it will allow you to create one more form.
    But you can surely try both the approaches.
    Reards,
    Durgesh.

  • Using internal tables in BI 7 Start routines

    Hi All
    I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
    This is what I am trying to do is the following:
    In a DSO ZSD_O01  I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
    The DSO structure is as follows:
    /BIC/AZSD_O0100
    DOC_NUMBER
    ITEM
    CONTRACT
    CITEMNUM
    I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
    Can any of you kindly show me how to :
    - Read data from a DSO into a internal table
    - Read the internal table for the first data package
    - How do I make the access in the internal table fast when my lookup in the internal table is not on the
      DSO key columns but on a different key column
    Appreciate your help
    Thanks
    Karen

    Hi Karen ,
    It will be helpful if you tell your requirement  as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
    -how to check for source_package = 1
    You need to hard code it .
    We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your  package then use global variable as counter and read only when record_count is <= 50000 .
    -how to declare the internal table so the values in it exists between different data packages
    Declare a global table and select data into it .A global table retain data across  the packages .
    - The key on which I need to lookup in the internal table is not the key fields as in the DSO
    Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate  in your source .then you just need to read the internal table having data from DSO2  with key field  A B C .
    Better if you set them as semantic keys at DTP level so that all  duplicate entries of A B  C will appear in same package .
    global Declarations
    In your start routine you will have this following code :
      TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ...   insert your code here
    $$ end of global - insert your declaration only before this line   -
    One question
    Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
    Regards,
    Jaya Tiwari

  • Index used or not for selecting data from ODS in a start routine

    Dear friends,
    In the start routine of the update rules to a cube, I am reading some data of an ODS in to an internal table .
    The ODS is indexed. But, I am not sure if the index is at all used in the Select statement (that gets the data from ODS to the internal table in the start routine) while loading data to the cube.
    Any help is highly appreciated.
    regards,
    atlaj

    Hi Atlaj
    You can findout this is display execution plan for SQL statement in DB02.
    Goto DB02. and under diagnostic, you find explain. Select that and enter your query. Make sure that everything here is in capital format. Below is a sample query which I have entered.
    SELECT "CRM_SALORG" "SALESORG" FROM "/BI0/QORGUNIT"
    WHERE "SALESORG" = ? AND "OBJVERS" = ? AND "DATETO" >= ?
    AND "DATEFROM" <= ?
    The select parameters should be inside qoutes and in caps and even the from table. Once you enter your query in this format, click on explain. It will show the index scan if the index is present. the output for my query will be something like
    0 SELECT STATEMENT ( Estimated Costs =  1,348E+01 [timerons] )
            1 (COOR) RETURN
                2 (    0) TQ
                    3 (    0) FETCH /BI0/QORGUNIT
                        4 (    0) IXSCAN /BI0/QORGUNIT~Z1
    Where my last statement (line 4) is showing index scan and the name of index read is Z1.
    Hope this helps.
    Please let me know if you have any problems entering the query in the specified format and u get any error.
    Regards
    Sriram

  • Filtering records using a start routine inside the update rules for a dmart

    Hi
    I am using a start routine inside the update rules. I want to filter out all records that have 0 in all three fields. My problem is that it not only filters these records, but also filter records with negative values, which I do not want. Only 1 field has a negative value, the other 2 have 0.
    I have tried:
    DELETE DATA_PACKAGE where  /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 .
      DELETE DATA_PACKAGE where ( /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 ).
    also tried:
    delete DATA_PACKAGE where /BIC/ZBILLCONS IS INITIAL and
    /BIC/ZBREVPRIM IS INITIAL and  /BIC/ZBREVSUBO IS INITIAL.
    The records are going to 1 cube and 1 ODS, I only have the start routine in 1 update rule. I  view the filtering in the PSA.
    Has anyone ran into this before?

    Try
    delete data_package where /BIC/ZBILLCONS = '0' and /BIC/ZBREVPRIM = '0' and /BIC/ZBREVSUBO = '0' .
    OR
    delete data_package where /BIC/ZBILLCONS EQ '0' and /BIC/ZBREVPRIM EQ '0' and /BIC/ZBREVSUBO EQ '0' .
    Good luck!

  • Start routine..where RECORDMODE=blank i the psa.

    Hi Friends,
    while loading data from PSA to DSO,i am getting an error in the dso, saying that got duplicate records in the psa, but we don't have any duplicate records.
    my question is to load the data in to the DSO, i need to write a start routine where it should pick from PSA only the records whcih RECORDMODE=blank.
    could u guide me how to write it pls.
    Thanks in advance.

    Hi follow this code
    this will work surely.
    Loop at DATA_PACKAGE.
    If DATA_PACKAGE-RECORDMODE NE ' '.
    DELETE DATA_PACKAGE WHERE RECORDMODE NE ' '.
    ENDIF.
      ENDLOOP.
    Regards
    Ram

  • Defining a customer method in start routine and using in char-routines

    Hi,
    can I define an own method in start routine and use this method in several routines for characteristics or key-figures?
    If yes, can anybody give me a short description where to define the new method (e.g. in wich section of the start routine), where to implement the new method and how to use the new method in transformation of char or key-figures.
    Thanks for your help
    Thomas

    Hi,
    If you are looking for something like global method it is not possible. But you can create a function module in SE37 and you can use the same wherever you want.
    Regards
    Githen

  • How to delete data from a DSO using start or end routine

    Is it possible to delete records from a DSO in the start or end routine.
    My example:  I have order 123, item 10, sched line 1.  This gets loaded into the DSO.
    Next day I have order 123, item 10, sched line 2 coming in.
    I want to delete the first one (with sched line 1) from the DSO and load the second one (with sched line 2).
    Can code be put in the start or end routine to do this?

    unless I can do it within the start routine I don't want to have to create new records.
    In the start routine I am comparing records coming in with what are already in the DSO.  If there is a match on order and item and the sched line is different, then I want to delete the record from the DSO and load the new one.  Is there code that I can put in a start routine to accomplish this?

  • How to get used InfoPackage name in SAP BW 3.5 in update/ start routine?

    Hello Experts,
    according to the Infopackage (weekly load ord monthly) the update rule should change.
    In BI 7.0 helps the method P_R_REQUEST. Is there any similar for BW 3.5? =Or is there a possiblility to get the request nr in the startroutine with accordant mapping table to InfoPackage?
    Best regards,
    Stephan Wagner

    Hi Experts,
    thank you for your answers. Now, I have got the mapping table InfoPackage/ Request-ID.
    But, how can I get the actual Request ID in the start routine in BW 3.5?
    The tables MONITOR and MONITOR_RECNO don´t store it and they needs to be filled.
    MONITOR_RECNO
    MSGID
    MSGTY
    MSGNO
    MSGV1
    MSGV2
    MSGV3
    MSGV4
    DETLEVEL
    RECNO
    MONITOR
    MSGID
    MSGTY
    MSGNO
    MSGV1
    MSGV2
    MSGV3
    MSGV4
    DETLEVEL
    Best Regards,
    Stephan

Maybe you are looking for