ABAP code needed to populate data in the fields............

Hi,
I have added 3 new fields to the datasource 0PROJETC_ATTR
fields names are : ZZPROFL , ZZPLFAZ and ZZPLSEZ
Can some body tell me the ABAP code to fill data in these 3 fields.
Thanks,
Jeetu

hi Jeetu,
we need the logic,
but the code will something like following sample ...
Declaration for datasource 0MATERIAL_ATTR
DATA : BEGIN OF S_BIW_MARA_S.
INCLUDE STRUCTURE BIW_MARA_S.
DATA : END OF S_BIW_MARA_S.
*Here BIW_MARA_S corresponds to the structure of your datasource *0MATERIAL_ATTR
*then you have to declare a when with the datasource on which you want to *populate the appended new fields.
*for example :
WHEN '0MATERIAL_ATTR'.
*then do a loop across your strcuture
LOOP AT C_T_DATA INTO S_BIW_MARA_S.
*a select from the table
SELECT SINGLE * FROM MARA
WHERE MATNR = S_BIW_MARA_S-MATNR.
*a check to see if your select is ok
IF SY-SUBRC = 0.
*if it is ok then your field in your structure is corresponding to a field in the table
S_BIW_MARA_S-Z1 = MARA-Z1.
S_BIW_MARA_S-Z2 = MARA-Z2.
*the c_t_data will be updated from what you get in your structure.
MODIFY C_T_DATA FROM S_BIW_MARA_S.
ENDIF.
ENDLOOP.
hope this helps.

