Help in transformation routine

I have to put an indicator for delivery block in transformation routine.
Logic: if headed delivery block 'LIFSK' is not blank, result is 'X'.
Here is my code which is not working:
IF SOURCE_FIELDS-LIFSK NE ''.
      RESULT = 'X'.
    ENDIF.
But this code is not doing anything. I tired using 'test' function in transformation, it gives abap dump.
What is the problem. Code is in right place in transformation routine.
A similar code for item level block is working:
More details:
$$ begin of routine - insert your code only below this line        -
    ... "insert your code here
*--  fill table "MONITOR" with values of structure "MONITOR_REC"
*-   to make monitor entries
    ... "to cancel the update process
   raise exception type CX_RSROUT_ABORT.
    ... "to skip a record
   raise exception type CX_RSROUT_SKIP_RECORD.
    ... "to clear target fields
   raise exception type CX_RSROUT_SKIP_VAL.
    IF SOURCE_FIELDS-ZZ_LIFSP ne ''.
      RESULT = 'X'.
    endif.
$$ end of routine - insert your code only before this line         -
  ENDMETHOD.                    "compute_ZDELIBLK
Thanks
Jeff
Edited by: Jeff Edwards on Aug 17, 2008 10:34 PM

No luck.
Error analysis
    The following checkpoint group was used: "No checkpoint group specified"
    If in the ASSERT statement the addition FIELDS was used, you can find
    the content of the first 8 specified fields in the following overview:
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
ST22 / ABAP Editor :
*-- Get field name from source field with extern posit.
  READ TABLE i_t_seg_source ASSIGNING <ls_s_seg_source>
    WITH KEY segid = i_segid.
  ASSERT sy-subrc = 0.
  IF sy-subrc = 0.
    READ TABLE <ls_s_seg_source>-t_field ASSIGNING <ls_s_field>
      WITH KEY position = l_posit_source_ex.
> ASSERT sy-subrc = 0.
  ENDIF.
*--  r_s_parameter-param_id has to be set out side due to type inheritance of RuleStepMapping
  CONCATENATE '<' <ls_s_seg>-y__nm '>' INTO
  c_s_connector-s__nm.
  c_s_connector-f__nm = <ls_s_field>-fieldname.
ENDMETHOD.

