Sample FI Report

Hi
Can any one post sample FI Customised report to test it on my system
Regards
Nanda

Check the report given below:
Report created for displaying the Funds assigned to the funds center for the year.
*& Report  ZFI_ASSIGNED_FUNDS
REPORT  ZFI_ASSIGNED_FUND.
TABLES: FMIT,FMCIT.
TYPE-POOLS: SLIS.
*ALV data declarations
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      FIELDCATALOG1 TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
      GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
      GD_REPID     LIKE SY-REPID.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: RFISTL FOR FMIT-RFISTL,
                FIKRS  FOR FMIT-FIKRS,
                RYEAR  FOR FMIT-RYEAR.
SELECTION-SCREEN END OF BLOCK B1.
DATA: BEGIN OF IT_FMIT OCCURS 0,
        RYEAR LIKE FMIT-RYEAR,
        FIKRS LIKE FMIT-FIKRS,
        RFISTL LIKE ZREV_BUDGET-KOSTL,
        RFIPEX LIKE ZREV_BUDGET-KSTAR,
        TSL01 LIKE FMIT-TSL01,
        TSL02 LIKE FMIT-TSL02,
        TSL03 LIKE FMIT-TSL03,
        TSL04 LIKE FMIT-TSL04,
        TSL05 LIKE FMIT-TSL05,
        TSL06 LIKE FMIT-TSL06,
        TSL07 LIKE FMIT-TSL07,
        TSL08 LIKE FMIT-TSL08,
        TSL09 LIKE FMIT-TSL09,
        TSL10 LIKE FMIT-TSL10,
        TSL11 LIKE FMIT-TSL11,
        TSL12 LIKE FMIT-TSL12,
        TSL13 LIKE FMIT-TSL13,
        TSL14 LIKE FMIT-TSL14,
        TSL15 LIKE FMIT-TSL15,
        TSL16 LIKE FMIT-TSL16,
     END OF IT_FMIT.
DATA: BEGIN OF IT_FMIT1 OCCURS 0,
        RYEAR LIKE FMIT-RYEAR,
        FIKRS LIKE FMIT-FIKRS,
        RFISTL LIKE ZREV_BUDGET-KOSTL,
        RFIPEX LIKE ZREV_BUDGET-KSTAR,
        TOTAL LIKE FMIT-TSL01,
     END OF IT_FMIT1.
DATA : BEGIN OF IT_BUDGET OCCURS 0,
         GJAHR LIKE ZREV_BUDGET-GJAHR,
         KOSTL LIKE ZREV_BUDGET-KOSTL,             " COST CENTER
         KSTAR LIKE ZREV_BUDGET-KSTAR,
         APR_B LIKE ZREV_BUDGET-APR_B,
         MAY_B LIKE ZREV_BUDGET-MAY_B,
         JUN_B LIKE ZREV_BUDGET-JUN_B,
         JUL_B LIKE ZREV_BUDGET-JUL_B,
         AUG_B LIKE ZREV_BUDGET-AUG_B,
         SEP_B LIKE ZREV_BUDGET-SEP_B,
         OCT_B LIKE ZREV_BUDGET-OCT_B,
         NOV_B LIKE ZREV_BUDGET-NOV_B,
         DEC_B LIKE ZREV_BUDGET-DEC_B,
         JAN_B LIKE ZREV_BUDGET-JAN_B,
         FEB_B LIKE ZREV_BUDGET-FEB_B,
         MAR_B LIKE ZREV_BUDGET-MAR_B,
     END OF IT_BUDGET.
DATA : BEGIN OF IT_BUDGET1 OCCURS 0,
         GJAHR LIKE ZREV_BUDGET-GJAHR,
         KOSTL LIKE ZREV_BUDGET-KOSTL,             " COST CENTER
         KSTAR LIKE ZREV_BUDGET-KSTAR,
         TOTAL1 LIKE FMIT-TSL01,
       END OF IT_BUDGET1.
DATA: BEGIN OF IT_FINAL OCCURS 0,
       FIKRS LIKE FMIT-FIKRS,
       RFISTL LIKE FMIT-RFISTL,
       RFIPEX LIKE FMIT-RFIPEX,
       TEXT LIKE FMCIT-TEXT1,
       ALLOC LIKE FMIT-TSL16,
       USED LIKE FMIT-TSL16,
       REMAIN LIKE FMIT-TSL16,
     END OF IT_FINAL.
*START-OF-SELECTION
START-OF-SELECTION.
  PERFORM GET_DATA.
  PERFORM PROCESS_DATA.
  PERFORM BUILD_FIELDCATALOG.
  PERFORM BUILD_LAYOUT.
  PERFORM DISPLAY_ALV_REPORT.
*&      Form  GET_DATA
*       text
*  -->  p1        text
*  <--  p2        text
FORM GET_DATA .
  SELECT RYEAR
         FIKRS
         RFISTL
         RFIPEX
         TSL01
         TSL02
         TSL03
         TSL04
         TSL05
         TSL06
         TSL07
         TSL08
         TSL09
         TSL10
         TSL11
         TSL12
         TSL13
         TSL14
         TSL15
         TSL16
         INTO TABLE IT_FMIT FROM FMIT
         WHERE RYEAR IN RYEAR
         AND   FIKRS IN FIKRS
         AND   RFISTL IN RFISTL.
  LOOP AT IT_FMIT.
    MOVE-CORRESPONDING IT_FMIT TO IT_FMIT1.
    IT_FMIT1-TOTAL = IT_FMIT-TSL01 + IT_FMIT-TSL02 + IT_FMIT-TSL03 + IT_FMIT-TSL04 + IT_FMIT-TSL05 + IT_FMIT-TSL06 + IT_FMIT-TSL07
                     + IT_FMIT-TSL08 + IT_FMIT-TSL09 + IT_FMIT-TSL10 + IT_FMIT-TSL11 + IT_FMIT-TSL12 + IT_FMIT-TSL13.
    IT_FMIT1-TOTAL = IT_FMIT1-TOTAL * -1 .
    COLLECT IT_FMIT1.
  ENDLOOP.
  LOOP AT IT_FMIT1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT  = IT_FMIT1-RFISTL
      IMPORTING
        OUTPUT = IT_FMIT1-RFISTL.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT  = IT_FMIT1-RFIPEX
      IMPORTING
        OUTPUT = IT_FMIT1-RFIPEX.
    MODIFY IT_FMIT1.
  ENDLOOP.
  SELECT   GJAHR
           KOSTL
           KSTAR
           APR_B
           MAY_B
           JUN_B
           JUL_B
           AUG_B
           SEP_B
           OCT_B
           NOV_B
           DEC_B
           JAN_B
           FEB_B
           MAR_B
           INTO TABLE IT_BUDGET FROM ZREV_BUDGET
           FOR ALL ENTRIES IN IT_FMIT1
           WHERE GJAHR IN RYEAR
           AND   KOSTL EQ IT_FMIT1-RFISTL
           AND KSTAR  EQ IT_FMIT1-RFIPEX.
  LOOP AT IT_BUDGET.
    MOVE-CORRESPONDING IT_BUDGET TO IT_BUDGET1.
    IT_BUDGET1-TOTAL1 = IT_BUDGET-APR_B + IT_BUDGET-MAY_B + IT_BUDGET-JUN_B + IT_BUDGET-JUL_B + IT_BUDGET-AUG_B
                        + IT_BUDGET-SEP_B + IT_BUDGET-OCT_B + IT_BUDGET-NOV_B + IT_BUDGET-DEC_B + IT_BUDGET-JAN_B +
                        IT_BUDGET-FEB_B + IT_BUDGET-MAR_B.
    IT_BUDGET1-TOTAL1 = IT_BUDGET1-TOTAL1 * 100000.
    COLLECT IT_BUDGET1.
  ENDLOOP.
ENDFORM.                    " GET_DATA
*&      Form  PROCESS_DATA
*       text
*  -->  p1        text
*  <--  p2        text
FORM PROCESS_DATA .
  LOOP AT IT_FMIT1.
    IT_FINAL-FIKRS =  IT_FMIT1-FIKRS.
    IT_FINAL-RFISTL = IT_FMIT1-RFISTL.
    IT_FINAL-RFIPEX = IT_FMIT1-RFIPEX.
    IT_FINAL-USED   = IT_FMIT1-TOTAL.
    READ TABLE IT_BUDGET1 WITH KEY KOSTL = IT_FMIT1-RFISTL KSTAR = IT_FMIT1-RFIPEX.
    IF SY-SUBRC EQ 0.
            IT_FINAL-ALLOC   = IT_BUDGET1-TOTAL1.
    ENDIF.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        INPUT  = IT_FMIT1-RFIPEX
      IMPORTING
        OUTPUT = IT_FMIT1-RFIPEX.
    SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                      AND   FIPEX EQ  IT_FMIT1-RFIPEX.
    IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
    APPEND IT_FINAL.
CLEAR IT_FINAL.
  ENDLOOP.
ENDFORM.                    " PROCESS_DATA
*&      Form  BUILD_FIELDCATALOG
*       text
*  -->  p1        text
*  <--  p2        text
FORM BUILD_FIELDCATALOG .
  FIELDCATALOG-FIELDNAME   = 'FIKRS'.
  FIELDCATALOG-SELTEXT_M   = 'Functional Mng Area'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'RFISTL'.
  FIELDCATALOG-SELTEXT_M   = 'Fund Center'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'RFIPEX'.
  FIELDCATALOG-SELTEXT_M   = 'Commitment Item'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'TEXT'.
  FIELDCATALOG-SELTEXT_M   = 'Commitment Item Text'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'ALLOC'.
  FIELDCATALOG-SELTEXT_M   = 'Allocated Budget'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'USED'.
  FIELDCATALOG-SELTEXT_M   = 'Used Budget'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
  FIELDCATALOG-FIELDNAME   = 'REMAIN'.
  FIELDCATALOG-SELTEXT_M   = 'Remaining Budget'.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
