Returncode in transfer rules routine

In every transfer routine template there is such interesting line of comment:
* returncode <> 0 means skip this record
I've tried to set the returncode to 1, was a certain condition encountered. However the record isn't ignored at all, and I get this error message in the monitor:
<i>Record 1 :Returncode 1 with the conversion for the field SOLD_TO</i>
How does the returncode function?
Thanks, <a href="https://wiki.sdn.sap.com/wiki/display/profile/Davide+Cavallari">Davide</a>

hi Davide,
checked sap help say ?
http://help.sap.com/saphelp_nw70/helpdata/en/0d/54a2a4705c3c4d9a3726773d741392/frameset.htm
have you set the option for error handling in infopackage ?
hope this helps.

Similar Messages

  • Challenge - Defining "global" variable accessible in Transfer Rules Routine

    Hi,
    Is there a way to define a global variable in BW which is accessible via all the "Routines" in the Transfer Rules in the Info Source.
    Scenario:
    1) I have a field called ZTEXT in the transfer rules.
    2) I am adding code in the Routine to manipulate this data in the Transfer Rules for the Info Source.  Ultimately the RESULT will be populated with a value.
    RESULT = .
    returncode <> 0 means skip this record
      RETURNCODE = 0.
    abort <> 0 means skip whole data package !!!
      ABORT = 0.
    $$ end of routine - insert your code only before this line   
    3) In the Routine Code, the value of the RESULT will be derived based on what's in a field called "g_value".  I don't want to derive the value in the "g_value" field in each Routine for each record that gets processed as it will take a performance hit. I am looking for a way that "g_value" can be populated once e.g. in a START Routine or another alternative and then "g_value" can be used throughout the Routine for any field in the transfer Rules.
    Is there a way to define and populate "g_value" as a global variable so its VALUE can be retained and used in all the Routines in the same transfer rules.  Note that there will be a fair amount of logic to derive "g_value" and hence the need to avoid deriving it each time.
    Could someone advise me if this is even possible?  If so, could you give me a ABAP code sample for it please? 
    Thank you very much,
    Haritha

    if you create the variable as global and in your start routine, calculate and give it a value, you can use that value in all your individual routines.

  • Creating an Incremental Unique Key in Transfer Rules Routine

    Hello Experts,
    In my Infosource, I have created a routine in the transfer rules on my infoobject.  I am trying to load my data from a flat file and create a unique key by autonumbering a field in my infosource/datatarget. 
    I am new to ABAP and can not figure out why my code will not return a value...
    Under "Use of Transfer Structure Fields" I chose my field to change only, and entered the following code:
    Under Global Code I declared my counter because I want it to maintain its value during the entire load:
      DATA: COUNTER TYPE I VALUE 0.
    Then in my routine I have the following code:
      COUNTER = COUNTER + 1.
      RESULT = COUNTER.
      RETURNCODE = 0.
      ABORT = 0.
    I expect this to return 1 for the first record, 2 for the second, and so on - therefore giving me a unique key.  Any assistance in my code or other ways to automate this process in BW would be greatly appreciated.
    Thank you.

    Sean,
    It looks like your routine is basically correct.  Have you tried using single quotes around the S instead?  Also - you may want to add a statement to indicate what 0AMOUNT should be in the instance where your condition isn't true.  Something like this:
    IF tran_structure-shkzg  = 'S'.
    RESULT = tran_structure-wrbtr * -1.
    ELSE.
    result = ???
    ENDIF.
    Good luck!  The syntax check in the transfer rules leaves a bit to be desired, doesn't it?

  • Transfer Rule Routine: Assign Date Value into Blank Field

    Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can assign "99991231" value into a date characteristics if it is blank?
    Many thanks for advance.

    I would like to check if the value of EXPIRYDATE is blank in data source. If its value is blank, assign '99991231' to it. Otherwise, it will get the value of EXPIRYDATE in transfer rule. I have rewritten the routine as follows. But there is no effects on the result.
    if TRAN_STRUCTURE-EXPIRYDATE IS INITIAL.
      RESULT = '99991231'.
    else.
      RESULT = TRAN_STRUCTURE-EXPIRYDATE.
    endif.
    Many thanks in advance.

  • Transfer Rule Routine: Change date format

    Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can change the format of a date (from 04/01/06 in the PSA) so that it's wrtitten as 01.04.06 into the cube?
    Many thanks in advance,
    Matt
    Message was edited by:
            Matt Potts
    Message was edited by:
            Matt Potts

    Hi Matt,
    so you are not using a standard date field or any other characteristic that refers to 0date, aren't you? If that is the case, just do the following in a routine:
    replace all occurrences of '/' in tran_structure-<your date field> with '.' into result.
    If you are using a standard date field which is always displayed as dd.mm.yy you need to convert it into the internal sap value which is yyyymmdd. You can achieve that by calling the fm CONVERT_DATE_TO_INTERNAL in a routine:
    call function 'CONVERT_DATE_TO_INTERNAL'
    exporting date_external = tran_structure-<your date field>
    importing date_internal = result
    exceptions date_external_is_invalid = 1.
    if sy-subrc <> 0.
    a action needs to be done, because the date was not valid.
    clear result.
    endif.
    kind regards
    Siggi

  • "Assertion failed" error in Transfer rule routine

    Hello Experts,
    I am new to BW. I am writing small abap routine in Transformation.
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-DIVISION TYPE /BI0/OIDIVISION
        SOURCE_FIELDS-/BIC/ZDIVNAME TYPE /BIC/OIZDIVNAME
       EXPORTING
         RESULT type tys_TG_1-/BIC/ZDIVNAME
         Data: wa_Division type /BI0/TDIVISION.
         select single * fROm /BI0/TDIVISION into wa_division where DIVISION
         = SOURCE_FIELDS-DIVISION.
         IF SY-SUBRC = 0.
         RESULT = WA_DIVISION-TXTSH.
         ENDIF.
    My aim here is that I have a Division Infoobject and I want to get its text(name) from text table /BI0/TDIVISION but this code doesnot work.
    Any suggestions!!
    Regards,
    DNP

    Hi Jerry,
    Please find below the details of dump. Thankyou very much for your help.
    Short text
        The ASSERT condition was violated.
    What happened?
        In the running application program, the ASSERT statement recognized a
        situation that should not have occurred.
        The runtime error was triggered for one of these reasons:
        - For the checkpoint group specified with the ASSERT statement, the
          activation mode is set to "abort".
        - Via a system variant, the activation mode is globally set to "abort"
          for checkpoint groups in this system.
        - The activation mode is set to "abort" on program level.
        - The ASSERT statement is not assigned to any checkpoint group.
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    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) "
    How to correct the error
        Probably the only way to eliminate the error is to correct the program.
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "ASSERTION_FAILED" " "
        "CL_RSTRAN_GEN=================CP" or "CL_RSTRAN_GEN=================CM00H"
        "GET_SOURCE_PARAMETER"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
        4. Details about the conditions under which the error occurred or which
        actions and input led to the error.
    User and Transaction
        Client.............. 001
        User................ "USNDIPA"
        Language key........ "E"
        Transaction......... "RSA1 "
        Transactions ID..... "498AF810CE1C0214E10080000AF00ED9"
        Program............. "CL_RSTRAN_GEN=================CP"
        Screen.............. "SAPLSPO4 0300"
        Screen line......... 19
    Information on where terminated
        Termination occurred in the ABAP program "CL_RSTRAN_GEN=================CP" -
         in "GET_SOURCE_PARAMETER".
        The main program was "RSAWBN_START ".
        In the source code you have the termination point in line 39
        of the (Include) program "CL_RSTRAN_GEN=================CM00H".
    Source Code Extract
    Line  SourceCde
        9     lr_rule           TYPE REF TO cl_rstran_trfn_rule,
       10     l_posit_source_ex TYPE rsposit,
       11     l_seg_source      TYPE rstran_segid.
       12
       13
       14   lr_rule = i_r_rule->get_model_rule( ).
       15 *-- GET POSIT pointer to segment field of source.
       16   CALL METHOD lr_rule->get_posit_ext
       17     EXPORTING
       18       i_paramtype = cl_rstran_stat=>paramtype_importing
       19       i_ruleposit = i_posit
       20       i_rulesegid = i_segid
       21     IMPORTING
       22       e_segid     = l_seg_source
       23       e_posit     = l_posit_source_ex.
       24
       25   ASSERT l_seg_source = i_segid.
       26
       27 *-- Get component name from seg
       28   READ TABLE i_t_segment_m ASSIGNING <ls_s_seg>
       29     WITH KEY segid = i_segid.
       30   ASSERT sy-subrc = 0.
       31
       32 *-- Get field name from source field with extern posit.
       33   READ TABLE i_t_seg_source ASSIGNING <ls_s_seg_source>
       34     WITH KEY segid = i_segid.
       35   ASSERT sy-subrc = 0.
       36   IF sy-subrc = 0.
       37     READ TABLE <ls_s_seg_source>-t_field ASSIGNING <ls_s_field>
       38       WITH KEY position = l_posit_source_ex.
    >>>>>     ASSERT sy-subrc = 0.
       40   ENDIF.
       41
       42 *--  r_s_parameter-param_id has to be set out side due to type inheritance of RuleStepMappin
       43
       44   CONCATENATE '<' <ls_s_seg>-y__nm '>' INTO
       45   c_s_connector-s__nm.
       46   c_s_connector-f__nm = <ls_s_field>-fieldname.
       47
       48 ENDMETHOD.
    Regards,
    DNP

  • Two formulas for a single field in Transfer Rules ?

    Hi friends ,
    I am learning BW  3.5 . I have got a problem could you please solve it ...
    My flatfile:           Empno     Empfirstname       Emplastname
                               1000         rajiv                     gandhi
    Expected Result: Empno     Empfirstname       Emplastname
                               1000         RAJIV                RAJIVGANDHI
    I need to concatenate and Convert it into capital letters for the same field (Emplastname)
    Points will be rewarded
    Thanking You

    Hi,
    then just create a routine in the transfer rules.
    routine for first name.
    result = tran_structure-empfirstname.
    translate result to upper case.
    routine for last name.
    concatenate tran_structure-empfirstname tran_structure-emplastname into result.
    translate result to upper case.
    kind regards
    Siggi

  • In Transfer rules...how to delete routine

    Hi friends,
    Small qns...Can u plz ans..i have routine for source field in transfer rules u2026
    Now I donu2019t want assign any routine, constant, source field or formula for that source object and I want to delete that routine assignment..How we will dele le that that routine assignmentu2026I donu2019t want want map anything...How can any one ans plzu2026
    Thanks
    TVR

    Take the help of ABAP person
    OR
    Check for the code in the areas mentioned below
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
      RESULT = .
    returncode <> 0 means skip this record
      RETURNCODE = 0.
    abort <> 0 means skip whole data package !!!
    Don't delete the code you can just comment the code and save it.
    Edited by: prashanthk on Dec 28, 2010 4:45 PM

  • Urgent: ABAP routine in transfer rules

    Hi,
    when i am loading master data from R/3 into BW, i need to filter some records based on material type. there is no option in RSA6 (on R/3) or in Infopackage (BW) to make it available for filter.
    So i assume i need to write ABAP routine in transfer rules. can some one help me with ABAP. i need to load the records only when MTART field(material type) in MARA is "FINI" or "RAW" and skip other records.
    what is difference between deleting the whole data packet and deleting the record.
    Thank you very much in advance
    Regards
    Emil

    Hi
    Write the below code in the start routine of your transfer rules.
    Regards
    Prakash
    DATA: IT_DATA        TYPE STANDARD TABLE OF TRANSFER_STRUCTURE
                         WITH HEADER LINE
                         WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    DATA: S_DATA, T_DATA TYPE TRANSFER_STRUCTURE.
    LOOP AT DATAPAK INTO S_DATA.
    IF S_DATA-MTART EQ 'A' OR S_DATA-MTART EQ 'B'.
    MOVE S_DATA TO T_DATA.
    DELETE S_DATA.
    ELSE.
    DELETE S_DATA.
    ENDIF.
    APPEND T_DATA TO IT_DATA.
    ENDLOOP.
    CLEAR T_DATA.
    DATAPAK[] = IT_DATA[].
    Assigning points is a way of saying thanks on SDN!!

  • Problem in standard routine 0RPM_DSKF in transfer rules 0rpm_role_d

    HI all,
    I am extracting the data from xRPM 4.0 to BW 7.0.Even though i am using BI 7.0 presently we are using 3.5 only.I have installed the transfer rules after that i am trying to activate the transfer rules .But i am getting the error with standard routine ( Syntax error ) written In transfer rules for one key figure 0RPM_DSKF.
    Data source : 0RPM_ROLE_D
    Data Target : 0RPM_C02
    Info Source : 0RPM_SRAR_02
    Routine :
    if TRAN_STRUCTURE-&RU& <> 'FTE'.
    RESULT = TRAN_STRUCTURE-ANUMBER.
      else.
        RESULT = 0.
      endif.
    There is no filed inT.Stru contains RU.
    Please suggest me what would be the solution for this.
    If is there any relavant OSS Note plz provide me that and also provide me the valuable suggestions.
    Thanks & Regards
    Ramakanth

    Hi Rathy!
    Thank you very much for your quick help! Usually I do the same. Now I faced with BI system, where data source were already activated in system A and replicated. I can see all needed active sata source un BI already. But I can not see transfer rules in content!
    What you can advise?
    Reagrds, Iryna.

  • Creating a start routine in the transfer rule

    I'VE CREATE a start routine, seel bleow.  Now I want to get at one of the fieds for a Key figure.    How do i do that?    do I need to add it to the transfer structure
    LOOP AT ROUTEDAY INTO WA_ROUTEDAY.
    CALL FUNCTION 'CONVERSION_EXIT_TSTRG_OUTPUT'
    EXPORTING
       input = ROUTEDAY-ROUTE_DAYS
    IMPORTING
         output = WA_DAYS_OUT.
      WA_ROUTEDAY-ROUTE_DAYS_CONV = WA_DAYS_OUT.
      APPEND WA_ROUTEDAY.
    ENDLOOP.

    Hi Mick,
    check these links
    start routine in transfer rules
    Look up to load master data
    excluding
    Start Routine in Transfer Rules
    Sample code in Update Rule to restrict data selection?
    Append Datapak - transfer start routine
    Excluding Blank field in Infopackage Filter
    Trans Routine ABAP help ..
    Hope this might help you.
    ****Assign Points If Helpful****
    Regards,
    Ravikanth

  • 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

  • Copy routines written in transfer rules to other system

    <Moderator Message: Even as a newbie you should be able to copy and paste or read here and write there>
    Hi All,
    In the datasource '0CO_OM_OPA_6' , in the transfer rules for infoobject 0PART_CCTR' , we have a ruotine written 'Fill  Partner Cost Center from Partner Objects'.
    Now I want to write the same routine for same infoobject in another test server for the same data source.
    Can anybody please tell me how to go about from start as I am new in BW.
    Regards,
    Sushmita
    Edited by: Siegfried Szameitat on Jun 8, 2009 3:47 PM

    I think you should check the source system assignment in the transport connection. It might have directed to the old sytem.
    Cheers
    Chanda

  • How to find the existing START ROUTINEs in Transfer Rules in whole system ?

    Hi all,
       How to find the existing Start Routines in Transfer Rules in BW System, please ?
       I know that we could find from the Transfer Rules.
       Is there any way to find instead of looking at Transfer Rules for <b>each</b> InfoSource?
    Thanks,
    Venkat.

    Hi Venkat
    You can find it in these tables
    RSTRAN
    RSUPDROUT
    RSAROUT
    RSAABAP
    RSAABAPINV
    Thanks
    Tripple k

  • Start Routine for transfer rules

    Hello experts,
    I want to use the SQL DISTINCT keyword to return non-duplicate results from a table in a DataSource (data base) in a the start routine for the transfer rules.
    How do I address that table in the start routine of the TR?
    I thought about something like that.
    TABLES: mytable
    DATA: itab_mytable type table of mytable
    SELECT DISTINCT CUSTID, etc.
    FROM mytable into table i_tab.
    I am new to ABAP so I would be happy to get some suggestions!
    thanx in advance
    Axel

    Hello Oscar,
    as fa as I understood the entire data package in the transfer structure format is used as parameter (DATAPAK) for the routine.
    so I want to perform a SQL statement on DATAPAK!
    But it sais it can't find DATAPAK in ABAP-Dictionary as a table!
    can I actually perform SQL statements on DATAPAK?
    Thanx
    Axel

Maybe you are looking for

  • Bapi for Sale order

    Hi Experts, I am using BAPI_SALESDOCU_CREATEFROMDATA to create sale orders. As of now i m giving the following inputs to the BAPI WA_HEADER-DOC_TYPE = T_UPLOAD-AUART.     WA_HEADERX-DOC_TYPE = 'X'.     WA_HEADER-PMNTTRMS = T_UPLOAD-ZTERM.     WA_HEAD

  • HT201269 CHANGED MY APPLE ID AND CANT UPDATE APPS

    CHANGED MY APPLE ID AND CANT UPDATE APPS

  • Mirror image print

    how do i print a mirror image to transfer onto a t shirt...helllpppp please. all in one office deskjet.

  • Quicktime Movies Not showing as Events

    I recently upgraded from a PowerBook G4 running iMovie '06 to a PowerBook Pro running iMovie '11.  When I used to finish a project in '06 I converted it to Quicktime with no compression and stored it on an external hard drive, since I had only 80 gig

  • Switch with 6 SFP

    Can anyone suggest me any Switch which will have minimum 12 10/100/1000T port and min 6 SFP for SX transiever or combo port?