TRDIR INSERT REPORT for PNP

HI ,
i used Insert report option for HR Programs. what should i declare if i have to select my own selection screen (that we select through ( HR Report Category) ) .
I was able to change the basic attributes that we select through TRDIR..
but these options are available in t599c table how to link between trdir & t 599c
thanks in advance
kindly share ur suggestions
regards
Hema

Hi,
  In Report attributes , u have to mention logical database = PNP..and go to HR report category..
then click report category...here u can create ur own selection.
Regards,
Ramesh.

Similar Messages

  • Alv report for multiple record insertion

    hi,
    i'm new to abap. i'm using alv report for record display and insertion. how can i insert multiple records from alv to my table??

    well that can be achieved only by running BDC inside alv report to enter the entries.and in that too you can append or edit single entries only
    reward if useful
    regards
    vivek

  • Creating a New Report Category for PNP

    Hi,
    Could anyone please help me in knowing the different steps involved while creating a custom and new report category for PNP LDB?
    Thanks,
    Sandeep.

    Hi create a program or use an existing program, which has logical database pnp.
    go to se38-> prog name->change-> goto->attributes-> HR report category->create report category->new entries.
    check and uncheck what all fields you require for your report
    now save the settings.
    This will serve your purpose. reward points will be appriciated.
    Regards,
    Quavi

  • Custom Reports for ESS/MSS ?    with PNP??

    I am trying to create a custom report for ESS, and am unsure if I can use the PNP logical database in this code.  I am concerned that if the associate does not have access to see those infoytpes in production, then they would not be able to see their own data from those infotypes in ESS. 
    Can anyone offer their opinion?  Thank you!!!!

    Hi Subash,
    This would be the case.As the J2EE version with ECC6.0 is 7.0 and we need to apply the BP to both ECC and EP.
    Try to think , how do you balance EP6.0 with 6.40 J2EE engine <-> ECC6.0 with 7.0 J2ee engine? will get the answer!
    Regards,
    Surya

  • Exceptions handling  for  "submit of  Insert Report "

    Dear Experts,
    i need to handle Exception "syntax Error" when Submit the inserted report.
    i tried " try and Catch " but failed to catch Dump Error.
    for example:
    Data  CODE TYPE  TABLE OF String .
    APPEND   'REPORT ZDYN.'                                 TO Code .
    APPEND 'Data Var1 type I   .'          TO Code .
    append 'if var > 10 '                         to Code .
    append 'Write ''Success''  .  '            to Code .
    append 'else. '                                  to Code .
    append 'Write ''Failed'' . '                   to Code .
    append 'EndIf . '                               to Code .
    TRY .
        data Prog TYPE c LENGTH 50 VALUE  'ZDYN'.
        INSERT REPORT Prog FROM CODE .
        SUBMIT Prog AND RETURN .
      CATCH CX_ROOT  .
        raise SYNTAX_ERROR .
    ENDTRY.
    " in the inserted Report the Variable Name is Var1 NOT Var So it will be Syntax error " DUMP Error ".
    Thanks in advance

    Hi,
    First write the code in a program and check what error you get and try to handle that particular error.
    Also a full stop is missing in the code ...
    REPORT ZDYN.
    Data Var1 type I.
    if var > 10 .
    Data CODE TYPE TABLE OF String .
    APPEND 'REPORT ZDYN.' TO Code .
    APPEND 'Data Var1 type I .' TO Code .
    append 'if var > 10 .' to Code . <--  Put a full stop here ..
    append 'Write ''Success'' . ' to Code .
    append 'else. ' to Code .
    append 'Write ''Failed'' . ' to Code .
    append 'EndIf . ' to Code .
    Regards,
    Srini.

  • Inserting Rows in Reports for Unused Numbers

    Post Author: scarmike67
    CA Forum: General
    I have a report that lists our customer numbers and names.  Each row has a 3-digit customer number in the first column with the customer name in the second column.  When the customer numbers were created, many numbers were skipped.  How can I make my report include rows for the unassigned customer numbers?  I would like the report to include rows all customer numbers 1-999, and only the assigned numbers would have customer names next to them.  This will allow us to see the unused numbers.  For example, if numbers 123, 124, 126, and 128 were assigned to customers , I would like to also have rows on the report for the skipped 125 and 127 numbers.  I'm not sure what this 'feature' is called in order to search for help.  Thanks!

    Post Author: scarmike67
    CA Forum: General
    I have Crystal v8.5 and v10.  I could use either for this report.  It is an SQL database.  I would like to be able to handle it within the report instead of adding a new table or blank records to the existing table.  Thanks!

  • Report  for downloading the source code of a Program

    Hi.
    Need a code to download the source code of a Program in a text file and all the includes of that program in a separate coressponding files. <b>This should be with scan and read report statements.It should be with classe CL_GUI_FRONTEND_SERVICES  but not with function modules.</b>
    Thanks in advance.
    Regards,
    Asha

    Hi Asha
    Use the below program for your purpose.
    Report: ZKBPROGS             *
    Function   : Up/Download ABAP reports complete with texts            *
    Change Log :                 *
    July 5, 1999         *
       - Combined existing programs that did the upload and download into*
       - one program.            *
       - Changed format that the reports are saved in to be compatible   *
         with Wolfgang Morgenthaler's upload/download program(YSTRASN00  *
         at www.antarcon.de).  Major differences between this program and*
         Wolfgang's are:
            - this program does not update TRDIR with the                *
              TRDIR entries that are in the program uploaded.  Instead,  *
              current users stats are used.          *
            - this program allows selection of reports from a list or    *
              a single report can be tuped in and uploaded               *
            - this program also updates TADIR so that a development class*
              is assigned to the program             *
            - this program checks to see if the program already has a    *
              TRDIR entry, and if it does, warns the user                *
            - this program will save/restore the program documenation too*
    REPORT ZKBPROGS
           NO STANDARD PAGE HEADING
           LINE-SIZE  255.
    Declare Database Objects     *
    tables:
      DOKIL,
      TRDIR.
    Constants*
    CONSTANTS:
      MC_TRDIR_IDENTIFIER(72)  TYPE C VALUE '%&%& RDIR',
      MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
      MC_TEXT_IDENTIFIER(72)   TYPE C VALUE '%&%& TEXP',
      MC_THEAD_IDENTIFIER(72)  TYPE C VALUE '%&%& HEAD',
      MC_DOC_IDENTIFIER(72)    TYPE C VALUE '%&%& DOKL',
      MC_TRDIR_SHORT(4)        TYPE C VALUE 'RDIR',
      MC_REPORT_SHORT(4)       TYPE C VALUE 'REPO',
      MC_TEXT_SHORT(4)         TYPE C VALUE 'TEXP',
      MC_THEAD_SHORT(4)        TYPE C VALUE 'HEAD',
      MC_DOC_SHORT(4)          TYPE C VALUE 'DOKP'.
    Declare Module level data structures             *
    DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
            LINE(72) TYPE C,
          END OF MTAB_PROGRAM_SOURCE.
    DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
    DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    DATA: MSTR_THEAD LIKE THEAD.
    DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
            LINE(275) TYPE C,
          END OF MTAB_PROGRAM_FILE.
    DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
            NAME LIKE TRDIR-NAME,
            DESC(72) TYPE C,
            SAVENAME LIKE RLGRAP-FILENAME,
          END OF MTAB_DIRECTORY.
    DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
            LINE(255) TYPE C,
          END OF MTAB_PROGRAM_DOCUMENTATION.
    Selection Screen             *
    *-- Options for upload/download of programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
    PARAMETERS:
      RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'.       " Download reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
    SELECT-OPTIONS:
      S_NAME  FOR TRDIR-NAME,              " Program Name
      S_SUBC  FOR TRDIR-SUBC               " Program Type
              DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
      S_CNAM  FOR TRDIR-CNAM               " Created by
              DEFAULT SY-UNAME,
      S_UNAM  FOR TRDIR-UNAM,              " Last Changed by
      S_CDAT  FOR TRDIR-CDAT,              " Creation date
      S_UDAT  FOR TRDIR-UDAT.              " Last update date
    SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
    *-- Options for uploading programs
    PARAMETERS:
      RB_UP   RADIOBUTTON GROUP UDL.       " Upload reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
    PARAMETERS:
      RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS:
      RB_LIST RADIOBUTTON GROUP HOW.
    SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
    SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
    *-- Options for up/downloading programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
    PARAMETERS:
      RB_DOS  RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
      RB_UNIX RADIOBUTTON GROUP FIL,       " Save to UNIX
      P_PATH  LIKE RLGRAP-FILENAME         " Path to save files to
            DEFAULT 'c:\temp\'.
    SELECTION-SCREEN END OF BLOCK FRM_FILEN.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
      CALL FUNCTION 'F4_PROGRAM'
           EXPORTING
                OBJECT             = S_NAME-LOW
                SUPPRESS_SELECTION = 'X'
           IMPORTING
                RESULT             = S_NAME-LOW
           EXCEPTIONS
                OTHERS             = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
      CALL FUNCTION 'F4_PROGRAM'
           EXPORTING
                OBJECT             = S_NAME-HIGH
                SUPPRESS_SELECTION = 'X'
           IMPORTING
                RESULT             = S_NAME-HIGH
           EXCEPTIONS
                OTHERS             = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
      PERFORM GET_NAME USING 'S_UNAM-LOW'
                    CHANGING S_UNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
      PERFORM GET_NAME USING 'S_UNAM-HIGH'
                    CHANGING S_UNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
      PERFORM GET_NAME USING 'S_CNAM-LOW'
                    CHANGING S_CNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
      PERFORM GET_NAME USING 'S_CNAM-HIGH'
                    CHANGING S_CNAM-HIGH.
    TOP-OF-PAGE.
      IF RB_LIST = 'X'.
        FORMAT COLOR COL_HEADING.
        NEW-LINE.
        WRITE: AT 3 TEXT-H01,
               AT 15 TEXT-H03.
        FORMAT COLOR OFF.
      ENDIF.
    AT LINE-SELECTION.
      CHECK RB_LIST = 'X'.                 " only do in list mode
      READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
    *-- Read file into an internal table
      PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
                USING  MTAB_DIRECTORY-SAVENAME.
    *-- Split table into TADIR entry, report lines, and report text
      PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
                     MTAB_PROGRAM_SOURCE
                     MTAB_PROGRAM_TEXTS
                     MTAB_PROGRAM_DOCUMENTATION
            CHANGING TRDIR
                     MSTR_THEAD.
    *-- Save all of the data
      PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
                   MTAB_PROGRAM_TEXTS
                   MTAB_PROGRAM_DOCUMENTATION
            USING  TRDIR
                   MSTR_THEAD.
    Start of processing          *
    START-OF-SELECTION.
      FORMAT COLOR COL_NORMAL.
      IF RB_DOWN = 'X'.
        PERFORM DOWNLOAD_REPORTS.
      ELSEIF RB_UP = 'X'.
        PERFORM UPLOAD_REPORTS.
      ENDIF.
    END-OF-SELECTION.
      IF RB_DOWN = 'X'.
        CONCATENATE P_PATH
                    'directory.txt'
          INTO P_PATH.
        PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
               USING  P_PATH.
      ENDIF.
          FORM UPLOAD_REPORTS   *
    FORM UPLOAD_REPORTS.
    *-- Can upload a reports entered in selection criteria or
    *-- select from a list.  List can be from index.txt in same directory
    *-- (created by the download) or by reading the first line of each file
    *-- in the directory.
      IF RB_FILE = 'X'. " Upload single program from a file
    *-- Read file into an internal table
        PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
                  USING  P_PATH.
    *-- Split table into TADIR entry, report lines, and report text
        PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
                       MTAB_PROGRAM_SOURCE
                       MTAB_PROGRAM_TEXTS
                       MTAB_PROGRAM_DOCUMENTATION
              CHANGING TRDIR
                       MSTR_THEAD.
    *-- Save all of the data
        PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
                     MTAB_PROGRAM_TEXTS
                     MTAB_PROGRAM_DOCUMENTATION
              USING  TRDIR
                     MSTR_THEAD.
      ELSEIF RB_LIST = 'X'. " Show list for user to choose from
    *-- get list of report names/descriptions from directory text
        CONCATENATE P_PATH
                    'directory.txt'
        INTO P_PATH.
        PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
                  USING  P_PATH.
        SORT MTAB_DIRECTORY.
    *-- Write out list of report names/descriptions
        LOOP AT MTAB_DIRECTORY.
          WRITE:
            / MTAB_DIRECTORY-NAME UNDER TEXT-H01,
              MTAB_DIRECTORY-DESC UNDER TEXT-H03,
              MTAB_DIRECTORY-SAVENAME.
        ENDLOOP.
    *-- Process user selections for reports to upload.
      ENDIF.
    ENDFORM.           " upload_reports
          FORM DOWNLOAD_REPORTS *
          From the user selections, get all programs that meet the      *
          criteria, and save them in ftab_program_directory.            *
          Also save the report to disk.             *
    FORM DOWNLOAD_REPORTS.
      DATA:
        LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
    *-- The table is put into an internal table because the program will
    *-- abend if multiple transfers to a dataset occur within a SELECT/
    *-- ENDSELCT (tested on 3.1H)
      SELECT * FROM  TRDIR
             INTO TABLE MTAB_PROGRAM_TRDIR
             WHERE  NAME  IN S_NAME
             AND    SUBC  IN S_SUBC
             AND    CNAM  IN S_CNAM
             AND    UNAM  IN S_UNAM
             AND    CDAT  IN S_CDAT
             AND    UDAT  IN S_UDAT.
      LOOP AT MTAB_PROGRAM_TRDIR.
    *-- Clear out text and source code tables
        CLEAR:
          MTAB_PROGRAM_FILE,
          MTAB_PROGRAM_SOURCE,
          MTAB_PROGRAM_TEXTS,
          MTAB_PROGRAM_DOCUMENTATION.
        REFRESH:
          MTAB_PROGRAM_FILE,
          MTAB_PROGRAM_SOURCE,
          MTAB_PROGRAM_TEXTS,
          MTAB_PROGRAM_DOCUMENTATION.
    *-- Get the report
        READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
    *-- Get the text for the report
        READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
    *-- Get the documentation for the report
        CLEAR DOKIL.
        SELECT * UP TO 1 ROWS FROM DOKIL
               WHERE  ID          = 'RE'
               AND    OBJECT      = MTAB_PROGRAM_TRDIR-NAME
               AND    LANGU       = SY-LANGU
               AND    TYP         = 'E'
               ORDER BY VERSION DESCENDING.
        ENDSELECT.
    *-- Documentation exists for this object
        IF SY-SUBRC = 0.
          CALL FUNCTION 'DOCU_READ'
               EXPORTING
                    ID      = DOKIL-ID
                    LANGU   = DOKIL-LANGU
                    OBJECT  = DOKIL-OBJECT
                    TYP     = DOKIL-TYP
                    VERSION = DOKIL-VERSION
               IMPORTING
                    HEAD    = MSTR_THEAD
               TABLES
                    LINE    = MTAB_PROGRAM_DOCUMENTATION
               EXCEPTIONS
                    OTHERS  = 1.
        ENDIF.
    *-- Put the report code and texts into a single file
    *-- Put the identifier line in so that the start of the TRDIR line
    *-- is marked
        CONCATENATE MC_TRDIR_IDENTIFIER
        MTAB_PROGRAM_TRDIR-NAME
        INTO MTAB_PROGRAM_FILE-LINE.
        APPEND MTAB_PROGRAM_FILE.
    *-- Add the TRDIR line
        MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
        APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report code
    *-- is marked
        CONCATENATE MC_REPORT_IDENTIFIER
                    MTAB_PROGRAM_TRDIR-NAME
          INTO MTAB_PROGRAM_FILE-LINE.
        APPEND MTAB_PROGRAM_FILE.
    *-- Add the report code
        LOOP AT MTAB_PROGRAM_SOURCE.
          MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
          APPEND MTAB_PROGRAM_FILE.
        ENDLOOP.
    *-- Put the identifier line in so that the start of the report text
    *-- is marked
        CONCATENATE MC_TEXT_IDENTIFIER
                    MTAB_PROGRAM_TRDIR-NAME
          INTO MTAB_PROGRAM_FILE-LINE.
        APPEND MTAB_PROGRAM_FILE.
    *-- Add the report texts
        LOOP AT MTAB_PROGRAM_TEXTS.
          MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
          APPEND MTAB_PROGRAM_FILE.
        ENDLOOP.
    *-- Put the identifier line in so that the start of the THEAD record
    *-- is marked
        CONCATENATE MC_THEAD_IDENTIFIER
                    MTAB_PROGRAM_TRDIR-NAME
          INTO MTAB_PROGRAM_FILE-LINE.
        APPEND MTAB_PROGRAM_FILE.
        MTAB_PROGRAM_FILE = MSTR_THEAD.
        APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report
    *-- documentation is marked
        CONCATENATE MC_DOC_IDENTIFIER
                    MTAB_PROGRAM_TRDIR-NAME
          INTO MTAB_PROGRAM_FILE-LINE.
        APPEND MTAB_PROGRAM_FILE.
    *-- Add the report documentation
        LOOP AT MTAB_PROGRAM_DOCUMENTATION.
          MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
          APPEND MTAB_PROGRAM_FILE.
        ENDLOOP.
    *-- Make the fully pathed filename that report will be saved to
        CONCATENATE P_PATH
                    MTAB_PROGRAM_TRDIR-NAME
                    '.txt'
          INTO LC_FULL_FILENAME.
        PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
               USING  LC_FULL_FILENAME.
    *-- Write out message with Program Name/Description
        READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
        IF SY-SUBRC = 0.
          MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
          MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
          MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
          APPEND MTAB_DIRECTORY.
          WRITE: / MTAB_PROGRAM_TRDIR-NAME,
                   MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
        ELSE.
          MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
          MTAB_DIRECTORY-DESC = 'No description available'.
          MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
          APPEND MTAB_DIRECTORY.
          WRITE: / MTAB_PROGRAM_TRDIR-NAME.
        ENDIF.
      ENDLOOP.
    ENDFORM.           " BUILD_PROGRAM_DIRECTORY
          FORM SAVE_TABLE_TO_FILE                   *
    -->  FTAB_TABLE            *
    -->  F_FILENAME            *
    FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
        USING  F_FILENAME.
      IF RB_DOS = 'X'.                  " Save file to presentation server
        CALL FUNCTION 'WS_DOWNLOAD'
             EXPORTING
                  FILENAME = F_FILENAME
                  FILETYPE = 'ASC'
             TABLES
                  DATA_TAB = FTAB_TABLE
             EXCEPTIONS
                  OTHERS   = 4.
        IF SY-SUBRC NE 0.
          WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
                   F_FILENAME COLOR COL_NEGATIVE.
        ENDIF.
      ELSE.            " Save file to application server
        OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
        IF SY-SUBRC = 0.
          LOOP AT FTAB_TABLE.
            TRANSFER FTAB_TABLE TO F_FILENAME.
            IF SY-SUBRC NE 0.
              WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
                       F_FILENAME COLOR COL_NEGATIVE.
            ENDIF.
          ENDLOOP.
        ELSE.
          WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
                   F_FILENAME COLOR COL_NEGATIVE.
        ENDIF.
      ENDIF.           " End RB_DOS
    ENDFORM.           " SAVE_PROGRAM
          FORM READ_REPORT_FROM_DISK                *
          Read report into internal table.  Can read from local or      *
          remote computer       *
    FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
           USING  F_FILENAME.
      DATA:
         LC_MESSAGE(128) TYPE C.
      CLEAR   FTAB_TABLE.
      REFRESH FTAB_TABLE.
      IF RB_DOS = 'X'.
        TRANSLATE F_FILENAME USING '/\'.   " correct slash for Dos PC file
        CALL FUNCTION 'WS_UPLOAD'
             EXPORTING
                  FILENAME            = F_FILENAME
                  FILETYPE            = 'ASC'
             TABLES
                  DATA_TAB            = FTAB_TABLE
             EXCEPTIONS
                  CONVERSION_ERROR    = 1
                  FILE_OPEN_ERROR     = 2
                  FILE_READ_ERROR     = 3
                  INVALID_TABLE_WIDTH = 4
                  INVALID_TYPE        = 5
                  NO_BATCH            = 6
                  UNKNOWN_ERROR       = 7
                  OTHERS              = 8.
        IF SY-SUBRC >< 0.
          WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
        ENDIF.
      ELSEIF RB_UNIX = 'X'.
        TRANSLATE F_FILENAME USING '\/'.   " correct slash for unix
        OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
        IF SY-SUBRC = 0.
          DO.
            READ DATASET F_FILENAME INTO FTAB_TABLE.
            IF SY-SUBRC = 0.
              APPEND FTAB_TABLE.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET F_FILENAME.
        ELSE.
          WRITE: / 'Error reading file from remote computer'
      COLOR COL_NEGATIVE,
                 / LC_MESSAGE,
                 / F_FILENAME.
          SY-SUBRC = 4.
        ENDIF.
      ENDIF.
    ENDFORM.           " READ_REPORT_FROM_DISK
          FORM SPLIT_INCOMING_FILE                  *
    -->  FTAB_PROGRAM_FILE     *
    -->  FTAB_PROGRAM_SOURCE   *
    -->  ` *
    -->  FTAB_PROGRAM_TEXTS    *
    FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
                     STRUCTURE MTAB_PROGRAM_FILE
                FTAB_PROGRAM_SOURCE
                     STRUCTURE MTAB_PROGRAM_SOURCE
                FTAB_PROGRAM_TEXTS
                     STRUCTURE MTAB_PROGRAM_TEXTS
                FTAB_PROGRAM_DOCUMENTATION
                    STRUCTURE MTAB_PROGRAM_DOCUMENTATION
       CHANGING FSTR_TRDIR
                FSTR_THEAD.
      DATA:
        LC_DATATYPE(4) TYPE C,             " Type of data, REPO, TEXP, RDIR
        LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
      LOOP AT FTAB_PROGRAM_FILE.
        LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
        CASE LC_PROGRAM_FILE(9).
          WHEN MC_TRDIR_IDENTIFIER.
            LC_DATATYPE = MC_TRDIR_SHORT.
          WHEN MC_REPORT_IDENTIFIER.
            LC_DATATYPE = MC_REPORT_SHORT.
          WHEN MC_TEXT_IDENTIFIER.
            LC_DATATYPE = MC_TEXT_SHORT.
          WHEN MC_DOC_IDENTIFIER.
            LC_DATATYPE = MC_DOC_SHORT.
          WHEN MC_THEAD_IDENTIFIER.
            LC_DATATYPE = MC_THEAD_SHORT.
          WHEN OTHERS. " Actual contents of report, trdir, or text
            CASE LC_DATATYPE.
              WHEN MC_TRDIR_SHORT.
                FSTR_TRDIR = FTAB_PROGRAM_FILE.
              WHEN MC_REPORT_SHORT.
                FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
                APPEND FTAB_PROGRAM_SOURCE.
              WHEN MC_TEXT_SHORT.
                FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
                APPEND FTAB_PROGRAM_TEXTS.
              WHEN MC_THEAD_SHORT.
                FSTR_THEAD = FTAB_PROGRAM_FILE.
              WHEN MC_DOC_SHORT.
                FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
                APPEND FTAB_PROGRAM_DOCUMENTATION.
            ENDCASE.
        ENDCASE.
      ENDLOOP.
    ENDFORM.           " SPLIT_INCOMING_FILE
          FORM INSERT_NEW_REPORT*
    -->  FTAB_PROGRAM_SOURCE   *
    -->  FTAB_PROGRAM_TEXTS    *
    -->  F_TRDIR               *
    FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
                  STRUCTURE MTAB_PROGRAM_SOURCE
              FTAB_PROGRAM_TEXTS
                   STRUCTURE MTAB_PROGRAM_TEXTS
              FTAB_PROGRAM_DOCUMENTATION
                   STRUCTURE MTAB_PROGRAM_DOCUMENTATION
       USING  FSTR_TRDIR LIKE TRDIR
              FSTR_THEAD LIKE MSTR_THEAD.
      DATA:
        LC_OBJ_NAME LIKE E071-OBJ_NAME,
        LC_LINE2(40)     TYPE C,
        LC_ANSWER(1)     TYPE C.
    *-- read trdir to see if the report already exists, if it does, prompt
    *-- user to overwrite or abort.
      SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
      IF SY-SUBRC = 0. " Already exists
        CONCATENATE 'want to overwrite report'
                    FSTR_TRDIR-NAME
          INTO LC_LINE2 SEPARATED BY SPACE.
        CONCATENATE LC_LINE2
          INTO LC_LINE2.
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  DEFAULTOPTION  = 'N'
                  TEXTLINE1   = 'The selected report already exists, do you'
                  TEXTLINE2      = LC_LINE2
                  TITEL          = 'Report already exists'
                  CANCEL_DISPLAY = SPACE
             IMPORTING
                  ANSWER         = LC_ANSWER
             EXCEPTIONS
                  OTHERS         = 1.
      ELSE.
        LC_ANSWER = 'J'.
      ENDIF.
      IF LC_ANSWER = 'J'.
    *-- Create the TADIR entry.  (TRDIR entry created by INSERT REPORT)
        LC_OBJ_NAME = TRDIR-NAME.
        CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
             EXPORTING
                  WI_E071_PGMID     = 'R3TR'
                  WI_E071_OBJECT    = 'PROG'
                  WI_E071_OBJ_NAME  = LC_OBJ_NAME
                  WI_TADIR_DEVCLASS = '$TMP'
             EXCEPTIONS
                  EXIT              = 3
                  OTHERS            = 4.
        IF SY-SUBRC = 0.
    *-- Create Report
          INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
    *-- Create Texts
          INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
                 LANGUAGE SY-LANGU.
    *-- Save Documentation
          CALL FUNCTION 'DOCU_UPDATE'
               EXPORTING
                    HEAD    = FSTR_THEAD
                    STATE   = 'A'
                    TYP     = 'E'
                    VERSION = '1'
               TABLES
                    LINE    = FTAB_PROGRAM_DOCUMENTATION
               EXCEPTIONS
                    OTHERS  = 1.
        ELSE.
          WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
                   'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
                   FSTR_TRDIR-NAME, 'was not loaded into SAP.'
                      COLOR COL_NEGATIVE INTENSIFIED OFF.
        ENDIF.
      ELSE.
        WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
                 'was not uploaded into SAP.  Action cancelled by user'
                     COLOR COL_NEGATIVE INTENSIFIED OFF.
      ENDIF.
    ENDFORM.           " INSERT_NEW_REPORT
          FORM GET_NAME         *
    -->  VALUE(F_FIELD)        *
    -->  F_NAME                *
    FORM GET_NAME USING VALUE(F_FIELD)
               CHANGING F_NAME.
      DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
            LC_PROG LIKE D020S-PROG,
            LC_DNUM LIKE D020S-DNUM.
      TRANSLATE F_FIELD TO UPPER CASE.
      refresh ltab_fields.
      LTAB_FIELDS-FIELDNAME = F_FIELD.
      append ltab_fields.
      LC_PROG =  SY-REPID .
      LC_DNUM =  SY-DYNNR .
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME     = LC_PROG
                DYNUMB     = LC_DNUM
           TABLES
                dynpfields = ltab_fields
           EXCEPTIONS
                OTHERS     = 01.
      read table ltab_fields index 1.
      IF SY-SUBRC EQ 0.
        F_NAME = LTAB_FIELDS-FIELDVALUE.
        refresh ltab_fields.
      ENDIF.
      CALL FUNCTION 'F4_USER'
           EXPORTING
                OBJECT = F_NAME
           IMPORTING
                RESULT = F_NAME.
    ENDFORM.           " GET_NAME
    Regards,
    Sree

  • Insert report....Directory entry dir

    Hi All,
        I am using the statement INSERT REPORT ..... with the extension DIRECTORY ENTRY dir. This extension specifies the program attributes for the created or overwritten program according to the content of dir. But here the condition is that the dir should have the structure of TRDIR. According to my requirement I need the report title also...which will be available in TRDIRT. Then how can I retrieve the report tilte from the INSERT REPORT statement. Is thr any other way to do this? Please respond as soon as possible.
    Thanks in advance,
    Swapna.

    Hi NagaSwapna,
    You can find the report titile in the table TRDIRT with the filed name TEXT
    give the program name in field NAME.
    Thanks

  • Material Stock Report  for tcode MB5B

    Hello Expert
    I have a SAP report for stock posting date with T-Code as MB5B and
    the report name is RM07MLBD.
    When I enter Material no, plant code , Movement type (101) and selection
    dates for a month, The report is displaying but not break by Movement type instead it is showing all the movement type....?
    Can anyone have idea about this
    REPORT RM07MLBD NO STANDARD PAGE HEADING MESSAGE-ID M7 LINE-SIZE 95.
        REPORT RM07MLBD   (Transaktionscode MB5B)                        *
    correction June 2004 MM                                   "n747306
    wrong the assignment of the MM and FI documents for data  "n747306
    constellation : n MM doc items --> 1 FI doc item          "n747306
    ABAP-Preprocessor removed                                 "n599218 A
    - this version is for release 4.6C and higher             "n599218 A
    - process database table OBEW always                      "n599218 A
    - IS-OIL specific functions :                             "n599218 A
      - define IS-OIL workings fields                         "n599218 A
      - transport and process these fields only when          "n599218 A
        structure MSEG comprise these fields                  "n599218 A
    Improvements :                       Dec. 2003 MM         "n599218
    - print the page numbers                                  "n599218
                                                              "n599218
    - send warnings and error messages only when report is    "n599218
      launched / advoid warnings when user changes entries on "n599218
      the selection screen                                    "n599218
    - send warning M7 689 when user does not restrict the     "n599218
      database in dialog or print mode                        "n599218
    - send warning M7 393 when user deletes the initial       "n599218
      display variant                                         "n599218
                                                              "n599218
    - allow to process the fields MAT_KDAUF, MAT_KDPOS, and   "n599218
      MAT_PSPNR from release 4.5B and higher                  "n599218
                                                              "n599218
    - show the current activity and the progress              "n599218
                                                              "n599218
    - error message 'programmfehler' improved                 "n599218
                                                              "n599218
    - new categories for scope of list                        "n599218
                                                              "n599218
    - use function module for database commit for the update  "n599218
      of the parameters in table ESDUS. This allows to record "n599218
      this transaction for a batch input session using        "n599218
      transaction SHDB                                        "n599218
                                                              "n599218
    - reset the entries for plant when valuation level is     "n599218
      is company code and mode is valuated stock              "n599218
                                                              "n599218
    - enable this report to run in the webreporting mode      "n599218
    Dec. 2002 MM                                              "n571473
    the definition of the selection screen moved from include "n571473
    RM07MLBP into this report                                 "n571473
    Sept 2002 MM                                              "n555246
    log function tax auditor                                  "n555246
    note 547170 :                              August 2002 MM "n547170
    - representation of tied empties improved                 "n547170
      active this function automatically in retail systems    "n547170
    - FORM routines without preprocessor commands and without "n547170
      text elements moved to the new include reports          "n547170
      RM07MLBD_FORM_01and RM07MLBD_FORM_02                    "n547170
    - the function module FI_CHECK_DATE of note 486477 will   "n547170
      be processed when it exists                             "n547170
    - function and documentation of parameter XONUL improved  "n547170
    - display MM documents with MIGO or MB03 depending from   "n547170
      the release                                             "n547170
    - get and save the parameters per user in dialog mode     "n547170
      only in release >= 4.6                                  "n547170
    the following items were improved with note 497992        "n497992
    - wrong results when remaining BSIM entries contain       "n497992
      an other quantity unit as material master MEINS         "n497992
    - improve check FI summarization                          "n497992
    - the messages M7 390, M7 391, and M7 392                 "n497992
    - definition of field g_f_repid for all releases          "n497992
    - incomplete key for access of internal table IT134M      "n497992
      causes wrong plant selection                            "n497992
    - the function "no reversal movement" did not surpress    "n497992
      the original movements; fields "SJAHR" was moved from   "n497992
      from report RM07MLBD_CUST_FIELDS to RM07MLBD            "n497992
    - process valuated subcontractor stock from database      "n497992
      table OBEW if it exists                                 "n497992
    - if FI summarization is active process warning M7 390    "n497992
      for stock type = valuated stock                         "n497992
    - the user wants to restrict the movement type : process  "n497992
      warning M7 391                                          "n497992
    - the user wants to surpress the reversal movements :     "n497992
      process warning M7 392                                  "n497992
    - consider special gain/loss-handling of IS-OIL           "n497992
    - automatic insert of field WAERS currency key into the   "n497992
      field catalogue :                                       "n497992
      - at least one ref. field is active -> WAERS active     "n497992
      - all reference fields are hidden   -> WAERS hidden     "n497992
    - the length of sum fields for values was increased       "n497992
    - customizing for the selection of remaining BSIM entries "n497992
    - customizing for the processing of tied empties          "n497992
    separate time depending authorization for tax auditor     "n486477
    additional fields are displayed in wrong format           "n480130
    report RM07MLBD and its includes improved  Nov 2001       "n451923
    - merging FI doc number into table G_T_MSEG_LEAN improved "n451923
    - handling of the short texts improved                    "n451923
    - some types and data definitions -> include RM07MLDD     "n451923
    error for split valuation and valuated special stock      "n450764
    process 'goods receipt/issue slip' as hidden field        "n450596
    error at start date : material without stock has value    "n443935
    wrong results for docs with customer consignment "W"      "n435403
    error during data selection for plants                    "n433765
    report RM07MLBD and its includes improved  May 10th, 2001 "n400992
    !!! IMPORTANT : DO NOT CHANGE OR DELETE THE COMMENT LINES !!!        *
    - consider the material number during looking for FI documents
    - field "g_cust_color" in include report "RM07MLBD_CUST_FIELDS"
      allows the customer to activate or inactivate the colors in the
      lines with the documents.
    - error during calcuation of start stock for special stock "M"
    - valuted stocks required : no documents found ? continue and
      process empty document table
    - the length of sum fields for quantities has been increased
      to advoid decimal overflow
    - table ORGAN is replaced by G_T_ORGAN
      - it is filled by the following ways :
        - at process time at selection screen if the
          user wants the selection via cc or plant
        - otherwise after the database selection of the stock
          tables
      - it contains less data fields
      - it contains all entries twice, for binary search
        with plant or valuation area
    - selection of databases MKPF and MSEG in one SELECT
      command with an inner JOIN
    - authority checks after the database selections
    - result of database selection from the both database tables
      MSEG and MKPF in working table G_F_MSEG_LEAN instead of
      the tables IMSEG and IMKPF
    - the number of processed data fields was reduced
    - the user has the possibility to increase the number of
      the processed fields deleting the '*' in the types-command
      in include report RM07MLBD_CUST_FIELDS
    - the creation of the field catalog for the ALV considers
      only the fields of structure G_S_MSEG_LEAN
    - the new table G_T_BELEG contains the results for the ALV.
      the number of fields of table G_T_BELEG corresponds with
      the number of fields of table G_T_MSEG_LEAN.
    - the functions "define breakdown" and "choose" are inactivated
      in the menue, because they are are not carried out correctly
      in all blocks of the list
        Anzeige der Materialbestände in einem Zeitintervall              *
    Der Report gliedert sich im wesentlichen in folgende Verarbeitungs- *
    blöcke:                                                             *
    1) Definition des Einstiegsbildes und Vorbelegung einzelner         *
        Selektionsfelder, sowie Prüfung der eingegebenen Selektions-     *
        parameter und Berechtigungsprüfung                               *
    2) Lesen der aktuellen Bestandswerte                                *
    3) Lesen und Verarbeiten der Materialbelege                         *
    4) Berechnung der Bestandswerte zu den vorgegebenen Datümern        *
    5) Ausgabe der Bestände und Materialbelege                          *
    *eject
    *# APP_CALL_DECLARE TEST
    this definitions depend on the release
    TYPE-POOLS:  IMREP,                   " Typen Bestandsführungsreporting
                 SLIS.                    " Typen Listviewer
      for the selection of the reversal movements only in release >=45B
          DATA: BEGIN OF STORNO OCCURS 0,
                  MBLNR LIKE MSEG-MBLNR,
                  MJAHR LIKE MSEG-MJAHR,
                  ZEILE LIKE MSEG-ZEILE,
                  SMBLN LIKE MSEG-SMBLN,
                  SJAHR LIKE MSEG-SJAHR,
                  SMBLP LIKE MSEG-SMBLP,
                END OF STORNO.
    include:  rm07mldd,     " reportspezifische Datendefinitionen
              rm07grid.     " Gitternetz, Formatierung, Farbgebung
    INCLUDE RM07APP1.     "ABAP-PREPROCESSOR  "TEST
    "n571473
    define the selection screen here                          "n571473
    "n571473
    SELECTION-SCREEN BEGIN OF BLOCK Database-selection
              WITH FRAME TITLE TEXT-001.
    Text-001: Datenbankabgrenzungen
    SELECT-OPTIONS: MATNR FOR MARD-MATNR MEMORY ID MAT
                                         MATCHCODE OBJECT MAT1,
                    BUKRS FOR T001-BUKRS  MEMORY ID BUK,
                    WERKS FOR T001W-WERKS MEMORY ID WRK,
                    LGORT FOR T001L-LGORT,
                    CHARG FOR MCHB-CHARG,
                    BWTAR FOR MBEW-BWTAR,
                    BWART FOR MSEG-BWART.
    PARAMETERS SOBKZ LIKE MSEG-SOBKZ.
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS: DATUM FOR MKPF-BUDAT NO-EXTENSION.
    Datumsintervall für Selektion
    SELECTION-SCREEN END OF BLOCK Database-selection.
    SELECTION-SCREEN BEGIN OF BLOCK BESTANDSART
    WITH FRAME TITLE TEXT-002.
    Text-002: Bestandsart
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS LGBST LIKE AM07M-LGBST RADIOBUTTON GROUP BART DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 4(50) TEXT-010 FOR FIELD LGBST.
    Text-010: Lagerort-/Chargenbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS BWBST LIKE AM07M-BWBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-011 FOR FIELD BWBST.
    Text-011: bewerteter Bestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS SBBST LIKE AM07M-SBBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-012 FOR FIELD SBBST.
    Text-012: Sonderbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BESTANDSART.
    improved definition of parameters for scope of list       "n599218
    SELECTION-SCREEN BEGIN OF BLOCK listumfang
      with frame title text-003.  "Listumfang
    the following 3 parameters became obsolete do not use     "n599218
    anymor. They are still here to inform the user about      "n599218
    that he is using old variants or SUBMIT commands          "n599218
      PARAMETERS :                                              "n599218
        XONUL  LIKE AM07M-XONUL            no-display,          "n599218
        XVBST  LIKE AM07M-XVBST            no-display,          "n599218
        XNVBST LIKE AM07M-XNVBS            no-display.          "n599218
    7 new categories for the scope of list                    "n599218
                                                              "n599218
    cat. I docs I stock on   I    I stock on I Parameter      "n599218
         I      I start date I    I end date I                "n599218
    ---+--+--------++------+--------      "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
         I      I            I    I          I                "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
                                                              "n599218
    definition of the pushbutton : show or hide the following "n599218
    parameters for the scope of list                          "n599218
      SELECTION-SCREEN PUSHBUTTON /1(20) PB_LIU                 "n599218
                                 USER-COMMAND LIU.              "n599218
                                                                "n599218
    text line : materials with movements                      "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN COMMENT 1(55) TEXT-072                 "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start = zero  =  end = zero              "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdzer    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-083 : no opening stock ; no closing stock          "n599218
        SELECTION-SCREEN COMMENT 5(70) text-083                 "n599218
                                 FOR FIELD pa_wdzer             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start = zero  =  end <> zero             "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdzew    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-084 : no opening stock ; with closing stock        "n599218
        SELECTION-SCREEN COMMENT 5(70) text-084                 "n599218
                                 FOR FIELD pa_wdzew             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start stock <> 0 / end stock = 0         "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwiz    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-085 : with opening stock ; no closing stock        "n599218
        SELECTION-SCREEN COMMENT 5(70) text-085                 "n599218
                                 FOR FIELD pa_wdwiz             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / with start and end stocks / different    "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwuw    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; changed       "n599218
        SELECTION-SCREEN COMMENT 5(70) text-086                 "n599218
                                 FOR FIELD pa_wdwuw             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / with start and end stock / equal         "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwew    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
        SELECTION-SCREEN COMMENT 5(70) text-087                 "n599218
                                 FOR FIELD pa_wdwew             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    text line : materials without movements                   "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN COMMENT 1(55) TEXT-073                 "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    materials without movements / stocks = zero               "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_ndzer    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-083 : no opening stock ; no closing stock          "n599218
        SELECTION-SCREEN COMMENT 5(70) text-083                 "n599218
                                 FOR FIELD pa_ndzer             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    materials without movements / with start or end stock     "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_ndsto    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
        SELECTION-SCREEN COMMENT 5(70) text-087                 "n599218
                                 FOR FIELD pa_ndsto             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    SELECTION-SCREEN END OF BLOCK listumfang.
    SELECTION-SCREEN BEGIN OF BLOCK EINSTELLUNGEN
       WITH FRAME TITLE TEXT-068.  "Settings
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XSUM LIKE AM07M-XSUM.
    SELECTION-SCREEN COMMENT 4(50) TEXT-019 FOR FIELD XSUM.
    Text-019: nur Summen
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XCHAR LIKE AM07M-XCHRG.
    SELECTION-SCREEN COMMENT 4(50) TEXT-015 FOR FIELD XCHAR.
    Text-015: nur chargenpflichtige Materialien
    Das Kennzeichen 'xchar' bestimmt die Art der Listausgabe entweder
    auf Material- oder Chargenebene.
    SELECTION-SCREEN END OF LINE.
    the function "No reversal movements" is only         "n571473
    available from relaese 4.5B and higher               "n571473
    ( TEXT-026 : No reversal movements )                 "n571473
        SELECTION-SCREEN BEGIN OF LINE.                    "n571473
          SELECTION-SCREEN POSITION 1.                     "n571473
          PARAMETERS NOSTO LIKE AM07M-NOSTO.               "n571473
          SELECTION-SCREEN COMMENT 4(50) TEXT-026          "n571473
                                 FOR FIELD NOSTO.          "n571473
        SELECTION-SCREEN END OF LINE.                      "n571473
    SELECTION-SCREEN END OF BLOCK EINSTELLUNGEN.
    SELECTION-SCREEN BEGIN OF BLOCK LISTE WITH FRAME TITLE TEXT-040.
    PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK LISTE.
    *eject
    new data definitions
    working fields for reading structures from DDIC           "n599218 A
    and check whether IS-OIL is active                        "n599218 A
    types : stab_x031l           type standard table of x031l   "n599218 A
                                 with default key.              "n599218 A
                                                                "n599218 A
    data : g_s_x031l             type x031l,                    "n599218 A
           g_t_x031l             type stab_x031l.               "n599218 A
                                                                "n599218 A
    data : g_f_dcobjdef-name     like dcobjdef-name,            "n599218 A
           g_flag_is_oil_active(01)        type c,              "n599218 A
           g_cnt_is_oil          type i.                        "n599218 A
    contains the a structure with the max. number of fields of
    the database table MSEG, but those lines are comment lines
    with a '*'. The customer can achtivate those lines.
    The activated fields will be selected from the database table
    and are hidden in the list. With the settings in the display
    variant the can be shown.
    INCLUDE                      RM07MLBD_CUST_FIELDS.
    common types structure for working tables
    a) g_t_mseg_lean   results form database selection
    b) g_t_beleg       data table for ALV
    TYPES : BEGIN OF STYPE_MSEG_LEAN,
              MBLNR             LIKE      MKPF-MBLNR,
               MJAHR             LIKE      MKPF-MJAHR,
               VGART             LIKE      MKPF-VGART,
               BLART             LIKE      MKPF-BLART,
               BUDAT             LIKE      MKPF-BUDAT,
               CPUDT             LIKE      MKPF-CPUDT,
               CPUTM             LIKE      MKPF-CPUTM,
               USNAM             LIKE      MKPF-USNAM,
    process 'goods receipt/issue slip' as hidden field        "n450596
               XABLN             LIKE      MKPF-XABLN,          "n450596
               LBBSA             LIKE      T156M-LBBSA,
               BWAGR             LIKE      T156S-BWAGR,
               BUKRS             LIKE      T001-BUKRS,
               BELNR             LIKE      BKPF-BELNR,
               GJAHR             LIKE      BKPF-GJAHR,
               WAERS             LIKE      MSEG-WAERS,
               ZEILE             LIKE      MSEG-ZEILE,
               BWART             LIKE      MSEG-BWART,
               MATNR             LIKE      MSEG-MATNR,
               WERKS             LIKE      MSEG-WERKS,
               LGORT             LIKE      MSEG-LGORT,
               CHARG             LIKE      MSEG-CHARG,
               BWTAR             LIKE      MSEG-BWTAR,
               KZVBR             LIKE      MSEG-KZVBR,
               KZBEW             LIKE      MSEG-KZBEW,
               SOBKZ             LIKE      MSEG-SOBKZ,
               KZZUG             LIKE      MSEG-KZZUG,
               BUSTM             LIKE      MSEG-BUSTM,
               BUSTW             LIKE      MSEG-BUSTW,
               MENGU             LIKE      MSEG-MENGU,
               WERTU             LIKE      MSEG-WERTU,
               SHKZG             LIKE      MSEG-SHKZG,
               MENGE             LIKE      MSEG-MENGE,
               MEINS             LIKE      MSEG-MEINS,
               DMBTR             LIKE      MSEG-DMBTR,
               DMBUM             LIKE      MSEG-DMBUM,
               XAUTO             LIKE      MSEG-XAUTO,
               KZBWS             LIKE      MSEG-KZBWS,
             special flag for retail                          "n497992
               retail(01)        type c,                        "n497992
    define the fields for the IO-OIL specific functions       "n599218 A
             mseg-oiglcalc     CHAR          1                "n599218 A
             mseg-oiglsku      QUAN         13                "n599218 A
               oiglcalc(01)      type  c,                       "n599218 A
               oiglsku(07)       type  p  decimals 3,           "n599218 A
               insmk             like      mseg-insmk,          "n599218 A
    the following fields are used for the selection of
    the reversal movements
              SMBLN    LIKE      MSEG-SMBLN,    " No. doc
              SJAHR    LIKE      MSEG-SJAHR,    " Year          "n497992
              SMBLP    LIKE      MSEG-SMBLP.    " Item in doc
    additional fields : the user has the possibility to activate
    these fields in the following include report
              INCLUDE           TYPE      STYPE_MB5B_ADD.
    TYPES : END OF STYPE_MSEG_LEAN.
    TYPES: STAB_MSEG_LEAN        TYPE STANDARD TABLE OF STYPE_MSEG_LEAN
                                 WITH KEY MBLNR MJAHR.
    data tables with the results for the ALV
    TYPES : BEGIN OF STYPE_BELEGE.
              INCLUDE            TYPE      STYPE_MSEG_LEAN.
    TYPES :   FARBE TYPE SLIS_T_SPECIALCOL_ALV.
    TYPES : END OF STYPE_BELEGE.
    TYPES : STAB_BELEGE          TYPE STANDARD TABLE OF STYPE_BELEGE
                                 WITH KEY  BUDAT MBLNR ZEILE.
    DATA : G_T_BELEGE            TYPE   STAB_BELEGE WITH HEADER LINE,
           G_T_BELEGE1           TYPE   STAB_BELEGE WITH HEADER LINE.
    global working areas data from MSEG and MKPF
    FIELD-SYMBOLS :        TYPE STYPE_MSEG_LEAN.
    DATA : G_S_MSEG_LEAN         TYPE STYPE_MSEG_LEAN,
           G_S_MSEG_UPDATE       TYPE STYPE_MSEG_LEAN,          "n443935
           G_T_MSEG_LEAN         TYPE STAB_MSEG_LEAN.
    working table for the control break                       "n451923
    types : begin of stype_mseg_work.                           "n451923
              include            type      stype_mseg_lean.     "n451923
    types :    tabix             like      sy-tabix,            "n451923
            end of stype_mseg_work,                             "n451923
                                                                "n451923
            stab_mseg_work       type standard table of         "n451923
                                 stype_mseg_work                "n451923
                                 with default key.              "n451923
                                                                "n451923
    data : g_t_mseg_work         type  stab_mseg_work,          "n443935
           g_s_mseg_work         type  stype_mseg_work.         "n443935
    working table for the requested field name from MSEG and MKPF
    TYPES: BEGIN OF STYPE_FIELDS,
               FIELDNAME           TYPE      NAME_FELD,
           END OF STYPE_FIELDS.
    TYPES: STAB_FIELDS           TYPE STANDARD TABLE OF STYPE_FIELDS
                                 WITH KEY FIELDNAME.
    DATA: G_T_MSEG_FIELDS        TYPE      STAB_FIELDS,
          G_S_MSEG_FIELDS        TYPE      STYPE_FIELDS.
    working table for the requested numeric fields of MSEG
    types : begin of stype_color_fields,
               FIELDNAME           TYPE      NAME_FELD,
             type(01)            type c,
           end of stype_color_fields,
           stab_color_fields     type standard table of
                                 stype_color_fields
                                 with default key.
    data: g_t_color_fields       type      stab_color_fields
                                 with header line.
    DATA: BEGIN OF IMSWEG OCCURS 1000,
            MBLNR LIKE MSEG-MBLNR,
            MJAHR LIKE MSEG-MJAHR,
            ZEILE LIKE MSEG-ZEILE,
            MATNR LIKE MSEG-MATNR,
            CHARG LIKE MSEG-CHARG,
            BWTAR LIKE MSEG-BWTAR,
            WERKS LIKE MSEG-WERKS,
            LGORT LIKE MSEG-LGORT,
            SOBKZ LIKE MSEG-SOBKZ,
            BWART LIKE MSEG-BWART,
            SHKZG LIKE MSEG-SHKZG,
            XAUTO LIKE MSEG-XAUTO,
            MENGE LIKE MSEG-MENGE,
            MEINS LIKE MSEG-MEINS,
            DMBTR LIKE MSEG-DMBTR,
            DMBUM LIKE MSEG-DMBUM,
            BUSTM LIKE MSEG-BUSTM,
            BUSTW LIKE MSEG-BUSTW,                               "147374
    define the fields for the IO-OIL specific functions       "n599218 A
          mseg-oiglcalc        CHAR          1                "n599218 A
          mseg-oiglsku         QUAN         13                "n599218 A
            oiglcalc(01)         type  c,                       "n599218 A
            oiglsku(07)          type  p  decimals 3,           "n599218 A
            insmk                like      mseg-insmk,          "n599218 A
          END OF IMSWEG.
    User settings for the checkboxes                          "n547170
      DATA: oref_settings TYPE REF TO cl_mmim_userdefaults.     "n547170
    *eject
    HAUPTPROGRAMM *********************************
    F4-Hilfe für Reportvariante -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    "n599218
    INITIALIZATION                                            "n599218
    "n599218
                                                                "n599218
    pay attentions : this process time will not be processed  "n599218
    in the webreporting mode                                  "n599218
    INITIALIZATION.
    PERFORM APP_PROCESS USING 'ME'. "TEST
      PERFORM initialisierung.
    get the parameters from the last run                      "n547170
      perform                    esdus_get_parameters.          "n547170
    set flag when INITILIZATION is processed
      move  'X'        to  g_flag_initialization.
    "n599218
    AT SELECTION-SCREEN                                       "n599218
    "n599218
    Prüfung der eingegebenen Selektionsparameter, -
    Berechtigungsprüfung -
    AT SELECTION-SCREEN.
    the following 3 parameters XONUL, XVBST, and XNVBST       "n599218
    became obsolete; send error when they should be filled.   "n599218
    This could be possible if the user works with old         "n599218
    selection variants or this report is launched by a        "n599218
    SUBMIT command                                            "n599218
      if  XONUL  is initial  and                                "n599218
          XVBST  is initial  and                                "n599218
          XNVBST is initial.                                    "n599218
    ok, the old parameters are empty                         "n599218
      else.                                                     "n599218
      text-088 : note 599218 : obsolete parameter used        "n599218
        MESSAGE E895             with  text-088.                "n599218
      endif.
    did the user hit the pushbutton "Category" ?              "n599218
      case     SSCRFIELDS-UCOMM.                                "n599218
        when  'LIU '.                                           "n599218
        yes, the pushbutton "Category" was hit                "n599218
          IF  g_flag_status_liu  =  C_HIDE.                     "n599218
          show the 7 parameters on the selection srceen       "n599218
            MOVE  C_SHOW         TO  g_flag_status_liu.         "n599218
          ELSE.                                                 "n599218
          hide the 7 paramaters                               "n599218
            MOVE  C_HIDE         TO  g_flag_status_liu.         "n599218
          ENDIF.                                                "n599218
      ENDcase.                                                  "n599218
                                                                "n599218
    go on only if the user wants to launch this report        "n599218
      check : sy-ucomm = 'ONLI'  or                             "n599218
              sy-ucomm = 'PRIN'  or                             "n599218
              sy-ucomm = 'SJOB'.                                "n599218
      PERFORM eingaben_pruefen.
    check whether FI summarization is active and other        "n547170
    restrictions could deliver wrong results                  "n547170
      perform                    f0800_check_restrictions.      "n547170
    - the user wants to surpress the reversal movements :     "n497992
      process warning M7 392                                  "n497992
        IF NOT NOSTO IS INITIAL.                                "n497992
      emerge warning ?                                        "n497992
          CALL FUNCTION            'ME_CHECK_T160M'             "n497992
              EXPORTING                                         "n497992
                I_ARBGB          = 'M7'                         "n497992
                I_MSGNR          = '392'                        "n497992
              EXCEPTIONS                                    

    Please read the KBA document  2012912 - Changeablility of the field "material group" in purchasing documents
    It clearly says that material group can't be changed in case you will use material master in purchase order.
    So, it is clear that you can't use different material group for material master in purchase order.
    For stock report, system will only show you the material group which is assigned to the material master (MARA-MATKL). System will not look into the purchase order section (like EKPO).

  • Can using query create aging report for GL Account

    Hi all expert,
    I have a challenge scenario which customer request print out aging report for the following GL Account.
    This is not a business partner account. However, customer want display like aging report.
    30 days aging report for the following GL accounts by projects:-
         i)     WIP (Work In Progress) account
         ii)     Accrued Revenue account
         iii)     Accrued Cost account
    Examples:
                            Current Balance       30 day   60 day  90 day   120 day
    Account  WIP         10000               2000        3000      5000     0
    Any idea or example given? If yes, can you provide a query here?
    Regards,
    Eric Tan

    Hi Eric
    In standard SAP Business One this is difficult as the reports are 2 dimensional. To achieve this you will need to write multiple select statements into a temporary table and then select the final result from the temp table. Here is a sample for you to test:
    USE [*DATABASE_NAME*]
    GO
    /****** Object:  StoredProcedure [dbo].[REPORT_NAME]    Script Date: 04/24/2009 13:17:21 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE proc [dbo].[*REPORT_NAME*]
    as
    set nocount on
    begin
    DECLARE @Day_no varchar(2)
    DECLARE @Month_no varchar(2)
    DECLARE @Year_no varchar(4)
    DECLARE @Start_Date Datetime
    SET @Day_no = DAY(GetDate())
    SET @Month_no = MONTH(GetDate())
    SET @Year_no = YEAR(GetDate())
    SET @Start_Date = @Year_No + '/' + @Month_no + '/' + @Day_no --  + '/' + @Year_No
    IF OBJECT_ID(N'tempdb..#CRDAGEING', N'U') IS NOT NULL
    drop table #CRDAGEING
    SELECT T0.[CardCode] AS [CardCode], T0.[CardName] AS [CardName], -T0.[Balance] AS [Balance], CAST(0 AS MONEY) AS [Current], CAST(0 AS MONEY) AS [1Week], CAST(0 AS MONEY) AS [2Weeks], CAST(0 AS MONEY) AS [3Weeks], CAST(0 AS MONEY) AS [4Weeks], CAST(0 AS MONEY) AS [5Weeks], CAST(0 AS MONEY) AS [6Weeks], CAST(0 AS MONEY) AS [Over6Weeks], CAST(0 AS MONEY) AS [Avg3Months], CAST (0 AS MONEY) AS [Onhand] INTO #CRDAGEING FROM OCRD T0 WHERE T0.[CardType] = 'S' -- and T0.[CardCode] <> '' --and T0.[DocDate] >= @FromDate AND T0.[DocDate] <= @ToDate
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] <= @Start_Date GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] >= DATEADD(DAY,1,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,8,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,8,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,15,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,15,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,22,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,22,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,29,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,29,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,36,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,36,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,43,@Start_Date) GROUP BY T1.[ShortName]
    INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,43,@Start_Date)  GROUP BY T1.[ShortName]
    SELECT SR.[CardCode], MAX(SR.[CardName]), SUM(SR.[Balance]) AS [BalanceOwing], SUM(SR.[Current]) AS [Current], SUM(SR.[1Week]) AS [1Week], SUM(SR.[2Weeks]) AS [2Weeks], SUM(SR.[3Weeks]) AS [3Weeks], SUM(SR.[4Weeks]) AS [4Weeks], SUM(SR.[5Weeks]) AS [5Weeks], SUM(SR.[6Weeks]) AS [6Weeks], SUM(SR.[Over6Weeks]) AS [Over6Weeks] FROM dbo.#CRDAGEING SR GROUP BY SR.[CardCode] ORDER BY SR.[CardCode]
    END
    Go to Microsoft SQL Studio manager and select your company database. Then expand the list and select Programmability > Stored Procedures. Right click on Stored Procedures and select New Stored Procedure. Copy the above code over the code in the edit window and change the database name as well as report name. Then select Execute to create the stored procedure. If you make changes, remember to change the word CREATE to ALTER (with other words CREATE for the first execute, and ALTER thereafter). Then in SAP Business One create a new query and leave everything blank. Click on execute and select the pencil to change to edit mode. Remove the words SELECT and type in EXEC REPORT_NAME (change the REPORT_NAME to the name you used in SQL). Then execute again and the results will be displayed in SAP Business One.
    Let me know if you get stuck. Remember the above is an example and will need to be changed to use your tables and fields as required. The basic idea is to move across by one column with each select statement. So for example the first select statement does the CURRENT column, the second one the 30DAYS column, and so on.
    Kind regards
    Peter Juby

  • Report for badi and useexits

    Hi All.
    Is there any program(report) for getting directly BADI's for t.ocdes.
    means if we select a T.code.. the report has to give the related BADI's.
    Thanks,
    srii..

    Hi ,
    This is the code to find BADI's and UserExits Actually i copied this code from SCN long back .
    * Global Declaration
    TABLES : tstc,         " SAP Transaction Codes
             tadir,        " Directory of Repository Objects
             modsapt,      " SAP Enhancements - Short Texts
             modact,       " Modifications
             trdir,        " System Table TRDIR
             tfdir,        " Function Module
             enlfdir,      " Additional Attributes for Function Modules
             sxs_attrt ,   " Exit: Definition side: Attributes, Text table
             tstct.        " Transaction Code Texts
    * Data Declaration
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    DATA wa_tadir TYPE tadir.
    * Selection screen
    PARAMETERS : p_tcode LIKE tstc-tcode,
    p_pgmna LIKE tstc-pgmna .
    * Event: start-of-selection
    START-OF-SELECTION.
      IF NOT p_tcode IS INITIAL.
        SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
      ELSEIF NOT p_pgmna IS INITIAL.
        tstc-pgmna = p_pgmna.
      ENDIF.
      IF sy-subrc EQ 0.
        SELECT SINGLE * FROM tadir
        WHERE pgmid = 'R3TR'
        AND object = 'PROG'
        AND obj_name = tstc-pgmna.
        MOVE : tadir-devclass TO v_devclass.
        IF sy-subrc NE 0.
          SELECT SINGLE * FROM trdir
          WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir
            WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir
            WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir
            WHERE pgmid = 'R3TR'
            AND object = 'FUGR'
            AND obj_name EQ enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
        SELECT * FROM tadir INTO TABLE jtab
        WHERE pgmid = 'R3TR'
        AND object IN ('SMOD', 'SXSD')
        AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct
        WHERE sprsl EQ sy-langu
        AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(105) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
    *Sorting the internal Table
          SORT jtab BY object.
          DATA : wf_txt(60) TYPE c,
          wf_smod TYPE i ,
          wf_badi TYPE i ,
          wf_object2(30) TYPE c.
          CLEAR : wf_smod, wf_badi , wf_object2.
    *Get the total SMOD.
      LOOP AT jtab INTO wa_tadir.
        AT FIRST.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 'Enhancement/ Business Add-in',
          41 sy-vline ,
          42 'Description',
          105 sy-vline.
          WRITE:/(105) sy-uline.
        ENDAT.
        CLEAR wf_txt.
        AT NEW object.
          IF wa_tadir-object = 'SMOD'.
            wf_object2 = 'Enhancement' .
          ELSEIF wa_tadir-object = 'SXSD'.
            wf_object2 = ' Business Add-in'.
          ENDIF.
          FORMAT COLOR COL_GROUP INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 wf_object2,
          105 sy-vline.
        ENDAT.
        CASE wa_tadir-object.
          WHEN 'SMOD'.
            wf_smod = wf_smod + 1.
            SELECT SINGLE modtext INTO wf_txt
            FROM modsapt
            WHERE sprsl = sy-langu
            AND name = wa_tadir-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WHEN 'SXSD'.
    *For BADis
            wf_badi = wf_badi + 1 .
            SELECT SINGLE text INTO wf_txt
            FROM sxs_attrt
            WHERE sprsl = sy-langu
            AND exit_name = wa_tadir-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED ON.
        ENDCASE.
        WRITE:/1 sy-vline,
        2 wa_tadir-obj_name HOTSPOT ON,
        41 sy-vline ,
        42 wf_txt,
        105 sy-vline.
        AT END OF object.
          WRITE : /(105) sy-uline.
        ENDAT.
      ENDLOOP.
      WRITE:/(105) sy-uline.
      SKIP.
      FORMAT COLOR COL_TOTAL INTENSIFIED ON.
      WRITE:/ 'No.of Exits:' , wf_smod.
      WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
      WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
      DATA : wf_object TYPE tadir-object.
      CLEAR wf_object.
      GET CURSOR FIELD field1.
      CHECK field1(8) EQ 'WA_TADIR'.
      READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
      MOVE jtab-object TO wf_object.
      CASE wf_object.
        WHEN 'SMOD'.
          SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
          CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
        WHEN 'SXSD'.
          SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
          CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
      ENDCASE.
      DO 2 TIMES.
      ENDDO.
    Thanks & Regards

  • How to take a report for the assigned transaction and activity in a role

    Hi Colleagues,
    I want to take a report for the assigned transaction with activity for all roles, which are assigned to the users,
    Transaction list for a role i can able to take it from SUIM but not able to take the ACTVT for the role.
    Please suggest how to take this information.
    BR,
    Jai

    Hi Jaikumar from the post :
    I think you have reached the state of finding the USER to ROLE relationship
    Take the output to an excel,
    COPY just the roles column exactly in order do not rearrange , use AGR_1251 like other experts have mentioned
    insert the roles copied from you buffer and execute, the output will have multiple entries for each role take the output to an EXCEL again , make it unique and match the outputs between both the EXCELS.
    It will be a little tricky to do this, but I think you are proficient in MS EXCEL.
    This is one of the ways to do , there are many other ways to do it.

  • Document or report for assessment and reversed assessment?

    Hi guyz,
    Is there any document or report for assessment and reversed assessment?
    I need to find documentation as a proof for any execution and reversal of assessment, such as journal entry or report line items that is showing debit or credit for the expenses..
    Currently, I can only see actual cost document which shows execution of assessment and an assessment cost element debit and credit in the Cost Center Actual/Plan/Variance report.
    However, when I do reversal at KSU5, in the Cost Center A/P/V report is showing that assessment cost element is still exist (no more debit and credit showing as the result of the reversal), only that the value is now zero.
    Need your answer asap...Thanking you..

    Dear Meila,
    Use tcode KSB1 Cost Center Actual Line Itens, execute then report and change the Layout, insert the field Business Transaction in the report.
    Regards

  • Std report for BOM : Reg.

    Hi experts,
         I need to display the materials along with the BOM of those materials with its quantity and its total price while user give the vendor name and date range as input.
    Is there any std report for the same? Try to give apt solution on it.
    Thanks and Regards
    Raaam's...

    Hi,
    CS12 is to get multi-level BOM report. You can insert satndard price field and vendor filed into the layout and you can filter it within the report itself.
    But what if you have several sources of supply and several prices (in info records!) for your goods? And this report can display only the multi-level BOM of one single material...
    If you want a transaction described by you, you should develop an own report in ABAP - I guess...
    You can post this thread in PP forum as well but I'm afraid there's no such kind of standard report in SAP...
    BR
    Csaba

  • Crystal Reports for Visual Studio 2008 - dbf

    Hello,
    I use both Visual Studio 2005 and 2008 on same PC. I can not work with dbf files (format foxpro2x, dbase IV) in VS 2005 and VS 2008.
    Q1. Work Crystal Reports for Visual Studio 2008 with database files - dbf (version foxpro2x, dbaseIV)? I get error -
    Crystal Reports ActiveX Designer
    Failed to load database information
    or with dbf files work only Full version of Crystal Reports?
    Q2. How re-install Crystal Reports for Visual Studio 2008. In setup Add/Remove features not exist Crystal Reports check box. I only Repair/reinstall all Visual Studio but after reinstall same error
    Crystal Reports ActiveX Designer
    Failed to load database information
    3. When I can open sample project with Crystal Reports which use Crystal Reports (dbf file) this error is displayed:
    Crystal Report Viever
    Failed to load database information
    Details: The database DLL "crdb_p2bxbse.dlll" could not be loaded.
    4. I reinstal Crystal Report in Visual Studio 2005 - same error
    5. I apply hotfix Crystal Reports for .NET 2005 - SP 1 - same error
    Thank You
    Ludek

    Hi Ludek,
    1-For dbase file to work you need have permission on database files for IIS as well as user accessing the database.
    2-For re-install you need to insert the CD of visual studio setup then do custom install and then try to choose crystal reports for re-installing
    3-The old viewer might cause the problem. In this case can you try connecting to a blank dbase file.
    and for such issues we have a special forum [here|SAP Crystal Reports, version for Visual Studio;
    Thanks,
    Hitesh Mangtani

Maybe you are looking for

  • Error while sending mail in RDI Format

    Hi All I have a requirement automate sending of invoices customers via fax and e-mail in RDI format. For this I created a from and used the parameter raw_data_interface = 'X' for this and for sending mail filled the parameters MAIL_SENDER and MAIL_RE

  • Condition isn't working properly

    hi, in MM pricing in subcontracting issue i want to add additional value on material price for that i create Z condition type but when i am inputing the value manually it is not adding in base price. The same procedure is working fine in devlopment b

  • Lightroom Raw and CR2 from my new 70d

         I just purchased my very own Canon 70d.  I find that the RAW module I have in Photoshop Elements 9 is not compatible with the .CR2 raw files my new camera generates, nor can the Organizer recognize the .CR2 format.  I wanted to find out what the

  • Query text fileds with ADO/OLEDB connection (Set command over ADO is it pos

    Dear Oracle users, I try to query the TEXT field of dba_views but run into the problem that the return lengths is limited to 80 characters. On iSQLplus I can use the command e.g. "set long 1000". If I try to use this command over the ADO connection b

  • I have an airport extreme with a USB printer attached (non-airprint).  Can i print from my ipad?

    I have an airport extreme with a USB printer attached, it is a non airprint printer. I can print via my network from my desktop but I want to know if i can print from my ipad 2 and ipad 1