ENDFORM.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT
*       text
*  -->  p1        text
*  <--  p2        text
FORM BUILD_LAYOUT .
  GD_LAYOUT-NO_INPUT          = 'X'.
  GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
ENDFORM.                    " BUILD_LAYOUT
*&      Form  DISPLAY_ALV_REPORT
*       text
*  -->  p1        text
*  <--  p2        text
FORM DISPLAY_ALV_REPORT .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = GD_REPID
      IS_LAYOUT          = GD_LAYOUT
      IT_FIELDCAT        = FIELDCATALOG[]
      I_SAVE             = 'X'
    TABLES
      T_OUTTAB           = IT_FINAL
    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.                    " DISPLAY_ALV_REPORT
Regards.

Similar Messages

  • Sample Ageing Report in XL Reporter

    Hi
    Does anyone have a copy of a sample ageing report that has been created in XL reporter?

    Hi,
    Seems that noone in this forum can answer your question. Maybe this is related to the fact that the main focus here is the SAP Business One SDK?
    In case the question is still open:
    I would recommend that you try these forums - which should fit better:
    For SAP partners only there's a forum where you can discuss implementation questions etc.:
    Got a question about customization / implementation? Maybe ask it in CPSN!
    ...and here's the SAP Business One Forum in the "SAP Community" (public to anybody):
    Re: Got a question about customization / implementation? Maybe ask it in CPSN!
    ...or you might try your luck with SAP Support?
    HTH

  • Example "sample test report" doesn't run - Error -1073741819

    I am trying to run the "Sample Test Report.vi" example in a totally unmodified version. I receive the message
    "Unknown System Error in Font Style.vi->Set Report Font.vi->Sample Test Report.vi"
    I have some trouble finding where the error occurs exactly. Any ideas?
    Best regards
    Matthias
    Attachments:
    Sample_Test_Report_-_Error.PDF ‏67 KB

    Hi Matthias
    Check this knowledgebase:
    http://digital.ni.com/public.nsf/websearch/5A42F1725790DFBC86256B900075F884?OpenDocument
    Hope this helps
    Luca
    Regards,
    Luca

  • Ask for debugging when customize authorization in the security extension sample of report server

    I have tried the sample of reporting service provide in MSDN
    http://msdn.microsoft.com/en-us/library/ms160724.aspx
    I successfully deploy the sample in my report server. But I want to know what happen in the authorization in order to authorize right to different user login from the login page. I can't debug the class Authorization by attaching aspnet_wp.exe in the process.
    Actually I want to know the value of secDesc, AceStruct ace in each CheckAccess method. But I can't debug in the file Authorization that implement interface IAuthorizationExtension. I try to add some coding in the Authorization class to write  the value of secDesc, AceStruct ace in file. It fails. Create Event log.... it also fail...any other method?

    Hi,
    "secDesc" is the security descriptor, which contains the following information for an item in the report server database:
    The group or user that has some type of permission to perform operations on the item.
    The item's type.
    A discretionary access control list controlling access to the item.
    AceStruct  is an access control entry for a trustee (user, group, or computer) that specifies the operations that a trustee can perform on items in the report server database. You can get a instance of AceStruct by de-serializing “secDesc”
    In addition, when you tried to debug the program, did you follow the steps below.
    Start Visual Studio .NET and open CustomSecurity.sln on your test report server.
    Open Internet Explorer and navigate to Report Manager while leaving the sample code open in Visual Studio.
    Switch to Visual Studio and set some break points in the custom security extension project code.
    With the extension project still the active window, from the Debug menu, click Process.The Processes dialog opens.
    From the list of processes, select the Aspnet_wp.exe process (or W3wp.exe, if your application is deployed on IIS 6.0), and click Attach.
    In the Attach to Process dialog, select the Common Language Runtime program type, and then click OK. For improved debugging performance, make sure that Native is not a selected program type.
    When the sample runs, a logon form appears. Type the user credentials into the logon form and click the Logon button. Whenever your break points are encountered during processing, the debugger should stop execution that point.
    Step through your code using the F11 key.
    Hope this helps.
    Thanks.

  • Want A Sample PayRoll Report

    Hi All Experts,
        I am new to ABAP-HR,I want One Sample PayRoll Report.Thanks in Advance.

    am providing you the e-link :
    http://cma.zdnet.com/book/abap/
    http://cma.zdnet.com/book/abap/index.htm
    http://www.sapdevelopment.co.uk/
    http://www.sap-img.com/
    http://juliet.stfx.ca/people/fac/infosys/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d6/0db357494511d182b70000e829fbfe/frameset.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://www.sapgenie.com/abap/example_code.htm
    http://www.geocities.com/SiliconValley/Campus/6345/abapindx.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://www.sap-img.com/abap-function.htm
    http://www.sapgenie.com/abap/code/abap19.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://help.sap.com/saphelp_40b/helpdata/ru/d6/0dc169494511d182b70000e829fbfe/applet.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    http://www.henrikfrank.dk/abapexamples/index.html
    http://sap.ittoolbox.com/documents/document.asp?i=752
    http://members.aol.com/_ht_a/skarkada/sap/
    http://sappoint.com/abap/
    http://members.tripod.com/abap4/SAP_Functions.html
    http://members.ozemail.com.au/~anmari/sap/index.html
    http://www.planetsap.com/Userexit_List.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.kabai.com/abaps/q.htm
    http://www.planetsap.com/Userexit_List.htm
    http://help.sap.com/saphelp_bw21c/helpdata/en/c4/3a8090505211d189550000e829fbbd/frameset.htm
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm
    http://www.sap-basis-abap.com/index.htm
    http://help.sap.com/saphelp_40b/helpdata/en/fc/eb2c46358411d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/aa/aeb23789e95378e10000009b38f8cf/frameset.htm
    http://www.geocities.com/ResearchTriangle/1635/system.html
    http://www.sapdesignguild.org/resources/MiniSG/3_Managing/3_Functions_Table_Control.htm
    http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm
    http://www.sapfans.com/sapfans/repos/saprep.htm
    http://www.planetsap.com/howdo_a.htm
    http://help.sap.com/saphelp_util464/helpdata/en/69/c2516e4ba111d189750000e8322d00/content.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sap-img.com/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm
    http://www.geocities.com/victorav15/sapr3/abap.html
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://abap4.tripod.com/Other_Useful_Tips.html
    http://help.sap.com/saphelp_45b/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    http://www.sap-basis-abap.com/sapmm.htm
    http://sap.ittoolbox.com/nav/t.asp?t=303&p=448&h1=303&h2=322&h3=448
    http://sapfans.com/
    http://cma.zdnet.com/book/abap/ch03/ch03.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapuk.html
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://www.sapgenie.com/abap/index.htm
    http://www.sap-img.com/abap.htm
    http://www.sapdevelopment.co.uk/tips/tipshome.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://sap.ittoolbox.com/nav/t.asp?t=322&p=322&h1=322
    http://sap.ittoolbox.com/nav/t.asp?t=448&p=448&h1=448
    http://www.thespot4sap.com/
    http://www.kabai.com/abaps/q.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapgenie.com/abap/tips_and_tricks.htm
    http://www.sapassist.com/code/d.asp?whichpage=1&pagesize=10&i=10&a=c&o=&t=&q=&qt=
    For FAQ
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.sapgenie.com/faq/abap.htm
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    Weblog for receive email and processing it through ABAP
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    For Logical database
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    very useful
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Useful link to websites
    http://www.hernangn.com.ar/sap.htm
    Useful for background
    http://www.sappoint.com/basis/bckprsng.pdf
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/08703713bf277ee10000009b38f8cf/frameset.htm
    http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.wbix_adapters.doc/doc/mysap4/sap4x41.htm
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    For posting weblog,
    /people/sap.user72/blog/2005/06/28/sdn-weblogs-making-it-easier
    Dynamic Internal table -weblog in sdn
    /people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
    Smartforms
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    Workflow
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    ALV
    http://www.geocities.com/mpioud/Abap_programs.html
    Mail
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    BOM Explosion
    /people/prakash.singh4/blog/2005/05/15/explode-boms-in-enterprise-portal-using-htmlb-tree--part-1-abap
    BOM
    http://help.sap.com/saphelp_erp2005/helpdata/en/ea/e9b7234c7211d189520000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/d1/2e4114a61711d2b423006094b9d648/frameset.htm
    http://www.sap-img.com/sap-sd/sales-bom-implementation.htm
    http://www.sap-basis-abap.com/sappp007.htm
    OLE
    http://www.sapgenie.com/abap/ole.htm
    http://help.sap.com/saphelp_46c/helpdata/en/59/ae3f2e488f11d189490000e829fbbd/frameset.htm
    ALVGRID with refresh
    http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
    For language setting and decimal separator
    /people/horst.keller/blog/2004/11/16/abap-geek-7-150-babylonian-confusion
    Oracle queries
    http://sqlzoo.net/
    To format SQL
    http://www.sqlinform.com/
    SCOT settings
    http://www.sap-img.com/basis/basis-faq.htm
    Status Icon ALV,Table Control,Tab Strip
    http://www.sapdesignguild.org/resources/MiniSG-old/from_develop/norm_status_icons.htm#positioning_4
    ALV Group Heading
    http://www.sap-img.com/fu037.htm
    For multiMedia
    /people/thomas.jung3/blog/2005/05/11/using-classic-activex-controls-in-the-abap-control-framework
    Uploading LOGO in SAP
    http://www.sap-img.com/ts001.htm
    LSMW
    http://www.sap-img.com/sap-data-migration.htm
    http://www.sapgenie.com/saptech/lsmw.htm
    http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
    http://www.sap.info/public/INT/int/glossary/int/glossaryletter/Word-17643ed1d6d658821_glossary/L#Word-17643ed1d6d658821_glossary
    Here are the two links which contains lots of PDFS:
    http://www.easymarketplace.de/online-pdfs-q-s.php
    http://www.consolut.de/saphelp/sap_online_help.html

  • 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

  • Sample ALV report required for FI module

    Hello friends,
    I am develoing ALV report for FI module for that i need some sample ALV report. If someone have than please send it to me.
    Thanx & Regards,
    Rahul Talele

    HI,
    SEE THE SAMPLE REPORT
                 Fringe Benefit Tax Report
    Program Name            :
    Object ID               :
    Functional Analyst      :
    Programmer              :
    Start date              :
    Initial CTS             :
    Description             : FRINGE Benefit Tax
    Includes                :
    Function Modules        :
    Logical database        :
    Transaction Code        :
    External references     :
                       Modification Log
    Date      | Modified by    | CTS number   | Comments
              |                |              | Initial Version          *
    REPORT  ZFI_FBT NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPE-POOLS: SLIS.
    TYPES : BEGIN OF
      T_BSIS,
              BUKRS TYPE BUKRS,         " Company Code
              HKONT TYPE HKONT,         " General Ledger Account
              GJAHR TYPE GJAHR,
              BELNR TYPE BELNR_D,       " Accounting Document Number
              BUDAT TYPE BUDAT,         " Posting Date in the Document
              BLDAT TYPE BLDAT,         " Document Date in Document
              XBLNR TYPE XBLNR1,        " Reference Document Number
              BSCHL TYPE BSCHL,         " Posting Key
              DMBTR TYPE DMBTR,         " Amount in Local Currency
              AUFNR TYPE AUFNR_NEU,     " Order Number
              NONFBT TYPE DMBTR,        " non fbt amount
              SUBFBT TYPE DMBTR,        " subject to fbt amount
              ZFI_FBT TYPE ZFI_FBT,     " Qualifying amount.
              AMOUNT TYPE DMBTR,
              FBTPAY TYPE DMBTR,
              ZFI_PAY TYPE ZFI_PAY,
            END OF T_BSIS,
            T_IT_BSIS TYPE STANDARD TABLE OF T_BSIS.
    TYPES : BEGIN OF T_FRINGE,
               ZFI_HKONT TYPE HKONT,
               ZFI_FBT TYPE ZFI_FBT,
               ZFI_PAY TYPE ZFI_PAY,
            END OF T_FRINGE,
            T_IT_FRINGE TYPE STANDARD TABLE OF T_FRINGE.
    DATA  : GIT_FRINGE TYPE T_IT_FRINGE,
            GWA_FRINGE TYPE T_FRINGE.
    DATA  : GIT_BSIS TYPE T_IT_BSIS,
            GWA_BSIS TYPE T_BSIS.
    DATA  : G_HKONT TYPE HKONT,
            G_BUDAT TYPE BUDAT,
            G_AUFNR TYPE AUFNR_NEU.
    FIELD-SYMBOLS : <BSIS> TYPE T_BSIS.
    DATA : G_REPID TYPE SY-REPID,
           GIT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           GWA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           GT_SORT TYPE SLIS_T_SORTINFO_ALV,
           GT_EVENTS TYPE SLIS_T_EVENT,
           GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
           GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
    GS_LAYOUT-ZEBRA = 'X'.
    GS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    CONSTANTS : C_50(2) TYPE C VALUE '50'.
      SELECTION SCREEN DEFINITIONS
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS     : P_BUKRS TYPE BUKRS DEFAULT 'H901' OBLIGATORY.
    SELECT-OPTIONS : S_HKONT FOR G_HKONT,
                     S_BUDAT FOR G_BUDAT.
    *PARAMETERS     : P_AUFNR TYPE AUFNR_NEU DEFAULT '000000100001' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
      EVENTS
      INITIALIZATION.
    INITIALIZATION.
      G_REPID = SY-REPID.
      AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
      PERFORM GET_ZTABLE.         " get data from ZFII_FRINGE table
      START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM GET_DATA.           "  get data from BSIS table
      IF NOT GIT_BSIS IS INITIAL.
        PERFORM GET_PERCENTAGE.   " to get the percentages from table ZFII_FRINGE
        PERFORM CHK4_INTERNAL.    " checking for the posting key wheather th document is reversed
        " and checking wheather internal order is FBT or non-FBT
      ENDIF.
      END-OF-SELECTION.
    END-OF-SELECTION.
      IF NOT GIT_BSIS IS INITIAL.
        PERFORM DISPLAY.        " display ALV GRID display
      ENDIF.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
      SELECT
             BUKRS
             HKONT
             GJAHR
             BELNR
             BUDAT
             BLDAT
             XBLNR
             BSCHL
             DMBTR
             AUFNR FROM BSIS
                   INTO TABLE GIT_BSIS
                   WHERE BUKRS EQ P_BUKRS AND
                         HKONT IN S_HKONT AND
                         BUDAT IN S_BUDAT.
      IF SY-SUBRC NE 0.
        MESSAGE I000(ZFI) WITH 'No data exist'.
        EXIT.
      ENDIF.
    ENDFORM.                    " get_data
    *&      Form  display
    FORM DISPLAY .
      PERFORM BUILD_FIELD_CATALOUGE.
      PERFORM GET_EVENTS.
      PERFORM DETERMINE_SORT_SEQUENCE.
      PERFORM SUB_COMMENTERY_BUILD.
      PERFORM ALV_DISPLAY.
    ENDFORM.                    " display
    *&      Form  build_field_catalouge
    FORM BUILD_FIELD_CATALOUGE.
      DATA : L_POS TYPE I.
      L_POS = 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'HKONT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '10'            " Output Length
                                       'GL Account'  " Column Name Text
                                       ' '             " Datatype
                                       'X'             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       ' '.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'BELNR'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '10'            " Output Length
                                       'Document No.'  " Column Name Text
                                       ' '             " Datatype
                                       'X'             " Key?
                                       '1'             " Row Position
                                       'X'             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       ' '.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'BUDAT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '10'             " Output Length
                                       'Posting Date'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       ' '.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'BLDAT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '10'             " Output Length
                                       'Docu. Date'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       ' '.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'XBLNR'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '16'             " Output Length
                                       'Ref. Doc. Number'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'DMBTR'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '16'             " Output Length
                                       'Gross Amount'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'SUBFBT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '16'             " Output Length
                                       'FBT Amount'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'NONFBT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '16'             " Output Length
                                       'Non FBT Amount'             " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'ZFI_FBT'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '12'            " Output Length
                                       'Percentage'    " Column Name Text
                                       ' '              " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       ' '.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'AMOUNT'        " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '16'            " Output Length
                                       'Qualifying Amount'  " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
      L_POS = L_POS + 1 .
      PERFORM INIT_FIELD_CATALOG USING GIT_FIELDCAT[]  " Field Catalog
                                        L_POS          " Column Position
                                       'FBTPAY'         " InTab Field Name
                                       'GIT_BSIS'      " InTab Name
                                       '12'            " Output Length
                                       'FBT payable'   " Column Name Text
                                       ' '             " Datatype
                                       ' '             " Key?
                                       '1'             " Row Position
                                       ' '             " Hotspot
                                       ' '             " Emphasize
                                       ' '             " key_sel
                                       ' '             " justification
                                       'X'.            " Sum field?
    ENDFORM.                    " build_field_catalouge
    *&      Form  init_field_catalog
          text
    FORM INIT_FIELD_CATALOG  USING    P_GIT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV
                                      PV_POS       LIKE GWA_FIELDCAT-COL_POS
                                      PV_FIELDNAME LIKE GWA_FIELDCAT-FIELDNAME
                                      PV_TABNAME   LIKE GWA_FIELDCAT-TABNAME
                                      PV_OUTPUT    LIKE GWA_FIELDCAT-OUTPUTLEN
                                      PV_SELTEXT   LIKE GWA_FIELDCAT-SELTEXT_M
                                      PV_DATATYPE  LIKE GWA_FIELDCAT-DATATYPE
                                      PV_KEY       LIKE GWA_FIELDCAT-KEY
                                      PV_ROW       LIKE GWA_FIELDCAT-ROW_POS
                                      PV_HOTSPOT   LIKE GWA_FIELDCAT-HOTSPOT
                                      PV_EMPHASIZE LIKE GWA_FIELDCAT-EMPHASIZE
                                      PV_KEY_SEL   LIKE GWA_FIELDCAT-KEY_SEL
                                      PV_JUST      LIKE GWA_FIELDCAT-JUST
                                      PV_SUM       LIKE GWA_FIELDCAT-DO_SUM.
      DATA:  LT_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      LT_FIELDCAT-OUTPUTLEN     = PV_OUTPUT.
      LT_FIELDCAT-COL_POS       = PV_POS.
      LT_FIELDCAT-FIELDNAME     = PV_FIELDNAME.
      LT_FIELDCAT-TABNAME       = PV_TABNAME.
      LT_FIELDCAT-SELTEXT_M     = PV_SELTEXT.
      LT_FIELDCAT-KEY           = PV_KEY.
      LT_FIELDCAT-ROW_POS       = PV_ROW.
      LT_FIELDCAT-HOTSPOT       = PV_HOTSPOT.
      LT_FIELDCAT-EMPHASIZE     = PV_EMPHASIZE.
      LT_FIELDCAT-KEY_SEL       = PV_KEY_SEL.
      LT_FIELDCAT-DO_SUM        = PV_SUM.
      LT_FIELDCAT-JUST          = PV_JUST.
      LT_FIELDCAT-DATATYPE      = PV_DATATYPE.
      APPEND LT_FIELDCAT TO  P_GIT_FIELDCAT.
      CLEAR  LT_FIELDCAT.
    ENDFORM.                    " init_field_catalog
    *&      Form  alv_display
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = G_REPID
         I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        I_CALLBACK_TOP_OF_PAGE            = ' '
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        i_grid_title                      = 'Fringe Benefit Tax'
        I_GRID_SETTINGS                   =
         IS_LAYOUT                         = GS_LAYOUT
          IT_FIELDCAT                       = GIT_FIELDCAT
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
         IT_SORT                           = GT_SORT
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
         IT_EVENTS                         = GT_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                          = GIT_BSIS
       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.                    " alv_display
    *&      Form  chk4_internal
          text
    -->  p1        text
    <--  p2        text
    FORM CHK4_INTERNAL .
      LOOP AT GIT_BSIS ASSIGNING <BSIS>.
        IF <BSIS> IS ASSIGNED.
          IF  <BSIS>-BSCHL = C_50.
            <BSIS>-DMBTR = <BSIS>-DMBTR * -1.
          ENDIF.
       IF NOT <bsis>-aufnr IS INITIAL.
          IF <BSIS>-AUFNR = '000000100000'.         "    P_AUFNR.
            <BSIS>-SUBFBT = <BSIS>-DMBTR.
            <BSIS>-AMOUNT = ( <BSIS>-SUBFBT * <BSIS>-ZFI_FBT ) / 100.
          ELSE.
           IF <bsis>-aufnr = '000000100020'.
            <BSIS>-NONFBT = <BSIS>-DMBTR.
          ENDIF.
       ENDIF.
          <BSIS>-FBTPAY = ( <BSIS>-AMOUNT * <BSIS>-ZFI_PAY ) / 100.
        ENDIF.
      ENDLOOP.
      UNASSIGN <BSIS>.
    ENDFORM.                    " chk4_internal
    *&      Form  get_ztable
          text
    -->  p1        text
    <--  p2        text
    FORM GET_ZTABLE .
      REFRESH : GIT_FRINGE.
      SELECT   HKONT
               ZFI_FBT
               ZFI_PAY
                       FROM ZFI_FBT_DETL
                       INTO TABLE GIT_FRINGE
                     FOR ALL ENTRIES IN s_hkont
                       WHERE HKONT IN S_HKONT.
      CHECK SY-SUBRC EQ 0.
      SORT GIT_FRINGE BY ZFI_HKONT.
    ENDFORM.                    " get_ztable
    *&      Form  get_percentage
          text
    -->  p1        text
    <--  p2        text
    FORM GET_PERCENTAGE .
      CLEAR : GWA_FRINGE.
      LOOP AT GIT_BSIS ASSIGNING <BSIS>.
        IF <BSIS> IS ASSIGNED.
          READ TABLE GIT_FRINGE INTO GWA_FRINGE WITH KEY
                                                       ZFI_HKONT = <BSIS>-HKONT
                                                       BINARY SEARCH.
          CHECK SY-SUBRC EQ 0.
          <BSIS>-ZFI_FBT = GWA_FRINGE-ZFI_FBT.
          <BSIS>-ZFI_PAY = GWA_FRINGE-ZFI_PAY.
        ENDIF.
      ENDLOOP.
      UNASSIGN <BSIS>.
    ENDFORM.                    " get_percentage
    *&      Form  determine_sort_sequence
          text
    -->  p1        text
    <--  p2        text
    FORM DETERMINE_SORT_SEQUENCE .
      DATA : LS_SORT TYPE SLIS_SORTINFO_ALV.
      LS_SORT-SPOS = 1.                           " Sort order
      LS_SORT-FIELDNAME = 'HKONT'.
      LS_SORT-TABNAME = 'GIT_BSIS'.
      LS_SORT-UP = 'X'.
      LS_SORT-SUBTOT = 'X'.                      " Sub total allowed
      APPEND LS_SORT TO GT_SORT.
      CLEAR LS_SORT.
    ENDFORM.                    " determine_sort_sequence
    *&      Form  get_events
          text
    -->  p1        text
    <--  p2        text
    FORM GET_EVENTS .
      CONSTANTS:
      GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
      GC_FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = GT_EVENTS.
      READ TABLE GT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO GT_EVENTS.
      ENDIF.
      READ TABLE GT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_USER_COMMAND TO LS_EVENT-FORM.
        APPEND LS_EVENT TO GT_EVENTS.
      ENDIF.
    ENDFORM.                    " get_events
    *&      Form  sub_commentery_build
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_COMMENTERY_BUILD .
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
      DATA : L_LOW  TYPE CHAR10,
            L_HIGH TYPE CHAR10,
            L_DATE TYPE CHAR25.
      CONCATENATE S_BUDAT-LOW6(2) '.' S_BUDAT-LOW4(2) '.' S_BUDAT-LOW+0(4) INTO  L_LOW.
      CONCATENATE S_BUDAT-HIGH6(2) '.' S_BUDAT-HIGH4(2) '.' S_BUDAT-HIGH+0(4) INTO  L_HIGH.
      CONCATENATE L_LOW  ' - ' L_HIGH INTO L_DATE.
    ***header
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'H'.
    LS_LINE-KEY: not used for this type
      LS_LINE-INFO = 'Fringe Benefit Tax'.
      APPEND LS_LINE TO GT_LIST_TOP_OF_PAGE.
    ***Selection
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Company Code'.
      LS_LINE-INFO = P_BUKRS.
      APPEND LS_LINE TO GT_LIST_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Posting Date'.
      LS_LINE-INFO = L_DATE.
      APPEND LS_LINE TO GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    " sub_commentery_build
          FORM TOP_OF_PAGE                                              *
    When TOP-OF-PAGE will be fired , this event will be called and it
    will use the contents of i_list_top_of_page for output in the header
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
               i_logo             = 'ENJOYSAP_LOGO'
                 IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    "top_of_page
    *&      Form  USER_COMMAND
    Called from within the ALV processes. Currently, '&IC1' is used to
    process the hotspot and display the document 'picked' by the user.
    FORM USER_COMMAND USING PV_UCOMM LIKE SY-UCOMM
                            SELFIELD TYPE SLIS_SELFIELD.
      CLEAR : GWA_BSIS.
      CASE PV_UCOMM.
        WHEN '&IC1'.
          READ TABLE GIT_BSIS INTO GWA_BSIS INDEX SELFIELD-TABINDEX.
          CASE SELFIELD-SEL_TAB_FIELD.
            WHEN 'GIT_BSIS-BELNR'.
              IF NOT GWA_BSIS-BELNR IS INITIAL.
                SET PARAMETER ID: 'BUK' FIELD GWA_BSIS-BUKRS,
                                  'BLN' FIELD GWA_BSIS-BELNR,
                                  'GJR' FIELD GWA_BSIS-GJAHR.
                CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
              ENDIF.
            WHEN OTHERS.
          ENDCASE.
        WHEN OTHERS.
      ENDCASE.
      CLEAR : GWA_BSIS.
    ENDFORM.                    "user_command
    *&      Form  SET_PF_STATUS
          text
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
    ENDFORM.                    "SET_PF_STATUSENDFORM.                    "SET_PF_STATUS
    AWARD POINTS IF USEFUL....

  • Sample SD  reports in querry designer

    Hi,
    We want to see the sample SD report at queerry design.we mean that. We want to check out sd reports querry designer to see how it is creating?
    Any link ?we are really appretiated..

    Hi,
    Designing SD queries or any queries depends on client requirement (refer report template) and you design query on top of IC/DSO/Multiprovider mostly with effective performance.
    Use following Bex Functions and design query. understand each function properly and use them to improve query performance.
    -     Generate index.
    -     Build query on multiprovider and better use Constant Selection Function to bring infoset functionality to Multiprovider.
    -     Make your query more dynamic using variables.
    -     Do partitioning on IC when you have restriction on 0CALMONTH.
    -     Use more free charecterstics.
    -     Use include than exclude at Bex level.
    -     Utilize Cache mode and Read mode functions.
    http://help.sap.com/saphelp_nw04/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm
    Regards,
    rvc

  • Sample ALV Report

    Hi,
    Please help me with some sample ALV reports for SAP HR.
    Rgds
    Preeti Saun

    Hi,
    See the sample report and design with HR data
    report ZRGRIRNA no standard page heading
           line-count 65
           line-size 255
           message-id mm.
                       GR IR Detail Report                               *
    Description          : The output has to be displayed
                           in the ALV Grid format with the Selection     *
                           screen appearing on the output. In The Output *
                           Subtotals for Vendor, Plant, Period, Material,*
                           Valuation Class, Purchase Order,Cost Center,  *
                           Cost Element and Receipt Date are displayed   *
                           after sorting the data by same fields.        *
    Declaration for Tables
    tables: t001,      " Company Codes
            t001w,     " Plants/Branches
            lfa1,      " Vendor Master
            ska1,      " GL Account Master
            mara,      " Material Master
            mbew,      " Material Valuation
            ekko,      " PO Header Data
            cska,      " Cost Elements
            csks,      " Cost Centers
            bsis,      " GL Accounts: Open Items Data
            bkpf.      " Accounting Doc: Header Data
    Type-pools
    Type pools for ALV display
    type-pools : slis.
    Global variables
    data: g_repid       like sy-repid,
          g_exit        type c,
          g_events      type slis_t_event,
          g_list_top_of_page type slis_t_listheader,
          g_exit_caused_by_caller,
          g_exit_caused_by_user type slis_exit_by_user,
          g_top_of_page  type slis_formname value 'TOP_OF_PAGE',
          g_variant like disvariant,
          g_save.
    Declaration for Constants
    constants : c_x  type c  value 'X',         " Flag
                c_c  type c  value 'C',         " Flag
                c_l  type c  value 'L',         " Flag
                c_a  type c  value 'A',         " Line Type
                c_h  type c  value 'H',         " Dr/Cr
                c_s  type c  value 'S',         " Line Type
                c_mkpf(4) type c value 'MKPF'.  " Table
    Declaration of Internal Tables
    Internal Table for BSIS Table data
    data: begin of i_bsis occurs 0,
            bukrs like bsis-bukrs,          " Company Code
            hkont like bsis-hkont,          " GR IR Account
            gjahr like bsis-gjahr,          " Fiscal Year
            belnr like bsis-belnr,          " Acc Document
            buzei like bsis-buzei,          " Item No
            budat like bsis-budat,          " Receipt Date(Posting)
            monat like bsis-monat,          " Period
          end of i_bsis.
    Internal Table for BSEG Table data
    data: begin of i_bseg occurs 0,
            bukrs like bsis-bukrs,          " Company Code
            belnr like bsis-belnr,          " Acc Document
            buzei like bsis-buzei,          " Item No
            gjahr like bsis-gjahr,          " Fiscal Year
            shkzg like bseg-shkzg,          " Dr/Cr Indicator
            lifnr like bseg-lifnr,          " Vendor Code
            matnr like bseg-matnr,          " Material No
            ebeln like bseg-ebeln,          " Purchase Order
            ebelp like bseg-ebelp,          " PO Item
            werks like bseg-werks,          " Plant
            menge like bseg-menge,          " PO Quantity
            meins like bseg-meins,          " UOM
            dmbtr like bseg-dmbtr,          " Amount in Local Currency
            wrbtr like bseg-wrbtr,          " Amount in Trans.Currency
          end of i_bseg.
    Internal Table for BKPF Table data
    data: begin of i_bkpf occurs 0,
            bukrs like bkpf-bukrs,          " Company Code
            belnr like bkpf-belnr,          " Acc Document
            gjahr like bkpf-gjahr,          " Fiscal Year
            waers like bkpf-waers,          " Trans. Currency
            awkey like bkpf-awkey,          " Object Key
            awtyp like bkpf-awtyp,          " Reference Procedure
          end of i_bkpf.
    Internal Table for MSEG Table data
    data: begin of i_mseg occurs 0,
            mblnr like mseg-mblnr,          " Material Document
            mjahr like mseg-mjahr,          " Fiscal Year
            bwart like mseg-bwart,          " Movement Type
            matnr like mseg-matnr,          " Material No
            menge like mseg-menge,          " PO Quantity
            meins like mseg-meins,          " UOM
          end of i_mseg.
    Internal Table for MBEW Table data
    data: begin of i_mbew occurs 0,
            matnr like mbew-matnr,          " Material No
            werks like mbew-bwkey,          " Plant
            bklas like mbew-bklas,          " Valuation Class
          end of i_mbew.
    Internal Table for EKPO Table data
    data: begin of i_ekpo occurs 0,
            ebeln like ekpo-ebeln,          " Purchase Order
            ebelp like ekpo-ebelp,          " PO Item
            matnr like ekpo-matnr,          " Material No
            txz01 like ekpo-txz01,          " Material Text
          end of i_ekpo.
    Internal Table for EKKN Table data
    data: begin of i_ekkn occurs 0,
            ebeln like ekkn-ebeln,          " Purchase Order
            ebelp like ekkn-ebelp,          " PO Item
            kostl like ekkn-kostl,          " Cost Center
            sakto like ekkn-sakto,          " Cost Element
          end of i_ekkn.
    Internal Table for LFA1 Table data
    data: begin of i_lfa1 occurs 0,
            lifnr like lfa1-lifnr,          " Vendor
            name1 like lfa1-name1,          " Name
          end of i_lfa1.
    Declaration of Output Internal Table
    data: begin of i_final occurs 0,
            lifnr like lfa1-lifnr,     " Vendor
            werks like bseg-werks,     " Plant
            monat like bsis-monat,     " Period
            matnr like mara-matnr,     " Material Number
            bklas like mbew-bklas,     " Val Class
            ebeln like bseg-ebeln,     " PO
            kostl like ekkn-kostl,     " Cost Center
            sakto like ekkn-sakto,     " Cost Element
            budat like bsis-budat,     " Rec. Date
            name1 like lfa1-name1,     " Vendor Name
            belnr like bsis-belnr,     " FI Document
            bwart like mseg-bwart,     " Movement Type
            txz01 like ekpo-txz01,     " Material Text
            menge like bseg-menge,     " Quantity
            meins like bseg-meins,     " UOM
            dmbtr like bseg-dmbtr,     " Local Amount
            wrbtr like bseg-wrbtr,     " Tran.Amount
            waers like bkpf-waers,     " Tran.Currency
            status type c,             " Material Status
          end of i_final.
    Internal table to hold field catgory data
    data:  i_fldcat  type slis_t_fieldcat_alv.   " Table - field catgory
    Internal table to hold Sort/Subtotals criteria data
    data:  i_sort  type slis_t_sortinfo_alv.     " Table - sort/Subtotals
    Structure
    data:  x_layout   type slis_layout_alv,      " Structure-layout
           x_fldcat   like line of i_fldcat,     " Structure-field catagory
           x_sort     like line of i_sort.       " Structure-Sort/Subtotals
           Selection screen
    selection-screen : begin of block b1 with frame title text-000.
    parameters:
       p_bukrs like t001-bukrs obligatory,          " Company Code
       p_grira like ska1-saknr default '0241101000' obligatory. " Account
    select-options:
       s_budat for bkpf-budat,        " Posting Date
       s_werks for t001w-werks,       " Plant
       s_lifnr for lfa1-lifnr,        " Vendor
       s_matnr for mara-matnr,        " Material Number
       s_kostl for csks-kostl,        " Cost Center
       s_kstar for cska-kstar,        " Cost Element
       s_ebeln for ekko-ebeln,        " Purchase Order
       s_monat for bsis-monat.        " Period
    selection-screen skip.
    parameters:
       p_incmt as checkbox default 'X',
       p_incnm as checkbox default 'X'.
    selection-screen end of block b1.
    Initialization
    initialization.
      g_repid = sy-repid.
      perform layout_init using x_layout.
      perform eventtab_build using g_events[].
      g_variant-report = g_repid.
      g_save           = 'A'.
    At selection screen
    at selection-screen.
    Validation of Selection Screen Fields
      perform validate_screen.
    Start of selection
    start-of-selection.
    Read Data from Database Tables
      perform read_data.
    End of selection
    end-of-selection.
    Build layout report layout.
      perform populate_layout_stucture.
    Perform build_field_catalog and Sort Table
      perform build_field_catalog.
      perform build_sort_totals.
    List Header for Top-Of-Page
      perform comment_build using g_list_top_of_page[].
    Call list viewer function module
      perform call_list_viewer .
    ****************Form - Routines**************************************
          Form        : layout_init
          Description : Form to Build layout for list display
    form layout_init using rs_layout type slis_layout_alv.
      rs_layout-detail_popup      = c_x.
    endform.
    Form         : Eventtab_build
    Description  : Registration of events to happen during list display
    form eventtab_build using rt_events type slis_t_event.
    Registration of events to happen during list display
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = rt_events.
      read table rt_events with key name = slis_ev_top_of_page
                               into ls_event.
      if sy-subrc = 0.
        move g_top_of_page to ls_event-form.
        append ls_event to rt_events.
      endif.
    endform.                                   "eventtab_build
          Form : top_of_page
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
             I_LOGO             = 'ENJOYSAP_LOGO'
                it_list_commentary = g_list_top_of_page.
    endform.
          Form validate_screen
    Validation of Selection Screen fields
    form validate_screen.
    Validation of Company Code
      clear t001.
      if not p_bukrs is initial.
        select single bukrs
          into t001-bukrs
          from t001
          where bukrs eq p_bukrs.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Company Code'(012).
        endif.
      endif.
    Validation of GL Account (GR/IR)
      clear ska1.
      if not p_grira is initial.
        select saknr
          into ska1-saknr
          from ska1
          up to 1 rows
          where saknr eq p_grira.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid GR/IR Account'(013).
        endif.
      endif.
    Validation of Vendor Code
      clear lfa1.
      if not s_lifnr[] is initial.
        select single lifnr
          into lfa1-lifnr
          from lfa1
          where lifnr in s_lifnr.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Vendor'(001).
        endif.
      endif.
    Validation of Plant Code
      clear t001w.
      if not s_werks[] is initial.
        select single werks
          into t001w-werks
          from t001w
          where werks in s_werks.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Plant'(014).
        endif.
      endif.
    Validation of Material Code
      clear mara.
      if not s_matnr[] is initial.
        select single matnr
          into mara-matnr
          from mara
          where matnr in s_matnr.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Material'(015).
        endif.
      endif.
    Validation of Purchase Order
      clear ekko.
      if not s_ebeln[] is initial.
        select single ebeln
          into ekko-ebeln
          from ekko
          where ebeln in s_ebeln.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Purchase Order'(016).
        endif.
      endif.
    Validation of Cost Center
      clear csks.
      if not s_kostl[] is initial.
        select kostl
          into csks-kostl
          from csks
          up to 1 rows
          where kostl in s_kostl.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Cost Center'(017).
        endif.
      endif.
    Validation of Cost Element
      clear cska.
      if not s_kstar[] is initial.
        select kstar
          into cska-kstar
          from cska
          up to 1 rows
          where kstar in s_kstar.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Cost Element'(018).
        endif.
      endif.
    endform.                          "validate_screen
    *&      Form  read_data
    Read the Data from the database Tables
    form read_data.
    Get the Accounting Documents for the GR/IR Account Entered on
    Selection Screen
      clear i_bsis.
      refresh i_bsis.
      select bukrs           " Company Code
             hkont           " GR IR Account
             gjahr           " Fiscal Year
             belnr           " Acc Document
             buzei           " Item No
             budat           " Receipt Date(Posting)
             monat           " Period
       into table i_bsis
       from  bsis
       where  bukrs = p_bukrs
         and  hkont = p_grira
         and  budat in s_budat
         and  monat in s_monat .
      if sy-subrc <> 0.
        message i899 with 'No data found'(043).
        g_exit = c_x.
        stop.
      endif.
      sort i_bsis by bukrs hkont gjahr belnr buzei.
    Get the Vendor,PO,Material,Qty details from BSEG Table
      if not i_bsis[] is initial.
        clear i_bseg.
        refresh i_bseg.
        select bukrs           " Company Code
               belnr           " Acc Document
               buzei           " Item No
               gjahr           " Fiscal Year
               shkzg           " Dr/Cr Indicator
               lifnr           " Vendor Code
               matnr           " Material No
               ebeln           " Purchase Order
               ebelp           " PO Item
               werks           " Plant
               menge           " PO Quantity
               meins           " UOM
               dmbtr           " Amount in Local Currency
               wrbtr           " Amount in Trans.Currency
        into table i_bseg
        from   bseg
        for all entries in i_bsis
        where  bukrs = p_bukrs
        and    belnr = i_bsis-belnr
        and    gjahr = i_bsis-gjahr
        and    buzei = i_bsis-buzei
        and    lifnr in s_lifnr
        and    werks in s_werks
        and    matnr in s_matnr
        and    ebeln in s_ebeln.
        sort i_bseg by bukrs belnr buzei gjahr.
    Select the Trans.Currency from BKPF Table
        clear i_bkpf.
        refresh i_bkpf.
        select bukrs           " Company Code
               belnr           " Acc Document
               gjahr           " Fiscal Year
               waers           " Trans. Currency
               awkey           " Object Key
               awtyp           " Reference Procedure
        into table i_bkpf
        from   bkpf
        for all entries in i_bsis
        where  bukrs = p_bukrs
        and    belnr = i_bsis-belnr
        and    gjahr = i_bsis-gjahr.
      endif.
      sort i_bkpf by bukrs belnr gjahr.
    Get the Quantity and UOM of Material from MSEG Table
      if not i_bkpf[] is initial.
        clear i_mseg.
        refresh i_mseg.
        select mblnr           " Material Document
               mjahr           " Fiscal Year
               bwart           " Movement Type
               matnr           " Material No
               menge           " PO Quantity
               meins           " UOM
          into table i_mseg
          from   mseg
          for all entries in i_bkpf
          where  mblnr = i_bkpf-awkey(10).
      endif.
      sort i_mseg by mblnr mjahr.
    Get the Material And Description from EKPO Table
      if not i_bseg[] is initial.
        clear i_ekpo.
        refresh i_ekpo.
        select ebeln           " Purchase Order
               ebelp           " PO Item
               matnr           " Material No
               txz01           " Material Text
        into table i_ekpo
        from   ekpo
        for all entries in i_bseg
        where  ebeln = i_bseg-ebeln
        and    ebelp = i_bseg-ebelp.
        sort i_ekpo by ebeln ebelp.
    Get the Valuation Class from MBEW Table
        clear i_mbew.
        refresh i_mbew.
        select matnr           " Material No
               bwkey           " Plant
               bklas           " Valuation Class
        into table i_mbew
        from   mbew
        for all entries in i_bseg
        where  matnr = i_bseg-matnr
        and    bwkey = i_bseg-werks.
        sort i_mbew by matnr werks.
    Get the Cost Center and Cost Element of the PO from EKKN Table
        clear i_ekkn.
        refresh i_ekkn.
        select ebeln           " Purchase Order
               ebelp           " PO Item
               kostl           " Cost Center
               sakto           " Cost Element
        into table i_ekkn
        from   ekkn
        for all entries in i_bseg
        where  ebeln = i_bseg-ebeln
        and    ebelp = i_bseg-ebelp
        and    kostl in s_kostl
        and    sakto in s_kstar.
        sort i_ekkn by ebeln ebelp.
    Get the Vendor Name
        clear i_lfa1.
        refresh i_lfa1.
        select lifnr            " Vendor
               name1            " Name
        into table i_lfa1
        from   lfa1
        for all entries in i_bseg
        where  lifnr = i_bseg-lifnr.
      endif.
      sort i_lfa1 by lifnr.
    Move the data to Final Output Internal Table
      loop at i_bsis.
        i_final-belnr = i_bsis-belnr.     " FI Document
        i_final-monat = i_bsis-monat.     " Period
        i_final-budat = i_bsis-budat.     " Rec. Date
    Read the Transaction Currency from BKPF Internal Table
        read table i_bkpf with key bukrs = i_bsis-bukrs
                                   belnr = i_bsis-belnr
                                   gjahr = i_bsis-gjahr
                                   binary search.
        if sy-subrc = 0.
          i_final-waers = i_bkpf-waers.     " Tran.Currency
    Read the Movement Type for all Material Related
    Documents from MSEG Internal Table
          if i_bkpf-awtyp = c_mkpf.
            read table i_mseg with key mblnr = i_bkpf-awkey(10)
                                       mjahr = i_bkpf-awkey+10(4).
            if sy-subrc = 0.
              i_final-bwart = i_mseg-bwart.     " Movement Type
            endif.
          endif.
        endif.
    Read Vendor, Plant, PO Document, Local And Trans.Amounts
    from BSEG Internal Table
        read table i_bseg with key bukrs = i_bsis-bukrs
                                   belnr = i_bsis-belnr
                                   gjahr = i_bsis-gjahr
                                   buzei = i_bsis-buzei
                                   binary search.
        if sy-subrc = 0.
          i_final-lifnr = i_bseg-lifnr.     " Vendor
          i_final-werks = i_bseg-werks.     " Plant
          i_final-ebeln = i_bseg-ebeln.     " PO
          i_final-dmbtr = i_bseg-dmbtr.     " Local Amount
          i_final-wrbtr = i_bseg-wrbtr.     " Tran.Amount
          i_final-menge = i_bseg-menge.     " Quantity
          i_final-meins = i_bseg-meins.     " UOM
    For Credit Indicator(SHKZG = H) amounts should be (-)ve
          if i_bseg-shkzg = c_h.
            i_final-dmbtr = i_final-dmbtr * -1.
            i_final-wrbtr = i_final-wrbtr * -1.
            i_final-menge = i_final-menge * -1.
          endif.
    Read the Material and its Description from EKPO Internal Table
          read table i_ekpo with key ebeln = i_bseg-ebeln
                                     ebelp = i_bseg-ebelp
                                     matnr = i_bseg-matnr
                                     binary search.
          if sy-subrc = 0.
            i_final-matnr = i_ekpo-matnr.     " Material Number
            i_final-txz01 = i_ekpo-txz01.     " Material Text
    Populate the Material Status depending on the Input Checkbox
    On Selection Screen
            if not i_ekpo-matnr is initial.
              i_final-status = c_x.
            endif.
          endif.
    Read the PO related Cost Element and Cost Centers
    from EKKN Internal Table
          read table i_ekkn with key ebeln = i_bseg-ebeln
                                     ebelp = i_bseg-ebelp
                                     binary search.
          if sy-subrc = 0.
            i_final-kostl = i_ekkn-kostl.     " Cost Center
            i_final-sakto = i_ekkn-sakto.     " Cost Element
          endif.
    Read the Valuation Class from MBEW Internal Table
          read table i_mbew with key matnr = i_bseg-matnr
                                     werks = i_bseg-werks
                                     binary search.
          if sy-subrc = 0.
            i_final-bklas = i_mbew-bklas.     " Val Class
          endif.
    Read the Vendor Name from LFA1 Internal Table
          read table i_lfa1 with key lifnr = i_bseg-lifnr
                                     binary search.
          if sy-subrc = 0.
            i_final-name1 = i_lfa1-name1.     " Vendor Name
          endif.
        endif.
        append i_final.
        clear i_final.
      endloop.
      sort i_final by lifnr werks monat matnr.
    Depending on the check Box Selected display the data
      if p_incmt = c_x and p_incnm ne c_x.
        delete i_final where matnr eq space.
      elseif p_incnm = c_x and p_incmt ne c_x.
        delete i_final where matnr ne space.
      endif.
    endform.           "Read Data
         Form        : populate_layout_stucture
         Description : Populating the layout structure
    form populate_layout_stucture.
      clear x_layout .
    Layout properties
      x_layout-zebra                = c_x.
      x_layout-detail_popup         = c_x.
      x_layout-detail_initial_lines = c_x.
      x_layout-colwidth_optimize    = c_x.
    endform.                    " populate_layout_stucture
         Form        : build_field_catalog
         Description : Building the field catalog data
    form build_field_catalog.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name         = g_repid
                i_internal_tabname     = 'I_FINAL'
                i_inclname             = g_repid
           changing
                ct_fieldcat            = i_fldcat
           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.
    Getting the Header text for the coloums
      loop at i_fldcat into x_fldcat where fieldname = 'LIFNR' or
                                           fieldname = 'NAME1' or
                                           fieldname = 'WERKS' or
                                           fieldname = 'MONAT' or
                                           fieldname = 'MATNR' or
                                           fieldname = 'BKLAS' or
                                           fieldname = 'EBELN' or
                                           fieldname = 'KOSTL' or
                                           fieldname = 'SAKTO' or
                                           fieldname = 'BUDAT' or
                                           fieldname = 'BELNR' or
                                           fieldname = 'BWART' or
                                           fieldname = 'TXZ01' or
                                           fieldname = 'MENGE' or
                                           fieldname = 'MEINS' or
                                           fieldname = 'DMBTR' or
                                           fieldname = 'WRBTR' or
                                           fieldname = 'WAERS' or
                                           fieldname = 'STATUS'.
        if x_fldcat-fieldname = 'LIFNR'.
          x_fldcat-seltext_l   = 'Vendor'(003).
          x_fldcat-seltext_m   = 'Vendor'(003).
          x_fldcat-seltext_s   = 'Vendor'(003).
          x_fldcat-reptext_ddic = 'Vendor'(003).
          x_fldcat-inttype   = c_c.
        endif.
        if x_fldcat-fieldname = 'NAME1'.
          x_fldcat-seltext_l   = 'Vendor Name'(002).
          x_fldcat-seltext_m   = 'Vendor Name'(002).
          x_fldcat-seltext_s   = 'Vendor Name'(002).
          x_fldcat-reptext_ddic = 'Vendor Name'(002).
          x_fldcat-inttype   = c_c.
        endif.
        if x_fldcat-fieldname = 'WERKS'.
          x_fldcat-seltext_l   = 'Plant'(010).
          x_fldcat-seltext_m   = 'Plant'(010).
          x_fldcat-seltext_s   = 'Plant'(010).
          x_fldcat-reptext_ddic   = 'Plant'(010).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'MONAT'.
          x_fldcat-seltext_l   = 'Period'(011).
          x_fldcat-seltext_m   = 'Period'(011).
          x_fldcat-seltext_s   = 'Period'(011).
          x_fldcat-reptext_ddic   = 'Period'(011).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'MATNR'.
          x_fldcat-seltext_l   = 'Material'(004).
          x_fldcat-seltext_m   = 'Material'(004).
          x_fldcat-seltext_s   = 'Material'(004).
          x_fldcat-reptext_ddic   = 'Material'(004).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'BKLAS'.
          x_fldcat-seltext_l   = 'Valuation Class'(009).
          x_fldcat-seltext_m   = 'Valuation Class'(009).
          x_fldcat-seltext_s   = 'Valuation Class'(009).
          x_fldcat-reptext_ddic   = 'Valuation Class'(009).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'EBELN'.
          x_fldcat-seltext_l   = 'Purchase Order'(005).
          x_fldcat-seltext_m   = 'Purchase Order'(005).
          x_fldcat-seltext_s   = 'Purchase Order'(005).
          x_fldcat-reptext_ddic   = 'Purchase Order'(005).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'KOSTL'.
          x_fldcat-seltext_l   = 'Cost Center'(006).
          x_fldcat-seltext_m   = 'Cost Center'(006).
          x_fldcat-seltext_s   = 'Cost Center'(006).
          x_fldcat-reptext_ddic   = 'Cost Center'(006).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'SAKTO'.
          x_fldcat-seltext_l   = 'Cost Element'(007).
          x_fldcat-seltext_m   = 'Cost Element'(007).
          x_fldcat-seltext_s   = 'Cost Element'(007).
          x_fldcat-reptext_ddic   = 'Cost Element'(007).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'BUDAT'.
          x_fldcat-seltext_l   = 'Receipt Date'(008).
          x_fldcat-seltext_m   = 'Receipt Date'(008).
          x_fldcat-seltext_s   = 'Receipt Date'(008).
          x_fldcat-reptext_ddic   = 'Receipt Date'(008).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'BELNR'.
          x_fldcat-seltext_l   = 'Acc.Document'(100).
          x_fldcat-seltext_m   = 'Acc.Document'(100).
          x_fldcat-seltext_s   = 'Acc.Document'(100).
          x_fldcat-reptext_ddic   = 'Acc.Document'(100).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'BWART'.
          x_fldcat-seltext_l   = 'Movement Type'(101).
          x_fldcat-seltext_m   = 'Movement Type'(101).
          x_fldcat-seltext_s   = 'Movement Type'(101).
          x_fldcat-reptext_ddic   = 'Movement Type'(101).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'TXZ01'.
          x_fldcat-seltext_l   = 'Material Text'(102).
          x_fldcat-seltext_m   = 'Material Text'(102).
          x_fldcat-seltext_s   = 'Material Text'(102).
          x_fldcat-reptext_ddic   = 'Material Text'(102).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'MENGE'.
          x_fldcat-seltext_l   = 'Quantity'(103).
          x_fldcat-seltext_m   = 'Quantity'(103).
          x_fldcat-seltext_s   = 'Quantity'(103).
          x_fldcat-reptext_ddic   = 'Quantity'(103).
          x_fldcat-ddictxt   = c_l.
          x_fldcat-do_sum    = c_x.
        endif.
        if x_fldcat-fieldname = 'MEINS'.
          x_fldcat-seltext_l   = 'UOM'(104).
          x_fldcat-seltext_m   = 'UOM'(104).
          x_fldcat-seltext_s   = 'UOM'(104).
          x_fldcat-reptext_ddic   = 'UOM'(104).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'DMBTR'.
          x_fldcat-seltext_l   = 'Amount in Local Curr'(105).
          x_fldcat-seltext_m   = 'Amount in Local Curr'(105).
          x_fldcat-seltext_s   = 'Amount in Local Curr'(105).
          x_fldcat-reptext_ddic   = 'Amount in Local Curr'(105).
          x_fldcat-ddictxt   = c_l.
          x_fldcat-do_sum    = c_x.
        endif.
        if x_fldcat-fieldname = 'WRBTR'.
          x_fldcat-seltext_l   = 'Amount in Trans.Curr'(106).
          x_fldcat-seltext_m   = 'Amount in Trans.Curr'(106).
          x_fldcat-seltext_s   = 'Amount in Trans.Curr'(106).
          x_fldcat-reptext_ddic   = 'Amount in Trans.Curr'(106).
          x_fldcat-ddictxt   = c_l.
          x_fldcat-do_sum    = c_x.
        endif.
        if x_fldcat-fieldname = 'WAERS'.
          x_fldcat-seltext_l   = 'Trans.Currency'(107).
          x_fldcat-seltext_m   = 'Trans.Currency'(107).
          x_fldcat-seltext_s   = 'Trans.Currency'(107).
          x_fldcat-reptext_ddic   = 'Trans.Currency'(107).
          x_fldcat-ddictxt   = c_l.
        endif.
        if x_fldcat-fieldname = 'STATUS'.
          x_fldcat-seltext_l   = 'Material Status'(019).
          x_fldcat-seltext_m   = 'Material Status'(019).
          x_fldcat-seltext_s   = 'Material Status'(019).
          x_fldcat-reptext_ddic   = 'Material Status'(019).
          x_fldcat-ddictxt   = c_l.
        endif.
        modify i_fldcat from x_fldcat index sy-tabix.
      endloop.
    endform.                    " build_field_catalog
         Form        : build_sort_totals
         Description : Building the Criteria for Sort/Subtotals
    form build_sort_totals.
      x_sort-fieldname = 'LIFNR'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  1.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'WERKS'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  2.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'MONAT'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  3.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'MATNR'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  4.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'BKLAS'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  5.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'EBELN'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  6.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'KOSTL'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  7.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'SAKTO'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  8.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
      x_sort-fieldname = 'BUDAT'.
      x_sort-tabname   = 'I_FINAL'.
      x_sort-spos      =  9.
      x_sort-up        =  c_x.
      x_sort-subtot    = c_x.
      append x_sort to i_sort.
      clear  x_sort.
    endform.                    " build_sort_totals
      Form        : comment_build
      Description : This form is used to display the Report Header(ALV)
    form comment_build using lt_top_of_page type
                                            slis_t_listheader.
      data: l_line type slis_listheader,
            l_heading1 like rs38m-repti,
            l_date(10), l_time(8).
      clear l_line.
      l_heading1 = 'GR/IR DETAIL REPORT'(021).
      g_repid = sy-repid.
      write sy-uzeit to l_time.
      write sy-datum to l_date.
      l_line-typ = c_h.
      move l_heading1 to l_line-info.
      append l_line to lt_top_of_page.
      clear l_line.
      l_line-typ  = c_s.
      concatenate 'System:'(023) sy-sysid
                  'Date:'(024) l_date
                  ' Time:'(025)
                  l_time into l_line-info.
      append l_line to lt_top_of_page.
      concatenate 'Report:'(026) g_repid
                  ' User:'(027) sy-uname into
                  l_line-info.
      append l_line to lt_top_of_page.
      l_line-typ = c_a.
      move 'SELECTION CRITERIA:'(028) to l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Company Code : '(029)
                  p_bukrs into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' GR/IR Account: '(030)
                  p_grira into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Posting Date : '(032) s_budat-low
                  ' To: '(031) s_budat-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Plant : '(033) s_werks-low
                  ' To: '(031) s_werks-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Vendor: '(034) s_lifnr-low
                  ' To: '(031) s_lifnr-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Material: '(035) s_matnr-low
                  ' To: '(031) s_matnr-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Cost Center : '(036) s_kostl-low
                  ' To: '(031) s_kostl-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Cost Element: '(037) s_kstar-low
                  ' To: '(031) s_kstar-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Purchase Order: '(038) s_ebeln-low
                  ' To: '(031) s_ebeln-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Period : '(039) s_monat-low
                  ' To: '(031) s_monat-high into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Include Material Items: '(040)
                  p_incmt into l_line-info.
      append l_line to lt_top_of_page.
      concatenate ' Include Non-Material Items: '(041)
                  p_incnm into l_line-info.
      append l_line to lt_top_of_page.
    endform.
         Form        : call_list_viewer
         Description : This form is used to display the grid through ALV
    form call_list_viewer.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = g_repid
                is_layout               = x_layout
                it_fieldcat             = i_fldcat[]
                i_default               = c_x
                it_sort                 = i_sort[]
                i_save                  = g_save
                is_variant              = g_variant
                it_events               = g_events[]
           importing
                e_exit_caused_by_caller = g_exit_caused_by_caller
                es_exit_caused_by_user  = g_exit_caused_by_user
           tables
                t_outtab                = i_final
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
        write: / 'Problem in calling the ALV report'(042).
      endif.
    endform.                    " call_list_viewer
    reward if useful
    regards,
    Anji

  • Where can I find BOE XI R1 sample auditing reports?

    Hi there,
    I'm trying to track down the auditing reports that came with or were available for BusinessObjects Enterprise XI R1. Does anyone know where I can find these? The sample auditing reports for XI R2 are easy to find (with the accompanying Universe), but the XI R1 reports seem to be lost..
    Thanks!
    Allan

    Hi Allan,
    When BusinessObjects Enterprise XI Release 2 was first installed, a custom install was used and sample reports were not selected.
    The sample audit reports and universe connection information are contained in the file m29.cab. This file is located in the win32 folder of the installation media.
    Perform the following steps:
    1. Open the m29.cab file using an uncompression tool, such as WinZip.
    2. Extract the file auditing_rpt_en_biar.65FF9700_720A_4759_AB8C_5E33BA2E32D3.
    3. Rename the extracted file to "auditing_rpt_en.biar".
    4. Depending on the type of auditing database you are using, extract the file auditing_db_<dbtype>.biar.65FF9700_720A_4759_AB8C_5E33BA2E32D3 file.
    5. Rename the extracted file to "auditing_db_<dbtype>.biar", where <dbtype> represents the database type you are using.
    6. Using the Import Wizard, import the biar file for the database connection first, and then the report biar file.
    These are the steps you have to follow as per the note.
    Hope this helps you.
    Regards,
    Abhijeet T.

  • Need a sample SSRS report with 3 groupings

    Where might I find a sample report with 3 groups that I could just download and modify for my purposes. I cannot get this to work right. I don't want any detail lines to show until all 3 groups have been chosen.
    Of course I'd like to learn how to do this myself rather than just modifying someone elses report but gotta start somewhere.
    I can do reports with one group with no problem.
    The problem I run into with doing groups is that all the groups and detail lines are on the same line in the designer and that is incorrect. However there seems to be nothing I can do about it.

    Hi cupboy1,
    According to your description, you want to design your report as the screenshot your post and hide the detail row until select in top parent group. Right?
    In this scenario, we can design the report as you have done by yourself, then delete the column (Label), but still keep the Label group, then add a column left of Disc, put the data field into appropriate textbox. You can get the same effect as your first
    screenshot. And we can hide the detail rows and set them toggled by Artist. We have tested your case in our local environment. Here are steps and screenshots for your reference:
    1. Create a table. Drag Disc into textbox, add parent group with header (group on Label) for Disc, add parent group with header (group on Artist) for Label.
    2. Delete the column Label, add a column left of Disc.
    3. Right click on detail rows, select Row Visibility. Set hide and toggled by Artist.
    4. Save and preview. It looks like below:
    Reference:
    Row Visibility Dialog Box (Report Builder)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Sample Financial Reporting reports

    Hi all,
    Since FR is used regularly with Planning, I thought I'd post this question to this forum as well.
    I'm looking for some nice samples of FR reports. I'm looking to highlight FR features like drill up/down, filtering, multiple grids, asymmetric reports, etc. I found some sample reports that came with FR Studio but I found that they're too simplistic.
    Any ideas?
    Regards,
    Gerd

    Hi,
    You can refer the
    11.1.2.1. - Oracle® Hyperion Financial Reporting Studio, Fusion Edition User Guide
    You have section Building Reports - Page 87
    Also you can find more information with Reports design.
    Hope this information helps you.
    Thanks in advance.
    regards,
    Harish.

  • Sample crystal report of Sales Analysis

    I would like to summary sales amount by month and group by sales employee. It's the same amount as 'Sales Analysis' report on B1 standard. If anyone have ever created, please guide me or give me some sample of crystal report file. I have to use it urgently but I still have no idea to write it.
    Thanks you very much.
    Angnam

    Hi Angnam......
    Please try this Report......
    SELECT SUBSTRING((CONVERT(VARCHAR(11),T0.DOCDATE,106)),4,11),
    Sum(T1.[Quantity]) 'Quantity', Sum(T1.[LineTotal]) 'Amount',
    (Sum(T1.[LineTotal])/Sum(T1.[Quantity])) 'Rate', T2.SlpName
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    LEFT Outer Join OSLP T2 On T0.SlpCode=T1.SlpCode
    Group By SUBSTRING((CONVERT(VARCHAR(11),T0.DOCDATE,106)),4,11),
    T2.SlpName
    Order By SUBSTRING((CONVERT(VARCHAR(11),T0.DOCDATE,106)),4,11)
    I am sure this will help you to build your Crystal Report.......
    Regards,
    Rahul

  • XLR sample - sales report by item by sales rep

    Hi all,
    I am using the above report at client site and its working great.
    The cust now has a requirement to modify this and include a column that looks at same period -12mths.
    I can easily do that by -
    - duplicating the existing columns 
    - applying period parameter to columns and not the report default
    - and changing the parameter to be @per-12.
    This doesnt seem to work however as the parameter is an expression which means I can select a range of periods.  XLR gives error:
    Definition parsing failed: syntax error near @per-12.
    It only seems to work when I have the parameter as a dimension so that only 1 period can be selected.
    Can XLR do the calculation for the range of periods -12 mths?
    My client wants to create a quarterly report so selecting 1 period is not going to be sufficient.
    I hope what I have explained is clear.
    Thanks for any advice,
    John

    Hi,
    There is a detailed syntax explaination document in portal> Docment Resource Center, you can download it and check.
    There also the explaination regarding @period-12
    For multiple selection, you can use Selection icon(next to the Expand icon) for columns to show more columns for different period.
    hope this helps you.
    maggie an
    SAP BusinessOne Forums Team

  • Where do i get sample abap report functional specification with coding

    hai
    please help me.
    i need sample abap functional spec with tech spec and also coing with doc file format.
    please reply
    thanks in advance
    by
    ashokkumar

    hi
    thanks for reply.
    this is my email id. please send some sample functional specification .
    [email protected]
    [email protected]
    thanks in advance.

