URGENT ** ABAP ROUTINE HELP

Hi gurus,
             I am write a ABAP routine to fetch G/L acount form zpur_acc DSO for a joining consition of PO # and line item #.
I am not etting the desired result. Can some one please lookinto the code and debug it.
Here I am reading OI_EBELN and OI_EBELP from the incoming data but since I am in BI7.0 how can I use info object (OI_EBELN , OI_EBELP) directly or it should be referenced via communication structure-filed name? What is the name of communication structure in Bi 7.0?
data: wa_tab type /BIC/AZPUR_ACC00.
select single * into wa_tab from /BIC/AZPUR_ACC00
where
OI_EBELN = wa_tab-OI_EBELN
and
OI_EBELP = wa_tab-OI_EBELP.
*and objvers = 'A'.
result = wa_tab-GL_ACCOUNT.
Warm Regards,
Anil

METHOD compute_0GL_ACCOUNT.
  IMPORTING
    request     type rsrequest
    datapackid  type rsdatapid
   EXPORTING
     RESULT type tys_TG_1-GL_ACCOUNT
    DATA:
      MONITOR_REC    TYPE rsmonitor.
$$ 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
data: wa_tab type /BIC/AZPUR_ACC00.
select single * into wa_tab from /BIC/AZPUR_ACC00
where
OI_EBELN = wa_tab-OI_EBELN
and
OI_EBELP = wa_tab-OI_EBELP.
*and objvers = 'A'.
*result = wa_tab-GL_ACCOUNT.
... "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.
     RESULT = wa_tab-GL_ACCOUNT.
$$ end of routine - insert your code only before this line         -
  ENDMETHOD.                    "compute_0GL_ACCOUNT