Similar Messages

  • Help with Transformation routine

    Hi,
    I have a transformation routine from a DSO to a cube. The DSO contains two infoobjects ( Form, Brand ) which are mapped to infoobject Material in the cube. My requirement is that i need to populate the material number based on the brand and form available in the DSO. Can you please help me with the routine to be written for material ?
    Regards
    Snehith.

    Hi,
    perform below steps in start routine .
    create one internal  as t_material having 3 fields
    and then write select query as :
    SELECT material
               brand
              form
         FROM /BIC/PGPUMATL
         INTO TABLE t_material
          FOR ALL ENTRIES IN SOURCE_PACKAGE
        WHERE brand EQ SOURCE_PACKAGE-brand
      form EQ SOURCE_PACKAGE-  form
    In transformation routine of material:
    write below logic :
    FIELD-SYMBOLS  :<fs_ t_material >    TYPE y_ t_material .
    *" Get material class value from table /bic/agpud009900
        READ TABLE  t_material
          ASSIGNING <fs_ t_material >
          WITH KEY brand = SOURCE_FIELDS-brand
                             form = SOURCE_FIELDS- form
        IF  sy-subrc EQ 0
        AND <fs_ t_material >  IS ASSIGNED.
          MOVE <fs_ t_material >material  TO RESULT.
        ENDIF.
    Hope this helps you
    Thanks .

  • Help Need Transformation Routine

    Hi ALL,
        I want to write a routine in transformation which generates sequence number(Surrogate key) whenever i load the data in cube/ODS  ,since i don't any idea on ABAP Coding i can't proceed further. Can anybody help me in writing ABAP code generate sequence number in object based on the number of records.
    Please can anyone help me on this.
    Thanks & Regards
    Sameer Khan

    Hi Sameer
    Please let me know whether my understanding is correct or not
    You need to create a sequence number for each record of the cube
    In that case you can write a simple routine to generate a number and assign it to any infoobejct. After the last record of the data package just store the last value of sequence into a temp memoey location.
    and at the start of the routine just retrive the value of that memory loacation.
    Thanks & Regards
    Rohit

  • Transformation Routine Help

    Hello Guys,
    I need your help in transformation routine.
    I have  source fields like 0DOC_NO(Sales Document no), 0CREATEDON(Created on), 0DLV_STS (Delivery status), 0DLVQLESC (Delivery Date Acc to scheduline date). i have 4 keyfigures like Late Incomplete (ZLI), Late Complete (ZLC), Ontime Complete (ZOC), Ontime In Complete (ZOI). i want to count no of sales order as ZLI, ZLC, ZOC, ZOI.
    I  have four conditions which i have to write for each keyfigures with above source fields in transformation routine.
    1) For Late Incomplete : -  if (0DLV_STS nt Eq C) and (0DLVQLSEC >0) then add1
    2) For Late Complete  : -  if (0DLV_STS  Eq C) and (0DLVQLSEC >0) then add1
    3) For On-Time Complete :- if (0DLV_STS  Eq C) and (0DLVQLSEC =0) then add1
    4) For On-TIme Incomplete :- if (0DLV_STS nt Eq C) and (0DLVQLSEC >0) then add1
    Can anyone tell me how to write it ?
    Thanks in advance
    Regards,
    Komik Shah
    Edited by: komik shah on Nov 14, 2009 1:24 AM

    Hi,
    Try this code...
    For Late Incomplete
    IF ( SOURCEFIELD-0DLV_STS NE 'C' ) AND ( SOURCEFIELD-0DLVQLSEC GE '0' ).
    IF ( SOURCEPACKAGE IS INITAL ).
    RESULT = 1.
    ELSE.
    RESULT = RESULT + 1.
    ENDIF.
    For Late Complete
    IF ( SOURCEFIELD-0DLV_STS EQ 'C' ) AND ( SOURCEFIELD-0DLVQLSEC GE '0' ).
    IF ( SOURCEPACKAGE IS INITAL ).
    RESULT = 1.
    ELSE.
    RESULT = RESULT + 1.
    ENDIF.
    For On-Time Complete
    IF ( SOURCEFIELD-0DLV_STS EQ 'C' ) AND ( SOURCEFIELD-0DLVQLSEC EQ '0' ).
    IF ( SOURCEPACKAGE IS INITAL ).
    RESULT = 1.
    ELSE.
    RESULT = RESULT + 1.
    ENDIF.
    For On-TIme Incomplete
    IF ( SOURCEFIELD-0DLV_STS NE 'C' ) AND ( SOURCEFIELD-0DLVQLSEC GE '0' ).
    IF ( SOURCEPACKAGE IS INITAL ).
    RESULT = 1.
    ELSE.
    RESULT = RESULT + 1.
    ENDIF.

  • Calling a function module from within a transformation routine

    I created a routine within a transformation and experience the following weird behavior now:
    When I call a function module within that routine, the load fails with the following error message:
    Exceptions in Substep: Rules
    When I click on the button next to this text, it point me to my function module call.
    What I do not understand is, that the following two scenarios work fine:
    - Having the same function call (with fake values) in a plain ABAP program works beautilfully
    - If I copy the content of my function module directly into my transformation routine, everything works fine as well
    I am now wondering whether the routine does not "see" the function module I am calling. The module resides in a different package. Is that a problem? Do I have to include something first?
    Here is the code that calls my FM (
    CALL FUNCTION 'Z_CA_CONVERT_US_COST'
         EXPORTING
            PSOURCEVAL                      = SOURCE_FIELDS-/BIC/USFRZMFC
            PSOURCEUOM                      = SOURCE_FIELDS-BASE_UOM
            PUSITM                          = SOURCE_FIELDS-/BIC/USITM
            PTARGETUOM                      = PRODUCTION_UOM
         IMPORTING
            PTARGETVAL                = RESULT
         EXCEPTIONS
           CONVERSION_NOT_MAINTAINED = 1
           PARTNO_NOT_FOUND          = 2
           OTHERS                    = 3.
    Thanks a lot for your help. Points will be assigned.
    Dennis

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Error in Transformation Routine

    Hi all,
    I have  written a code in transformation routine. I have debugged the code. The code which I have written is working fine. The value in 'Result' is correct and till here the code executes without any error. After that , system throws an error which I cannot understand as this is the system generated code.
    I wanted to paste the error analysis here but i dont have any option to copy from there. Message class is "RSBK". Number is 299
    Any ideas?
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi AI,
       As I told you earlier ... jsut copy and paste the code I sent you in the end routine ... if the end routine contains your data then we are sure that the transformations have worked fine ... if it does not contain any data then we are sure something has gone wrong during the transformation.... you cannot find the problem until you are sure where it is happening.... lets work on this and get it out of our way... I am waiting for your response.
      Another point if anything has gone wrong while doing the transformations for location then the end routine will not have location info ... this is why I suggest you to put the code above in the end routine and debug ... this will give you a fair idea as to what has happened and where the problem arises.... Hope this helps.
    best regards,
    Kazmi

  • Table Declaration in Transformation Routine

    Hi all,
    I have declared a table in transformation routine as follows :
    DATA : BEGIN OF VACATIONS OCCURS 0,
           DATE TYPE D,
           END OF VACATIONS.
    System is giving following error on this :
    ' E:Tables with headers are no longer supported in the OO context.'
    What should I do now?
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi Al,
       Let me explain here ... because you are doing what is being told to do without actually understanding your purpose. Let me take a scenario. You want to read a database table for sales orders populate it into the internal table. Then you wnat to loop at the internal table you populated and print the output. For this what you need is an internal table where your data will be stored - simply put its a 2 dimentional array. so your data once put into the internal table would look like:
    Sales_Order  Sold_To_Party
    1                        1
    2                        3
    3                        5
    4                        1
    Now what you do is read it - which means you are going to read one line at a time, which means a structure not an internal table, which was the purpose of the header line. but since header lines are not supported you need a different work area (structure). So that when you read the first line your structure contains as follows:
    1                       1
    When you read the second line your structure or work area contains the second line:
    2                        3
    so on.....
    From the explaination above you must be clear that you need an internal table to store data temporarily and a structure to manipulate a single record. Now the cod would look like:
    DATA: it_vbak type table of VBAK.
    DATA: wa_vbak type vbak.
    Notice above that one is using a "table" while declaring and the other is not.
    Select * from VBAK into table it_vbak.
    loop at it_vbak into wa_vbak.
    note above that you are looping at the internal table and populating one record
    into the work area.
       write:/ wa_vbak-vbeln.
    endloop.
    Hope this helps. Ask if you have any more concerns.
    Best regards,
    Kazmi

  • CX_SY_NO_HANDLER triggered when call FM in Transformation Routine in BI

    Hi,
    Currently we are encountering an error whereby the Exception 'CX_SY_NO_HANDLER' will be triggered whenever we call a Function Module inside a Transformation Routine in BI.
    Previously, this FM was a Custom FM, but even after changing to a standard FM this error still happens.
    The process does not even enter into the FM, but immediately jumps to a 'Try - Catch' block of standard SAP, with the message "an exception (CX_SY_NO_HANDLER) occured".
    Hence, we need to confirm:
    does SAP/BI allow calling an FM inside a Transformation Routine?
    if yes to above, how do we avoid encountering this error when calling a FM inside a Transformation Routine.
    Your help is very much appreciated.
    Thanks you.

    Yes, you can call a FM from function module.
    Make sure your import and export parameters are of same type as defined in FM when passing values to FM from transformation.
    For example:
    in function module
    xyz type i.
    transformation
    abc type char.
    CALL FUNCTION 'dsjfh'
    EXPORT
    xyz = abc.
    Regards,
    San!

  • How to know infopackage request ID in transformation routine ?

    Hi All,
    I'm looking for the ABAP code to know the infopackage request ID in transformation start or end routine
    I can see this ID when I clic on "manage" on a PSA (looks like for instance REQU_D706H24SFFUIGNKMQMPPAIJLM)
    I need it in transformation routine
    Thanks for your help
    Sebastien Lepeltier

    Sorry Sat but again with the code :
    field-symbols: <l_requnr> type any.
    data: l_requnr_fieldnm type string value 'l_requnr'.
    assign (l_requnr_fieldnm) to <l_requnr>.
    I have this error message in debug mode : Field symbol <L_REQUNR> is not yet assigned
    Thanks Joe for the answer but in
    IMPORTING
    request TYPE rsrequest
    datapackid TYPE rsdatapid
    request and datapackid are filled with information of the current DTP not infopackage source
    Sebastien

  • Need help in transformation

    Hi All,
        I need a help in transformation.  There are 5 Key figures : KF1, KF2,KF3, KF4 , KF5 in my target.
    Requirement is  KF3 should be KF1 * KF2
    and if KF4 >0 ,  KF5 = KF4.
      else
            KF5 = KF3.
    I am not able to see these key figures when im trying in  formula or routine.
    How can I do these in transformations ???
    Thanks in advance..

    Hi All,
      Thanks for your inputs .
    I have used end routine for this requirement as the field level transformation will become complex as the (already present KFs in target are derived from the routines)..
    So  I have used end routine,
    Data: lwa_result_package like line of result_package.
    loop at result_package into lwa_result_package.
    lwa_result_package-/BIC/zval_chng = lwa_result_package-/BIC/zpri_new * lwa_result_package-/BIC/z_qty_new -
                                   lwa_result_package-/BIC/zpri_old * lwa_result_package-/BIC/z_qty_old.
    if lwa_result_package-/BIC/zval_chng is not initial.
    lwa_result_package-/BIC/ztot_amnt = lwa_result_package-/BIC/zval_chng.
    else.
    lwa_result_package-/BIC/ztot_amnt = lwa_result_package-/BIC/znetprice.
    endif.
    MODIFY result_package from lwa_result_package.
    endloop.
    Thanks again for your posts..

  • Problem to call a easy function in a transformation routine

    Hi,
    I wanted to convert a string ("12") to an integer (12) in my transformation routine.
    Here the code:
    DATA: vaca_number TYPE i.
        CALL FUNCTION u2019conversion_exit_alpha_outputu2019
          EXPORTING
            input  = source_fields-vaca
          IMPORTING
            output = vaca_number.
        IF source_fields-smocker CS 'Y'.
          result = vaca_number * 120.
        ELSEIF source_fields-smocker CS 'N'.
          result = vaca_number * 240.
        ELSE.
          monitor_rec-msgid = 'ZMESSAGE'.
          monitor_rec-msgty = 'E'.
          monitor_rec-msgno = '001'.
          monitor_rec-msgv1 = 'ERROR SMOCKER UNKNOWN FOR PPS'.
          monitor_rec-msgv2 = source_fields-smocker.
          APPEND monitor_rec TO monitor.
          RAISE EXCEPTION TYPE cx_rsrout_abort.
        ENDIF.
    When i check, i have the following error:
    E:"RS_C_ICON_VERSION-" expected, not "#CONVERSION_"
    Have you an idea ?
    Thanks for your help.
    Rodolphe.

    That's one problem.  But if you look at the interface for the FM, it requires a character value.  The following, using an integer, will dump.  Try it and see.  The only way to make it work is to define i_2 as a character, not integer.
    PROGRAM zz_temp.
    DATA:
      c_1  TYPE c VALUE '1',
      i_2  TYPE i.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input  = c_1
      IMPORTING
        output = i_2.

  • How can I call a Method in a Transformation Routine

    Hello Experts,
    How can I call a Method in a Transformation Routine ??
    THNXX

    Hi,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19?quicklink=index&overridelayout=true
    It will be help full .
    Regards,

  • Transformation Routine for checking condition only once

    Hello,
    I would like to perform he calculations based on certain criteria which goes like this...
          LOOP AT ITab WHERE EMPno  = ITAB Empno AND
                            ATYPE = ITAB-stype .
            IF ITAB-LTYP = '1000'.
              CHECK ITab-ABEGIN GE YR_BEGDT AND ITab-ABEGIN LE YR_ENDDT.
              CHECK FLAG_ST <> 1.
              ITAB-PENDING_ST = ITAB-PENDING_ST + ( ( ITab-BAL / 825 ) * 100 ).
            ELSEIF ITAB-STPE = '2000'.
              CHECK FLAG_SL <> 1.
              ITAB-PENDING_SL = ITAB-PENDING_ST + ( ( ITab-BAL  / 825 ) * 100 ).
              ENDLOOP.
          IF ITAB-stype  = '1000'.
            FLAG_ST = 1.
          ENDIF.
          IF ITAB-stype  = '2000'.
            FLAG_SL = 1.
          ENDIF.
          MODIFY ITAB.
    How to implement this logic in Transformation roles ... as this flag checks only once.... to perform the calculation.
    Thanks
        ENDLOOP.

    Hi there,
    You must be aware of start and end routine in a transformation.
    Assumin that you would like to modify the code before sending it to individual( field wise transormation) transformation , you can write your code in start routine tab of the transformations.
    Code written in Start routine in a transformation can manipulate the data data package wise..
    say for eg if u need to fill the values in indivual routine  then u can save all  the values in an internal table ( say for eg ur itab) in the start routine and this data is available for u in the transformation routines.. so anything written in start rotuine shall work as global modification for the transformation routines.
    Similarly code written in end rotuine shall work for chunk of data which is modified individually in transformation routine.
    you ca go thr this link for more clarification
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417700)ID2067718350DB10090875593766856688End?rid=/library/uuid/609eea32-455e-2c10-c08a-c23adf8c934e&overridelayout=true
    http://help.sap.com/saphelp_nw04/helpdata/en/4f/a9ea964a86b04dbe4df20af6e598cf/frameset.htm
    Regards,
    kk

  • Transformation routine for Infoobject lookup

    Hey guys,
    I am aware of Update rule routines but never done Transformation routine before. I didnt get any related post for my req.
    My requirement is on WBS element I have some attributes which is coming from std WBS Attr extractor but I have one custom attribute infooject which I want to populate through an Infoobject which is also a master data Infoprovider. For this I have to write a Tranfer rule routine.
    Please note these are transfer rules in BW 3.5 not BI 7. Please provide exact code. Appreciate your help.
    Thanks.
    BMW M///

    Declaration of Types table for your master data object in the declaration area....
    Replace your attributes in place of plant, GSRCSYS and CALMONTH
        TYPES: BEGIN OF TY_WBS,
                     /BIC/GPLANT TYPE /BIC/OIGPLANT,
                     /BIC/GSRCSYS TYPE /BIC/OIGSRCSYS,
                     CALMONTH TYPE /BI0/OICALMONTH,
               END OF TY_WBS.
        DATA: IT_WBS TYPE TABLE OF TY_WBS,
                    WA_WBS TYPE TY_WBS.
    /BIC/AWBS = your master data table name
    SELECT * FROM /BIC/AWBS INTO WA_WBS
        WHERE OBJVERS = 'A'.
    THen in the transformation Routine on field level use the below code to populate the value
    "  /BIC/GPLANT = L_SOURCE_PACKAGE-/BIC/GPLANT.
       substitute your objects here to query the master data object to get values.
    READ TABLE IT_WBS INTO WA_WBS WITH KEY
          /BIC/GPLANT = L_SOURCE_PACKAGE-/BIC/GPLANT.
    RESULT = WA_WBS-Your object name.
    Hope this will help you...

  • Transformation Routine to convert single record into multiple

    All,
    I need your help with ABAP Syntax.  My requirement is to take a single record and convert it to multiple records into a DSO with a condition to not create a record if a KF value is 0.
    R/3 Data Record:
    Employee | Date | Char1 | KF1 | Char2 | KF2 | Char3 | KF3 | Char4 | KF4
    Conversion Result into DSO:
    Employee | Date | Char1 | KF1
    Employee | Date | Char2 | KF2
    Employee | Date | Char3 | KF3
    Employee | Date | Char4 | KF4 (This record will not be written if no value is in KF4)
    I have read about the result table in update rules, however within BI 7.0 Transformations I am unfamiliar as to where the RESULT_TABLE function applies.  Has this been replaced by the Expert Routine?
    Could any ABAP expert provide sample code as to how I would perform this conversion in a Transformation Routine?
    Thanks,
    David

    Thanks Alex for your response.
    I did find a solution to this as it turns out to be fairly simple, however I executed the routine as an Expert Routine instead of a Start Routine.  I was advised to do the transformation here.
    The basic concept is defined below:
    Loop at source_package assigning -kf2.
              Append result_fields to result_package.
           Endif.
    -- Kf3u2026  and so on
    Endloop.
    Basically the APPEND statement is used to create the additional records.

Maybe you are looking for

  • AP Prepayments before an invoice is raised

    Hi all, I would appreciate any help you can provide with the following Can you use Prepayment functionality in SAP where the material ledger is employed? Any advice on how this can be achieved would be greatly appreciated. The client wishes to raise

  • Images in text column to move?

    Hi, I placed an image over a column of text and used the text wrap tool. Now, is there a way for the image to move and shift down and keep in place with the copy as I add more text either before or after this article? I'm imagining, some sort of link

  • Bose Sounddock functionality post ios4 upgrade

    Hi all, following my ios4 upgrade to my 16gig Touch I noticed the only functionality that works from my Bose Sounddock 2 remote control are the volume controls ... nothing else works !! I see the 'Home' menu item withing settings has also disappeared

  • Single side printing on Photosmart 6525

    I have a current imac, running system 10.0. I am using Word 11.0 word processing software. Prior to upgrading to the newest system softwar and buying this printer (which I did a the same time), the print dialog box that came up in Word 11 offered a c

  • Relative paths not used in the same way for flv and mp3

    When I load an mp3 using the Sound component, with the relative path "medias/test.mp3", it works. When I try to load a flv using the VideoDisplay component, with the relative path "medias/test.flv", it doesn't work! VideoDisplay seems to build the pa