What is #R2,#R3 in abap code

Hi,
Can any one explain what is #R2,#R3 in abap code. You can see the code snippet below.
#R2  DATE = DEPER = I2001-BEGDA.                          "WGYS11K127228
#R3  DEPER     = I2001-BEGDA.                             "
#R3  DATE+4(4) = I2001-BEGDA(4).                          "
#R3  DATE2(2) = I2001-BEGDA4(2).                        "
#R3  DATE(2)   = I2001-BEGDA+6(2).                        "WGYS11K127228
Regards
Eswar

What is the name of the standard program?
Just run a little test, I think you are right, seems to check whether it's running on an R/2 or R/3 system. Never noticed this before.
#R2 write 'R/2!'.
#R3 write 'R/3!'.
Output: R/3!
couldn't test the R/2 case, obviously...
Thomas

Similar Messages

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • What is the use of a proxy client to test web service from ABAP code?

    In NW640, we need to create a proxy client to test our web service from a ABAP code.
    Why is this so? What is the significance of a proxy client? Is this mandatory? Can we test the webservice from a ABAP code without proxy client?

    Hi Gopal,
    There are two types of proxies that can be generated from ABAP - the client proxy (to call an internet web service) and a server proxy (to communicate with XI). It sounds to me like you are looking for information about the client proxy, if so you can see the following link from SAP Help:
    http://help.sap.com/saphelp_nw04s/helpdata/en/e5/a68d10f4eb894087fc9c1c3f9ae433/frameset.htm
    Hope this helps.
    Sudha

  • What are the acceptable Sap methods/steps to change standard SAP/Abap code?

    To you Sap experts:
    Can you point me to Sap document  that lists the acceptable methods to follow when modifing SAP standard  (abap code).  We are on release 4..7.  
    I assume there is a best practice guide if you have to modify standard Sap code of what to do and don't do.  Ex:. Field exit, CMOD, SMOD... Thanks for assistance.

    Hi,
        You can implement your own logic using User Exits (which includes function module exits, screen exits, field exits and menu exits), Badi's, Enhancement points and Business Transaction, Events.
    Thanks,
    Srinivasa Rada

  • What are the steps to optimise ABAP code

    What are the steps to optimise ABAP code, that is how to increase the performance of a code?

    Hi
    Welcome to SDN forum
    1) Dont use nested select statements
    2) If possible use for all entries in addition
    3) In the where addition make sure you give all the primary key
    4) Use Index for the selection criteria.
    5) You can also use inner joins
    6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
    7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234
    ABAP performance depends upon various factors and in devicded in three parts:
    1. Database
    2. ABAP
    3. System
    Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.
    u can get an interactive grap in SE30 regarding this with a file.
    also if u find runtime of parts of codes then use :
    Switch on RTA Dynamically within ABAP Code
    *To turn runtim analysis on within ABAP code insert the following code
    SET RUN TIME ANALYZER ON.
    *To turn runtim analysis off within ABAP code insert the following code
    SET RUN TIME ANALYZER OFF.
    Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    Avoid for all entries in JOINS
    Try to avoid joins and use FOR ALL ENTRIES.
    Try to restrict the joins to 1 level only ie only for tables
    Avoid using Select *.
    Avoid having multiple Selects from the same table in the same object.
    Try to minimize the number of variables to save memory.
    The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    Avoid creation of index as far as possible
    Avoid operators like <>, > , < & like % in where clause conditions
    Avoid select/select single statements in loops.
    Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
    Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
    Avoid using ORDER BY in selects
    Avoid Nested Selects
    Avoid Nested Loops of Internal Tables
    Try to use FIELD SYMBOLS.
    Try to avoid into Corresponding Fields of
    Avoid using Select Distinct, Use DELETE ADJACENT
    Check the following Links
    Re: performance tuning
    Re: Performance tuning of program
    http://www.sapgenie.com/abap/performance.htm
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    check the below link
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    See the following link if it's any help:
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    Check also http://service.sap.com/performance
    and
    books like
    http://www.sap-press.com/product.cfm?account=&product=H951
    http://www.sap-press.com/product.cfm?account=&product=H973
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    Performance tuning for Data Selection Statement
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    Debugger
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    Run Time Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    SQL trace
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    CATT - Computer Aided Testing Too
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    Test Workbench
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    Coverage Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    Runtime Monitor
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    Memory Inspector
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Just refer to these links...
    performance
    Performance
    Performance Guide
    performance issues...
    Performance Tuning
    Performance issues
    performance tuning
    performance tuning
    You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
    1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    2 Avoid for all entries in JOINS
    3 Try to avoid joins and use FOR ALL ENTRIES.
    4 Try to restrict the joins to 1 level only ie only for 2 tables
    5 Avoid using Select *.
    6 Avoid having multiple Selects from the same table in the same object.
    7 Try to minimize the number of variables to save memory.
    8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    9 Avoid creation of index as far as possible
    10 Avoid operators like <>, > , < & like % in where clause conditions
    11 Avoid select/select single statements in loops.
    12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
    13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
    14 Avoid using ORDER BY in selects
    15 Avoid Nested Selects
    16 Avoid Nested Loops of Internal Tables
    17 Try to use FIELD SYMBOLS.
    18 Try to avoid into Corresponding Fields of
    19 Avoid using Select Distinct, Use DELETE ADJACENT.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • What does this ABAP code do?

    Hi,
    I came across this ABAP code and I'd like to know what the asterisk (*) before the variable names does.
      *mkpf = mkpf.
      *mseg-lgort = mseg-lgort.
      *ladr = ladr.
      save_mkpf = *mkpf-usnam.
      save_mblnr = *mkpf-mblnr.
      save_budat = *mkpf-budat.
      save_cpudt = *mkpf-cpudt.
      save_ematn = *mseg-ematn.
      save_lgort = *mseg-lgort.
      save_ladr = *ladr.
      *t001w = t001w.
      save_werks = *t001w-werks.
      save_name1 = *t001w-name1.
      *ekko = ekko.
      *am07m = am07m.
      save_lifnr = *ekko-lifnr.
      save_ebeln = *ekko-ebeln.
      save_ekgrp = *ekko-ekgrp.
      save_linam = *am07m-name1.
      save_lina2 = *am07m-name2.
      *t024 = t024.
      save_eknam = *t024-eknam.
      save_ektel = *t024-ektel.
      *mkpf-usnam = old_mkpf.
      *mkpf-mblnr = old_mblnr.
      *mkpf-cpudt = old_cpudt.
      *mkpf-budat = old_budat.
      *mseg-ematn = old_ematn.
      *mseg-lgort = old_lgort.
      *ladr = old_ladr.
      *t001w-werks = old_werks.
      *t001w-name1 = old_name1.
      *t024-eknam = old_eknam.
      *t024-ektel = old_ektel.
      *ekko-lifnr = old_lifnr.
      *ekko-ebeln = old_ebeln.
      *ekko-ekgrp = old_ekgrp.
      *am07m-name1 = old_linam.
      *am07m-name2 = old_lina2.
    Thx.
    Andy

    Hi,
    It is nothing but the Work Area. Check the below sample code.
    report abcd.
      tables: *vbak, vbak.
      select single * from vbak into *vbak where vbeln <> space.
      write *vbak-vbeln.
    Regards,
    Satya

  • Creating a long text using ABAP code.. fm SAVE_TEXT

    When you create an order via IW31 one of the options is to click on the text button and create a long text. I am basically trying to mimic this action from within my ABAP code.
    The text id details are as follows:
    Text Name       500000015000046  which is (5000000 + order number)
    Language        EN
    Text ID            KOPF         Order header text
    Text Object      AUFK       Order text
    If i manually create the text within the transaction i am then able to view and update it via function modules READ_TEXT and SAVE_TEXT. But if the text has not already been created READ_TEXT obviously returns nothing as it does not exist and SAVE_TEXT does not seem to created it!
    Anyone know how i would go about creating this text using ABAP code?
    Hope this make a bit of sense
    Thanks in advance
    Mart

    I have implemented the code as i think it should be. See below, can any see what is wrong. If i add init_text it makes no difference and adding the commit_text just makes it hang
    DATA: IT_TEXTS type standard table of TLINE,
           wa_texts like line of it_texts,
           wa_txtheader type THEAD.
    wa_txtheader-TDID     = 'KOPF'.
    wa_txtheader-TDSPRAS  = 'EN'.
    wa_txtheader-TDNAME   = '500000015000056'.
    wa_txtheader-TDOBJECT = 'AUFK'.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        CLIENT                = SY-MANDT
        HEADER                = wa_txtheader
        INSERT                = 'X'
       SAVEMODE_DIRECT       = ' '
       OWNER_SPECIFIED       = 'X'
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
      TABLES
        LINES                 = IT_TEXTS
    EXCEPTIONS
       ID                    = 1
       LANGUAGE              = 2
       NAME                  = 3
       OBJECT                = 4
       OTHERS                = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • Help needed in writting Customer exit - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic  lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2.  I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,
    manmit

    Hi Arun,
    1. What should CHAR2 take - Hierarchy node variable or something else ?
    --> CHAR2 is a simple charateristic
    2. In your scenario - why have CHAR1 and CHAR2 ? why not have the user enter values against CHAR2 ??
    --> We dont want user to enter two input as the input values for both Chars are same.
    3. Did you try using a replacement path variable with the CHAR2 variable taking values from Variable on CHAR1 ?
    --> In BI7.0 replacement path variable only take values from Query results. So not able to do the same.
    Thanks

  • ABAP Code Problem in Start Routine to Fill the value from Look-up Table ???

    Hi all,
         I am trying to fill the values of DOC_NUMBER & PLANT from look-up table /BIC/AZSD_O0700 (Billing Item ODS) for each BILL_NUM in Start Routine for Update Rules of Billing Header ODS and modify the data_package.
    What is wrong with the below ABAP code, PLEASE ???
    data: it_data type standard table of data_package_structure
            with header line
            with non-unique default key initial size 0.
    types: begin of billing_item_type,
                 BILL_NUM          like /BIC/AZSD_O0700-BILL_NUM,
                 DOC_NUMBER   like /BIC/AZSD_O0700-DOC_NUMBER,
                 PLANT               like /BIC/AZSD_O0700-PLANT,
             end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data[] = DATA_PACKAGE[].
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
        select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
               from /BIC/AZSD_O0700
               where  BILL_NUM  = it_data-BILL_NUM
               and    FISCVARNT = it_data-fiscvarnt.
        endselect.
        if sy-subrc = 0.
           move-corresponding it_data to DATA_PACKAGE.
        endif.
      endloop.
      modify DATA_PACKAGE.
    Thanks,
    Venkat.

    Hi Venkat,
      Two things -One is the performance and the other ... there is no Append  within the loop.
      Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
       Let me know if you need more help.
    Best regards,
    Kazmi
    data: it_data type standard table of data_package_structure
    with header line
    with non-unique default key initial size 0.
    types: begin of billing_item_type,
    BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
    DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
    PLANT like /BIC/AZSD_O0700-PLANT,
    end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data] = DATA_PACKAGE[.
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
    select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
    from /BIC/AZSD_O0700
    where BILL_NUM = it_data-BILL_NUM
    and FISCVARNT = it_data-fiscvarnt.
    endselect.
    if sy-subrc = 0.
    move-corresponding it_data to DATA_PACKAGE.
    Append DATA_PACKAGE.
    endif.
    endloop.

  • Difference between checking Objects in SU24 and in ABAP code

    Hi all,
    What is the difference between objects checked in SU24 and the objects checked in ABAP Code.
    I think if objects are even checked to No in SU24 and they are in ABAP code then user is able is able to execute that object, is this correct?
    and vice versa, if objects are checked to yes in su24 and not in the ABAP code then user wont be able to excute? is this correct
    or what is the purpose of maintaing objects both in SU24 and in ABAP Code.
    Thanks,
    Sun

    This is what is known in German as a "Schwerer Geburt"... (not sure whether there is an English term which has the same meaning)...
    When you searched, did you read this thread?:
    F110 - S_BTCH_ADM
    >
    Julius Bussche wrote:
    > My understanding of this confusion is ...
    >
    > ... SAP's development systems deem an "unknown" check to be successfull until specifiied for a check (this is different in customer systems - which leads many to believe that adding and removing check indicators from SU24 will add and remove authority-checks....),
    >
    > ...This problem then reproduces itself both in SU53 and ST01 once the SU22 / SU24 error has been made.
    >
    > ...It is one of those things which you need to know or find on your own (not too difficult), otherwise you simple don't know it.
    It is context specific, when the context is known to the customer system where the code is running => You cannot activate a check in SU24 if it is not coded anywhere (please distingish between starting a transaction, using it, and navigating further from that transaction...). The only case where SAP does what you seem to be assuming (or hoping for...) is infact to turn an authority-check off in some cases or to make the calling context known when it is remote (in which case sy-tcode or the entry point context is not known)...
    *It is not to turn the check on when it is not coded anywhere!!!
    Perhaps you would like to phrase your final question just one more time.
    Cheers,
    Julius

  • Execute ABAP code in Start Routine only once

    I have ABAP code in a start routine that I only want to execute once. Is there a way to tell this is first execution of the start routine?
    Also can I find out these value in the start routine ABAP:
    1. How many data packets there are?
    2. What data packet I am processing?
    Regards,
    Mike...

    Hi,
    I've just setup a little test:
    TRules, Start Routine Global Decl:
    DATA: GVI TYPE I, GVN(5) TYPE N.
    Start Routine:
    IF GVI IS INITIAL.
    GVI = 1.
    ELSE.
    ADD 1 TO GVI.
    ENDIF.
    MOVE GVI TO GVN.
    This is basically counting the times the start routine is executed and populating the var GVN; I am posting GVN in a char ZTESTGV in the target cube. I am posting as well the datapakID in my cube.
    I have loaded two requests (each 4 packets)
    the first one first to PSA and then from the PSA to the target: this is Serially using one single process. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________1____________1
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________2____________2
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________3____________3
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________4____________4
    In this case the global variable is persistent accross packets.
    the second request is loaded in paralell: this is, multiple processes are executed at the time. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_14QVH21BSVH44FAJW94BD7N2H____________1____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________2____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________3____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________4____________1
    In this case the global variable is always1 !!
    This is logic since several a process cannot access the internal memory used by another one...
    Conclusion; the global variable will work only if the load is serial...
    hope this helps...
    Olivier.

  • ABAP code in transformation

    Hello,
    I have a transformation routine as follows:
    DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR,
             l_greybatch TYPE /BI0/MBATCH-BATCH,
             oref   TYPE REF TO cx_root,
              l_num type i,
              l_len  type i,
              l_len1(2)  type c.
        l_len = strlen( SOURCE_FIELDS-/BIC/ZBAT_SUP ).
        l_len1 = ( l_len - 1 ).
        try.
            concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into
            l_greybatch.
          catch CX_SY_CONVERSION_NO_NUMBER INTO oref.
        ENDTRY.
    =============
    this transformation is between a infosource and infoobject. When i run the DTP, it gives an error at the line "concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into l_greybatch."
    This -/BIC/ZBAT_SUP is calculated using a routine in the transformation between the datasource and the infosource. The same DTP is used for both load across both these transformations.
    what is wrong? any suggestions?

    Hello Siegfried,
    Thank you very much.
    As you rightly pointed out -/BIC/ZBAT_SUP is not filled.
    But i didnt want to fill it in the second transformation(between the infosrc and infoobject) becoz, this is used for populating 2 differnt objects for which there are different rules. I will have to run the logic(for populating -/BIC/ZBAT_SUP) twice in these 2 rules.
    Hence i was trying to populate it in the first transformation(between the datasrc and the infosrc) and then use this value in the 2 rules in the second transformation.
    Can you give me some other logic to do the same with the necessary ABAP code?
    Following is the routine use to populate -/BIC/ZBAT_SUP in the first transformation:
    $$ begin of routine - insert your code only below this line        -
    DATA: l_charg TYPE /BIC/AZMM_O0100-BATCH.
          SELECT SINGLE /BIC/ZBAT_SUP FROM /BIC/AZMM_O0100
          into l_charg
              WHERE BATCH = SOURCE_FIELDS-CHARG.
         RESULT = l_charg .
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_ZBAT_SUP
    ====================================================
    The second transformation populates 2 different vendor fields in 2 different rules. Both the rules use the follwing 2 routines:
    $$ begin of routine - insert your code only below this line        -
        DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR,
             l_greybatch TYPE /BI0/MBATCH-BATCH,
             oref   TYPE REF TO cx_root,
              l_num type i,
              l_len  type i,
              l_len1(2)  type c.
        l_len = strlen( SOURCE_FIELDS-/BIC/ZBAT_SUP ).
        l_len1 = ( l_len - 1 ).
          try.
              concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into
              l_greybatch.
         move SOURCE_FIELDS-/BIC/ZBAT_SUP(l_len1) to l_greybatch.
         move 'G' to l_greybatch+l_len1(1).
            catch CX_SY_CONVERSION_NO_NUMBER INTO oref.
          ENDTRY.
    *Populating Supplying(finished) batch vendor
          select single VENDOR from /BI0/MBATCH
          into l_lifnr1
          where BATCH = l_greybatch.
          RESULT = l_lifnr1.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_0VENDOR
    =====================================================
    METHOD compute_ZVENDOR.
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-/BIC/ZBAT_SUP TYPE /BIC/OIZBAT_SUP
       EXPORTING
         RESULT type tys_TG_1-/BIC/ZVENDOR
        DATA:
          MONITOR_REC    TYPE rsmonitor.
    $$ begin of routine - insert your code only below this line        -
    DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR.
    *Populating Supplying(finished) batch vendor
                select single VENDOR from /BI0/MBATCH
                into l_lifnr1
                where BATCH = SOURCE_FIELDS-/BIC/ZBAT_SUP.
         RESULT = l_lifnr1.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_ZVENDOR
    ===================================
    thank you....

  • ABAP CODE TO POPULATE LOGICAL SOURCE SYSTEM

    Hi Friends please help me with the below
    1. Requirement : to Populate The system Date , Source System
    in BI for Each load request.
    1 Solution: I thought of writing the Start Routine for this but it is giving me error
    syntax Error: END METHOD MISSING?????
    2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
    Thanks
    Poonam Roy
    ABAP Code.
    I have the End Method. what more to do.
    METHOD start_routine.
    *=== Segments ===
    FIELD-SYMBOLS:
    <SOURCE_FIELDS> TYPE tys_SC_1.
    DATA:
    MONITOR_REC TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line -
    ... "insert your code here
    FORM STARTROUTINE
    USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TRANSTRU
    ABORT LIKE SY-SUBRC.
    DATA: ZLOAD_DAT LIKE SY-DATUM
    ZZSOURSYS TYPE RSLOGSYS
    IF G_S_MINFO-DATAPAKID=1
    SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
    SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
    ENDIF.
    ABORT = 0.
    ENDFORM.
    ENDMETHOD.
    ENDCLASS.
    *-- fill table "MONITOR" with values of structure "MONITOR_REC"
    *- to make monitor entries
    ... "to cancel the update process
    raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line -
    ENDMETHOD.

    You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
    There the FORM begin with
    [code]USING RECORD_NO LIKE SY-TABIX
        TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
        G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING RESULT TYPE /BI0/OIPERSON
        G_T_ERRORLOG TYPE rssm_t_errorlog_int
        RETURNCODE LIKE SY-SUBRC
        ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]
    GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
    <i>G_S_MINFO. This passes technical information about the data load request,
    such as requesting user, request date and time, update mode, the handling of
    duplicate records, error handling flags, parallel processing flags, and what data
    targets to update.</i>
    If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
    [code]USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TAB_TRANSTRU
        G_T_ERRORLOG TYPE rssm_t_errorlog_int
        ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]
    And stay in FORM between limits :
    [code]$$ begin of routine
    $$ end of routine[/code]
    Update RESULT in first case, and field(s) of DATAPAK in second case.
    [code]RESULT = G_S_MINFO-LOGSYS.[/code] or
    [code]LOOP AT DATAPAK INTO l_s_datapak_line.
      l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
      MODIFY DATAPAK FROM l_s_datapak_line.
    ENDLOOP.[/code]
    Regards

Maybe you are looking for