Similar Messages

  • Inbound Extended Idoc, need to populate data into the segments

    Hi Experts,
    I am assigned with an assignment, where
    IDOC: WGSREQ02
    Create a FM with the following Parameters:
    Export u2013 IDOC Number
    Tables:
                 i.      E1WGRK1
                 ii.      ZRACEHD
                 iii.      E1WGRP1
                 iv.      ZRACE01
    Get the data and populate the IDOC and generate an IDOC. pretty much new to idocs.
    Please help me in coming out of this assignment. I would be very thank full to you if send me the sample code
    thanks in advance.
    Ram.
    Moderator Message: Please understand that these are not Training Forums. Here you cannot ask for your work to be done by others.
    Edited by: kishan P on Sep 2, 2010 12:23 PM

    Hi Experts,
    I am assigned with an assignment, where
    IDOC: WGSREQ02
    Create a FM with the following Parameters:
    Export u2013 IDOC Number
    Tables:
                 i.      E1WGRK1
                 ii.      ZRACEHD
                 iii.      E1WGRP1
                 iv.      ZRACE01
    Get the data and populate the IDOC and generate an IDOC. pretty much new to idocs.
    Please help me in coming out of this assignment. I would be very thank full to you if send me the sample code
    thanks in advance.
    Ram.
    Moderator Message: Please understand that these are not Training Forums. Here you cannot ask for your work to be done by others.
    Edited by: kishan P on Sep 2, 2010 12:23 PM

  • ABAP code to derive last date of the month from month input.

    Hi ,
    how to derive the last date of of month for the for user exit variable
    Hussain Reddy

    Hi,
    See the following code.. .
    WHEN 'ZLDAY'.    " Customer Exit variable on 0CALDAY
      IF i_step = 2.
         data: fd type sy-datum,
               ld type sy-datum.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDAY'.   " User entry date on 0CALDAY
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              fd =  loc_var_range-low.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
                  EXPORTING
                    day_in                  = fd
                 IMPORTING
                   last_day_of_month       = 
    *             EXCEPTIONS
    *               DAY_IN_NOT_VALID        = 1
    *               OTHERS                  = 2
                IF sy-subrc <> 0.
    *             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                ENDIF.
             l_s_range-low = ld.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
                APPEND l_s_range TO e_t_range.
           ENDIF.
      ENDIF.
    Simple Program.
    Just copy past in SE38 and test and use the logic for your requiremet
    REPORT  ztest1.
    data: fd type sy-datum,
             ld type sy-datum.
          fd = sy-datum.
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
            EXPORTING
              day_in                  = fd
           IMPORTING
             LAST_DAY_OF_MONTH       =  ld
    *       EXCEPTIONS
    *         DAY_IN_NOT_VALID        = 1
    *         OTHERS                  = 2
          IF sy-subrc <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    write:/ ld.
    further help on exitc you ca see the articles.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    Reddy
    Edited by: Surendra Reddy on Dec 15, 2009 11:38 AM

  • How to populate data in the same table based on different links/buttons

    Hi
    I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
    Can anyone please suggest how can this be achieved.
    Thanks

    I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
    What format do you have the date in - table / form ?

  • How to populate data in the data table on combo box change event

    hi
    i am deepak .
    i am very new to JSF.
    my problem is i want to populate data in the datatable on the combo box change event.
    for example ---
    combo box has name of the city. when i will select a city
    the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
    its urgent
    reply as soon as possible
    thanks in advance

    i am using Rational Application Developer to develop my application.
    i am using a combo box and i am assigning cityName from the SDO.
    and i am declaring a variable in the pageCode eg.
    private String cityName;
    public void setCityName(String cityName){
    this.cityName = cityName;
    public String getCityName(){
    return cityName;
    <h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
                        <f:selectItems
                             value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
                   </h:selectOneMenu>
                   <hx:behavior event="onchange" target="menu1" behaviorAction="get"
                        targetAction="box1"></hx:behavior>
    and also i am declaring a requestParam type variable named city;
    and at the onChangeEvent i am writing the code
    public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
    requestScope.put("login",(String)valueChangedEvent.getNewValue());
    and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
    it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
    it is possible that i may not clear at this point.
    please send me the way how my problem can be solved.
    thanks in advance

  • I have an old Mac Tower.  I need to move data from the unit to an external hard drive. What kind of hard drive do I purchase.  There is not a lot of data to be transferred.

    I have an old Mac Tower.  I need to move data from the unit to an external hard drive.  What kind of of hard drive must I purchase so that it works with the Tower?  There is not a lot to transfer.

    MG,
    What we might need to do is to change the question.  What computer do you plan to use the data on in the future?  For example, if you have a newer tower, just move the hard drive to the new tower.  If you want to use the data, what about an ethernet LAN to get the data over?  If you want to archive the data, how do you store the second drive?  What are your plans for the first drive?  If the new software will not recognize the old file type, the data must be exported.  Just getting files to another hard drive will not finish your journey.
    As Allan said, knowing the exact model and year of your tower is important.  My suggestion is to find a user group near you.  Please post back with more information, including the name of a large city near you.
    For example, our user group just experimented with a 1983 Apple IIc that predates the Mac.  It started right up, read files from 1984  and saved them from a 5.25" floppy to a 3.5" floppy.  That 3.5 floppy will go into a platinum G3 which will read PRODOS files using Apple File Exchange.  That G3, with a USB card, will allow saving the files to a USB flash drive.  But, somewhere along the way, some software has to read the file and convert it to data that is useable by current software.
    Ji~m

  • How to extract data from the fields present in two or three tables

    Hi Experts,
          I have a scenario where i have to extract data from the fields of different tables. e.g. let there 2 tables which have some number of fields . I want the data of 3 fields each from these 2 tables. How can i get that??
    Sam

    Hi
    You can create view in tcode se11..
    here you include all tables from which you want to fetch the data..
    you need to give selection condition here
    eg..
    say select empname from table A, select empadd from table B.. where empno(from A)=empno(from B)
    (note that you dont need to write queries like this.. i have just given u the example)
    After creating the view you can create datasource in RSO2..
    Regards
    Swati

  • Date fields and compare and get the later date of the fields

    I am trying to compare these date fields and compare and get the later date of the fields
    Tables are
    TABCASER
    TABCASER1
    EVCASERS
    Field
    Are
    TABCASER1.CASER_no
    The dates are to be compared and then get the records with the highest or latest date value.
    TABCASER1.CASERRECIEVEDDATE
    EVCASERS.FINALEVDATES
    EVCASERS.PUBLICATIONDATE
    EVCASERS.PUBLICATIONDATE
    TABCASER.COMPAREACCEPDATE
    I have this code but I am trying to figure out what it all means.
    I have several questions.
    1.
    1.     greatest it is used here to compare right? How do I then output this ? do I store it to a var (coldfusion) ultimately , I wish to send it to a page of records
    2.     is it necessary to use todate? And to_date? What does this do?
    3.     decode, is this necessary too. What does this do? NULL?
    4.     
    5.     
    6.     when I do get the query results how do I send it to coldsuion and out put to a display.
    Someone sent me this code.
    is there abetter way of doing this? To compare the dates and store in a var to display. thanks
    Here is my code below:
    Greatest(
         CASE
              WHEN INSTR(TABCASER1.CASER_no,'-CE') > 0 THEN
         decode(TABCASER1.CASERRECIEVEDDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER1.CASERRECIEVEDDATE)
                             WHEN INSTR(TABCASER1.CASER_no,'-ERNIE') > 0 THEN
         decode(EVCASERS.FINALEVDATES,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.FINALEVDATES)
                             WHEN INSTR(TABCASER1.CASER_no,'-MONIE') > 0 THEN
         decode(EVCASERS.PUBLICATIONDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.PUBLICATIONDATE)
                             WHEN INSTR(TABCASER1.CASER_no,'-NADINE') > 0 THEN
         decode(EVCASERS.PUBLICATIONDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.PUBLICATIONDATE)
                             ELSE
         decode(TABCASER.COMPAREACCEPDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER.COMPAREACCEPDATE)
                        END
              ,decode(TABCASER.COMPAREACCEPDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER.COMPAREACCEPDATE))
              between TO_DATE('#dateformat(form.startDate,"mm/dd/yyyy")#','MM/DD/YYYY') and TO_DATE('#dateformat(form.endDate,"mm/dd/yyyy")#','MM/DD/YYYY')
    is there abetter way of doing this? To compare the dates and store in a var to display. thanks

    Hi
    If you have date datatypes than:
    select
    greatest(TABCASER1.CASERRECIEVEDDATE, EVCASERS.FINALEVDATES, EVCASERS.PUBLICATIONDATE, EVCASERS.PUBLICATIONDATE, TABCASER.COMPAREACCEPDATE)
    from TABCASER, TABCASER1, EVCASERS
    where ...-- join and other conditions
    1. greatest is good enough
    2. to_date creates date dataype from string with the format of format string ('mm/dd/yyyy')
    3. decode(a, b, c, d) is a function: if a = b than return c else d. NULL means that there is no data in the cell of the table.
    6. to format the date for display use to_char function with format modell as in the to_date function.
    Ott Karesz
    http://www.trendo-kft.hu

  • Storing data in the fields during the transition back and forth

    How to make the transition within the tab back and forth, the page is not updated, and the data saved in the fields? Caching enabled, but its not work, or after Opera I think that the cache should work differently. There's all the data stored in the transition. Its not auto fill when typing in the field, or by using the wand passwords. Data in the field is only stored until update the page. In fact, you can only go back on any number of levels of your history, and then return to the past and the data fields will be the same. So in the 12x version of Opera
    I hope clearly explained

    ''yozuul [[#question-1051752|said]]''
    <blockquote>
    I hope clearly explained
    </blockquote>
    Not really. Are you trying to say you are typing on a web page, but what
    you typed does not show up on the page?
    What is the site and public web address?
    Security Issue: Update your Flash Player '''Version 17.0.0.134<br>https://www.adobe.com/products/flashplayer/distribution3.html'''
    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache and
    * Remove Cookies<br> '''''Warning ! ! '' This will log you out of sites you're logged in to.'''
    Type '''about:preferences'''<Enter> in the address bar.
    * '''Cookies;''' Select '''Privacy.''' Under '''History,''' select Firefox will '''Use Custom Settings.''' Press the button on the right side called '''Show Cookies.''' Use the search bar to look for the site. Note; There may be more than one entry. Remove '''All''' of them.
    * '''Cache;''' Select '''Advanced > Network.''' Across from '''Cached Web Content,''' Press '''Clear Now.'''
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • ABAP code in update rules to convert the date

    Hi,
    Could any one send me the ABAP code that is written in the update rules to convert the date (DD/MM/YYYY  -- lenght 10) to YYYYMMDD ---  length 8  format.
    Also please let me know where I should write this code; while creating update rules or while creating infosource.
    Thanks,

    Hi Bharath,
    Hi Bharath,
    I suggest you do the conversion of dates in the transfer rules. Here is the correct code you need:
    * Assuming the source data field is called MYDATE
    * Place the ff. in the routine in the transfer rules:
    concatenate tran_structure-mydate+6(4) tran_structure-mydate+3(2) tran_structure-mydate(2) into result.
    replace MYDATE with the name of the source field (10 chars) in the transfer structure. Hope this helps.

  • 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 Enhance Master data

    Hi Friends,
    can  you send me a sample ABAP code to enhance the master data
    Regards
    Hari

    Dear Adluru Hari Varma ,
    Hereunder an example of code to enhance Master Data
    0ART_SALES_ATTR for 0MAT_SALES:
    EXIT_SAPLRSAP_002
    DATA: l_biw_mvke_s LIKE biw_mvke_s,
    l_tabix LIKE sy-tabix,
    v_satnr LIKE mara-satnr.
    CASE i_datasource.
    WHEN '0ART_SALES_ATTR'.
    LOOP AT i_t_data INTO l_biw_mvke_s.
    l_tabix = sy-tabix.
    clear v_satnr.
    SELECT SINGLE satnr FROM MARA INTO v_satnr
    where matnr = l_biw_mvke_s-matnr.
    IF sy-subrc = 0.
    l_biw_mvke_s-zzsatnr = v_satnr.
    ENDIF.
    MODIFY i_t_data FROM l_biw_mvke_s INDEX l_tabix.
    ENDLOOP.
    ENDCASE.
    Also
    the user exit code zxrsau02 to populate the new fields .say you add field zzfield1, user exit code zxrsau02 can be like
    data : l_s_custattr like BIW_KNA1_S,
    l_zzfield1 like tablexyz-fieldabc,
    l_tabix like sy-tabix.
    case i_datasource.
    when '0customer_attr'.
    loop at c_t_data into l_s_custattr.
    l_tabix = sy-tabix.
    fill the new field
    select single fieldabc into l_zzfield1
    where ....
    l_s_custattr-zzfield1 = l_zzfield1.
    modify c_t_data from l_s_custattr index l_tabix.
    endloop.
    take a look some links on enhancement
    Enhancement
    User exit
    and download pdf 'enhancements in sap bw'
    here you can find the steps ...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e11994d8b5
    hope this helps.
    Re: enhancements
    Check in SDN you will find more programs
    Hope it helps.Revert back to me if you have any queries
    Regards
    Bala

  • For abap-hr i need datatype and length for the fields which i selected

    hi seniors,
          I got one task for which i have to get the data type and length for the fields of a table in abap-hr. I am using dd03l table, but my team leader told me to not to use this. So, please anybody can help, i will be thankfull.
          I have to select PA30 fields in which pernr and choic, subty and whatever i have selected the infotypes fields. If there is any function module to find data type and length or else any other table.
    thanks,
    sekhar.

    Hi,
    Try using the Function Module "DDIF_FIELDINFO_GET". You can use this for fetching the complete details of a structure or, a specific field.
    Input:->
    TABNAME        PA0001
    FIELDNAME     PERNR
    Output:->
    Check the DFIES_TAB  it will contain all the details you need for the specific field.
    Sample--->
    CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        TABNAME              = 'PA0001'
    *   FIELDNAME            = ' '
    *   LANGU                = SY-LANGU
    *   LFIELDNAME           = ' '
    *   ALL_TYPES            = ' '
    *   GROUP_NAMES          = ' '
    *   UCLEN                =
    *   DO_NOT_WRITE         = ' '
    * IMPORTING
    *   X030L_WA             =
    *   DDOBJTYPE            =
    *   DFIES_WA             =
    *   LINES_DESCR          =
    TABLES
       DFIES_TAB            = MY_DFIES_TAB
    *   FIXED_VALUES         =
    * EXCEPTIONS
    *   NOT_FOUND            = 1
    *   INTERNAL_ERROR       = 2
    *   OTHERS               = 3.
    Hope this was of some help.
    Best regards,
    Sagar.

  • Populate data into the dynamic table ie using field symbols

    Dear All,
    I need to convert the XML data into internal table. I did this using the guidelines in the forum. Using all those i can get my data
    in the format of
    Cname Cvalue
    id          1
    name    XX
    id          2
    name    YY
    But i need the values in the format of int_tab like,
    ID      Name
    1       XX
    2       YY
    I used the below code to create the dynamic table strucure.
    call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
    assign dy_table->* to <itab>.
    * Create dynamic work area and assign to FS
      create data dy_line like line of <itab>.
      assign dy_line->* to <wa>.
    So now my strucure will be like ID Name.
    I strucked in the place of populating the data into this like 1,XX,2,YY into the dynamic table.
    If you come across with this scenario, can anyone suggest me on this.
    Regards,
    Anita Vizhi Arasi B

    Hi Anita,
    Try to understand below given code. It works same as you want. But I used Function module not any method.
    TYPES: BEGIN OF ty_xml,
              raw(255) TYPE x,
             END OF ty_xml.
      DATA: lv_file_name TYPE                   rlgrap-filename,
            lit_hdr      TYPE TABLE OF          ty_hdr,
            ls_hdr       TYPE                   ty_hdr,
            lv_file      TYPE                   string,
            wa_xml       TYPE                   ty_xml,
            lit_xml      TYPE STANDARD TABLE OF ty_xml,
            lv_filename  TYPE                   string ,
            ls_xmldata   TYPE                   xstring ,
            lit_result   TYPE STANDARD TABLE OF smum_xmltb,
            ls_result    TYPE                   smum_xmltb,
            lit_return   TYPE STANDARD TABLE OF bapiret2,
            lv_size      TYPE                   i,
            lv_count     TYPE                   i.
      CONSTANTS: line_size TYPE i VALUE 255.
      REFRESH lit_hdr.
    *~ File selected from Local System
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = syst-repid
          dynpro_number = syst-dynnr
        CHANGING
          file_name     = lv_file_name
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      lv_file = lv_file_name.
    *~ Upload for Data Provider
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = lv_file
          filetype            = 'BIN'
          has_field_separator = ' '
          header_length       = 0
        IMPORTING
          filelength          = lv_size
        TABLES
          data_tab            = lit_xml
        EXCEPTIONS
          OTHERS              = 1.
    *~ Convert from Binary to String
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = lv_size
        IMPORTING
          buffer       = ls_xmldata
        TABLES
          binary_tab   = lit_xml
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
    *~ Parse XML docment into a table structure
      CALL FUNCTION 'SMUM_XML_PARSE'
        EXPORTING
          xml_input = ls_xmldata                  " Buffered data
        TABLES
          xml_table = lit_result                  " final internal table which contain records
          return    = lit_return.
      LOOP AT lit_result INTO ls_result.
        IF ls_result-hier = '3'.
          IF ls_result-type = 'V'.
            CASE ls_result-cname.
              WHEN 'intno'.                       "Internal Number
                ls_hdr-intno = ls_result-cvalue.
              WHEN 'acode'.                       "Article Code
                ls_hdr-matnr = ls_result-cvalue.
              WHEN 'adesc'.                       "Article Description
                ls_hdr-maktx = ls_result-cvalue.
              WHEN 'idesc'.                       "Item Description
                ls_hdr-itmds = ls_result-cvalue.
              WHEN 'sdesc'.                       "Standard Description
                ls_hdr-stdds = ls_result-cvalue.
              WHEN 'at'.                          "Article Type
                ls_hdr-mtart = ls_result-cvalue.
              WHEN 'mc'.                          "Merchandise Category
                ls_hdr-matkl = ls_result-cvalue.
              WHEN 'cp'.                          "Characteristic Profile
                ls_hdr-charp = ls_result-cvalue.
                CONDENSE ls_hdr-charp.
              WHEN 'c1'.
                ls_hdr-col01 = ls_result-cvalue.
              WHEN 'c2'.
                ls_hdr-col02 = ls_result-cvalue.
              WHEN 'c3'.
                ls_hdr-col03 = ls_result-cvalue.
              WHEN 'c4'.
                ls_hdr-col04 = ls_result-cvalue.
              WHEN 'c5'.
                ls_hdr-col05 = ls_result-cvalue.
              WHEN 'c6'.
                ls_hdr-col06 = ls_result-cvalue.
              WHEN 'tc'.                          "Tax Classification
                ls_hdr-taklv = ls_result-cvalue.
              WHEN 's'.                           "Season
                ls_hdr-saiso = ls_result-cvalue.
              WHEN 'sy'.                          "Season Year
                ls_hdr-saisj = ls_result-cvalue.
              WHEN 'fg'.                          "Fashion Grade
                ls_hdr-fashg = ls_result-cvalue.
              WHEN 'rm'.                          "Reference Material
                ls_hdr-rfmat = ls_result-cvalue.
              WHEN 'fcv'.                         "Free Character Value
                ls_hdr-frecv = ls_result-cvalue.
              WHEN 'uom'.                         "Unit of Measure
                ls_hdr-uom = ls_result-cvalue.
              WHEN 'pou'.                         "PO Unit
                ls_hdr-pount = ls_result-cvalue.
              WHEN 'v'.                           "Vendor
                ls_hdr-lifnr = ls_result-cvalue.
              WHEN 'b'.                           "Vendor
                ls_hdr-brand = ls_result-cvalue.
              WHEN 'pg'.                          "Purchasing Group
                ls_hdr-wekgr = ls_result-cvalue.
              WHEN 'rv'.                          "Regular Vendor
                ls_hdr-rlifn = ls_result-cvalue.
              WHEN 'pp'.                          "Pricing Profile
                ls_hdr-sprof = ls_result-cvalue.
              WHEN 'sp'.                          "Sales Price
                ls_hdr-spric = ls_result-cvalue.
              WHEN 'm'.                           "Margin
                ls_hdr-margn = ls_result-cvalue.
              WHEN 'c'.                           "Calculate
                ls_hdr-pcalc = ls_result-cvalue.
              WHEN 'purp'.                        "Purchase Price
                ls_hdr-ppric = ls_result-cvalue.
              WHEN 'a'.                            "Assortment
                ls_hdr-asort = ls_result-cvalue.
              WHEN 'bm'.                           "Batch Management
                ls_hdr-batch = ls_result-cvalue.
              WHEN 'mrl'.                          "Min. Remaining Life
                ls_hdr-minrl = ls_result-cvalue.
              WHEN 'aag'.                          "Account Assignment Group
                ls_hdr-acass = ls_result-cvalue.
              WHEN 'vc'.                           "Valuation Class
                ls_hdr-valcl = ls_result-cvalue.
              WHEN 'eancat'.                       "EAN Category
                ls_hdr-eanct = ls_result-cvalue.
              WHEN 'ean11'.
                ls_hdr-ean11 = ls_result-cvalue.
            ENDCASE.
            AT END OF hier.
              APPEND ls_hdr TO lit_hdr.
            ENDAT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      APPEND LINES OF lit_hdr TO git_hdr.
      DELETE git_hdr  WHERE maktx IS INITIAL            "Article Description
                          AND mtart IS INITIAL          "Article Type
                          AND matkl IS INITIAL          "Merchandise Category
                          AND charp IS INITIAL          "Characteristic Profile
                          AND taklv IS INITIAL          "Tax Classification
                          AND uom   IS INITIAL          "Unit of Measure
                          AND pount IS INITIAL          "PO Unit
                          AND lifnr IS INITIAL          "Vendor
                          AND brand IS INITIAL          "Brand
                          AND wekgr IS INITIAL          "Purchasing Group
                          AND ppric IS INITIAL          "Purchasing Price
                          AND spric IS INITIAL          "Sales Price
                          AND acass IS INITIAL          "A/c Assign. Grp.
                          AND valcl IS INITIAL          "Valuation Class
                          AND saiso IS INITIAL          "Season
                          AND saisj IS INITIAL.         "Season Year
      IF git_hdr[] IS NOT INITIAL.
        CLEAR: lv_count.
        LOOP AT git_hdr INTO ls_hdr.
          lv_count  = lv_count + 1.
          ls_hdr-intno = lv_count.
          MODIFY git_hdr FROM ls_hdr TRANSPORTING intno.
          CLEAR: ls_hdr.
        ENDLOOP.
      ENDIF.
    Code written is part of my program. Try to understand it. I hope it will help you out.
    Regards,
    Narendra

  • Populate dates within the date range columns in a table

    Hi ,
    I have a Students table with StudentID, StartDate and EndDate. For one of the requirements, I need to populate all the dates within and includeing the StartDate and EndDate for all the students. Please find the DDL for the source table samples and also below
    samples of Source table columns and how the output should be.
    create table #Students (ID int,startdate date,Enddate date)
    insert into #Students values (1000, '2014-01-01',
    '2014-01-10')
    insert into #Students values (1000, '2014-02-22',
    '2014-02-28')
    insert into #Students values (1001, '2013-07-01',
    '2013-07-12')
    insert into #Students values (1001, '2013-08-01',
    '2013-08-03')
    insert into #Students values (1001, '2014-04-01',
    '2014-04-05')
    --select * from #Students order by id,startdate
    --drop table #students
    Thanks in advance  for your help!

    Hi vskindia,
    A recursive way to achieve the expected output.
    create table #Students (ID int,startdate date,Enddate date)
    insert into #Students values (1000, '2014-01-01',
    '2014-01-10')
    insert into #Students values (1000, '2014-02-22',
    '2014-02-28')
    insert into #Students values (1001, '2013-07-01',
    '2013-07-12')
    insert into #Students values (1001, '2013-08-01',
    '2013-08-03')
    insert into #Students values (1001, '2014-04-01',
    '2014-04-05')
    ;WITH cte AS
    SELECT ID,startdate,Enddate FROM #Students
    UNION ALL
    SELECT ID,DATEADD(DAY,1,startdate) AS startdate,Enddate FROM cte
    WHERE startdate<Enddate
    SELECT id,startdate FROM CTE ORDER BY ID,startdate
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for

  • Iphoto wont open after i installed ilife11

    i bought ilife 11 and i bought snow leopard. I installed snow leopard and then ilife11 my imovie updated fine but my iphoto wont even open. Theres just a circle and it goes around and around and it never opens. my itunes got messed up too i had to re

  • Acrobat 9 Pro extended 64-bit add-on uninstall crashes

    My windows 7 64 bit computer seems to reboot itself. I've located the problem to possibly be with Acrobat. When I then tried to unistall "Accrobat 9 Pro extended 64-bit add-on" the computer crashes--straight to black screen and rebooting. I tried to

  • PO approver name & PO approval date in an report

    Hi, I am aware that there is no standard SAP report which gives the information of PO approver name and PO approval date. If there is any please let me know. However we want to develop such report which gives this information and we are bulding logic

  • Sccm 2012 DP failed to create iis virtual directories

    I am trying to install a branch server as Sccm 2012 DP. I already installed around 15 branch servers without any problems. The problem I have is that the branch server failed to create iis virtual directories. In my console under Monitoring, componen

  • After upgrade from SP2010 Foundation to Enterprise, services/features are missing

    Hi I recently upgraded the SharePoint 2010 Foundation, that was installed with TFS 2012, to Enterprise. The upgrade went through.  The Products and Configuration wizard ran through to 100% without errors, however there are no Enterprise services avai