Correct abap code - selectinf file by routine

Hi All,
Please correct my ABAP. I am selecting file by writing routine - BI7.0.
Following error I am getting:
When I clicked preview data i got "Fine Name wrong."
My file name. : 10042007.csv
Following code I wrote:
*TABLES: ...
DATA: str1(60) TYPE c,
str2(10) TYPE c,
str3(10) TYPE c.
str1 = 'C:\Documents and Settings\sun\Desktop/'.
str2 = SY-DATUM.
str3 = 'csv'.
$$ end of global - insert your declaration only before this line   -
form compute_flat_file_filename
  using    p_infopackage  type rslogdpid
           p_datasource   type rsoltpsourcer
           p_logsys       type rsslogsys
  changing p_filename     type RSFILENM
           p_subrc        like sy-subrc.
$$ begin of routine - insert your code only below this line        -
This routine will be called by the adapter,
when the infopackage is executed.
concatenate str1 '\' str2 '.' str3 into p_filename.
          p_subrc = 0.
When I click check button its giving me No systax error.
Thanks in advance

1. if i were you, i will debugg your flat file determination code. put unconditional loop in your code (which should not end any more).
go to SM51, debugg the process from menu options.
or
try to keep file name without spaces i.e. Documents_settings like that.
Hope this helps.
Nagesh Ganisetti.

