Cmod code for data extractor enhancement

hi guys  i need some help writing some abap code
the requirement is to enhance the datasource to show data..i have data like
1  b  john   etc...
1  c  john   etc..
1  d john   etc...
the data belongs in the same structure. .. the structure has 15 fields and i could append the structure with a new filed to hold the concatenated value of b, c, d.
i need it to written out in the data source as
1 line showing
1  b c d  john   etc.......
delete the rest of the extra lines..
any ideas.?

Hi Amar,
You can do this in start routine of transformation.
Create one internal table to hold the target value ie. combination of a b c and d in one field.
Now you can keep  looping on source package and collect all the similar values as given below.
create a temporary variable for storing the value of field1 which is holding all 1 values.
Loop at source_package into wa_package.
if sy-tabix = 1.
temp_field1 = wa_package-field1.
concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
endif.
if temp_field1 = wa_package-field1.
concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
else.
append wa_table into it_table.
clear wa_table.
wa_table-field2 = wa_package.
endif.
endloop.
Regards,
Durgesh.
endloop.

Similar Messages

  • Unable to debug/correct the CMOD code for a variable used in a query

    unable to debug/correct the CMOD code for a variable used in a query
    i am using the data in a DSO in a query and using a custom coding variable in that query , but this data not coming in that query ..
    can anyone suggest how to debug that cmod code for the variable?
    code is written in CMOD tocde for the variable.

    belowis the code that i have written for a custom coding for a variable
    *******Start***
    IF i_step = 2.
      CASE i_vnam.
        WHEN 'IC_COMPCD'.
         TYPES:       BEGIN OF gt_itab_DyAuthTable,
                           username  TYPE /bic/afiop_o1200-/BIC/IC_USER,
                           companycode TYPE /bic/afiop_o1200-COMP_CODE,
                      END OF gt_itab_DyAuthTable,
                      BEGIN OF gt_itab_Cocd_all,
                            companycode TYPE /BI0/MCOMP_CODE-COMP_CODE,
                      END OF gt_itab_Cocd_all.
          DATA: gi_itab_DyAuthTable TYPE STANDARD TABLE OF gt_itab_DyAuthTable,
                wa_itab_DyAuthTable TYPE gt_itab_DyAuthTable.
           DATA: gi_itab_Cocd_all TYPE STANDARD TABLE OF gt_itab_Cocd_all,
                wa_itab_Cocd_all TYPE gt_itab_Cocd_all.
          SELECT /BIC/IC_USER
                 COMP_CODE FROM /bic/afiop_o1200
            INTO CORRESPONDING FIELDS OF TABLE gi_itab_DyAuthTable
            WHERE /bic/ic_user = sy-uname.
          LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
            IF wa_itab_DyAuthTable-companycode EQ '*'
              OR
              wa_itab_DyAuthTable-companycode EQ ' '.
              SELECT COMP_CODE FROM /BI0/MCOMP_CODE
                  INTO CORRESPONDING FIELDS OF TABLE gi_itab_Cocd_all.
              LOOP AT gi_itab_Cocd_all INTO wa_itab_Cocd_all.
                l_s_range-low    = wa_itab_Cocd_all-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
          to exit the loop if any one value is */space/all for a user's compcode values
            EXIT.
            ENDIF.
          ENDLOOP.
           if control is here means, the comp codes values didnt have */space
              LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
                l_s_range-low    = wa_itab_DyAuthTable-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
      Endcase.
    Endif.

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

  • Any sample code for an Extractor to read in a flat file?

    Hi SAP gurus,
    Are there any sample code for an extractor to read in a flat file?
    Are there any documentation on custom coding an extractor to dump
    information into an info source?
    Are there any documentation on the pit falls and contraints using Solution
    Manager, the BI tools, particularly on the Info Source?
    Thanks,
    Steve

    Thanks Muppet Mark
    I forgot to mention that I had also tried just fileObject.read() as well and it didn't work either.  It was the same run on sentence result I got with the script I showed above.  Seems odd.  However, the \r instead of \n did the trick.  I had some recollection of another line feed character but couldn't remember what it was, so thanks for that.
    Doug

  • ABAP code for Date Range

    Hi All,
    I have requirement to write code for date range.
    Characterstic = Run-Out Date, it was created reference to 0Date.
    Requirement is data should load depends on Run-Out Date 7 days old and 14 days future.
    Logic is -7 days old >= Run_out date <= 14 days future.
    please let me know how I need to proceed with ABAP code for this requirement.
    Thanks.
    Please do not ask for ABAP code here. Its not a training forum
    Edited by: Pravender on Aug 18, 2011 1:46 AM

    >
    Sree vignesh wrote:
    > Hi,
    > In the select option we have a field month range as
    > SELECT-OPTION : FROM 01.2007       TO  01.2009 " Let say Ur Selection option is SO_MONTH
    > but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    >
    > LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
    >     ls_output-matnr = lt_data-belnr.
    >     ls_output-werks = lt_data-bukrs.
    >     ls_output-lgort = lt_data-dmbtr.   
    >
    >     COLLECT  ls_output INTO lt_output .
    >
    >   ENDLOOP.
    >
    > please help with code .
    >
    > thanks in advance.
    Regards,
    Suneel G

  • Demo code for data mining

    Where can I find the demo code for data mining?

    Where can I find the demo code for data mining?

  • How to use same CMOD code for 2 Diff. variableS?

    Experts,
    I have written some code under CMOD. Now, i have another query which i could use the same CODE, but diff. variable
    ( In the CMOD code, i am passing one User input variable ). For the 2nd query i have to pass different User Input variable.
    How OR what should i wright to tell CMOD, that IF its Query # 1 then use ABC variable and if Query # 2 then use XYZ .
    thanx

    Dear Hon Bon,
    Let us have a small example on ur scenario.
    Lets take the requirement as to calculate Month from Date. (In both the queries).
    Query 1: Input variable for Date is say  'ZDATE1'.
    Query 2: Input variable for Date is say  'ZDATE2'.
    Now let the CMOD variable be ZVAR_CALMONTH.
    when 'ZVAR_CALMONTH'.
        clear: lwa_var_rng,
               lwa_range.
        loop at i_t_var_range into lwa_var_rng where vnam = 'ZDATE1' or vnam = 'ZDATE2'.
          concatenate lwa_var_rng-low+0(4)
                      lwa_var_rng-low+4(2)
                 into lwa_range-low.
          lwa_range-sign = 'I'.
          lwa_range-opt  = 'EQ'.
          append lwa_range to e_t_range.
          clear lwa_range.
        endloop.
    Now when you execute the Query1,  the above code will work for 'ZDATE1' variable,
    if you execute the Query2,  the above code will work for 'ZDATE2' variable.
    So, the key point is,
    1. You need not worry about which query is getting executed. Whatever the query, the particular user entry variable of that query will be taken care.
    2. This method works only if the cmod variable (ZVAR_CALMONTH) is used in both the queries (Ofcourse its ur requirement).
    3. If queries have both the user entry variables then the cmod will work differently(it ll get data from both the user variables).
    You shall try ur code in the above example by replacing the code and the variable names and try playing around it.
    Hope this helps.
    Regards,
    Guru

  • Text not visible for the new fields created for Data Source Enhancement

    Hi .... I am working on Data Source Enhancements. I created few fields and append then to the Data SourceStructure . I also have populated the fields with data. The problem with a field is that I am not getting the text displayed in RSA3 ..Instead I am getting the field name itself.
    Example:
    FieldName       DataElement    Datatype  length  dec           Text
    ZZDOCTY                AUART         CHAR      4         0      Sales Document Type
    ZZNOODL                ZD_NODL     NUMC      1         0      Number of Deliveries
    In the above example the field ZZDOCTY is showing me the description in RSA3 i.e. Sales Document Type whereas the field ZZNOODL is not showing the text. Instead it is directly giving the fieldname ZZNOODL. Is it because of the fact that I created a Data Element for that field ??? and as I did not use the predefined data element as I did for ZZDOCTY???? Please reply me soon.....I need to display the text as "Number of Deliveries"  instead of ZZNOODL........I am working on 7.0.....

    May be the fields are hidden.
    Go to RSA6 select your data source and on the tool bar there will be a pencil butonto change. Click that and at the bottom, you will lots of check boxes.
    You go the field that you have enhanced and see whether the HIDE boxes are checked. If so, uncheck them, save and execute RSA3.
    Ravi Thothadri

  • How to find the code for ECC transaction enhancement (VA02) ?

    Dear experts,
    We have one field enhanced in the VA02 transaction, now we need to find out the logic of how this field is enhanced.
    I am from BI area and not familiar with the ECC side transaction enhancement.
    Can anybody let me know how can I identify where the enhancement program is (like is there any standard user exit/badi for VA02 field enhancement)? Or how can I debug into the enhancement logic of the specific field in VA02?
    Any post will be appreciated, and thank you all for your time in advance!
    Best regards,
    Tim

    Hi Tim,
    It can be a BADI, User exit, Repair, object enhanced using enhancement framework. It would be a good idea to talk to a local SD consultant. They might have some info or documentation. If all this does not work then unfortunately you will need someone to debug and find out where the change was made. And you would need an ABAPer for that. 
    Regards,
    Shravan

  • User exit(cmod) defined for a Datasource enhancement behaviour

    Hi,
      How does a user exit(cmod) defined in ECC to populate ZZ fields in a extractor that is enhanced.
      Will it execute for every row of a datapackage
    Thanks

    Hi,
      The data is extracted first and then stored in data packets. After that the data packet hits the exit code and you should loop the data package so that all the records are affected by the exit code you have written.
    Regards,
    Raghavendra.

  • Variable Code for Date

    Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with
    User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPSTDATE). .</b>
    <b>Example</b> POSTING DATE = 03032007
    POSTING DATE = 01012006
    IF USER INPUT DATE = 01012007
    Then only POSTING DATE = 03032007 will show up in report
    write the code in <b>customer exit cmod in BI</b> if CAN CORRECT THE CODE WOULD BE GREAT
    Data: l_s_var_range Type rrangeexit.
    L_d_PSTDATE Type /bio/oipstdate.
    L_d_PSTDATE Type /bio/oipstdate.
    IF I_STEP=2.
    READ TABLE I_t_var_range INTO l_s_var_range WITH KEY VNAM = ‘PSTVAR’.
    If L_d_PSTDATE >= PSTVAR’
    L_d_PSTDATE=l_s_var_range-low(0)
    Please help me modify the above code with logic or with some extra line of code to solve my requirement. Appreciate all of you for help in advance
    Thanks
    Soniya Kapoor

    This can be done without any coding.
    If you are using the Web, there is a Boolean operator dropdown for each variable. Enter "1/1/2007" for the Posting Date variable value (in your example), then change the operator to ">=". (There is probably even a way to default to this.)
    If you are using Excel, enter "1/1/2007" for the Posting Date variable value, then right click and choose "Options" and ">=".
    Hope this helps...
    Bob

  • Code for date navigator

    Hi,
    I want to display one date navigator input field in my ITS Screen. Please provide me the HTMLB code if you have or tell me the procedure to do the same..
    Thanks in advance...
    Naresh

    user8967004 wrote:
    i want insert date of birth in contionues....and.....this date of birth is taken by user.......Curiosity compels me to ask: How does this relate to the 'Technology Network Community » Downloads' forum purpose?
    (The forum description says: "Use this forum to report problems with or suggestions for the download.oracle.com service or content. ")
    If you want help with a product, such as an application (Peoplesoft, JD Edwards) or technology (Oracle Database, Oracle Application Server) you are encouraged to tell us which product. Or provide a webcam so we can see your desktop.

  • T Code for Date wise FG and SFG Created

    I want to check how many FG and SFG are created in each month? Any one knows the report or table in which  I will Get this DATA?

    ASK ABAP to copy MM60 to create a Modified report and add the cloulmn created on Table Mara field ERSDA and also ask him to add in the selection parameter the same so when you will run it for month it will give you for that period and by material type too the ouput with created on date in output too.
    Regards
    qsm sap
    Edited by: qsm sap on Jul 10, 2010 3:43 PM

  • Code for date range

    Hi,
    In the select option we have a field month range as
    SELECT-OPTION : FROM 01.2007       TO  01.2009
    where as in one of the internal table we have data without considering the month range as below
    MONTH RANGE     BUKRS        BELNR    DMBTR
    01.2006         10            1001      50
    05.2006         10            1001      20
    02.2007         10            1001      30
    06.2007         10            1001      40 
    01.2009         10            1001      90
    but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    if i write the code as below its getting all the data sum up but i dont want 2006 data
    LOOP AT LT_DATA.
        ls_output-matnr = lt_data-belnr.
        ls_output-werks = lt_data-bukrs.
        ls_output-lgort = lt_data-dmbtr.
        COLLECT  ls_output INTO lt_output .
      ENDLOOP.
    please help with code .
    thanks in advance.

    >
    Sree vignesh wrote:
    > Hi,
    > In the select option we have a field month range as
    > SELECT-OPTION : FROM 01.2007       TO  01.2009 " Let say Ur Selection option is SO_MONTH
    > but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    >
    > LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
    >     ls_output-matnr = lt_data-belnr.
    >     ls_output-werks = lt_data-bukrs.
    >     ls_output-lgort = lt_data-dmbtr.   
    >
    >     COLLECT  ls_output INTO lt_output .
    >
    >   ENDLOOP.
    >
    > please help with code .
    >
    > thanks in advance.
    Regards,
    Suneel G

  • Code for Date Picker

    Hi all,
      I have a icon related to calendar.when the mouse is over the icon it should open the calendar and when i click the particular date it should automatically enter into the input fields.
    Thanks In Advance.
    Regards,
    Surya.

    Hi,
    You can use the htmlb:dateNavigator tag for it. Check the tag browser, BSP extensions, Transportable, HTML. Drag the tag on the layout, click on the tag and press F1 for help.
    Alternatively, you can use things like the Tigra calendar: http://www.softcomplex.com/products/tigra_calendar/
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