Similar Messages

  • 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!!

  • Urgent: ABAP Code help reqd

    Hi,
    Can anyone please me provide me ABAP code for the following case:
    Table1 – JHAGA
    Table2 – JHAGVZ
    Primary keys in JHAGA:
    Order Item Number [POS_NR]
    Billing Dataset [GRUPPABRNR]
    Sales Document Number [AVM_NR]
    This requirement is for an InfoSet. For each order ideally we can have multiple sales agent. Sales Agent is being pulled from JHAGVZ. For this InfoSet we are going to go with assumption that we wont have more then 10 sales agent for an order,
    Consider 10 extra fields in InfoSet SA1 – SA10 for 10 Sales Agent.
    I need code which to populate this sales agent field. If an order exists in JHAGA then for that order in JHAGVZ populate the SA1-SA10 field.
    JHAGA – Order#10
    JHAGVZ – Order#10 – SalesAgent11
                   SalesAgent12
                   SalesAgent13
    Then SA1 should have SalesAgent11, SA2 should have SalesAgent12 and SA3 should have SalesAgent13 and so on…     
    Thank you,
    sam

    HI ,
    Are these two field a part of the table INFOROBJECT?
    if they are, you can write a select statement like :
    select 0CUSTOMER 0SALESORG YLEG_ENTITY
           from INFOROBJECT
           into Y_CUST_LE
           where ( Yacc_SEQ <> ´ZROO´  and
                   0PRICE_LIST <> space).
    Hope this helps.
    If not, please explain problem clearly.

  • ABAP routine help required in BI

    Hi Experts,
    I have a some fields in DSO (Data Store Object) as below
    _Code.................. Type.................... Date & Time_
    1..............................A....................01/01/10    01:00:00
    1..............................B....................01/01/10    02:00:00
    2..............................A....................02/01/10    01:00:00
    2..............................B....................02/01/10    02:00:00
    2..............................C....................02/01/10    03:00:00
    3..............................A....................03/01/10    01:00:00
    3..............................B....................03/01/10    02:00:00
    I need to have the above details in my DSO in single line like
    Code.......Type A Date & Time........Type B Date & Time..........Type C Date & Time
    1.........01/01/10    01:00:00........01/01/10    02:00:00
    2.........02/01/10    01:00:00........02/01/10    02:00:00......02/01/10    03:00:00
    3.........03/01/10    01:00:00........03/01/10    02:00:00
    Can any expert please provide me the ABAP code to bring the code details in the single line.
    Maximum points will be assigned.
    Thanks

    Not resolved

  • ABAP Routine in UR Help

    Hi Friends
    We are on BI7 and ECC6.
    We have to get the quantities into BI from ECC for that we are using one field from 2lis_11_vaitm. But we want to count the quantity only when material is a complete package all other values should be 0. Packages are described in the material as for example DMS PACKAGE , DST PACKAGE , DTTS PACKAGE DTTTT PACKAGE.
    Now My thinking is ,Inorder to do that we have to use the offsets in ABAP routine. But the first few letters are not 3 / 4 fixed it may be 3, 4, 5 or 6 letters the PACKAGE will start from the next word..
    Can any one help me how to write the ABAP logic to get the offset for last 11 letters ?
    regards

    F2 & F3 TYPE I.
    F1 = 'DTTS PACKAGE' (F1 contains the value)
    F2 = LENGTH(F1) (F2 determines the length of the field)
    OR
    F2 = STRLEN(F1)
    F3 = F2 - 11 (F3 determines the difference)
    F4 = F1+F3(11) (F4 picks up value based on offset)
    *Not sure if variables are accepted for offsets.

  • ABAP Trans routine help

    Hi
    I'm writing below abap routine in transrules to bring the plant from ZODS_01 active table :
      SELECT SINGLE PLANT INTO ZPLANT
      FROM /BIC/AZODS_01
      WHERE DOC_NUMBER = TRAN_STRUCTURE-VBELN
      AND /bic/ZCODE = 'SE'.
    Code is working if there is only one record exist in /BIC/AZODS_01 with ZCODE = SE. But if there is more records exist with different codes including SE, its not brining the SE value. Do I need to remove the Single from SELECT statement or do I need to loop this in start rotuine to loop through every record until it finds SE ?
    Please advice.

    Hello
          Writing a SELECT SINGLE is not good if we want a better Code Performance , as for each record it hits the data base , which inturn will increase the load time . rather its suggested that Do one select with For all entries of data package & subsequently at INfo Object level have READ statement . some time like below
          SELECT
         PLANT
            FROM /bic/a<DSO Name>
            INTO TABLE Internal table
             FOR ALL ENTRIES IN source_package
           WHERE doc_number = source_packagedoc_number
    & read would like below
        READ TABLE Internal table  INTO wa_doc
             WITH TABLE KEY doc_number = SOURCE_FIELDS-doc_number
    If this suggestion looks good , & need more code help do let me know
    Thanks
    Vivek

  • Data selection in info package using ABAP routine.

    Hi,
    when we are  scheduling the info package(Infp package name is like XYZ),we want to load past 6 months data from the current date(INFO OBJECT(0CREATEDON) BETWEEN (Sy-Datum - 6 months TO  Sy-Datum),in the selection tab in schedule i want to write the abap routine (type 6).please can any one have this type of code please sedn to me asap.
    this is very urgent.delivery is tomorrow.

    hi Lekha,
    try following code.
    seems you post the same question twice, one posting is sufficient. and please don't forget to reward helpful answers.
    data: l_idx like sy-tabix.
    read table l_t_range with key
    iobjnm = '0CREATEDON'.
    l_idx = sy-tabix.
    DELETE l_t_range
    WHERE iobjnm = '0CREATEDON'.
    L_t_RANGE-SIGN = 'I'.
    L_t_RANGE-OPTION = 'EQ'.
    if not work, try
    L_t_RANGE-OPTION = 'BT'.
    BT = between
    last 6 month
    L_t_RANGE-LOW = sy-datum - 180.
    current date
    L_t_RANGE-HIGH = sy-datum.
    append l_t_range.
    modify l_t_range index l_idx.
    p_subrc = 0.
    $$ end of routine - insert your code only before this line -
    endform.

  • Populate new fields in DSO (DBTable) with ABAP routine

    Hi,
    I've added a couple of fields to a DSO. The DSO contains a large number of records (60m+) and I have a tight window to cutover so the activation time would be an issue if I use a loop transformation. Therefore, I am looking to populate the additional fields directly in the Active table using an ABAP routine.
    One of the fields is a key figure to be derived from an existing CHAR field so would need to apply some logic during update, such as IF <CHAR_FIELD> CA 'ABC'. <KYF_FIELD> = 1 etc.
    Aside from fairly basic Start Routines my ABAP is very poor so was wondering if anyone can help me with the syntax or, preferably some sample code to achieve this.
    Thanks in advance,
    Ad

    Hi,
       In transformation of the cube, choose routine  for char E.
       There you can assign value in RESULT field. Actually RESULT field is assigned to E, find the code below,
    *--  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.
      (* insert your abap code here to find the value of E*.)
         RESULT =                     * assign the value you got for E here.
    rgrs,
    v.sen

  • ABAP Routine in selection of Info package in 3x

    Hello Experts
    We need to load distinct PO data in 3x server.
    I have added this distinct po values in range table of info package abap routine.
    However its not loading for range table values more than two selections/pos.
    If I try to append more than 2 values,only last one is uploaded.
    However after load, in monitor tab-header , selection paramenters I can see all PO values in selection.
    Some how it works only for two inputs (rows) in range table of ABAP routine in infopackage.
    Anybody has faced such issue? any help is appreciated!
    Edited by: Kanchan Angalwar on Jan 30, 2010 9:59 AM

    Hi,
    Please post your ABAP code here

  • Call function in abap routine of infopackage

    Experts,
    Good day. I have a problem concerning the data to be imported in my ods.I can't find a similar thread corcerning my problem. My ‘File date’ field should contain only 2 years and 3months data of recent data. I'm using a call function fima_date_create to filter values of zfile_date.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        I_DATE                             = sy-datum
        I_FLG_END_OF_MONTH   = ' '
        I_YEARS                          = 2-
        I_MONTHS                        = 3-
        I_DAYS                             = 0
        I_CALENDAR_DAYS          = 0
        I_SET_LAST_DAY_OF_MONTH       = ' '
      IMPORTING
        E_DATE                             =
        E_FLG_END_OF_MONTH   =
        E_DAYS_OF_I_DATE         =   
    The sy-datum becomes the “High” value and the date generated by this FM will be the “low” value. I already tested this function module and it is what i want. How Should I write the ABAP code for this in the abap routine for my infopackage? Or what steps do I need to take.

    Hi,
    When you choose the option to write a routine for one of the characteristics in the infopackage selections, you get a window to write your code with some prewritten code as below. Modify it as shown below, for your requirement.
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'CALDAY'.
    l_idx = sy-tabix.
    START of YOUR CODE
    <----
    Required logic -
    >
    L_T_RANGE-LOW  = <lower limit of range>.
    L_T_RANGE-HIGH = <upper limit of range>.
         L_T_RANGE-SIGN = 'I'.
         L_T_RANGE-OPTION = 'BT'.
    END of YOUR CODE
    modify l_t_range index l_idx.
    p_subrc = 0.
    Hope this helps.

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • Abap Routine in DTP Filter with selection in a table

    Hi guys,
    I need help please.
    I'm trying include a abap routine in a DTP filter, for this case I need to make a select in a dso table and return a list of criterias.
    Example: for this characteristic 0GL_ACCOUNT i need in a fiter 20 or more 0GL_ACCOUNT of table  "/BIC/DSO_XXX".
    How can I select more than one 0GL_ACCOUNT in a tranparency table  "/BIC/DSO_XXX"... and put in a DTP Fiter.
    DTP FILTER ROUTINE.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'GL ACCOUNT'.
              l_idx = sy-tabix.
              if l_idx <> 0.
                modify l_t_range index l_idx.
              else.
                append l_t_range.
              endif.
              p_subrc = 0.

    Try this:
    DATA: lv_rows TYPE n LENGTH 10,
            it_zbw_pl_proj LIKE STANDARD TABLE OF /BIC/DSO_XXX 
            lw_zbw_pl_proj LIKE LINE OF it_zbw_pl_proj .
      SELECT COUNT(*) INTO lv_rows FROM  /BIC/DSO_XXX Where <your condition> .
    SELECT * INTO TABLE it_zbw_pl_proj FROM zbw_pl_proj where <your condition>
      IF lv_rows <> 0.
        LOOP AT it_zbw_pl_proj INTO lw_zbw_pl_proj  .
          l_t_range-iobjnm = '/BI0/GL_ACCOUNT'.
          l_t_range-fieldname = 'GL_ACCOUNT'.
          l_t_range-sign = 'I'.
          l_t_range-option = 'BT'.
          l_t_range-low = lw_zbw_pl_proj-GL_ACCOUNT.
          l_t_range-high = lw_zbw_pl_proj-GL_ACCOUNT.
          APPEND l_t_range.
        ENDLOOP.
      ELSE.
        " No data found for Current Forecast Version.
        p_subrc = 4.
      ENDIF.
    I just copied this data from a DTP routine where i am fetching Versions from a DB table zbw_pl_proj. You may need to change the naming convention and performance tune the code ( like defining internal table only to hold GL_account and then only selecting GL_Account from ODS).
    Hope this helps!
    Regards
    Amandeep Sharma
    Edited by: AmanSharma123 on Jul 14, 2011 2:42 PM

  • ABAP routine in Infopackage

    I am in the process of creating an ABAP routine in the Infopackage to load current month based on system data from one cube in BW to another Cube in BW. I am getting the following error in the load. I am not an ABAPer and would appreciate if you can help or guide me with a sample code.
    Here is the error.
    For sel. field '/BIC/Z_APOSNAP', no selection with SIGN = ''; OPTION '' allowed.
    Thank you
    Neelu

    Hi Neelu,
    U can create a ABAP Routine of the type 6 (ABAP Routine),The field you are trying to populate is a select-option so you have to define both Sign and Option along with Low and High values.
    As u want to load current month, from a system values , u can do it from sy-datum.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = ''/BIC/Z_APOSNAP'.
                l_idx = sy-tabix.
                l_t_range-low = 
                l_t_range-high = 
                l_t_range-sign =
                l_t_range-option =
          modify l_t_range index l_idx.
              p_subrc = 0.
    Just u can fill Sign as 'I' and Option 'EQ'.
    Fill Low and High with values u get from System Data.
    Hope this Helps,
    Thanks,
    Krish
    **awarding points is way of saying thanks in SDN.

  • ABAP routine in DTP

    hi,
    I need some help withe ABAP routine in the DTP selection
    I have requirement to load the data for specific company codes on a specific days.
    If the current date is monday then it should pick Taiwan  or
    if the current date is Tuesday the it should pick Australia and Korea or
    if the current date is sunday then it should pick CHINA and Vietnam.
    I want to use only one DTP for this requirement. Please help me with the code for Info Object 0COMP_Code.
    Regards,
    Raghu

    hi,
    I have tried the code and it is not populating any value in the selection.
    Please check
    data: l_idx like sy-tabix.
    data: day like SCAL-INDICATOR.
    *Finding out the day
      clear day.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
        EXPORTING
          DATE = sy-datum
        IMPORTING
          DAY  = day.
      read table l_t_range with key
           fieldname = 'COMP_CODE'.
      l_idx = sy-tabix.
    case day.
        when 1.                                 "Monday
          l_t_range-low = '0711'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
        when 2.                                 "Tuesday
          l_t_range-low = '0355'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
        when 3.                                 "Wednesday
         l_t_range-low = '0211'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
       when 4.
       when 5.
       when 6.
       when 7.
         l_t_range-low = 'China'.
         l_t_range-high = ' '.
         l_t_range-option = 'EQ'.
         l_t_range-sign   = 'I'.
         modify l_t_range index l_idx.
    endcase.
    p_subrc = 0.

  • ABAP Routine in the InfoPackage

    Hello,
    I need to write an ABAP Routine in the infopackage to populate the selection conditions automatically. Coding is for Fiscal year/Period and it should be populated as LOW - Pervious period and HIGH - Current period.
    I tried to do the coding myself but couldn't able to fetch the current and previous periods. I would be grateful if some one can share the code with me.
    Best Regards,
    Nene.

    Hello,
    Try this.
    1) Identify the current period by inputting sy-datum to function module  'DATE_TO_PERIOD_CONVERT'.
    2) Find the first day of current period using function module
        'FIRST_DAY_IN_PERIOD_GET'
    3) Minus one day from the first day of current period to get previous period last date.
    4) Call the same function module 'DATE_TO_PERIOD_CONVERT' by inputting the previous period last date (derived in step 3).
    5) Pass the values to the infopackage code.
    $$ begin of routine - insert your code only below this line        -
    data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = '<field name>.
      l_idx = sy-tabix.
      l_t_range-SIGN   = 'I'.
      l_t_range-OPTION = 'BT'.
      l_t_range-LOW    = <previous period> (refer step 4)
      l_t_range-HIGH   =  <current period>  (refer step 1)
      modify l_t_range index l_idx.
    Thanks
    Viswa
    (Assign points if helpful).

