Need a small abap code

Dear Friends,
request your help in creating a small abap Logic.
Business Case : loading data into 0sd_c03. an addition field product line (ZPRODLINE) has to be populated using Plant (WERKS) and division (SPART)
Psuedo Logic :
If division is '32' and plant is '4100'.
Result = concatenate Plant & Division.
Else.
Result = division.
ENDIF.
could you pl. help me to write the abap code for the above.
Regards
Padmanabham

Hi,
In case if you are trying to write in 'Start Routine'  the would be similar to this:
DATA : I_DATAPACKAGE LIKE DATA_PACKAGE,
         I_TABIX LIKE SY-TABIX.
CLEAR: I_DATAPACKAGE, I_TABIX.
  LOOP AT DATA_PACKAGE INTO I_DATAPACKAGE.
    I_TABIX  = SY-TABIX.
    IF I_DATAPACKAGE-WERKS  EQ  '4100' AND
        I_DATAPACKAGE-DIVISION EQ  '32'.
       CONCATENATE
        I_DATAPACKAGE-WERKS I_DATAPACKAGE-DIVISION INTO
        I_DATAPACKAGE-<RESULT-FILED>.
      MODIFY DATA_PACKAGE INDEX I_TABIX.
    ENDIF.
  ENDLOOP.
Hope this would help.
Message was edited by:
        Nasiroddin Pattan