Maybe you are looking for

  • Computer says usb/device not recognized when plugged in??

    When I plug in my sons ipod nano 7th generation, just recently says usb/device not recognized and doesn't light up when plugged into the wall either??? Any suggestions??

  • A few removed features

    Maybe these features have been gone for awhile but I just noticed them recently (since I'm in a mad package installation phase again). When you go to http://www.archlinux.org/packages you can no longer browse by category. The PKGBUILDs still let you

  • Using CASE on WHERE clause?

    Is it posible to use a CASE on the WHERE clause? I always used the following syntax on MSSQL but Oracle aparently doesn't accept it: SELECT... WHERE      CASE WHEN keyword IS NOT NULL THEN           CONTAINS(field, keyword) > 0      END AND      CASE

  • Styles Properties panel keeps closing

    I'm brand new to Dreamweaver but not to CSS or HTML.  Anyway when I click a selector such as #header, and it's properties show up in the properties window to the right, and then I change one of the properties, the whole properties window then closes

  • DB2 archive log backup

    Dear Sir i am using SAP EHP5 with DB2 9.7 FP4 on windows 2008r2 1) i have turn on archive log and log is generating following following directory :\db2\PSD\log_archive\DB2PSD\PSD\NODE0000\C0000000 2) we want to take archive log backup, as per SAP DB1