Maybe you are looking for

  • ITunes and iPhon will not sync....

    I just bought a new computer using Windows7. I installed iTunes and plugged in my iPhone4. When I check Library in iTunes all of my Apps, Music and Books are there. I downloaded a few new apps tonight in iTunes but when I Sync the do not got to my Ph

  • Help: Slow Performance in Captivate 2

    I have a new computer running XP Pro SP3 with a fast processor and 4GB memory. I am editing a CP movie with 70 slides. When moving from slide to slide, it takes 3-5 seconds for the selected slide to appear. During this time, Task Manager says CP is s

  • SB0460 Code 12 & code 10 in Win 7

    &SB0460 Code 2 & code 0 in Win 7? :angry:Right getting annoyed as hell with this i have a sound blaster XtremeGamer which works fine ( apart from S.C.P).?But when i try to put my other card in my Creative Labs Sound Blaster X-Fi Platinum 7. SB0460 (6

  • About singleton pattern

    if i use Class.forName(MyClass).newInstance() to init MyClass and MyClass uses singleton pattern, i wonder what is the difference between Class.forName(MyClass).newInstance() and Class.forName(MyClass).newInstance().getInstance(),i meant whether the

  • Repeatedly connecting to certain websites since using Firefox 7

    I connect to a website and it displays as expected. I move my cursor to the page and it disappears, waits for the connection, connects, disappears, waits, connects, and so on. It's only a few sites and it's only since upgrading to 7. Example site pro