Need example BDC reports in HR ABAP

hi all,
     I need example BDC reports in HR-ABAP .both download and upload reports..
I was tried but I'm not getting it , so please, any one send sample reports .
Rewarded for helpful answers.

Hi,
Check these links
BDC for infotype 0008
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erphcm/employee%2bphoto%2bupload
Search using "bdc" in this forum you will get lot of examples

Similar Messages

  • Need example report program using PNPCE LDB in SAP HR

    Need example report program using PNPCE LDB in SAP HR.
    and how to create a report category in sap hr for using it as cutomised selection screen.

    Hi,
    Go through the following links, i hope it will help you.....
    /people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
    A sample prog with LDB PNP
    *& Report ZH_REPT_PAYMENT *
    report zh_rept_payment line-size 80 no standard page
    heading.
    tables: pernr, " Standard Selections for HR Master Data Reporting
    pcl1, " HR Cluster 1
    pcl2, " HR Cluster 2
    pa0009,
    PA9001,
    PA9006,
    pa0002,
    pc260 , " Cluster Directory for Payroll Results
    bnka .
    Infotypes
    infotypes: 0001. " Organizational Assignment
    Declaration of Internal Tables
    data : bnka1 like bnka occurs 0 with header line .
    data: begin of t_int_rep occurs 100,
    bankl like pc209-bankl, " Bank Number
    zlsch like pc209-zlsch, " Payment method
    pernr like pernr-pernr, " Employee Number
    ename like pernr-ename, " Employee Name
    bankn like pc209-bankn, " Bank Account Number
    betrg like pc209-betrg, " Amount to be transfered
    zweck like pa0009-zweck, " Purpose
    end of t_int_rep.
    data: begin of int_rep occurs 100,
    bankl like pc209-bankl, " Bank Number
    zlsch like pc209-zlsch, " Payment method
    pernr like pernr-pernr, " Employee Number
    ename like pernr-ename, " Employee Name
    bankn like pc209-bankn, " Bank Account Number
    betrg like pc209-betrg, " Amount to be transfered
    zweck like pa0009-zweck, " Purpose
    begda like pa0009-begda, "Begin date
    end of int_rep.
    Declaration of Data Variables
    data: ws_betrg like pc209-betrg, " BT Amount
    w_val like spell occurs 0 with header line,
    int_rep1(6), " TYPE I, " Employee Number
    cnt type i value 0, " Counter
    calcmolga like t500l-molga value '40', " Country Grouping
    v_id(15),
    calc_currency like t001-waers value 'INR'. " Currency
    data : ctr type i,
    dt_merge like pa0009-begda.
    data: ws_totemp(6) type c,
    ws_totamt(20) type c,
    r_mth(9) type c,
    ws_fpbeg(6) type c,
    ws_fpend(6) type c,
    ws_mthyr(6) type c,
    ws_mthyr_r(14) type c,
    r_mth_t(3) type c,
    ws_amt(8) type c,
    ws_bankl(14) type c,
    ws_date(6) type c,
    amount_word(500),
    total_page type i,
    pages type i,
    remain type i.
    data begin of i_spell.
    include structure spell .
    data end of i_spell .
    data : c_molga type t500l-molga value '40',
    c_banks type bnka-banks value 'IN'.
    Standard Includes
    include rpc2cd09. "Cluster CD data definition
    include pc2rxin0.
    include rpc2rx09.
    include rpppxd00. " Data Definition buffer PCL1/PCL2
    include rpppxd10. " Common Part buffer PCL1/PCL2
    include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
    include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
    Selection Screen
    selection-screen begin of block b1 with frame title text-001.
    parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
    pa_year(4) type c default sy-datum(4) obligatory,
    p_bankl like pc209-bankl, " Bank Number
    p_zlsch like pc209-zlsch. " Payment method
    selection-screen end of block b1.
    save_calc_currency = calc_currency.
    count_top = 0.
    get_pernr_flag = 0.
    Top-Of-Page
    top-of-page.
    perform convert_month using pa_mth(2) r_mth.
    ws_mthyr_r = r_mth.
    concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
    SKIP 5.
    skip 1.
    skip 4.
    if int_rep-bankl eq ' '.
    if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
    int_rep-zlsch eq ' '.
    write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
    elseif int_rep-zlsch eq 'L'.
    write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
    endif.
    else.
    write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
    endif.
    skip.
    write: /34 ws_mthyr_r,
    62 'Page :'(008),69(2) sy-pagno intensified off,
    ' Of ',78(2) pages intensified off.
    clear pages.
    read table bnka1 with key bankl = int_rep-bankl .
    if sy-subrc = 0.
    if int_rep-zlsch eq 'T'.
    write:/03(10) 'Bank Name : ', bnka1-banka.
    write:/03(10) 'Branch : ', bnka1-brnch.
    write:/03(10) 'Address : ', bnka1-stras.
    endif.
    endif.
    skip.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 2(5) 'Sl.No'(002),
    7 sy-vline, 8(8) 'Emp.No.'(003),
    16 sy-vline,17(35) 'Employee Name'(004).
    *--added for Demand Draft
    if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
    write : 47 sy-vline, 48(15) 'Payable at'(005).
    else.
    write : 47 sy-vline,48(15) 'Account No.'(005).
    endif.
    write: 63 sy-vline,64(16) 'Amount'(006),
    80 sy-vline.
    write:/1(80) sy-uline.
    end-of-page.
    write:/1(80) sy-uline.
    write:/2 'Printed on ', sy-datum.
    Start-of-selection.
    start-of-selection.
    *perform h_headr.
    ctr = 0.
    set margin 5.
    call function 'RP_GET_CURRENCY'
    exporting
    molga = calcmolga
    importing
    waers = calc_currency
    exceptions
    others.
    if sy-subrc ne 0.
    calc_currency = 'DEM'.
    calc_currency = save_calc_currency.
    endif.
    get pernr.
    cd-key-pernr = pernr-pernr.
    perform import_cluster.
    get_pernr_flag = 1.
    check : ocd-version-molga eq calcmolga.
    The table 'tabpernr' is filled with the personnel numbers
    and is used after selection is finished.
    move-corresponding pernr to tabpernr.
    append tabpernr.
    The table 'tab_rgdir' is filled
    loop at rgdir.
    rx-key-pernr = pernr-pernr.
    unpack rgdir-seqnr to rx-key-seqno.
    perform int_tab. "fill tab_rgdir
    perform import_bt.
    perform validate.
    endloop.
    End of Selection
    end-of-selection.
    *perform h_headr.
    perform convert_date_a using pa_mth r_mth_t.
    sort int_rep by bankl zlsch pernr betrg descending.
    delete adjacent duplicates from int_rep
    comparing bankl zlsch pernr .
    sort int_rep by bankl zlsch bankn . "PERNR.
    loop at int_rep.
    at new bankl.
    select single * into bnka1 from bnka
    where banks = c_banks and
    bankl = int_rep-bankl .
    append bnka1.
    clear bnka1.
    endat.
    endloop.
    for Demand Draft - purpose added
    loop at int_rep.
    concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
    select single * "zweck into int_rep-zweck
    from pa0009 where
    pernr = int_rep-pernr and
    bankl = int_rep-bankl and
    zlsch = int_rep-zlsch
    and begda <= dt_merge and
    endda >= dt_merge .
    if sy-subrc = 0.
    int_rep-zweck = pa0009-zweck.
    modify int_rep.
    endif.
    endloop.
    *-for DD and Chq sorted by PAyable at and EMPNO wise
    if p_zlsch = 'T' .
    sort int_rep by bankl zlsch bankn . "PERNR.
    else. "added for "payable at" for DD/Chq
    else.
    sort int_rep by zweck pernr . "PERNR.
    endif.
    *delete adjacent duplicates from int_rep.
    t_int_rep] = int_rep[.
    loop at int_rep.
    *-for page of page no.
    total_page = 0.
    loop at t_int_rep where bankl = int_rep-bankl
    and zlsch = int_rep-zlsch.
    total_page = total_page + 1.
    endloop.
    pages = total_page div 25.
    remain = total_page mod 25.
    comment bcoz its adding one extra page no.
    done as on 29/11/2004
    if remain > 0.
    pages = pages + 1.
    endif.
    **-end
    at new bankl.
    ctr = 0 .
    new-page.
    endat.
    at new zlsch.
    ctr = 0 .
    new-page.
    endat.
    clear v_id.
    select single natio
    into pa0002-natio
    from pa0002
    where pernr eq int_rep-pernr.
    *-testing......for soma
    if ctr > 24.
    ctr = 0 .
    write:/1(80) sy-uline.
    new-page .
    endif.
    ctr = ctr + 1 .
    cnt = cnt + 1.
    pack int_rep-pernr to int_rep1.
    write:/1 sy-vline, 2(3) cnt intensified off,
    7 sy-vline, 9(6) int_rep1 intensified off,
    16 sy-vline,17(35) int_rep-ename intensified off .
    if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
    write : 47 sy-vline,48(15) int_rep-zweck intensified off.
    else.
    write:
    47 sy-vline,48(15) int_rep-bankn intensified off .
    endif.
    write: 63 sy-vline,64(16) int_rep-betrg
    intensified off currency 'INR',
    80 sy-vline.
    ws_betrg = ws_betrg + int_rep-betrg.
    *-testing......for soma
    skip.
    write :
    /1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
    sy-vline .
    *-end testing......for soma
    at end of zlsch.
    if int_rep-bankl = ' '.
    call function 'HR_IN_CHG_INR_WRDS'
    exporting
    amt_in_num = ws_betrg
    importing
    amt_in_words = amount_word
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    w_val-word = amount_word.
    concatenate 'INR.' w_val-word into w_val-word
    separated by space.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 7 'Total transfer:'(009),
    64(16) ws_betrg intensified off currency 'INR',
    80 sy-vline.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
    80 sy-vline.
    write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
    80 sy-vline.
    write:/1(80) sy-uline.
    clear: ws_betrg,cnt.
    skip 2.
    write: /2 'Prepared by :'(010), '_______________'(013),
    45 'Checked by :'(011),'_______________'(013).
    skip 2.
    write: /2 'Printed On ', sy-datum,
    45 'Approved by :'(012),'_______________'(013).
    clear sy-pagno.
    endif.
    endat.
    at end of bankl.
    if int_rep-bankl ' '.
    call function 'HR_IN_CHG_INR_WRDS'
    exporting
    amt_in_num = ws_betrg
    importing
    amt_in_words = amount_word
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    w_val-word = amount_word.
    concatenate 'INR.' w_val-word into w_val-word
    separated by space.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 7 'Total transfer:'(009),
    64(16) ws_betrg intensified off currency 'INR',
    80 sy-vline.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
    80 sy-vline.
    write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
    80 sy-vline.
    write:/1(80) sy-uline.
    clear: ws_betrg,cnt.
    skip 2.
    write: /2 'Prepared by :'(010), '_______________'(013),
    45 'Checked by :'(011),'_______________'(013).
    skip 2.
    write: /2 'Printed on ', sy-datum,
    45 'Approved by :'(012),'_______________'(013).
    clear sy-pagno.
    NEW-PAGE.
    endif.
    endat.
    endloop.
    End of Page
    end-of-page.
    write: /2 'Prepared by :'(010), '_______________',
    45 'Checked by :'(011),'_______________'.
    *& Form IMPORT_CLUSTER
    Importing Data from Cluster *
    form import_cluster.
    sy-subrc = 0.
    rp-imp-c2-cd.
    if sy-subrc eq 0.
    if cd-version-number ne ocd-version-number.
    endif.
    endif. " SY-SUBRC EQ 0
    endform. " IMPORT_CLUSTER
    *& Form INT_TAB
    Filling internal table tab_rgdir form int_tab.
    *Fill internal table tab_rgdir.
    move-corresponding rgdir to tab_rgdir.
    tab_rgdir-pernr = pernr-pernr.
    append tab_rgdir.
    endform. " INT_TAB
    *& Form IMPORT_bt
    Import Values from Bank Transactions Table (BT) form import_bt.
    rp-init-buffer.
    RP-IMP-C2-RX.
    rp-imp-c2-in.
    if rp-imp-in-subrc eq 0.
    if in-version-number ne oin-version-number.
    write: / 'Schlüssel des Clusters RX:'(015),
    rx-key-pernr, rx-key-seqno.
    write: / 'The imported version of the cluster'(016), 'RX',
    'is not current'(017).
    write: / 'Imported version :'(018),
    oin-version-number.
    write: / 'Current version of cluster :'(019),
    in-version-number.
    stop.
    else.
    sy-subrc = 0.
    endif.
    else.
    sy-subrc = 8.
    write: /
    'Inconsistencies between cluster directory and directory for'(020).
    write: /
    'No payroll results found for data in cluster directory'(021).
    write : /
    'Please contact hotline to solve the current problem'(022).
    endif.
    ws_fpbeg(2) = versc-fpbeg+4(2).
    ws_fpbeg+2(4) = versc-fpbeg(4).
    ws_fpend(2) = versc-fpend+4(2).
    ws_fpend+2(4) = versc-fpend(4).
    ws_mthyr(2) = pa_mth.
    ws_mthyr+2(4) = pa_year.
    check ws_mthyr = ws_fpbeg.
    check ws_mthyr = ws_fpend.
    loop at bt. "from pc209
    int_rep-pernr = pernr-pernr.
    int_rep-ename = pernr-ename.
    int_rep-bankl = bt-bankl.
    int_rep-bankn = bt-bankn.
    int_rep-betrg = bt-betrg.
    int_rep-zlsch = bt-zlsch.
    append int_rep.
    endloop.
    IF P_BANKL ' ' AND P_ZLSCH ' '.
    DELETE INT_REP WHERE BANKL P_BANKL.
    ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
    DELETE INT_REP WHERE ZLSCH P_ZLSCH.
    ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
    DELETE INT_REP WHERE BANKL P_BANKL.
    ENDIF.
    endform. " IMPORT_BT
    *& Form CONVERT_MONTH
    Fetching Month Text form convert_month using mth t_mth.
    case mth.
    when '01'.
    t_mth = 'January'(023).
    when '02'.
    t_mth = 'February'(024).
    when '03'.
    t_mth = 'March'(025).
    when '04'.
    t_mth = 'April'(026).
    when '05'.
    t_mth = 'May'(027).
    when '06'.
    t_mth = 'June'(028).
    when '07'.
    t_mth = 'July'(029).
    when '08'.
    t_mth = 'August'(030).
    when '09'.
    t_mth = 'September'(031).
    when '10'.
    t_mth = 'October'(032).
    when '11'.
    t_mth = 'November'(033).
    when '12'.
    t_mth = 'December'(034).
    endcase.
    endform. " CONVERT_MONTH
    *& Form CONVERT_DATE_A
    Fetching Month Text * form convert_date_a using mth_t t_mth_t.
    case mth_t.
    when '01'.
    t_mth_t = 'Jan.'(035).
    when '02'.
    t_mth_t = 'Feb.'(036).
    when '03'.
    t_mth_t = 'Mar.'(037).
    when '04'.
    t_mth_t = 'Apr.'(038).
    when '05'.
    t_mth_t = 'May.'(039).
    when '06'.
    t_mth_t = 'Jun.'(040).
    when '07'.
    t_mth_t = 'Jul.'(041).
    when '08'.
    t_mth_t = 'Aug.'(042).
    when '09'.
    t_mth_t = 'Sep.'(043).
    when '10'.
    t_mth_t = 'Oct.'(044).
    when '11'.
    t_mth_t = 'Nov.'(045).
    when '12'.
    t_mth_t = 'Dec.'(046).
    endcase.
    endform. " CONVERT_DATE_A
    *& Form VALIDATE
    text
    --> p1 text
    <-- p2 text form validate .
    if p_bankl <> ' ' and p_zlsch ' '.
    delete int_rep where bankl p_bankl.
    elseif p_bankl = ' ' and p_zlsch ' '.
    delete int_rep where zlsch p_zlsch.
    elseif p_bankl ' ' and p_zlsch = ' '.
    delete int_rep where bankl p_bankl.
    endif.
    endform. " VALIDATE
    check this weblog.....
    /people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
    Also , check the following link too.
    http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
    Regards,
    Harish

  • Need help to create CTC report in HR ABAP

    Hi guys,
    I am new to HR abap, and i need to create annal CTC report. Do you guys have ever work on such requirement plz post me some sample programs.
    Thanks in Advance...

    <h5>Dear Ramkhee,</h5>
    Well I have been working as ABAP-HR since long but no such requirement has came yet but still would like to much more detail what kind of thing you will need in that report.
    But you would need to know bit of ABAP-HR report programming specifically using LDB with Report & Fetching data from the LDB with GET event.
    Anyways for your ready reference:
    1.[ This is the basic Report that help you understand how to write ABAP HR Report|http://gauravpatwari.files.wordpress.com/2009/09/report-ymhcrobjonloan.pdf].
    2. Use this function module: RP_FILL_WAGE_TYPE_TABLE for fetching the wage types with amount from the IT0008.
    eg:-
    DATA: T_PPBWLA LIKE PBWLA OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'
          EXPORTING
                 BEGDA = sy-datum -
                 ENDDA = sy-datum
                 INFTY = '0008'
                 PERNR = pernr
          TABLES
                 PPBWLA = T_PPBWLA.
    Here begda and endda you can put as per your logic.
    Accordingly you can program.
    <h5>Regards,
    [Gaurav Patwari|http://gauravpatwari.wordpress.com] </h5>
    Edited by: GauravPa on Mar 29, 2010 2:26 PM
    Edited by: GauravPa on Mar 29, 2010 2:29 PM

  • Needing Evidence on the Advantages of ABAP OO

    I am looking for the warm and fuzzy that I've yet to experience while being convinced about this one particular advantage of OO. Particulary involving multiple creation of objects, or instances occurring at one time.
    I know the syntax of local and global classes, have done quite a bit of reading, and am familiar with OO coding, but seem to be missing the real-world implications of its use and its superiority to Function Modules in Function Groups.
    My understanding is that with data in Function Modules within a Function Group, unlike attributes in a class, a single value in a field has one existence (and value) at runtime for the Function Group. However, for attributes, or objects, in a class, multiple instances may occur at one time. While even as I say this it confuses me, because I do not think I've seen an example of a convincing custom application in SAP in my experience only. Not that I do not doubt SAP's intent, I just am not getting it.
    Can any experienced, and already convinced, ABAP OO programmer try to explain an application (in its simplest terms, if possible) where I would create multiple objects where this principle can be seen. And then tell me why I wouldn't be able to accomplish the same thing with Function Modules within Function Groups. Especially, if you have experienced a real-world implementation of this claim using OO.
    What I would really like is to have some code that uses Function Modules, then some classes, that both accomplish the same results, that would prove to me that OO, and its classes are superior to Function Modules in Function Groups.I suppose what I really need is an application where multiple instances of the same object is being used, and its advantages.
    I will listen to any, or all explanantions. I will accept any code, links, etc. Anything, please to settle my thinking and convince me once and for all.     
                                        Thank-You.
    Edited by: TMM on Jun 17, 2009 4:36 PM
    Edited by: TMM on Jun 17, 2009 4:37 PM

    This is real world stuff:
    After an application has been developed, it has happened a few times that I've wanted to use the same logic (or very similarl) in a different context.  By subclassing, I'm able to reuse what I've already developed, with little effort.  All I've had to do is redefine one or two methods of the main class.
    I often develop stuff that has to run on different versions of SAP.  Subclassing here is very useful, as the subclass for ECC 6.0, for example, doesn't even have to pass syntax checking in 4.6c!
    Using composition, I was able to develop an ["ABAP Decision" process type in BW|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/30664504-40dd-2a10-3794-db7b4190bef3] - re-using what SAP developed.  The only coding I had to do was the variation from the standard sap.
    I've developed a framework for writing Function Exits in BPS.  For a new function exit, I subclass the main class, and override an initialisation method and a processing method.  All the repeated stuff I was doing before is in the main class.
    Generally, I find that developing in OO takes a little longer, but maintenance and support is much quicker.  As the bulk of the cost of software development lies in the latter, this can only be a good thing.  I also find that I'm reusing a lot of generic code I'm developing - e,g, I've developed a class for handling hierarchies in BW.
    Currently, I'm working in the QM module, developing reports and smartforms for notifications.  The first thing I did was create a class ZCL_NOTIFICATIONS, which is my Data Access class, getting the various bits of data that I need in my reports.  This will be used in all my reports.  Now, I could do this using Function Modules, but using the functional notation of objects, I can say
    l_physnum = lr_notif->get_physnum( ).
    rather than
    CALL FUNCTION MODULE 'GET_PHYSNUM' IMPORTING e_physnum = l_physnum.
    I think the former is neater.  Also, if had a physnum in a different class, I can use the same name.  With function modules, I'd have to have
    GET_PHYSNUM_FOR_NOTIFICATION
    GET_PHYSNUM_FOR_INVENTORY
    Finally, with CONSTRUCTOR and CLASS-CONSTRUCTOR, initialisation can be done without having to remember to call the INITIALISATION function module of my function group. 
    matt

  • HOW TO CREATE A DRILLDOWN PROGRAM NEED EXAMPLE

    HAI FRIENDS
      1  I WANT TO KNOW HOW TO CREATE A DRILLDOWN PROGRAM NEED EXAMPLE IN ABAP
      2 NEED ABAP PROGRAM EBOOK
    PLZ DO IT

    CHECK THIS ALV DRILL DOWN REPORT
    *& Report  ZHAI_SD_CUSTOMER_DETAILS_ALV
    REPORT  ZHAI_SD_CUSTOMER_DETAILS_ALV.
    TYPE-POOLS: SLIS.
        TYPES DECLARATIONS
    TABLES : KNA1.
    DATA : BEGIN OF IT_CUST OCCURS 0,
      KUNNR LIKE KNA1-KUNNR,
      NAME1 LIKE KNA1-NAME1,
      LAND1 LIKE KNA1-LAND1,
      ORT01 LIKE KNA1-ORT01,
      STRAS LIKE KNA1-STRAS,
      PSTLZ LIKE KNA1-PSTLZ,
           END OF IT_CUST.
    DATA:BEGIN OF IT_SALE OCCURS 0,
    VBELN LIKE VBAK-VBELN,"SALES DOC NO
    AUDAT LIKE VBAK-AUDAT,"DATE RECIEVED AND SENT
    AUART LIKE VBAK-AUART,"SALES DOC LIKE
    NETWR LIKE VBAK-NETWR,"NET VALUE IN DOC CURRENCY
    KUNNR LIKE VBAK-KUNNR,
          END OF IT_sale.
    TYPES: BEGIN OF TY_ITEM,
    VBELN TYPE VBAP-VBELN,
    POSNR TYPE VBAP-POSNR,"ITEM NO
    MATNR TYPE VBAP-MATNR,"MATERIAL NO
    CHARG TYPE VBAP-CHARG,"BATCH
    MATKL TYPE VBAP-MATKL,"MATERIAL GROUP
    MEINS TYPE VBAP-MEINS,"BASE UNIT OF MEASURE
    END OF TY_ITEM.
    SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
         INTERNAL TABLES
    DATA:
         IT_CUST  TYPE TABLE OF TY_CUST,
         IT_SALE  TYPE TABLE OF TY_SALE,
          IT_ITEM  TYPE TABLE OF TY_ITEM.
                       INTERNAL TABLES FOR ALV
    DATA: IT_FCAT   TYPE  SLIS_T_FIELDCAT_ALV,
          IT_FCAT1  TYPE  SLIS_T_FIELDCAT_ALV,
          IT_FCAT3  TYPE SLIS_T_FIELDCAT_ALV.
    DATA: IT_EVENTS TYPE TABLE OF   slis_alv_event,
          IT_EVENTS1 TYPE TABLE OF SLIS_ALV_EVENT,
          IT_EVENTS2 TYPE TABLE OF SLIS_ALV_EVENT.
    DATA: IT_LISTHEADER1 TYPE SLIS_T_LISTHEADER,
          IT_LISTHEADER TYPE TABLE OF slis_listheader,
          IT_LISTHEADER3 TYPE TABLE OF SLIS_LISTHEADER,
          IT_FOOTER TYPE TABLE OF SLIS_LISTHEADER.
    DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          WA_SORT LIKE LINE OF IT_SORT.
                       WORK AREAS FOR ALV
    DATA: WA_LAYOUT  TYPE SLIS_LAYOUT_ALV,
          WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
          WA_FCAT    LIKE LINE OF IT_FCAT,
          WA_FCAT1   LIKE LINE OF IT_FCAT1,
          WA_FCAT3   LIKE LINE OF IT_FCAT3,
          WA_EVENTS  LIKE LINE OF IT_EVENTS,
          WA_EVENTS1 LIKE LINE OF IT_EVENTS,
          WA_EVENTS2 LIKE LINE OF IT_EVENTS.
            WORK VARIABLES
    DATA: W_REPID TYPE SY-REPID,
          W_KUNNR TYPE KNA1-KUNNR.
    $$**----
       WORK  AREAS
        MACROS
    DEFINE ADD_FCAT1..
    WA_FCAT1-COL_POS = &1.
    WA_FCAT1-FIELDNAME = &2.
    WA_FCAT1-TABNAME = &3.
    WA_FCAT1-REF_TABNAME = &4.
    WA_FCAT1-KEY = &5.
    WA_FCAT1-DO_SUM = &6.
    WA_FCAT1-HOTSPOT = &7.
    WA_FCAT1-EMPHASIZE = &8.
    APPEND WA_FCAT1 TO IT_FCAT1.
    END-OF-DEFINITION.
    START-OF-SELECTION.
      PERFORM F_GET_DATA.
      PERFORM F_BUILD_FCAT.
      PERFORM F_GET_EVENTS.
      PERFORM F_BUILD_LAYOUT USING WA_LAYOUT.
      PERFORM F_GET_DISPLAY.
    *&      Form  F_GET_DATA
    FORM F_GET_DATA .
    SELECT   KUNNR
              NAME1
              LAND1
              ORT01
              STRAS
              PSTLZ FROM KNA1
              INTO TABLE
    IT_CUST WHERE KUNNR IN S_KUNNR.
    ENDFORM.                    " F_GET_DATA
    *&      Form  F_GET_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_DISPLAY .
    CLEAR W_REPID.
    MOVE SY-REPID TO W_REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = w_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
         I_CALLBACK_TOP_OF_PAGE            = 'F_TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = 'DUCK'
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = WA_LAYOUT
         IT_FIELDCAT                        = IT_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                          = IT_EVENTS
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_CUST
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
    ENDFORM.                    " F_GET_DISPLAY
    *&      Form  F_GET_EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_EVENTS .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = IT_EVENTS
        EXCEPTIONS
          LIST_TYPE_WRONG = 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.
      SORT IT_EVENTS.
    READ TABLE IT_EVENTS INTO WA_EVENTS
    WITH KEY NAME = 'TOP_OF_PAGE' BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    WA_EVENTS-FORM = 'F_TOP_OF_PAGE'.
    MODIFY  IT_EVENTS  INDEX SY-TABIX FROM
    WA_EVENTS TRANSPORTING FORM.
      ENDIF.
    READ TABLE IT_EVENTS INTO WA_EVENTS
    WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    WA_EVENTS-FORM = 'F_USER_COMMAND'.
    MODIFY IT_EVENTS FROM WA_EVENTS INDEX
    SY-TABIX TRANSPORTING FORM.
    READ TABLE IT_EVENTS INTO WA_EVENTS
    WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
    ENDIF.
    READ TABLE IT_EVENTS INTO WA_EVENTS WITH
    KEY NAME = 'END_OF_PAGE' BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    WA_EVENTS-FORM = 'F_END_OF_PAGE'.
    MODIFY IT_EVENTS FROM WA_EVENTS
    INDEX SY-TABIX TRANSPORTING FORM.
    ENDIF.
    ENDFORM.                    "F_GET_EVENTS
    *&      Form  F_BUILD_LAYOUT
    FORM F_BUILD_LAYOUT  USING P_WA_LAYOUT LIKE WA_LAYOUT .
    CLEAR P_WA_LAYOUT.
    P_WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    *P_WA_LAYOUT-F2CODE = '&ETA'.
    *p_wa_layout-detail_popup = 'X'.
    P_WA_LAYOUT-DETAIL_TITLEBAR = 'ALV REPORT'.
    *P_WA_LAYOUT-CONFIRMATION_PROMPT  = 'X'.
    ENDFORM.                    " F_BUILD_LAYOUT
    *&      Form  F_TOP_OF_PAGE
    FORM F_TOP_OF_PAGE .
    refresh it_listheader.
      DATA: LS_LIST TYPE SLIS_LISTHEADER.
      LS_LIST-TYP = 'H'.
      LS_LIST-INFO = TEXT-004.
      APPEND LS_LIST TO IT_LISTHEADER.
      LS_LIST-typ = 'S'.
      LS_LIST-key = 'Date: '.
      CONCATENATE sy-datum+6(2) '.'
      sy-datum+4(2) '.'
      sy-datum(4) INTO LS_LIST-info. "todays date
      append LS_LIST to IT_LISTHEADER.
      clear: LS_LIST.
      LS_LIST-TYP = 'S'.
      LS_LIST-KEY = 'DEVELOPED:'.
      LS_LIST-INFO = SY-UNAME.
      APPEND LS_LIST TO IT_LISTHEADER.
      CLEAR LS_LIST.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LISTHEADER
          I_LOGO             = 'GLOBAL'.
    ENDFORM.                    " F_TOP_OF_PAGE
    *&      Form  F_BUILD_FCAT
    FORM F_BUILD_FCAT .
    CLEAR: W_REPID,
           IT_FCAT.
      MOVE SY-REPID TO W_REPID.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = W_REPID
         I_INTERNAL_TABNAME           = 'IT_CUST'
         I_INCLNAME                   = W_REPID
        CHANGING
          CT_FIELDCAT                  = IT_FCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " F_BUILD_FCAT
    *&      Form  F_USER_COMMAND
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                              RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE  R_UCOMM.
    WHEN '&IC1'.
    IF RS_SELFIELD-FIELDNAME = 'KUNNR'.
    READ TABLE IT_CUST
    INDEX RS_SELFIELD-TABINDEX.
    MOVE rs_selfield-value TO W_KUNNR.
    IF IT_CUST IS NOT INITIAL.
       PERFORM F_GET_SECONDARY_DATA.
       PERFORM F_BUILD_FCAT1.
       PERFORM F_BUILD_EVENTS.
       PERFORM F_GET_SORT.
       PERFORM F_BUILD_LAYOUT1.
      PERFORM F_GET_DISPLAY1.
    ENDIF.
      ENDIF.
      ENDCASE.
    ENDFORM.                    " F_USER_COMMAND
    *&      Form  F_GET_SECONDARY_DATA
    FORM F_GET_SECONDARY_DATA .
    data:v_data.
    SELECT  VBELN
              AUDAT
              AUART
              NETWR
    KUNNR FROM VBAK INTO TABLE IT_SALE
    WHERE KUNNR EQ IT_CUST-KUNNR.
      IF IT_SALE[] IS INITIAL .
       CALL FUNCTION 'POPUP_TO_CONFIRM'
         EXPORTING
          TITLEBAR                    = SY-REPID
         DIAGNOSE_OBJECT             = ' '
           TEXT_QUESTION               = 'NO SALES FOR THIS CUSTOMER'
         TEXT_BUTTON_1               = 'Ja'(001)
         ICON_BUTTON_1               = ' '
         TEXT_BUTTON_2               = 'Nein'(002)
         ICON_BUTTON_2               = ' '
          DEFAULT_BUTTON              = '1'
          DISPLAY_CANCEL_BUTTON       = 'X'
         USERDEFINED_F1_HELP         = ' '
         START_COLUMN                = 25
         START_ROW                   = 6
         POPUP_TYPE                  =
         IV_QUICKINFO_BUTTON_1       = ' '
         IV_QUICKINFO_BUTTON_2       = ' '
        IMPORTING
          ANSWER                      = v_data
       TABLES
         PARAMETER                   =
        EXCEPTIONS
          TEXT_NOT_FOUND              = 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.
    case v_data.
    when '2'.
    leave screen.
    when 'A'.
    leave to screen '0'.
    endcase.
      ENDIF.
    ENDFORM.                    " F_GET_SECONDARY_DATA
    *&      Form  F_BUILD_FCAT1
    FORM F_BUILD_FCAT1 .
    REFRESH IT_FCAT1.
    CLEAR WA_FCAT1.
    ADD_FCAT1:
    '1' 'VBELN' 'VBAK' 'VBAK' 'X' ' ' 'X' 'C500',
    '2' 'AUDAT' 'VBAK' 'VBAK' ' ' ' ' ' ' 'C400',
    '3' 'AUART' 'VBAK' 'VBAK' ' ' ' ' ' ' 'C100',
    '4' 'NETWR' 'VBAK' 'VBAK' ' ' 'X' ' ' 'C300'.
    ENDFORM.                    " F_BUILD_FCAT1
    *&      Form  F_GET_DISPLAY1
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_DISPLAY1 .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           =  'F_USER_COMMAND1'
         I_CALLBACK_TOP_OF_PAGE            = 'F_TOP_OF_PAGE1'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
         IT_FIELDCAT                       = IT_FCAT1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
       IT_SORT                            = IT_SORT
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                         = IT_EVENTS1
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_SALE
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
    ENDFORM.                    " F_GET_DISPLAY1
    *&      Form  F_BUILD_EVENTS
    FORM F_BUILD_EVENTS .
    clear wa_events1.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = IT_EVENTS1.
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
      SORT IT_EVENTS1.
      read table It_events1 with key name = 'TOP_OF_PAGE'
      into WA_eventS1.
      if sy-subrc = 0.
        move 'F_TOP_OF_PAGE1' to WA_EventS1-form.
        append WA_eventS1 to it_events1.
      endif.
      READ TABLE IT_EVENTS WITH KEY NAME = 'USER_COMMAND'
      INTO WA_EVENTS1.
      IF SY-SUBRC = 0.
      MOVE 'F_USER_COMMAND1' TO WA_EVENTS1-FORM.
      APPEND WA_EVENTS1 TO IT_EVENTS1.
      ENDIF.
    *READ TABLE IT_EVENTS WITH KEY NAME = 'SUBTOTAL_TEXT'
    INTO WA_EVENTS1.
    IF SY-SUBRC = 0.
    MOVE 'F_SUBTOTAL_TEXT' TO WA_EVENTS1-FORM.
    APPEND WA_EVENTS1 TO IT_EVENTS1.
    ENDIF.
    ENDFORM.                    " F_BUILD_EVENTS
    *&      Form  F_TOP_OF_PAGE1
    FORM F_TOP_OF_PAGE1 .
    DATA: LS_HEADER TYPE SLIS_LISTHEADER.
    REFRESH : IT_LISTHEADER1.
      LS_HEADER-TYP = 'H'.
      LS_HEADER-INFO = 'SALES ORDER DETAILS FOR CUSTOMER'.
      APPEND LS_HEADER TO it_listheader1.
      CLEAR LS_HEADER.
      LS_HEADER-TYP  = 'S'.
      LS_HEADER-KEY = 'CUSTOMER NO:'.
      LS_HEADER-INFO = W_KUNNR.
      APPEND LS_HEADER TO IT_LISTHEADER1.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER1
         I_LOGO                   = 'DUCK'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    " F_TOP_OF_PAGE
    *&      Form  F_END_OF_PAGE
          text
    -->  p1        text
    <--  p2        text
    FORM F_END_OF_PAGE .
    DATA:LS_FOOTER TYPE SLIS_LISTHEADER.
    LS_FOOTER-TYP = 'S'.
    LS_FOOTER-KEY = SY-UNAME.
    LS_FOOTER-INFO = 'DEVELOPED BY:'.
    APPEND LS_FOOTER TO IT_FOOTER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = IT_FOOTER
    ENDFORM.                    " F_END_OF_PAG
    *&      Form  F_USER_COMMAND1
          text
    -->  p1        text
    <--  p2        text
    FORM F_USER_COMMAND1 USING R_UCOMM LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    READ TABLE IT_SALE INDEX RS_SELFIELD-TABINDEX.
    PERFORM F_GET_SECONDARY2.
    PERFORM F_GET_FCAT3 USING:
    'VBELN' '1' 'C' '12' 'SALES_DOC'   'M'  'VBAP' 'X' 'C51' ' ',
    'POSNR' '2' ' '  '5' 'ITEM_NO'      'M'  'VBAP' ' ' 'C61' ' ',
    'MATNR' '3' ' '  '12' 'MATERIAL_NO' 'M'  'VBAP' ' ' 'C71' ' ',
    'CHARG' '4' ' ' '10' 'BATCH_NO'    'M'  'VBAP' ' ' 'C41' ' ',
    'MATKL' '5' ' ' '10' 'MAT_GROUP'   'M'  'VBAP' ' ' 'C31' ' ',
    'MEINS' '6' ' ' '12' 'BASE_UNIT'   'M'  'VBAP' ' ' 'C21' 'X' .
    PERFORM F_GET_EVENTS2 USING WA_EVENTS2
                         CHANGING IT_EVENTS2.
    PERFORM F_GET_DISPLAY3.
    REFRESH IT_FCAT3.
    ENDCASE.
    ENDFORM.                    " F_USER_COMMAND1
    *&      Form  F_GET_SECONDARY2
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_SECONDARY2 .
    SELECT VBELN
           POSNR
           MATNR
           MATKL
           MEINS
           FROM VBAP INTO
           TABLE IT_ITEM WHERE
           VBELN EQ IT_SALE-VBELN.
    IF SY-DBCNT EQ 0.
    MESSAGE E000(ZHAI) WITH TEXT-KO1.
    ENDIF.
    ENDFORM.                    " F_GET_SECONDARY2
    *&      Form  F_GET_DISPLAY3
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_DISPLAY3 .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'F_PF_STATUS'
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = 'F_TOP_OF_PAGE3'
       I_CALLBACK_HTML_TOP_OF_PAGE       = 'F_TOP_OF_PAGE3'
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = WA_LAYOUT1
       IT_FIELDCAT                       = IT_FCAT3
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           = IT_SORT
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
       IT_EVENTS                         = IT_EVENTS2
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_ITEM
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
    ENDFORM.                    " F_GET_DISPLAY3
    *&      Form  F_GET_FCAT3
    FORM F_GET_FCAT3  USING    VALUE(P1)
                               VALUE(P2)
                               VALUE(P3)
                               VALUE(P4)
                               VALUE(P5)
                               VALUE(P6)
                               VALUE(P7)
                               VALUE(P8)
                               VALUE(P9)
                              VALUE(P10).
    CLEAR WA_FCAT3.
      WA_FCAT3-FIELDNAME = P1.
      WA_FCAT3-COL_POS = P2.
      WA_FCAT3-JUST = P3.
      WA_FCAT3-OUTPUTLEN = P4.
      WA_FCAT3-SELTEXT_M  = P5.
      WA_FCAT3-DDICTXT = P6.
      WA_FCAT3-REF_TABNAME = P7.
      WA_FCAT3-HOTSPOT = P8.
      WA_FCAT3-EMPHASIZE = P9.
      WA_FCAT3-DO_SUM  = P10.
      APPEND WA_FCAT3 TO IT_FCAT3.
    ENDFORM.                    " F_GET_FCAT3
    *&      Form  F_BUILD_LAYOUT1
          text
    -->  p1        text
    <--  p2        text
    FORM F_BUILD_LAYOUT1 .
    WA_LAYOUT1-totals_text = 'TOTAL'.
    wa_layout1-detail_popup = 'X'.
    ENDFORM.                    " F_BUILD_LAYO
    *&      Form  F_GET_EVENTS2
          text
         -->P_IT_EVENTS2  text
         <--P_WA_EVENTS2  text
    FORM F_GET_EVENTS2  USING    VALUE(P_WA_EVENTS2) LIKE WA_EVENTS2
                        CHANGING P_IT_EVENTS2 LIKE IT_EVENTS2.
    P_WA_EVENTS2-NAME = 'HTML_TOP_OF_PAGE'.
    P_WA_EVENTS2-FORM = 'F_TOP_OF_PAGE3'.
    APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
    CLEAR P_WA_EVENTS2.
    P_WA_EVENTS2-NAME = 'PF_STATUS'.
    P_WA_EVENTS2-FORM = 'F_PF_STATUS'.
    APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
    CLEAR P_WA_EVENTS2.
    P_WA_EVENTS2-NAME = 'USER_COMMAND'.
    P_WA_EVENTS2-FORM = 'F_USER_COMMAND3'.
    APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
    CLEAR P_WA_EVENTS2.
    p_wa_events2-name = 'HTML_END_OF_LIST'.
    P_WA_EVENTS2-FORM = 'F_HTML_END_OF_LIST'.
    APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
    CLEAR p_wa_events2.
    ENDFORM.                    " F_GET_EVENTS2
    *&      Form  F_TOP_OF_PAGE3
          text
    -->  p1        text
    <--  p2        text
    FORM F_TOP_OF_PAGE3 USING DOCUMENT TYPE REF TO cl_dd_document .
    data : link_area type ref to cl_dd_area,
           picture_area type ref to cl_dd_area.
    CALL METHOD DOCUMENT->ADD_TEXT
      EXPORTING
        TEXT          = 'ALV REPORT'
       TEXT_TABLE    =
       FIX_LINES     =
       SAP_STYLE     =
        SAP_COLOR     = cl_dd_area=>list_background_int
        SAP_FONTSIZE  = 'LARGE'
        SAP_FONTSTYLE = 'TIMES'
        SAP_EMPHASIS  = 'STRONG'
       STYLE_CLASS   =
    CHANGING
       DOCUMENT      =
    CALL METHOD DOCUMENT->NEW_LINE.
    CALL METHOD DOCUMENT->ADD_PICTURE
      EXPORTING
        PICTURE_ID       = 'LOGO1'
        WIDTH            = '10%'
    ENDFORM.                    " F_TOP_OF_PAGE3
    *&      Form  F_GET_SORT
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_SORT .
    WA_SORT-FIELDNAME = 'NETWR'.
    WA_SORT-SPOS  = 4.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOT = 'X'.
    APPEND WA_SORT TO IT_SORT.
    ENDFORM.                    " F_GET_SORT
    *&      Form  F_PF_STATUS
          text
    -->  p1        text
    <--  p2        text
    FORM F_PF_STATUS USING RS_EXTAB TYPE SLIS_T_EXTAB .
    SET PF-STATUS 'ZHAIALV' EXCLUDING RS_EXTAB.
    ENDFORM.                    " F_PF_STATUS
    *&      Form  F_USER_COMMAND3
          text
    -->  p1        text
    <--  p2        text
    FORM F_USER_COMMAND3 USING R_UCOMM LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&SALE'.
    IF RS_SELFIELD-FIELDNAME = 'VBELN'.
    SET parameter ID 'AUN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
    ENDIF.
    WHEN '&MAT'.
    IF RS_SELFIELD-FIELDNAME = 'MATNR'.
    SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-VALUE.
    CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDCASE.
    ENDFORM.                    " F_USER_COMMAND3
    *&      Form  F_HTML_END_OF_LIST
          text
    -->  p1        text
    <--  p2        text
    FORM F_HTML_END_OF_LIST USING DOCUMENT TYPE REF TO CL_DD_DOCUMENT.
    DATA : PAGE TYPE SDYDO_TEXT_ELEMENT.
    MOVE SY-PAGNO TO PAGE.
    CALL METHOD DOCUMENT->ADD_TEXT
      EXPORTING
        TEXT          = PAGE
       TEXT_TABLE    =
       FIX_LINES     =
       SAP_STYLE     =
       SAP_COLOR     =
       SAP_FONTSIZE  =
       SAP_FONTSTYLE =
       SAP_EMPHASIS  =
       STYLE_CLASS   =
    CHANGING
       DOCUMENT      =
    ENDFORM.                    " F_HTML_END_OF_LIS

  • Scheduling custom BDC report as a job....

    Hi,
    I want to generate a background Job for a custom BDC ABAP report.
    I am going to transaction SM36, entering name of Job -> Job class as 'C' ->  enter.
    But after I provide name of the program, it also has a field called variant. What do I enter there ?
    Is it that I need to create some varaiant for my BDC report ? How do I do that ?
    Also how do I schedule this job which I created ?
    Regards.

    Hi Rajesh,
    I assume that you have a variant for your program.
    Follow these steps.
    1) Goto SM36
    2)Enter Job Name and Job Class. Then Save it. (Goto Job-->Save(Ctrl + S) in Menu bar).
    3) You will get a popup.
    In program values enter  ABAP program and  Variant name.
    Save it.
    4) Now goto SM37.
    Job status all selected.
    Execute.
    5)You will find your Job created. <b>Check it</b>.
    6)Press CtrlShiftF10 (Release Job)
    Immediate. Save again.
    Done..
    Regards,
    <b>AS</b>.

  • NEED SAMPLE HR REPORTS

    HI TO ALL EXPERTS,
    IM NEW TO ABAP HR PROGRAMMING I NEED SAMPLE HR REPORTS FOR PRACTICE (ESPECIALLY PAYROLL REPORTS)
    plz send it on mail id mausam_8atyahoo.com

    hii,
    hr abap
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    cheers,
    sharad

  • What is Report Painter in Abap ?

    What is Report Painter in Abap ?
    How we can write a simple report through report painter .
    It's Tcode , How to proceed ?
    I developed several report through ABAP , but i have no clue about Report Painter .
    What is advantage to using it .
    Plz give some Example .
    Regards : rajneesh

    Hi rajneesh,
    Report Painter : -
    You use the Report Painter to create reports from data in the Special Purpose Ledger (FI-SL) application component and other R/3 application components to meet your specific reporting requirements.Advantages of the Report Painter include:--Easy and flexible report definitionReport definition without using setsDirect layout controlABAP QueryThe SAP Query application is used to create reports not already contained in the default. It has been designed for users with little or no knowledge of the SAP programming language ABAP.SAP Query offers users a broad range of ways to define reports and create different types of reports such as basic lists, statistics, and ranked lists. ABAP Report--
    A ABAP Report is the one which is used to display the output in the form of list with out any GUI screen.It is less userinteraction. or Reading and displaying data, for example in a list. Obsolete name for an execution program that can only implement reporting
    Report Painter allows you to create reports using data from SAP application components, which you can adapt to meet your individual requirements.
    Many of your reporting requirements can already be met by using the standard reports provided by various SAP application components. If these SAP standard reports do not meet your reporting needs, Report Painter enables you to define your specific reports quickly and easily.
    Report Painter fulfills a function similar to Report Writer, but is easier to use. Most of the functions found in Report Writer have been built into Report Painter; however, you do not need to be familiar with all Report Writer concepts (such as Sets) in order to use Report Painter.
    When executing a Report Painter report, it is displayed by the system in Report Writer format. You thus have access to the same functions as for Report Writer reports defined in the same way, and can combine Report Painter and Report Writer reports together in a report group.
    Report Painter uses a graphical report structure, which forms the basis for your report definition and displays the rows and columns as they appear in the final report output.
    To facilitate report definition, you can use many of the standard reporting objects provided by SAP (such as libraries, row/column models, and standard layouts) in your own specific reports. When you define a Report Painter report you can use groups (sets). You can also enter characteristic values directly.
    Advantages of Report Painter include:
    Flexible and simple report definition
    Report definition without using sets
    Direct layout control: The rows and columns are displayed in the report definition as they appear in the final report output, making test runs unnecessary.
    http://help.sap.com/saphelp_47x200/helpdata/en/56/32e339b62b3011e10000000a11402f/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    thanks
    shankar
    reward me if usefull

  • Hi All,Can any provide an example for SAP MEMORY AND ABAP memory

    Hi All,
          Can any provide me an example for SAP MEMORY AND ABAP memory.
    thanks&regards.
    Bharat.

    HI Bharat
    A simple example of ABAP memory is using the EXPORT/IMPORT statements.
    Here in this program, I get the data, export it to memory,
    clear out the internal table in my progam, then reimport the data into it and write out the data.
    You probably wounldn't do this in a normal program,
    but this is how you can pass data from program a to program b when A Submits program B.
    report zxy_0002 .
    data: it001 type table of t001 with header line.
    select * into table it001 from t001.
    export it001 = it001 to memory id 'ZXY_TEST'.
    clear it001. refresh it001.
    import it001 = it001 from memory id 'ZXY_TEST'.
    loop at it001.
    write:/ it001-bukrs, it001-butxt.
    endloop.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access.
    You can use SAP memory either to pass data from one program to another within a session,
    or to pass data from one session to another.
    Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters).
    These parameters can be set either for a particular user
    or for a particular program using the SET PARAMETER statement.
    Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement.
    The most frequent use of SPA/GPA parameters is to fill input fields on screens
    ABAP/4 Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access
    using the EXPORT and IMPORT statements.
    Data within this area remains intact during a whole sequence of program calls. To pass data
    to a program which you are calling,
    the data needs to be placed in ABAP memory before the call is made.
    The internal session of the called program then replaces that of the calling program.
    The program called can then read from the ABAP memory.
    If control is then returned to the program which made the initial call, the same process operates in reverse.
    SAP memory
    The SAP memory, otherwise known as the global memory,
    is available to a user during the entire duration of a terminal session.
    Its contents are retained across transaction boundaries as well as external and internal sessions.
    The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.
    ABAP/4 memory
    The contents of the ABAP/4 memory are retained only during the lifetime of an external session
    (see also Organization of Modularization Units).
    You can retain or pass data across internal sessions.
    The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.
    ABAP Memmory & SAP Memmory
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Set
    http://www.geocities.com/SiliconValley/Campus/6345/set_para.htm
    GET
    http://www.geocities.com/SiliconValley/Campus/6345/get_para.htm
    EXPORT
    http://www.geocities.com/SiliconValley/Campus/6345/export01.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/frameset.htm
    Other Imp Help
    http://www.geocities.com/SiliconValley/Campus/6345/abapindx.htm
    Regards Rk

  • I  Need some standard report

    I need some standard reports regarding Purchage Data Analysis Report and Open Sales order report .
    Thanks & Regards
    Satish Patnaik

    Hi,
    Check the following links:
    http://sap-img.com/abap/make-e-mail-sender-of-po-the-po-creators-name.htm
    http://sap-img.com/abap/sending-mail-when-the-purchase-order-is-released.htm
    Regards,
    Naresh

  • I need the one report in oracle bam

    i need the one report in oracle bam, My report requirement is show the employee name and employee name count from employee data object.
    below i have mentioned the format of report,
    Example :
    Employee_name Employee_name_count
    Ravi 25
    Ragul 50
    Ramesh 100
    Siva 75
    <null> 50 -----> incase have the null value in employee name column,
    need to disply null count also
    total 300
    Notes:
    i) Column heading is important
    ii) Need to display the employee name and employee name count (same column used to display)
    iii) Null count also important.
    iv) total count also important
    So kindly tell me which report format or chart format sutiable for this above scenario.
    Thanks in advance

    You can use Summary crosstab view of BAM for your requirement.
    Here are the steps that -
    1) I am assming a data object with two fields -
    name count
    pravin 25
    pravin1 50
    null 20
    2) In BAM ActiveStudio web apps, create a new report, selected Summary crosstab view type.
    3) In View editor, select the data object created in step 1
    4) In Choose Fields step, select the rows (here name )and values (here count)
    5) In Summary step, select teh Values as count, summary function as Sum
    6) Next and Finish.
    If this answer satisfies your query, please close this thread as answered.

  • Difference between Reports in normal ABAP and Reports in CRM

    Hi Experts,
    I am new to CRM. Can someone tell me the Difference between Reports in normal ABAP and Reports in CRM.
    It will be very useful if someone explains with example.
    Some where in SDN i read in CRM we should not select statment. Then how to fetch data?
    Please give me more basic concepts about CRM programming.
    Thanks,
    RAGU

    Hi Ragu,
    You can find much information at http://service.sap.com/crm-inst.
    Go to Installation & Upgrade Guides -> SAP Business Suite Applications -> SAP CRM
    Check the CRM version in which you are working and get the documents.
    FMs are specific to the requirement. Like all Business Partner related FMs generally start with BUPA* or BAPI_BUPA*.
    For CRM transaction data you can get info using FM CRM_ORDER_READ. To create a new transaction use CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE.
    More information can be fetched by surfing through the SDN threads and checking in SE37 t-code.
    Hope this helps!
    Regards,
    Saumya

  • Need Matrix Style Report...

    I need to create a matrix style report. There is a template for matrix reports in Oracle Report Writer, but not in APEX. My report should have a list of countries going down and a list of species going across with data showing how many for each country, each species.
    Example of report:
    Species Pollack Whiting Tuna
    Country
    China 5 6 10
    Chile 1 2 1
    Japan 4 4 8
    How do I build this?

    Is this in Oracle 11g?? If so, you could use the pivot function in your sql to build the output data..
    http://technology.amis.nl/blog/1207/dynamic-sql-pivoting-stealing-antons-thunder
    Also threads in APEX forum dealing with this:
    How to create a matrix report
    Thank you,
    Tony Miller
    Webster, TX

  • Examples for SAP Memory and ABAP Memory

    Hi all,
        can u give me one example of sap memory and abap memory.
                                              Ranjith

    Hi,
    <b>SAP Memory</b>
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program at the time of logon using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens .
    <b>example:</b>
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    <b>ABAP Memory</b>
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this memory area remains throughout a sequence of program calls, with the exception of LEAVE TO TRANSACTION. To pass data to a program that you are calling, the data needs to be placed in ABAP memory before the call is made from the internal calling session using the EXPORT statement. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory using the IMPORT statement. If control is then returned to the program that made the initial call, the same procedure operates in reverse.If a transaction is called using LEAVE TO TRANSACTION, the ABAP memory and the call stack are deleted. They cannot be used for data transfer.
    Since objects belonging to ABAP objects can only be accessed within an internal session, it does not make sense and is therefore forbidden (from a syntax point of view) to pass a reference to an object to a calling program through the ABAP memory.
    <b>Example:</b>
    Export hello to memory id 'Hello_world'.
    Import hello from memory id 'Hello_world'
    Regards
    Sudheer

  • What is Report Writer in Abap ?

    What is Report Writer in Abap ?
    How we can write a simple report through report writer .
    It's Tcode , How to proceed ?
    I developed several report through ABAP , but i have no clue about Report Writer .
    What is advantage to using it .
    Plz give some Example .
    Regards : rajneesh

    Hi,
       see the help
    http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7dc143c211d182b30000e829fbfe/frameset.htm
    Regards
    Kiran Sure

Maybe you are looking for

  • How to view individual art board in Bridge CS4?

    Hi. Can somebody tell me how to configure the Adobe Bridge CS4 so that it shows/views/displays individual art boards (that I can scroll thru) and NOT the whole *.ai file (which contains ALL the art boards)? I want to preview the individual art boards

  • Quick Drop-Down Question

    I've got a CSS drop-down menu... All is functioning well, EXCEPT: I'd like users to be able to click on the main menu items to go directly to pages. In other words, user can mouse over "About" to make the submenu appear, or click on "about" to go dir

  • Material staging in production with IM and WM storage locations

    Hello, I have the following situation at hand in a Client. They use Process Orders and want to do material staging of the components. The Production Supply área is an IM managed storage location but the storage location of the components is WM manage

  • WebDynPro Application Need Help.

    Hi Gurus, Our developers have developed a WebDynPro application.We needed to make it available through internet.The first step was to enable the HTTPS protocol on the server which we did  successfully. We imported the SSL certificate and enable HTTPS

  • What is the shortcut to make this: \

    What is the shortcut to make this: \   ???