Similar Messages

  • Need help in ABAP code to Enhance the Extract Structure ?????

    Hi all,
        I want to enhance the extract structure to get KBETR & KBRUE fields of KONP table since it didn’t allow me to add those fields while creating the generic extractor because of currency key problems. I want to read all KONP records into internal table with KNUMH (Key). Next, I want to fill them into ZZKBETR & ZZKBRUE of Extract Structure ZOXUR40065 in loop.
    DATA:
      i_t_zrebate like ZOXUR40065 occurs 0 with header line,
      reb_tabix like sy-tabix.
    TABLES: KONP.
      Could you please help me in completing the ABAP code?
    Thanks,
    Venkat.

    Hello Manga,
        I have included the following code in ZXRSAU01:
    WHEN 'ZREBATE'.
    PERFORM ZREBATE_EXIT TABLES C_T_DATA.
    After Double click on ZREBATE_EXIT on perform statement, it created ZXRSAF01 include and the following code is added in it:
    FORM ZREBATE_EXIT TABLES FP_C_T_DATA STRUCTURE ZOXUR40065.
    DATA:
    i_t_zrebate like ZOXUR40065 occurs 0 with header line,
    reb_tabix like sy-tabix.
    FIELD-SYMBOLS: <l_c_t_data> TYPE ZOXUR40065.
    LOOP AT fp_c_t_data ASSIGNING <l_c_t_data>.
    reb_tabix = sy-tabix.
    select single KBETR KBRUE
    into (<l_c_t_data>-ZZKBETR,
    <l_c_t_data>-ZZKBRUE,
    from KONP
    where KNUMH eq <l_c_t_data>-KNUMH.
    if sy-subrc eq 0.
    MODIFY fp_c_t_data FROM <l_c_t_data> INDEX reb_tabix.
    endif.
    CLEAR:reb_tabix.
    ENDLOOP.
    ENDFORM.
    When I tried to Activate this ZXRSAF01 include, it fails with 'The FORM "ZREBATE_EXIT" does not exist'.
      Should it be FP_C_T  or P_C_T? I found P_C_T in ZXRSAF01 include.
      What is wrong with it, please ?
       Can't I add this whole code in main include ZXRSAU01itself?
      The Extractor ZREBATE is based on KONA, KONH & KONP tables. This Extractor and KONA table have the same 4000 records and KONP has 13000 records. I want to extract KBERT & KBRUE from KONP.
       Thanks in advance.
    Regards,
    Venkat

  • For RFC  Sender  " Is it must i need to write ABAP code " ?

    Hi All
       I am learning XI but  i have problem while creating RFC sender ?
       How to configure RFC sender? I must write ABAP code in R/3 side ?
      Can any one expalin me indetail on this?
      I see many links in SDN but i was not able to find the exact one
    Adv..thanks and points
    Rakesh

    Hi ,
    Go thru this data...
    <b>Configuring the Sender RFC Adapter </b>
    <b>Use</b>
    You configure the sender RFC adapter so that you can use it to convert RFC calls from a sender to XML messages and send these messages to the Integration Server.
    <b>Integration</b>
    You configure the adapter on the Parameters tab page during the definition of a communication channel. In addition to the adapter configuration, on the Module tab page in the module processor, you can specify generic modules, which give the adapter additional functions.
    <b>Prerequisites</b>
           1.      You have created a new communication channel or have opened an existing one.
           2.      On the Parameter tab page you have selected the adapter type RFC.
           3.      You have selected the Sender radio button to define the adapter as a sender adapter.
           4.      The communication channel in which the RFC adapter is defined must be defined for a service of type Business System in the area Service Without Party.
           5.      The specifications in the communication channel must match the specifications for the adapter-specific identifiers for the business system. For more information on adapter-specific identifiers, see:  Service
    <b>Activities</b>
    <b>Transport Protocol</b>
    The transport protocol is RFC.
    <b>Message Protocol</b>
    The message protocol is RFC (RFC XML).
    <b>Adapter Engine</b>
    Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine.
    <b>Adapter Status</b>
    Set the adapter to Active to enable messages to be exchanged.
    RFC Server Parameters
    The RFC server parameters identify the sender system.
    <b>Specify the following parameters:</b>
    Parameter     Entry
    Application server (Gateway)     Gateway host of the sender system
    Application server service (Gateway)     Gateway service of the sender system
    Program ID     Program ID of the registered server program
    Unicode     Select this check box if the sender system is a Unicode system
    Initial connections     Number of initial connections required between sender system and adapter
    Maximum connections     Maximum possible number of initial connections required between sender system and adapter
    Advanced mode     Select this check box if you want to specify additional parameters of the class JCO.Server for the adapter configuration
    Enter the name and values of the parameters in the table displayed
    <b>RFC Metadata Repository Parameters</b>
    The RFC metadata repository parameters identify the SAP system containing the repository for the RFC metadata. This does not necessarily have to be the sender system.
    <b>Specify the following parameters:</b>
    <b>Parameter     Entry</b>
    Load balancing     Select this check box if your SAP system works with load balancing
    Application server     Host name of the SAP system (without load balancing)
    System number     System number of the SAP system (without load balancing)
    Message server     Host name of the message server (with load balancing)
    Message server service     Operating system service of the message server or message server port (with load balancing)
    System ID     System ID of the SAP system (with load balancing)
    Logon group     Logon group for the dynamic logon load (with load balancing)
    Authentication Type     Logon data for the SAP system
    User Name     SAP user name
    User Password     SAP user password
    Logon language     SAP logon language
    Client     SAP client
    Advanced mode     Select this check box if you want to specify additional parameters of the class JCO.Client for the adapter configuration
    Enter the name and values of the parameters in the table displayed
    Depending on the SAP system version, the following authorizations are required to read the metadata (authorization object: S_RFC, ACTVT: 16, FUGR):
    Function Groups by R/3 Release
    R/3 Release     Function Groups (FUGRs)
    As of 3.1H     RFC1, SG00, SRFC, SUNI, SYST
    As of 4.0A     RFC1, SDIF, SG00, SRFC, SYST, SYSU, SUNI
    As of 4.6A     RFC1, SDIF, SG00, SRFC, SYST, SYSU
    As of 4.6D     RFC1, SDIFRUNTIME, SG00, SRFC, SYST, SYSU
    As of SAP Web Application Server 6.20, the role SAP_BC_JSF_COMMUNICATION_RO is available, which is used for the user SAPJSF and contains all the required authorizations.
    Regards,
      Jayaram...

  • Need help in ABAP code

    Hi All,
    I have the data like this and ABC line is the primary object, Inline is the attribute.
    ABC Line                                                                       Inline
    GH04                    1001
    OI04                    1031
    OU04                    1002
    OU05                                                                            1002
    My requirement is like in the report. I have to use the Inline and restrict with the data when I restrict with 1001, 1031 and 1002. But it has to consider 1001, 1031 and 1002 which starts with only OU*. I donu2019t require all ABC lines.
    I tried to write the code but I couldnu2019t.
    Can any one give the code please?
    Thanks
    Sravani

    if the ABC line item is OU* then you need to display 1001 and 1031 else you want display all the items
    I m right???
    reach me at
    Edited by: shanthi bhaskar on Apr 15, 2010 5:20 PM

  • Need help for ABAP CODE

    hi,
    i need to reload the master data without FM, i put the comments 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 manage of infoObject, it is show 1123455 records in "transfer" column and 0 record 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

    You need not use start routine to achieve this. Instead you can write transfer routines/formulas for those fields in UR.

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need towrite ABAP code in cnoverting Country like Malysia to Area like East

    Hi ,
    Need to write ABAP code in cnoverting Country like Malysia  to Area like Ease or West.
    Can anybody help me please?
    Regards,
    kranti

    Hi,
    I think you can also do  it by concatenating the 2 fields data and displaying it in the result. You can go through the link below which discusses the similar issue. Not very sure which would be the best way to achieve this.
    Concatenate 2 fields in a Query
    hope this helps in some way.
    Regards,
    Gaurav

  • 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

  • ABAP code to get MM Movement Types into BI

    Hi All,
    I need help in ABAP code to extract data on MM tables for Purchase Price Variance Raw Material. I'm getting material documents for all reversals 102 movement type and not extracting followed up 544 or 543 values for same documents. I don't have much idea about ABAP in depth.
    program using BSIS, BKPF , EKBE, MSEG, MKPF, EKPO tables to extract data.
    See below pieces of code from program.
    DATA: TEMP_AWKEY LIKE BKPF-AWKEY,
          YEAR(4) TYPE N,
          WRX_AMT TYPE BSEG-DMBTR,
          PRD_AMT TYPE BSEG-DMBTR,
          WP_AMT TYPE BSEG-DMBTR,
          QTY TYPE BSEG-MENGE,
          I_BSIS_WA TYPE I_BSIS_TYPE,
          MATDOC TYPE MSEG-MBLNR,
          MATDOC_YEAR TYPE MSEG-MJAHR,
          PERIOD(2) TYPE N.
    DATA:
                ITAB_MSEG TYPE HASHED TABLE OF ITAB_MSEG_TYPE WITH UNIQUE KEY MBLNR MJAHR ZEILE WITH HEADER LINE INITIAL SIZE 0,
          ITAB_MSEG2 TYPE HASHED TABLE OF ITAB_MSEG_TYPE WITH UNIQUE KEY MBLNR MJAHR ZEILE WITH HEADER LINE INITIAL SIZE 0,
    READ TABLE ITAB_BSEG WITH TABLE KEY BUKRS = I_BSIS-BUKRS BELNR = I_BSIS-BELNR GJAHR = I_BSIS-GJAHR BUZEI = I_BSIS-BUZEI  .
          IF SY-SUBRC EQ 0.
            MOVE :
               ITAB_BSEG-MEINS TO I_BSIS-MEINS,
               ITAB_BSEG-SHKZG TO I_BSIS-SHKZG,
               ITAB_BSEG-MATNR TO I_BSIS-MATNR,
               ITAB_BSEG-WERKS TO I_BSIS-WERKS,
               ITAB_BSEG-MENGE TO I_BSIS-MENGE,
               ITAB_BSEG-BEWAR TO I_BSIS-BEWAR,
               ITAB_BSEG-DMBTR TO I_BSIS-DMBTR,
               ITAB_BSEG-KTOSL TO I_BSIS-KTOSL,
               ITAB_BSEG-XREF3 TO I_BSIS-XREF3,
               ITAB_BSEG-PEINH TO I_BSIS-PEINH,
               ITAB_BSEG-EBELN TO I_BSIS-EBELN,
               ITAB_BSEG-EBELP TO I_BSIS-EBELP.
           IF ITAB_BSEG-SHKZG = 'H' .
             I_BSIS-DMBTR = I_BSIS-DMBTR * -1.
             ITAB_BSEG-DMBTR = ITAB_BSEG-DMBTR * -1.
           ENDIF.
    IF NOT I_BSIS[] IS INITIAL.
          SELECT * FROM MSEG
          INTO CORRESPONDING FIELDS OF TABLE ITAB_MSEG
          FOR ALL ENTRIES IN I_BSIS
          WHERE MBLNR = I_BSIS-MATDOC
          AND   MJAHR = I_BSIS-MATDOC_YEAR
          ORDER BY PRIMARY KEY.
         LOOP AT ITAB_MSEG.
           LOOP AT I_BSIS WHERE MATDOC = I_MSEG_WE-MBLNR. "AND MATDOC_YEAR = I_MSEG_WE-MJAHR.
             MOVE :
                ITAB_MSEG-BWART TO I_BSIS-BWART.
             MODIFY I_BSIS TRANSPORTING BWART.
           ENDLOOP.
         ENDLOOP.
    IF WA_ZBW_MM_PPVCALC-BWART = '    '.
    MATDOC_YEAR = WA_ZBW_MM_PPVCALC-AWKEY+10(4).
         MATDOC = WA_ZBW_MM_PPVCALC-AWKEY(10).
          SELECT * FROM MSEG
          INTO CORRESPONDING FIELDS OF TABLE ITAB_MSEG2
         FOR ALL ENTRIES IN I_BSIS
          WHERE MBLNR = MATDOC
          AND   MJAHR = MATDOC_YEAR
          ORDER BY PRIMARY KEY.
      LOOP AT ITAB_MSEG2.
      WA_ZBW_MM_PPVCALC-BWART = ITAB_MSEG2-BWART.
      ENDLOOP.
      ENDIF.
    Please let me know where I need to change the logic to pick all movement types documents.
    Thanks,
    SAP_BI_AP
    Edited by: SAP_BI_AP on Jun 23, 2010 10:35 PM

    Hi
    There is one std tcode COOIS where u can get the information what u have asked
    Pls check
    regards
    Vijay

  • Need ABAP  Code

    Hi,
                             I want to write a small ABAP routine for a particular variable "ZS". The logic is ..
    I want to read a variable "ZV" , if the first char of the ZV is "A" then Assign a constant "Y" to ZS
    if not Assign "N" to ZS...
    Can any one help me in developing this code..

    Hello,
    You can code with below logic:
    if zv-low+0(1) = 'A'.
    zs-low = 'Y'.
    else.
    zs-low = 'N'.
    endif.
    This is the main logic....i hope u can write the other stuff as per the need.
    regards,
    shashank

  • 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

  • Need help in writing a small java code

    Hi,
    I have a small requirement where I need write a small java code. I am thinking of using array. Please suggest if you know the solution:
    1. Need to compare user logon id is preset in the lookup table or not.
    2. If user id present in the lookup then send type "A" mail
    3. If user id in not present in the lookup then send type "B" email.
    Please suggest.
    Thanks,
    Kalpana.

    use this code . you have to pass userlogin and lookup name
    Public String GetEmail(String UserLogin,String lookupcode)
    String email;
    try{
    tcLookupOperationIntf lookupIntf = Platform.getService(tcLookupOperationIntf.class);
    HashMap<String, String> lookupValues = getLookupHashMap(lookupIntf, lookupCode);
    String found = lookupValues.get(UserLogin);
    if (found!=null) email= "EMAIL A";
    else
    email= "EMAIL B";
    }catch(Exception e){}
    return email;
    private HashMap<String, String> getLookupHashMap(tcLookupOperationsIntf lookupOperationsIntf, String lookupCode)throws tcAPIException,tcInvalidLookupException,tcColumnNotFoundException {
    HashMap<String, String> lookupMap = new HashMap<String, String>();
              tcResultSet resultLookupHashMap = lookupOperationsIntf
                        .getLookupValues(lookupCode);
              int countResultLookupHashMap = resultLookupHashMap.getRowCount();
    if (countResultLookupHashMap > 0) {
                   for (int i = 0; i < countResultLookupHashMap; i++) {
                        resultLookupHashMap.goToRow(i);
                        lookupMap.put(resultLookupHashMap..getStringValue("Lookup Definition.Lookup Code Information.Code Key"),
    resultLookupHashMap.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
    return lookupMap;
    }

  • 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

  • Need ABAP code for the below Services requirement

    Hi,
    We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
    1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
    2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
    3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
    4.This will be the Service entry record for that PO number.
    Can any one Please suggest me to how to write the ABAP code for the above logic.
    Thanks & Regards,
    Dinakar

    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

  • Need ABAP code to make unique hierarchy values - Request prompt help

    hi
    <removed>
    I am new to SAP. Please help me in the following
    I require an ABAP code for the following scenario
    I have a simple hieraarchy. The hierarchy is
    SEG -> fam -> clas -> comm
    The values of the seg , fam, cla, com......all will be charecter values
    But in some cases the values will be NOT_KNOWN
    If the values are NOT_KNOWN i need to change them as NOT_KNOWN_1, NOT_KNOWN_2...like that unique charecter values
    should be replaced for NOT_KNOWN
    Example
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN
    Construction -> equipments -> machinery->NOT_KNOWN
    Computers -> Laptops -> Imported -> NOT_KNOWN
                     -> desktops ->flat monitors -> Indian
                           -> imported                     -> NOT_KNOWN->
    NOT_KNOWN -> baggages
    This should be changed to
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN_1
    Construction -> equipments -> machinery->NOT_KNOWN_2
    Computers -> Laptops -> Imported -> NOT_KNOWN_3
              -> desktops ->flat monitors -> Indian
                              -> imported                         
           -> NOT_KNOWN_4 ->
    NOT_KNOWN_5 -> baggages
    This is to make them unique nodes to upload them in hiereachy
    Data is coming from database tables and i was not supposed to do anything in database and the incomin
    data needs to finetuned like this to update them in cube
    So I like to have some coding which will enable this to work in the start routine
    If start routine is not the right option, where else we can do coding
    <removed>
    Regards
    KC

    data : w_suff_n(8) type n,
             w_suff_c(8).
    loop at data_package.
    if data_package-<fieldval> = 'NOT_KNOWN'.
      w_suff_n = w_suff_n + 1. w_suff_c = w_suff_n.
      shift w_suff_c left deleting leading '0'.
      concatenate data_package-<fieldval> w_suff_c into data_package-<fieldval>.
      modify data_package.
    endif.
    endloop.
    *Change <fieldval> in the above to the actual field name.

Maybe you are looking for

  • Expanding text field to hold data

    This sounds like a pretty simple problem, but... I have created a form using Designer that consists for 4 text boxes that span the width of the page. We are using a middleware product, LogiXML, to populate the form. We have successfully accomplished

  • Hi, i tried to connect my mac book pro on my tv. I can't clci kon mirror displays

    Hi, i tried to connect my mac book pro on my tv with my hdmi cable but when i click on displays, "arrangement" doesn't appear . Even if i click on detect displays, it doesn't work. Mirror displays doesn't appear on my screen. Does anybody get any ide

  • Closing Window in Task Bar leaves app open

    Ok so this may be a noob question but that would be because I'm a noob. I have an Air application which has states some of which are invisible. There is always a systray icon where the user can close the application but in windows when the state is v

  • My desktop as a base station

    Is it possible to have my Intel iMac act as a base station for nearby iBooks? If so, how do I set that up? Thanks for any help you can give!

  • Missing help contents - really need to reinstall?

    Hi there, from one day to the next I got problems with the Mac help viewer: when started I - get an empty window - "home" button takes you to the "home"page (the one with the iChat video conference ad picture) but no links work - entering some search