Maybe you are looking for

  • Can I create a JSP component library

    I hope I make some sense here: Instead of creating a tag library which contains compiled code (and in my case HTML, which I am trying to avoid), I would like to create a library of JSP files that contain small snippets of HTML/JSP to be included in J

  • Internal Credit memo

    Hi All, I have successufully completed the cycle intercompany return process which means Sales order --> Delivery --> Billing --> Intercompany billing then Return process Return order referring to Billing --> return delivery --> credit memo --> inter

  • F Keyboard shortcuts disabled on Mac OS 10.5.4 in Indesign CS3

    Hi , I have this same problem with My Mac Laptop at Home and my Mac at work. The default F keyboard shortcuts no longer work. For example, if I wanted to bring up the paragraph styles panel which is F11 I get the volume control for the Mac. I have tr

  • Totals for Groups not adding

    Hello, I created a report for our Scheduling team here and I thought it was working nicely and someone found  that my totals are not adding up. In the Group Header Reset I have: WhilePrintingRecords; Shared NumberVar PastDue :=0; Shared NumberVar Day

  • Universal Windows 8.1 & Phone App accessing on-premise SQL Server DB and offline SQLite DB

    I am new to Windows Mobile App development. I am creating a mobile app that I want to connect and get data/authentication from on-premise SQL Server database.  I then would like to have a local (on device) SQLite DB to hand offline situations. I am a