Skip to Content
author's profile photo Former Member
Former Member

analysis report urgent

can any get me code

interactive sales performance analysis report, comparing performance of sales in a sales organization over a user specified date range.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 06:26 AM

    hi,

    check weather upto what extent it is useful for you,

    Shipping Location - Plant VBAP-WERKS

    Order Number VBAK-VBELN

    Order Amount VBAP-NETWR

    Order Base quantity VBEP-LMENG

    Scheduled Ship Date VBEP-EDATU

    Customer Name KNA1-NAME1

    Customer City KNA1-ORT01

    Customer State KNA1-REGIO

    Customer Country KNA1-LAND1

    Material VBAP-MATNR

    Material Description VBAP-ARKTX

    REPORT ZDOR1 .

    Tables declaration ****************************

    tables : vbak,

    vbap,

    vbep,

    vbfa,

    kna1,

    vbpa.

    variable Declaration ********************

    data : int type f,

    int1 type f,

    s type f value '0.574'.

    data : x type i,

    y type i.

    Internal table declaration ***************

    data : begin of itab occurs 0,

    vbeln like vbak-vbeln,

    kunnr like vbak-kunnr,

    werks like vbap-werks,

    netwr like vbap-netwr,

    matnr like vbap-matnr,

    arktx like vbap-arktx,

    lmeng like vbep-lmeng,

    edatu like vbep-edatu,

    name1 like kna1-name1,

    ort01 like kna1-ort01,

    regio like kna1-regio,

    land1 like kna1-land1,

    erdat like vbfa-erdat,

    avg type f,

    end of itab.

    Selection Screen **************************

    selection-screen : begin of block blk1 with frame title text-001.

    select-options :

    s_vbeln for vbak-vbeln,

    s_vkorg for vbak-vkorg,

    s_kunnr for vbak-kunnr,

    s_werks for vbap-werks,

    s_auart for vbak-auart.

    parameters :

    fdate like sy-datum obligatory,

    tdate like sy-datum default sy-datum obligatory.

    selection-screen : end of block blk1.

    selection-screen : begin of block blk2 with frame no intervals.

    parameters : p_excel as checkbox,

    p_title as checkbox.

    selection-screen : end of block blk2.

    Event Processing **********************

    initialization.

    fdate = tdate - 365.

    s_vkorg-sign = 'I'.

    s_vkorg-option = 'EQ'.

    s_vkorg-low = '2022'.

    append s_vkorg.

    s_vkorg-low = '2024'.

    append s_vkorg.

    s_vkorg-low = '2114'.y

    append s_vkorg.

    s_auart-sign = 'I'.

    s_auart-option = 'EQ'.

    s_auart-low = 'OR'.

    append s_auart.

    s_auart-low = 'TA'.

    append s_auart.

    s_auart-low = 'ZXD'.

    append s_auart.

    s_auart-low = 'KB'.

    append s_auart.

    s_auart-low = 'KE'.

    append s_auart.

    disply the report header *************************

    top-of-page.

    if p_title = ' '.

    write : /001 ' report:', sy-repid,

    115 ' Date :', sy-datum.

    write : /001 ' System :',sy-sysid(3),sy-mandt,

    115 'page :',sy-pagno.

    skip.

    write :/ 'From date :', fdate, 'To Date :', tdate.

    Uline.

    skip.

    endif.

    if p_excel = ' '.

    write : /1 text-002,

    10 text-003,

    20 text-004,

    40 text-005,

    60 text-006,

    80 text-007,

    115 text-008,

    130 text-009,

    140 text-010,

    145 text-011,

    160 text-012,

    200 text-013,

    220 text-014.

    Uline.

    else.

    write : /1 text-002,

    10 text-003,

    20 text-004,

    40 text-005,

    60 text-006,

    80 text-007,

    115 text-008,

    130 text-009,

    140 text-010,

    145 text-011,

    160 text-012,

    200 text-013,

    220 text-014.

    Uline.

    endif.

    Start-of-selection **********************

    start-of-selection.

    if p_excel = ' '.

    new-page line-size 132 line-count 65.

    else.

    new-page line-size 260 line-count 999999.

    endif.

    perform get_sales_data.

    perform get_output_data.

    get_sales_data *************************

    form get_sales_data.

    select vbak~vbeln

    vbak~kunnr

    vbap~werks

    vbap~netwr

    vbap~matnr

    vbap~arktx

    into table itab

    from vbak as vbak inner join vbap as vbap

    on vbak~vbeln = vbap~vbeln

    where vbak~vbeln in s_vbeln

    and vbak~vkorg in s_vkorg

    and vbak~kunnr in s_kunnr

    and vbak~auart in s_auart

    and vbap~werks in s_werks

    and vbak~erdat between fdate and tdate.

    loop at itab.

    select single edatu lmeng from vbep into (itab-edatu,itab-lmeng)

    where vbeln = itab-vbeln.

    select single name1 ort01 regio land1 from kna1 into

    (itab-name1,itab-ort01,itab-regio,itab-land1)

    where kunnr = itab-kunnr.

    select single erdat from vbfa into itab-erdat

    where vbeln = itab-vbeln

    and vbtyp_n = 'R'

    and vbtyp_v = 'C'.

    modify itab.

    endloop.

    loop at itab.

    move itab-netwr to x.

    move itab-lmeng to y.

    if ( y 0 ).

    int = x / y.

    int1 = int * s.

    move int1 to itab-avg.

    else.

    move 0 to itab-avg.

    endif.

    move x to itab-netwr.

    move y to itab-lmeng.

    modify itab.

    endloop.

    endform. "get_sales_data

    get_output_data ***********************

    form get_output_data.

    loop at itab.

    if P_excel = ''.

    write : /(4) itab-werks under text-002,

    itab-vbeln under text-003,

    itab-netwr under text-004,

    itab-lmeng under text-005,

    itab-edatu under text-006,

    itab-name1 under text-007,

    itab-ort01 under text-008,

    itab-regio under text-009,

    itab-land1 under text-010,

    itab-arktx under text-011,

    itab-matnr under text-012,

    itab-avg under text-013,

    itab-erdat under text-014.

    else.

    write : / itab-werks under text-002,

    itab-vbeln under text-003,

    itab-netwr under text-004,

    itab-lmeng under text-005,

    itab-edatu under text-006,

    itab-name1 under text-007,

    itab-ort01 under text-008,

    itab-regio under text-009,

    itab-land1 under text-010,

    itab-arktx under text-011,

    itab-matnr under text-012,

    itab-avg under text-013,

    itab-erdat under text-014.

    endif.

    at end of vbeln.

    sum.

    write : / itab-werks under text-002,

    itab-netwr under text-004,

    itab-lmeng under text-005.

    skip.

    endat.

    endloop.

    endform. "get_output_data

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.