Similar Messages

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

  • Currency translation routine - pls correct ABAP code

    Hi,
    I am trying to implement a scenario for currency conversion at the transformation level.(i am using BI 7.0)
    My source data is flat file.
    My scenario here is like
    I have 2 masters - country & supplier.
    I added 0loc_currcy as an attribute to the country.
    The master data of country is as below:
    Cid    cname         local currency
    C1     INDIA         INR
    C2     SWISS         CHF
    C3     America       USD
    For supplier master data is:
    supp id  Sname
    S1         raghu
    S2         tej
    S3         harish
    S4         reddy
    I defined 2 key figures one Zprice1 & Zprice2.
    Zprice1 has currency type 0DOC_CURRCY
    Zprice2 has currency type 0LOC_CURRCY
    In the PSA the data is as below:
    cid    sid     0calday         price1         doc_curr
    C1     S1     01.01.2007    300,00        INR
    C1     S2     01.02.2007    400,00        CHF
    C1     S3     03.01.2007    350,00        USD
    C1     S4     15.04.2007    450,00        EUR
    C2     S1     31.05.2007    600,00        INR
    C2     S2     21.06.2007    250,00        CHF
    C2     S3     01.01.2007    900,00        USD
    C2     S4     01.02.2007    1.300,00      EUR
    C3     S1     03.01.2007    1.250,00      INR
    C3     S2     15.04.2007    500,00        CHF
    C3     S3     31.05.2007    50,00         USD
    C3     S4     21.06.2007    300,00        EUR
    I am expecting my data in the cube to be as below:
    cid  sid  0calday     price1 doc_curr   price2    loc_curr
    C1  S2  01.02.2007 400,00   CHF      350,00    INR
    (bcoz c1->INR)
    C3  S1  03.01.2007 1.250,00 INR       25,00     USD
    (bcoz c3->USD)
    Based on cid the loc_curr value(amount & currency after conversion) should be displayed.
    in the transformation i assigned
    /BIC/zprice1 -> zprice1
    DOC_CURRCY -> zprice1
    /BIC/zprice1 -> zprice2
    DOC_CURRCY -> zprice2
    For zprice2 i selected rule details.
    In IOassignment of source fields i assigned ZPRICE1
    and 0DOC_CURRCY.
    In currency tab of rule details now it is like :
    Target Currency                 0LOC_CURRCY
    Currency                           from source
    Source Currency                DOC_CURRCY
    Now in rule type i selected routine and inserted code shown below:
    data: ZResult_Val type f,
    CALMONTH type rsgeneral-chavl .
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
      EXPORTING
        I_CTTNM                = 'ANYCALMON'
        I_AMOUNT              = SOURCE_FIELDS-/BIC/ZPRIC1
        I_SCUR                = SOURCE_FIELDS-DOC_CURRCY
        I_TCUR                = 'EUR'  --- (what should i give here for target currency should be taken based on cid)
        I_TIME_IOBJVL         = CALMONTH
      I_SCUR_IOBJVL         =
      I_TCUR_IOBJVL         =
      I_PERIV               =
        I_RATE                = 'M'
      I_VDATE               =
      IR_MSG                =
      I_MSG_TYPES           =
    IMPORTING
        E_AMOUNT              = ZResult_Val
        E_RATE                = 'M'
        E_SCUR                = SOURCE_FIELDS-DOC_CURRCY
        E_TCUR                = 'EUR'
    EXCEPTIONS
      SCUR_NOT_FOUND        = 1
      TCUR_NOT_FOUND        = 2
      DATE_NOT_FOUND        = 3
      CTT_NOT_FOUND         = 4
      SCUR_CONFLICT         = 5
      TCUR_CONFLICT         = 6
      DATE_CONFLICT         = 7
      INVALID_SCUR          = 8
      INVALID_TCUR          = 9
      RATE_NOT_FOUND        = 10
      X_MESSAGE             = 11
      INHERITED_ERROR       = 12
      OTHERS                = 13
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    RESULT = ZResult_Val.
    I am new to ABAP coding; infact this is my first peace of code.
    Can any one tell me some tips of writing code-
    ->how to see all the syntax error at a time ; By clicking on check(ctrl+F2) i could see only the first syntax error.
    -> how to check what each perameter mean? like what does I_CTTNM in this function call 'RSW_CURRENCY_TRANSLATION'. mean?
    please help.
    Thanks,
    Raghu

    I have written a test program as below:
    <code>
    REPORT  ZCURRENCY.
    data: tgtcurr type /BI0/OILOC_CURRCY,
          ZResult_Val type F.
    select LOC_CURRCY into tgtcurr from /BIC/PZCONTRY1 where /BIC/ZCONTRY1 =
    'C3'.
    endselect.
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
        EXPORTING
        I_CTTNM = 'TEJ5' --currency trans type defined in RSCUR
        I_AMOUNT = 10
        I_SCUR = 'INR'
        I_TCUR = tgtcurr
    *I_TIME_IOBJVL = CALMONTH
        IMPORTING
        E_AMOUNT = ZResult_Val
        E_TCUR = tgtcurr.
        write: ZResult_Val
    </code>
    It is working fine
    But the following code is not working for my scenario can some debug pls:
    <code>
    data: ZResult_Val type f,
    ZSrc_val type f,
    locvar type /BI0/OILOC_CURRCY.
    Zsrc_val = SOURCE_FIELDS_RULE-/BIC/ZPRIC1.
    select LOC_CURRCY into locvar from /BIC/PZCONTRY1 where /BIC/ZCONTRY1 =
    SOURCE_FIELDS_RULE-/BIC/ZCONTRY1.
    endselect.
    CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
    EXPORTING
    I_CTTNM = 'TEJ5'
    I_AMOUNT = 10
    I_SCUR = 'INR'
    I_TCUR = locvar
    IMPORTING
    E_AMOUNT = ZResult_Val
    E_TCUR = locvar
    RESULT = ZResult_Val.
    </code>

  • Abap code Retrieve file from a folder

    Hi experts,
    We have this current customized program use to create SO from a single file (chosen by the user).  I'm looking for a possibilty for the user to put a multiple file in a folder residing on their work station and this program should retrived all files from that particular folder and process it. How could I do that? Please help.
    Thanks.

    try the ABAP forum.

  • Abap code in bw start routine

    Hi
    i need to reload the master data with out FM, i putted the comment on fm and relaod the data, now i having a problem, loading process is slow now as compair to before, when i was using with FM.
    i checked the mange on data target, it is show 1123455 in transfer column and 0 in added column below is the start routine,
    Please help me to fix that problem
    IF NOT DATAPAK[] IS INITIAL.
    LOOP AT DATAPAK INTO S_DATAPAK.
    CLEAR V_INDEX.
    V_INDEX = SY-TABIX.
    IF S_DATAPAK-/BIC/ABRETPRI CO ' 0123456789.'.
    CLEAR: V_AMOUNT, V_PRC.
    V_AMOUNT = S_DATAPAK-/BIC/ABRETPRI.
    CALL FUNCTION 'RSAR_CURRENCY_CONVERT'
    EXPORTING
    I_CURRENCY = S_DATAPAK-CURRENCY
    CHANGING
    C_AMOUNT = V_AMOUNT.
    V_PRC = V_AMOUNT.
    S_DATAPAK-/BIC/ABRETPRI = V_PRC.
    ENDIF.
    IF S_DATAPAK-/BIC/ABBLNKFLG IS INITIAL.
    S_DATAPAK-/BIC/ABBLNKFLG = 'N'.
    ENDIF.
    TRANSLATE S_DATAPAK-/BIC/ABSZRANGE TO UPPER CASE
    IF S_DATAPAK-CURRENCY IS INITIAL.
    S_DATAPAK-CURRENCY = S_DATAPAK-WHLPRCCURR.
    MODIFY DATAPAK FROM S_DATAPAK INDEX V_INDEX TRANSPORTING
    /BIC/ABRETPRI /BIC/ABWHLPRCE /BIC/ABBLNKFLG
    ENDIF.
    *ENDLOOP.
    ENDIF
    Thanks

    Hi Rob,
        Requirement is not clear. please let us know which FM you are commented and why you are using that FM and what is your exact requirement.
    Regards,
    Ramakrishna kotha.

  • Routine (ABAP Code)  in Transformation error

    Hi Experts
    Please correct the ABAP CODE written as Field routine in Transformations
    Requirment
    If  ZB_AMT = '0.00'
    then result should be '0.00'
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE  SOURCE_FIELDS-/BIC/ZB_AMT  '%' INTO RESULT.
    The code below is not working as it should please update me where i went wrong
    Source Fields
    SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
    SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
    CODE
    IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
          RESULT = '0.00'.
        ELSE.
          IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
             SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
            CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
            IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
               SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
              CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
            ENDIF.
          ENDIF.
        ENDIF.

    Your logic will not work, if your first check on amount is 0.00 fails, the other checks fail as well. I am not sure of the requirement but..try this..
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
      RESULT = '0.00'.
    ELSE.
    Do nothing or throw any message
    ENDIF.

  • ABAP Code Corrections

    Hi Experts
    Please correct the ABAP CODE written as Field routine in Transformations
    Requirment
    If ZB_AMT = '0.00'
    then result should be '0.00'
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    The code below is not working as it should please update me where i went wrong
    Source Fields
    SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
    SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
    CODE
    IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    RESULT = '0.00'.
    ELSE.
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
    SOURCE_FIELDS-/BIC/ZB_AMT '0.00'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
    SOURCE_FIELDS-/BIC/ZB_AMT '0.00'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    ENDIF.
    ENDIF.
    ENDIF.

    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    if zb_amt = '0.00' and SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    endif.
    if zb_amt = '0.00' and SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    endif.
    you can use a case statement as well
    if zb_amt = '0.00'.
    case SOURCE_FIELDS-/BIC/ZB_TPE1.
    when 'AMOUNT'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    when 'PERCENTAGE'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    endcase.
    endif.

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

  • Append Duplicate entries in Start Routine through ABAP code

    Hi Experts,
    I need to write an ABAP code in the start routine for the following conditions.
    For every record in fiscal period (FISCPER) which has non u2013quarter months eg if Jan/Feb ie (001.2007 or 002.2007) I need to create an additional duplicate record which keeps all the other values same but negates the key figures and replaces the month by a quarter ending month
    Eg: if my records are
    FISCPER   COMP_CODE    GLACCT       BALANCE
    001.2007     1000                     6789090       70
    002.2007      1000                    6789090       80
    I need to create/append duplicate entries by negating the Balance value and replacing the Fiscper with 003.2007
    FISCPER COMP_CODE   GLACCT   BALANCE
    003.2007    1000                6789090    -70
    003.2007    1000                6789090    - 80
    Hence the entire structure should now look like:
    001.2007       1000        6789090         70
    002.2007       1000        6789090         80
    003.2007       1000        6789090        -70
    003.2007       1000        6789090       - 80
    Similarly, I need to append duplicate entries for all non quarter ending months and replacing the Fiscper with the quarter ending month and also negate the Key figure value.
    Hence, similarly,
    001.2007        1000            6789090             70
    002.2007        1000            6789090             80
    003.2007        1000            6789090             -70
    003.2007        1000            6789090            - 80
    004.2007        1000            6789090              30
    005.2007        1000            6789090              90
    006.2007        1000            6789090             -30
    006.2007        1000            6789090             -90
    I am very new to ABAP, can someone please provide the ABAP start routine code for this..
    Regards,
    Dipali

    Hi,
        Check the below code. Paste it in yr Start Routine.
    '*'Begin of code
    DATA : wa_Data_Package LIKE Data_Package.
    DATA : t_Data_Package LIKE Data_Package.
    DATA : wa_temp LIKE Data_Package-BALANCE.
    Loop at Data_Package into wa_Data_Package.
    IF ( wa_Data_Package-FISCPER EQ 001/2007 ) or
         ( wa_Data_Package-FISCPER EQ 002/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 003/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 004/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 005/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 006/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 007/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 008/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 009/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 010/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 011/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 012/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ENDIF.
    APPEND t_Data_Package to Data_Package
    Endloop.
    '*'End of code
    Regards,
    Balaji V

  • Creating an xml file from abap code

    Hello All,
    Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
    Thanks in advance,
    Paul.

    This has been discussed before
    XML files from ABAP programs

  • Needs sample ABAP code for field routine

    Dear Expert,
    There is a field "Pay Scale Group" in my DSO which stores the data in the format
    AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
    InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
    I need to write a field routine on the transformation between DSO and Cube.
    Can any one please help me with the sample ABAP code for this scenario.
    Some more examples for better understanding of the requirement:-
    Data in DSO(Source)            Data in Cube(Target)
    ===================            ===================
    AA1/B1/CCC2/DD2/EEE1            EEE1
    AAA1/BB2/CC1/DDD3/EE2           EE2
    A2/BBB2/CC2/DDD3/EEE5           EEE5
    AA2/BB1/C1/DDD3/EE3             EE3
    A3/B1/CC2/DDD1/EE4              EE4
    Many thanks in advance.
    Regards,
    Prakash
    Please do not dump your code requirements in SDN
    Edited by: Pravender on May 18, 2011 11:37 AM

    Hi,
    You can use the following code :
    Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
    And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
    My assumption is that there will always be 4 '/'.
    In the field routine write the below code
    data: V1(5) type c,
              V2(5) type c,
             V3(5) type c,
              V4(5) type c,
             V5(5) type c.
    data : VAR1 TYPE /BIC/OIZPAY_SGRP.
    split VAR 1  at '/' into V1 V2 V3 V4 V5.
    result = V5.
    V5 will be having the characters after the last '/' .That is V5 = EEE1.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
    Edited by: Ashutosh Singh on May 17, 2011 4:17 PM

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • Update Routine - ABAP code

    Hi,
    I am trying to write an update routine to calculate and populate fields in my ODS infoprovider.
    one of the key figure field in my update rules is 'No. of Days'. Based on the 'No. of Days' range, I want to send a key figure(Infoobject:Due amount) value to another infoobject(Bucket1, Bucket2, Bucket3 ect.)in my ODS infoprovider. For example, let's say,
    IF NO. OF DAYS = >0 AND <=30
       THEN TAKE THE DUE AMOUNT PUT IN BUCKET1
    ENDIF.
    ELSE IF
       NO. OF DAYS = >31 AND <=60
       THEN TAKE THE DUE AMOUNT PUT IN BUCKET2
    ENDIF.
    ELSE IF
       NO. OF DAYS = >61 AND <=90
       THEN TAKE THE DUE AMOUNT PUT IN BUCKET3
    ENDIF.
    I think, I know the data flow logic but I don't know how to code in ABAP language. If someone can give me some psuedo like ABAP code, I would appreciate your help with points.

    Hi Roa,
    I would do this in the start routine of the update rule.
    Here is a sample on how do this. You could use a case statement for this code also.
    Loop at Data_Packet.
    IF NO. OF DAYS = >0 AND <=30
    Data_Packet-BUCKET1 = DUE AMOUNT
    ELSEIF
    NO. OF DAYS = >31 AND <=60
    Data_Packet-BUCKET2 = DUE AMOUNT
    ENDIF.
    ELSEIF
    NO. OF DAYS = >61 AND <=90
    Data_Packet-BUCKET3 = DUE AMOUNT
    ENDIF.
    modify data_packet.
    endlloop.
    Cheers! Bill

  • ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2

    Hi
    I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
    I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
    ODS1 :-
    DocNO   EventType    Date
    123         001             08/08/2008
    123         003             08/08/2008
    123         011              09/08/2008
    I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
    Doc NO     EventType      From Date          Todate
    123              001               08/08/2008         09/08/2008
    So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
    So please give the me the code for start routine ....
    Regards
    Suresh

    Its difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
    You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
    define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
    data: l_w_datapkg_001 type data_package,
    data: l_w_newdatapkg type new_data_package,
    data: l_w_datapkg_011 type data_package
    LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
    l_w_newdatapkg-docno = l_w_datapkg_001-docno.
    l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
    l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
    MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
    READ TABLE data_package INTO l_w_datapkg_011
    WITH KEY docno = l_w_datapkg_001-docno
                     event_type = '011'.
    l_w_newdatapkg-to_date = l_w_datapkg_011-date.
    APPEND l_w_newdatapkg TO new_data_package          
    ENDLOOP.
    Now the new datapackage contains the ODS2 data that u needed

  • Need ABAP Code in BI routine

    Hi,
    I want to write a transfer routine, Can any one give me the ABAP Code...
    Here is what I want to do:
    1. Read by document Number at the Header level (identified by item = "#")
    2. Read the Status of the Header
    3. If the Status = deleted
    4. Read all the line items related to the Header
    5. Assign the Status of the line item = Status of the Header
    Thanks
    Edited by: tanu d on Aug 20, 2010 11:32 AM

    Hi,
    See the simple code.
    IF SOURCE_FIELDS-N_WBSEOM = ' '.
          RESULT = 'N'
        ELSE.
          RESULT = SOURCE_FIELDS-N_WBSEOM.
        ENDIF.
    OR
    IF SOURCE_FIELDS-N_WBSEOM IS INITIAL.
          RESULT = 'N'
        ELSE.
          RESULT = SOURCE_FIELDS-N_WBSEOM.
        ENDIF.
    Thanks
    Reddy
    Edited by: Surendra Reddy on Nov 25, 2009 5:38 AM

Maybe you are looking for

  • Image not showing in XML Publisher [works on windows, not unix]

    I have an xml publisher RTF template that references an image from a URL passed in from the xml data file. The report definition references the image as follows: <fo:external-graphic> <xsl:attribute name="src"> <xsl:value-of select="//fld_FILE_PATH_N

  • List of Blocked BP Code

    How can I run a query in the system that shows me a list of BP which BP Code is blocked/disable ( in other words a list of BP that I'm not allowed to change the BP Code )

  • Search on a FBA site

    I have a sharepoint 2007 site witch run with AD login, and have been extended with a custom FBA login. It's all working great except the search on the FBA site. On the AD site, the content is security trimmed correctly, but on the FBA site, which don

  • First JSF Test fails

    Hi, I'm new to JSF and was just about testing a first simple test. I'm using Tomcat (for WSDP), WSDP and Eclipse with the sysdeo-tomcat-plugin. I followed a tutorial in a book ("Java Server Faces" by Andi Bosch, Addison-Wesley) so I'm sure that my co

  • Urgently  need help for parsing IP header

    Hi, could anyone tell which class I should use to parsing the IP header of a packet? Thanks many many times!