Need help regd standard report

Hi Experts,
                 I have a requirement where i need to add a check box on the selction screen for the standard program Stock card and inventory material report .
program name : J_1HSTCD.
my concern is ,
1. Is it possible to do, if i copy it to a Z progam,
2. Since it deals with logical data base what will be the impact if i do the modification, (whether a minor or major changes required).
3. How difficult it is ?
please i need it urgent, since i am new to abap , i dont know the correct solution.
please advise....
Many thanks,
Soyunee

Hi,
1.Yes,it is possible to do copt into zreport and make changes.
2.If your changes are not reflect to the LDB,Then it is ok.It is medium Task,you can handle it normal way.
Regards,
Shiva Kumar

Similar Messages

  • Need help in standard report

    Hi  experts,
    Need to change account number decription as  long text  in starndard  GAL A/C BALANCE report G/L S_PLO_86000030
    any idea would be great.
    Regards,
    venkatesh

    After executing report S_PL0_86000030, you will get the ouput.
    On the output screen,
    - Click on the any account name
    - Then select Settings > Characteristics Display (Select Lead Column, if asked)
    - Here you can define whether long text will come or short text will come.
    Regards,
    Gaurav

  • Need help on classical report

    hi friends i need help on classical reports,
    sold-party,
    material
    sales and distrubitutation channel ,division,
    incoming orders,order number,invoice ,credit,
    i need sub totals and final total of invoice and each customer should display in new page .

    Hi
    Use the Tables KNA1,VBAk,VBAP,VBRK and VBRP and design the report
    see the sample report using KNA1,VBAK and VBAP.
    REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
    HEADING.
    *TABLES DECLARATION
    TABLES : KNA1, VBAK, VBAP.
    *SELECT OPTIONS
    SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
    *INITIALIZATION
    INITIALIZATION.
    CUST_NO-LOW = '01'.
    CUST_NO-HIGH = '5000'.
    CUST_NO-SIGN = 'I'.
    CUST_NO-OPTION = 'BT'.
    APPEND CUST_NO.
    *SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN ON CUST_NO.
    LOOP AT SCREEN.
    IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
    MESSAGE E001(ZTJ1).
    ENDIF.
    ENDLOOP.
    *BASIC LIST SELECTION
    START-OF-SELECTION.
    SELECT KUNNR NAME1 ORT01 LAND1 INTO
    (KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
    FROM KNA1
    WHERE KUNNR IN CUST_NO.
    WRITE:/1 SY-VLINE,
    KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
    16 SY-VLINE,
    KNA1-NAME1 UNDER 'NAME',
    61 SY-VLINE,
    KNA1-ORT01 UNDER 'CITY',
    86 SY-VLINE,
    KNA1-LAND1 UNDER 'COUNTRY',
    103 SY-VLINE.
    HIDE: KNA1-KUNNR.
    ENDSELECT.
    ULINE.
    *SECONDARY LIST ACCESS
    AT user-command.
    IF SY-UCOMM = 'IONE'.
    PERFORM SALES_ORD.
    ENDIF.
    IF SY-UCOMM = 'ITWO'.
    PERFORM ITEM_DET.
    ENDIF.
    *TOP OF PAGE
    TOP-OF-PAGE.
    FORMAT COLOR 1.
    WRITE : 'CUSTOMER DETAILS'.
    FORMAT COLOR 1 OFF.
    ULINE.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'CUSTOMER NO.',
    16 SY-VLINE,
    18 'NAME',
    61 SY-VLINE,
    63 'CITY',
    86 SY-VLINE,
    88 'COUNTRY',
    103 SY-VLINE.
    ULINE.
    FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR SECONDARY LISTS
    TOP-OF-PAGE DURING LINE-SELECTION.
    *TOP OF PAGE FOR 1ST SECONDARY LIST
    IF SY-UCOMM = 'IONE'.
    ULINE.
    FORMAT COLOR 1.
    WRITE : 'SALES ORDER DETAILS'.
    ULINE.
    FORMAT COLOR 1 OFF.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'CUSTOMER NO.',
    16 SY-VLINE,
    18 'SALES ORDER NO.',
    40 SY-VLINE,
    42 'DATE',
    60 SY-VLINE,
    62 'CREATOR',
    85 SY-VLINE,
    87 'DOC DATE',
    103 SY-VLINE.
    ULINE.
    ENDIF.
    FORMAT COLOR 3 OFF.
    *TOP OF PAGE FOR 2ND SECONDARY LIST
    IF SY-UCOMM = 'ITWO'.
    ULINE.
    FORMAT COLOR 1.
    WRITE : 'ITEM DETAILS'.
    ULINE.
    FORMAT COLOR 1 OFF.
    FORMAT COLOR 3.
    WRITE : 1 SY-VLINE,
    3 'SALES ORDER NO.',
    40 SY-VLINE,
    42 'SALES ITEM NO.',
    60 SY-VLINE,
    62 'ORDER QUANTITY',
    103 SY-VLINE.
    ULINE.
    ENDIF.
    FORMAT COLOR 3 OFF.
    *END OF PAGE
    END-OF-PAGE.
    ULINE.
    WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
    SY-PAGNO.
    SKIP.
    *& Form SALES_ORD
    *& FIRST SECONDARY LIST FORM
    FORM SALES_ORD .
    SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
    (VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
    FROM VBAK
    WHERE KUNNR = KNA1-KUNNR.
    WRITE:/1 SY-VLINE,
    VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
    16 SY-VLINE,
    VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
    40 SY-VLINE,
    VBAK-ERDAT UNDER 'DATE',
    60 SY-VLINE,
    VBAK-ERNAM UNDER 'CREATOR',
    85 SY-VLINE,
    VBAK-AUDAT UNDER 'DOC DATE',
    103 SY-VLINE.
    HIDE : VBAK-VBELN.
    ENDSELECT.
    ULINE.
    ENDFORM. " SALES_ORD
    *& Form ITEM_DET
    *& SECOND SECONDARY LIST FORM
    FORM ITEM_DET .
    SELECT VBELN POSNR KWMENG INTO
    (VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
    FROM VBAP
    WHERE VBELN = VBAK-VBELN.
    WRITE : /1 SY-VLINE,
    VBAP-VBELN UNDER 'SALES ORDER NO.',
    40 SY-VLINE,
    VBAP-POSNR UNDER 'SALES ITEM NO.',
    60 SY-VLINE,
    VBAP-KWMENG UNDER 'ORDER QUANTITY',
    103 SY-VLINE.
    ENDSELECT.
    ULINE.
    ENDFORM. " ITEM_DET
    REPORT demo_list_at_pf.
    START-OF-SELECTION.
    WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
    AT pf5.
    PERFORM out.
    AT pf6.
    PERFORM out.
    AT pf7.
    PERFORM out.
    AT pf8.
    PERFORM out.
    FORM out.
    WRITE: 'Secondary List by PF-Key Selection',
    / 'SY-LSIND =', sy-lsind,
    / 'SY-UCOMM =', sy-ucomm.
    ENDFORM.
    After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
    Secondary List by PF-Key Selection
    SY-LSIND = 14
    SY-UCOMM = PF06
    Example for AT USER-COMMAND.
    REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
    START-OF-SELECTION.
    WRITE: 'Basic List',
    / 'SY-LSIND:', sy-lsind.
    TOP-OF-PAGE.
    WRITE 'Top-of-Page'.
    ULINE.
    TOP-OF-PAGE DURING LINE-SELECTION.
    CASE sy-pfkey.
    WHEN 'TEST'.
    WRITE 'Self-defined GUI for Function Codes'.
    ULINE.
    ENDCASE.
    AT LINE-SELECTION.
    SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
    PERFORM out.
    sy-lsind = sy-lsind - 1.
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'FC1'.
    PERFORM out.
    WRITE / 'Button FUN 1 was pressed'.
    WHEN 'FC2'.
    PERFORM out.
    WRITE / 'Button FUN 2 was pressed'.
    WHEN 'FC3'.
    PERFORM out.
    WRITE / 'Button FUN 3 was pressed'.
    WHEN 'FC4'.
    PERFORM out.
    WRITE / 'Button FUN 4 was pressed'.
    WHEN 'FC5'.
    PERFORM out.
    WRITE / 'Button FUN 5 was pressed'.
    ENDCASE.
    sy-lsind = sy-lsind - 1.
    FORM out.
    WRITE: 'Secondary List',
    / 'SY-LSIND:', sy-lsind,
    / 'SY-PFKEY:', sy-pfkey.
    ENDFORM.
    When you run the program, the system displays the following basic list with a the page header defined in the program:
    You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status.
    Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton.
    For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1.
    Reward points for useful Answers
    Regards
    Anji

  • Need help on Oracle Report format

    Hi,
    I need help on Oracle Reports. I am generating a report in excel sheet. I have a column which is 13 digit number (In database it is CHAR datatype). In excel sheet it showing some thing like 9.78381E+12. I want to show complete number like 9783805591331.
    Also sometimes leading zero's are not showing when my column values is something like 0098794859583. I need to show the leading zero's as well in excel without losing them.
    Below are the parameters i am using for the report
    DESFORMAT=SPREADSHEET AND DESTYPE=FILE
    My Oracle 9i developer version.
    Any help on this would be much appreciated.
    Thanks
    Kishore

    An additional quote string ' character with the number field will solve this problem but if u want to display this field in report then it will look ugly
    '''||yourfield from table; check ur regional settings also
    plz mark it helpful correct if it is

  • Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c

    Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c.  I need assistance on connecting these together so I can run a report.  I am not an IT person so if someone could dumb it down it would be great.
    Thanks,
    NBGHealth

    Hello,
    I assume GBS Agency Expert 6.7.6c is some sort of database or data source? If you have an ODBC driver then create or use a System DSN to the database. Then you can create a report using that DSN.
    Otherwise I suggest you contact the makers of GBS Agency Expert 6.7.6c and ask them how to connect to the database.
    Let them know CR is ANSII 92 ODBC 3 compliant.
    Thank you
    Don

  • Need help in dynamic report for a range of year and period

    Dear all,
    I need help in creating an ALV report with dynamic columns based on the Year and period entered on the selection screen. for example if in the year we enter 2002 and period range from 10 to 12 then we should get the 3 columns display for cost(example) for period 10/2002, 11/2002 and 12/2002.
    Can anyone help me in achieving this dynamically since the user can enter the year also in intervals along with the period and data also needs to be populated in the corresponding columns.
    An example code would be of great help.
    Thanks,
    Amit

    Hi,
    Use field symbols as follows.
    TYPE-POOLS : SLIS.
    TABLES : MARC,T001W.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARC-MATNR,
           END OF ITAB.
    DATA : FIELDSTAB TYPE LVC_T_FCAT,
           STAB      TYPE LVC_S_FCAT,
           T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           S_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           NEW_LINE TYPE REF TO DATA,
           NEW_TABLE TYPE REF TO DATA,
           INDEX(3) TYPE C,
           STR(70),
           TEXT(6),
           CNT(1),
           TEXT1(16),
           REPID LIKE SY-REPID.
    FIELD-SYMBOLS : <FS> TYPE STANDARD TABLE,
                    <WA> TYPE ANY.
    SELECT-OPTIONS : S_WERKS FOR MARC-WERKS NO INTERVALS,
                     S_MATNR FOR MARC-MATNR NO INTERVALS.
    INITIALIZATION.
      REPID = SY-REPID.
    START-OF-SELECTION.
      SELECT * FROM MARC
               INTO CORRESPONDING FIELDS OF TABLE ITAB
               WHERE MATNR IN S_MATNR
               AND   WERKS IN S_WERKS.
      SORT ITAB BY MATNR.
      DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR.
      STAB-FIELDNAME = 'MATNR'.
      STAB-DATATYPE  = 'CHAR'.
      STAB-INTLEN    = '18'.
      APPEND STAB TO FIELDSTAB.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR TEXT.
        CNT = CNT + 1.
        CONCATENATE  'EISLO' CNT INTO TEXT.
        STAB-FIELDNAME = TEXT.
        STAB-DATATYPE  = 'CHAR'.
        STAB-INTLEN    = '16'.
        APPEND STAB TO FIELDSTAB.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = FIELDSTAB
        IMPORTING
          EP_TABLE        = NEW_TABLE.
      ASSIGN NEW_TABLE->* TO <FS>.
      CREATE DATA NEW_LINE LIKE LINE OF <FS>.
      ASSIGN NEW_LINE->* TO <WA>.
      PERFORM MOVE_DATA.
      CLEAR S_FIELDCAT.
      S_FIELDCAT-FIELDNAME = 'MATNR'.
      S_FIELDCAT-TABNAME = ITAB.
      S_FIELDCAT-SELTEXT_M = 'Part Number'.
      S_FIELDCAT-NO_ZERO = 'X'.
      S_FIELDCAT-DDICTXT   = 'M'.
      APPEND S_FIELDCAT TO T_FIELDCAT.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR T001W.
        CNT = CNT + 1.
        SELECT SINGLE * FROM T001W WHERE WERKS = S_WERKS-LOW AND SPRAS = SY-LANGU.
        CLEAR TEXT.
        CONCATENATE 'EISLO' CNT INTO TEXT.
        S_FIELDCAT-FIELDNAME = TEXT.
        S_FIELDCAT-SELTEXT_M = T001W-NAME2.
    S_FIELDCAT-NO_ZERO = 'X'.
        S_FIELDCAT-DDICTXT   = 'M'.
        APPEND S_FIELDCAT TO T_FIELDCAT.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IT_FIELDCAT = T_FIELDCAT[]
        TABLES
          T_OUTTAB    = <FS>.
    *&      Form  MOVE_DATA
          text
    FORM MOVE_DATA.
      LOOP AT ITAB.
        CLEAR STR.
        CONCATENATE ITAB-MATNR ' ' INTO STR SEPARATED BY SPACE.
        LOOP AT S_WERKS.
          CLEAR MARC.
          SELECT SINGLE * FROM MARC WHERE MATNR = ITAB-MATNR AND WERKS = S_WERKS-LOW.
          IF SY-SUBRC EQ 0.
            CLEAR TEXT1.
            TEXT1 = MARC-EISLO.
            CONCATENATE STR TEXT1 INTO STR SEPARATED BY SPACE.
          ELSE.
            CONCATENATE STR '0' INTO STR SEPARATED BY SPACE.
          ENDIF.
        ENDLOOP.
        <WA> = STR.
        APPEND <WA> TO <FS>.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    "MOVE_DATA
    Reward points if helpful.
    Regards,
    Sankar..

  • Need Help XML Publisher Report

    Hi Friends
    I need to generate a report in xml publisher responsibility .
    I have create and designed the RTF file using word , And i have genetared an XML file(template )
    I have some doubt please clarify by doubts
    In RTF template i have some 4columns
    For EXample i Give some column name
    Invoice Number , Invoice Line Number ,Tax Type ,Tax Code Name etc....
    In my RTF I have done like this
    I have created two 2 row and 4column
    In the 1st row i have all the 4 column heading
    In the 2nd row i have done like this
    Developer tab> Design mode > In the legacy tool i have selected text Form field
    Once i double click the text form field in the default text i have Given C1 Then in the Add help text button i have given <?C_INVOICE_NUMBER?> like this i have done for alls the columns
    My RTF design is completed
    Now i need load the XML is it?
    In the XMl data query i have placed my sql statement
    Here my doubt starts
    wether all the column in the RTF should be in the XML sql statement ha?
    2)In the top of my RTF i need to add date and page No how to add that ?
    Thanks In advance
    AT

    Hi Friend
    Iam saying this is my XML file
    <LIST_G_TAX_NAME>
    <G_TAX_NAME>
    <C_SORT_TAX_NAME>USE TAX</C_SORT_TAX_NAME>
    <C_TAX_NAME>Use Tax</C_TAX_NAME>
    <C_TAX_RATE>8.25</C_TAX_RATE>
    <C_TAX_TYPE>USE</C_TAX_TYPE>
    <C_PERIOD_NAME>OCT-11</C_PERIOD_NAME>
    <LIST_G_VENDOR>
    <G_VENDOR>
    <C_SORT_VENDOR_NAME/>
    <C_SORT_SITE_CODE/>
    <C_VENDOR_ID>851</C_VENDOR_ID>
    <C_VENDOR_NAME>ORACLE CORPORATION</C_VENDOR_NAME>
    <C_SITE_CODE>CHICAGO</C_SITE_CODE>
    <LIST_G_INVOICE>
    <G_INVOICE>
    <C_INVOICE_DATE>17-OCT-11</C_INVOICE_DATE>
    <C_SORT_INVOICE_NUMBER>1308</C_SORT_INVOICE_NUMBER>
    <C_INVOICE_ID>350889</C_INVOICE_ID>
    <C_INVOICE_NUMBER>1308</C_INVOICE_NUMBER>
    <C_INVOICE_LINE_NUMBER>1</C_INVOICE_LINE_NUMBER>
    <C_PO_NUMBER>256388</C_PO_NUMBER>
    <C_DESCRIPTION>TEST</C_DESCRIPTION>
    <C_GL_DATE>17-OCT-11</C_GL_DATE>
    <C_INVOICE_LINE_AMOUNT>15</C_INVOICE_LINE_AMOUNT>
    <C_CHARGE_ACCOUNT>412.00.6410.7831.1076.1001.00.000.0000</C_CHARGE_ACCOUNT>
    <C_LIABILITY_ACCOUNT>412.00.0000.2152.1208.1001.00.000.0000</C_LIABILITY_ACCOUNT>
    <C_BATCH_NAME>101711</C_BATCH_NAME>
    <C_SITE_CODE2>CHICAGO</C_SITE_CODE2>
    <C_INVOICE_AMOUNT>15</C_INVOICE_AMOUNT>
    <LIST_G_DIST>
    <G_DIST>
    <C_INVOICE_TAX_ID>10061</C_INVOICE_TAX_ID>
    <C_LINE_TYPE>ITEM</C_LINE_TYPE>
    </G_DIST>
    </LIST_G_DIST>
    <C_TAXABLE_AMOUNT>15</C_TAXABLE_AMOUNT>
    <C_TAX_AMOUNT>1.24</C_TAX_AMOUNT>
    <C_INVOICE_AMOUNT_DISP> 15.00 </C_INVOICE_AMOUNT_DISP>
    <C_TAXABLE_AMOUNT_DISP> 15.00 </C_TAXABLE_AMOUNT_DISP>
    <C_TAX_AMOUNT_DISP> 1.24 </C_TAX_AMOUNT_DISP>
    </G_INVOICE>
    </LIST_G_INVOICE>
    <C_INVOICE_SITE_SUM>124.9</C_INVOICE_SITE_SUM>
    <C_INVOICE_SITE_SUM_DISP> 124.90 </C_INVOICE_SITE_SUM_DISP>
    <C_TAX_SITE_SUM>5.4</C_TAX_SITE_SUM>
    <C_TAX_SITE_SUM_DISP> 5.40 </C_TAX_SITE_SUM_DISP>
    <C_TAXABLE_SITE_SUM>65.66</C_TAXABLE_SITE_SUM>
    <C_TAXABLE_SITE_SUM_DISP> 65.66 </C_TAXABLE_SITE_SUM_DISP>
    </G_VENDOR>
    </LIST_G_VENDOR>
    <C_OLD_VENDOR_ID>0</C_OLD_VENDOR_ID>
    <C_INVOICE_SUM>124.9</C_INVOICE_SUM>
    <C_INVOICE_SUM_DISP> 124.90 </C_INVOICE_SUM_DISP>
    <C_TAX_SUM>5.4</C_TAX_SUM>
    <C_TAX_SUM_DISP> 5.40 </C_TAX_SUM_DISP>
    <C_TAXABLE_SUM>65.66</C_TAXABLE_SUM>
    <C_TAXABLE_SUM_DISP> 65.66 </C_TAXABLE_SUM_DISP>
    </G_TAX_NAME>
    </LIST_G_TAX_NAME>
    And if i need all the column to be displayed in my report
    1)Invoice Number
    2)Invoice Line Number
    3)Tax Type
    4)Tax Code Name
    5)Tax Rate Percent
    6)Supplier Name
    7)Description
    8)Gl Date
    9)Invoive Line Amount
    10)Taxable Line Amount
    11)Tax Liability
    12)Po Number
    13)Charge Account
    14)Liability Account
    Which tag do i need to use fro grouping
    For ex
    Instead of this <?for-each:G_TAX_NAME?> <?end for-each?>
    which one i need to use
    Please help
    Thanks
    AT

  • Need list of Standard Reports in BW

    Hi all,
           I have to prepare a document on All standard reports on application wise that
    are available in the business content.
    Can any one provide me the list or please let me know the fastest way to find out the queries.
    Thanks & Regards
    Ramakanth.

    Hi,
    MM-
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/62073c44564d59e10000000a114084/frameset.htm
    Inventory
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fb/64073c52619459e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/f7/64073c52619459e10000000a114084/frameset.htm
    SD-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/cd5e407aa4c44ce10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/ed/62073c44564d59e10000000a114084/frameset.htm
    FI-GL Queries :
    http://help.sap.com/saphelp_nw04/helpdata/en/53/dd153c4eb5d82ce10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/95/de153c4eb5d82ce10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a7f2f294-0501-0010-11bb-80e0d67c3e4a
    http://help.sap.com/bp_biv335/BI_EN/html/BW/FinancialAccounting.htm
    Regards
    CSM Reddy

  • I need help in Custom Reporting

    Hi,
    i need help in auditing, SCOM 2012 R2 is deployed in 2 servers with ACS, i have 2 file server that has some shared folder in which users work on some certain document i need to have a report that i can run on certain file that will show me who access that
    file when he access what he did like (read write, delete). i don't think we have this type of capability in default report. let me know if someone can help me in that. (free/paid) i know its a bit customized. let me know if u need any more info.
    Syed Kasif

    Hi,
    As far as I know, to audit file access, we should Enable Audit Policy, and then Set up Audit System Access Control List (SACL).
    After that, we can make sure that under security event logs there are auditing logs for file access.
    Please refer to the below link for more details about auditing file access on file server:
    http://blogs.technet.com/b/mspfe/archive/2013/08/27/auditing-file-access-on-file-servers.aspx
    And for Collecting Security Events Using Audit Collection Services in Operations Manager:
    http://technet.microsoft.com/en-us/library/hh212908.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Need Help on calling report in OAF Page

    Hi,
    At present i am wokring EAM Module. Here i need to call one report.
    In my OAF Page one button is there("The name of the button is *Issue*"). After clicking this button i need to fire one report(The name of the report is "Maintenance Picking Slip Issued Report").
    Please help me how to call report? I don't have any idea how to proceed for this.please explain clearly.
    Thanks in advance..
    Thanks,
    Somasekhar.

    Somasekhar,
    you want to call PLSQL Report or XML Publisher report or you want to submit the concurrent request.
    If this XML Publisher report then refer following code for your refrence
    public BlobDomain getXMLData(String as[], String s, String s1, String s2, String s3, String s4, String s5,
    String s6, String s7, String s8, String s9, String s10)
    throws Throwable
    int i;
    int j;
    int k;
    int l;
    int i1;
    int j1;
    int k1;
    int l1;
    int i2;
    int j2;
    int k2;
    OracleCallableStatement oraclecallablestatement;
    ARRAY array;
    int ai[] = new int[as.length];
    i = 0;
    j = 0;
    k = 0;
    l = 0;
    i1 = 0;
    j1 = 0;
    k1 = 0;
    l1 = 0;
    i2 = 0;
    j2 = 0;
    k2 = 0;
    for(int l2 = 0; l2 < as.length; l2++)
    ai[l2] = Integer.parseInt(as[l2]);
    if(s.equals("Y"))
    i = 1;
    if(s1.equals("Y"))
    j = 1;
    if(s2.equals("Y"))
    k = 1;
    if(s3.equals("Y"))
    l = 1;
    if(s4.equals("Y"))
    i1 = 1;
    if(s5.equals("Y"))
    j1 = 1;
    if(s6.equals("Y"))
    k1 = 1;
    if(s7.equals("Y"))
    l1 = 1;
    if(s8.equals("Y"))
    j2 = 1;
    if(s10.equals("Y"))
    k2 = 1;
    i2 = Integer.parseInt(s9);
    DBTransaction dbtransaction = getDBTransaction();
    String s11 = "BEGIN :1 :=EAM_WorkOrderRep_PVT.getWoReportXML(:2, :3, :4, :5, :6, :7, :8, :9,:10,:11,:12,:13); END;";
    oraclecallablestatement = (OracleCallableStatement)dbtransaction.createCallableStatement(s11, 1);
    java.sql.Connection connection = oraclecallablestatement.getConnection();
    ArrayDescriptor arraydescriptor = ArrayDescriptor.createDescriptor("SYSTEM.EAM_WIPID_TAB_TYPE", connection);
    array = new ARRAY(arraydescriptor, connection, ai);
    BlobDomain blobdomain;
    oraclecallablestatement.registerOutParameter(1, 2005);
    oraclecallablestatement.setArray(2, array);
    oraclecallablestatement.setInt(3, i);
    oraclecallablestatement.setInt(4, j);
    oraclecallablestatement.setInt(5, k);
    oraclecallablestatement.setInt(6, l);
    oraclecallablestatement.setInt(7, k1);
    oraclecallablestatement.setInt(8, l1);
    oraclecallablestatement.setInt(10, i1);
    oraclecallablestatement.setInt(11, j1);
    oraclecallablestatement.setInt(9, j2);
    oraclecallablestatement.setInt(12, i2);
    oraclecallablestatement.setInt(13, k2);
    oraclecallablestatement.execute();
    CLOB clob = ((OracleCallableStatement)oraclecallablestatement).getCLOB(1);
    blobdomain = new BlobDomain();
    OutputStream outputstream = blobdomain.getBinaryOutputStream();
    long l3 = clob.length();
    byte abyte0[] = new byte[(int)l3];
    String s12 = clob.getSubString(1L, (int)l3);
    abyte0 = s12.getBytes("UTF-8");
    outputstream.write(abyte0);
    outputstream.close();
    return blobdomain;
    SQLException sqlexception;
    sqlexception;
    try
    oraclecallablestatement.close();
    catch(Exception exception) { }
    throw OAException.wrapperException(sqlexception);
    public void initSearchCriteria()
    log(this, "init search crieria", 1);
    getWorkPlanSearchCriteriaVO().executeQuery();
    Let me know you got your point or not.
    Thanks,
    Kumar

  • Need help to create report with jpeg/gif image

    Hello,
    I need help with creating a form with a special jpeg/gif seal. I never done this Java. Until now, I created all forms with ansi C++ with HP escape characters to draw lines, boxs, and text. This form will contain boxes which is populated with database information read from a text file.
    Since this form contains a special seal on the upper right, I don't think it can be done with old fashion ansi C++. How can I create a form with Java and create it as a simple exe to just print the form to a specified printer.
    Thanks,
    John

    Hi,
    I am creating a form with boxes (lines and text). What is special about this form is that it has an image jpeg or gif at the top right corner. Is is a state department seal. Up to this form, I had used ansi C++ and print out escape HP character to print out the lines, boxes, and text. I have no idea how to print out the image. I am new to JAVA and only 1 class in it. Is there sample code out there to create this type of form with the image? I need a starting point.
    Thanks,
    John

  • Need to find standard reports

    Hi all,
        Where can I find the standard reports in FI module, how can I activate those? Where can i get the documentation regarding those reports?
    Thank you in advance,
    Chandra.

    Hi
    Please goto SE81 and click on FI.
    You will get the standard packages for FI with the programs available
    Please check out this link
    http://www.sap-img.com/financial/useful-reports-tcode-in-sap-financial-accounting.htm
    Message was edited by: Dominic  Pappaly

  • Need help with simple report built in CR in Eclipse

    I'm using the Java SDK in Eclipse to be able to leverage a function that does not appear to be native in Crystal Reports - auto refresh.  Looking at the SDK, it appears straight forward to create a viewer on an existing report (built via Crystal Reports) and then refresh the data in a loop.  First glance at the SDK it appeared CrystalReportViewer would be the right class, but I didn't find that in the CR Java Runtime Library that comes with cr4e download.  So, I used ReportViewerBean, at least to prove out the concept.  Here's the prototype code (high-level), using the bean:
    public static void main (...) throws ReportSDKException
         ReportViewerBean viewer = new ReportViewerBean();
         viewer.setReportSource(path to the .rpt file);
         viewer.init();
         viewer.start();
         while (...) {
              viewer.refreshReport();
    What else is needed to display the report?
    Thanks,
    Roger

    I'm using the Java SDK in Eclipse to be able to leverage a function that does not appear to be native in Crystal Reports - auto refresh.  Looking at the SDK, it appears straight forward to create a viewer on an existing report (built via Crystal Reports) and then refresh the data in a loop.  First glance at the SDK it appeared CrystalReportViewer would be the right class, but I didn't find that in the CR Java Runtime Library that comes with cr4e download.  So, I used ReportViewerBean, at least to prove out the concept.  Here's the prototype code (high-level), using the bean:
    public static void main (...) throws ReportSDKException
         ReportViewerBean viewer = new ReportViewerBean();
         viewer.setReportSource(path to the .rpt file);
         viewer.init();
         viewer.start();
         while (...) {
              viewer.refreshReport();
    What else is needed to display the report?
    Thanks,
    Roger

  • Need help in Interactive Report

    hi,
    i am using a ALV report now i want to make it interactive. as i click on the current page i need to go MIR4 transaction. how can i do it?
    please please help on this issue.

    to make an alv interactive  i did the following steps
    try it by yourself then only u can learn dont copy and paste the code
    step1: declare an iternal table and work area of the type
    data: it_events type standard table of slis_t_alv_events,
            wa_events like line of it_data.
    step2: use the function module
                  reuse_alv_get_events
    and pass the internal table to the fm so that u will get all the events in an internal table . This internal table will have 2 fields like name and form. In the name field u will have all the names of events like
    top_of_page,end_of_page,user_command etc
    so what ever event u want to use modify the internal table according it.For example if u want to use user_command.
    read the internal table it_events into wa_events with key name eq 'USER_COMMAND'.
    after reading the internal table
    move 'f_user_command' to wa_events-form.
    then modify the internal table according to it
    modify it_events from wa_events transporting form.
    after this the internal table will have name = USER_COMMAND and
    form = 'f_user_command'.
    call this form anywhere in the program
    form f_user_command using r_ucomm like sy-ucomm
                                      rs_selfield like slis_selfield.
    case r_ucomm.
    write u r code as appropiate
    WHEN '&IC1'.
    SET parameter ID 'AUN' FIELD rs_selfield-value.( aun is the parameter id for the field for which u r clicking depending on that select the parameter id)
    CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
    ENDIF.

  • Needs Help in Backorder Report!

    Good day to everyone.
    I would like to ask for help in checking the Backorder Report below. The user requirement is to include the plant field in the Report. Though I already included the plant field, the program encounters ABAP runtime upon execution. Please help me correct the errors that is being encountered.
    Thank you very much.
    Raffee
    REPORT zsdr_out_of_stock  LINE-SIZE  380
              LINE-COUNT 65 NO STANDARD PAGE HEADING.
    TABLES:  mara,
             zcust,
             vbrk,
             vbak,
             vbap.
    Start of Internal tables for Out of Stock
    DATA: BEGIN OF it_total_out_stock1 OCCURS 0,
            fkdat  LIKE vbrk-fkdat,         "Billing Date
            bukrs  LIKE vbrk-bukrs,         "Company
            knumv  LIKE vbrk-knumv,         "No of the document condition
            vbeln  LIKE vbrp-vbeln,         "Billing Doc
            posnr  LIKE vbrp-posnr,         "Item
            aubel  LIKE vbrp-aubel,         "Sales Order
            aupos  LIKE vbrp-aupos,         "Sales Item
            matnr  LIKE vbrp-matnr,         "Material No.
            fkimg  TYPE p DECIMALS 2,       "Billed Quantity
            auart  LIKE vbak-auart,
            kunnr  LIKE vbak-kunnr,
            vkbur  LIKE vbak-vkbur,           "Sales office
            vkorg  LIKE vbak-vkorg,           "Sales organization
            vkgrp  LIKE vbak-vkgrp,           "Sales group
            zcusno LIKE zcust-zcusno,
            zregion LIKE zcust-zregion,
          END OF it_total_out_stock1.
    DATA: BEGIN OF it_total_out_stock2 OCCURS 0,
            vbeln   LIKE vbak-vbeln,
            auart   LIKE vbak-auart,
            kunnr   LIKE vbak-kunnr,
            vkbur   LIKE vbak-vkbur,           "Sales office
            vkorg   LIKE vbak-vkorg,           "Sales organization
            vkgrp   LIKE vbak-vkgrp,           "Sales group
            zcusno  LIKE zcust-zcusno,
            zregion LIKE zcust-zregion,
          END OF it_total_out_stock2.
    DATA: BEGIN OF it_vbap OCCURS 0,
              vbeln  LIKE vbap-vbeln,
              posnr  LIKE vbap-posnr,
              werks  LIKE vbap-werks,
              matnr  LIKE vbap-matnr,
              netwr  LIKE vbap-netwr,
              kwmeng LIKE vbap-kwmeng,
              bukrs_vf LIKE vbak-bukrs_vf,
              knumv  LIKE vbak-knumv,
              kunnr  LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
          END OF it_vbap.
    DATA: BEGIN OF it_vbap_stock OCCURS 0,
              vbeln  LIKE vbap-vbeln,
              posnr  LIKE vbap-posnr,
              werks  LIKE vbap-werks,
              matnr  LIKE vbap-matnr,
              netwr  LIKE vbap-netwr,
              kwmeng TYPE p DECIMALS 2,
              bukrs_vf LIKE vbak-bukrs_vf,
              knumv   LIKE vbak-knumv,
              kunnr   LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
          END OF it_vbap_stock.
    DATA: BEGIN OF it_out_stock OCCURS 0,
              vbeln LIKE vbap-vbeln,
              posnr LIKE vbap-posnr,
              werks LIKE vbap-werks,
              matnr LIKE vbap-matnr,
              netwr LIKE vbap-netwr,
              knumv LIKE vbak-knumv,
              bukrs_vf LIKE vbak-bukrs_vf,
              kunnr   LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
              fkimg   TYPE p DECIMALS 2,         "Billed Quantity
              kwmeng LIKE vbap-kwmeng,
              counter TYPE i,
          END OF it_out_stock.
    DATA: BEGIN OF it_mara_totals_stock OCCURS 0,
            matnr LIKE mara-matnr,
            matkl LIKE mara-matkl,
            spart LIKE mara-spart,
          END OF it_mara_totals_stock.
    DATA: BEGIN OF it_tspat_totals_stock OCCURS 0,
            spart LIKE tspat-spart,
            vtext LIKE tspat-vtext,
          END OF it_tspat_totals_stock.
    DATA: BEGIN OF it_t023t_totals_stock OCCURS 0,
            matkl  LIKE t023t-matkl,
            wgbez  LIKE t023t-wgbez,
          END OF it_t023t_totals_stock.
    DATA: BEGIN OF it_konv_totals_stock OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            kschl LIKE konv-kschl,
            kawrt LIKE konv-kawrt,
            kwert LIKE konv-kwert,
            kbetr LIKE konv-kbetr,
          END OF it_konv_totals_stock.
    DATA: BEGIN OF it_total_stock_final OCCURS 0,
            cnt1   TYPE i,
            cnt2   TYPE i,                  "DPM Category
            werks  LIKE vbap-werks,         "Plant
            spart  LIKE mara-spart,         "Division Description
            matkl  LIKE mara-matkl,         "Material Type
            vbeln  LIKE vbrk-vbeln,         "Billing Doc
            aubel  LIKE vbrp-aubel,         "Sales document
            aupos  LIKE vbrp-aupos,         "Sales document item
            vkbur  LIKE vbak-vkbur,         "Sales office
            vkorg  LIKE vbak-vkorg,         "Sales organization
            vkgrp  LIKE vbak-vkgrp,         "Sales group
            kunnr  LIKE vbak-kunnr,         "Customer
            matnr  LIKE vbrp-matnr,         "Material
            vtext  LIKE tspat-vtext,        "Material Group Desc
            kbetr1 LIKE konv-kbetr,
            kbetr2 LIKE konv-kbetr,
            kawrt  LIKE konv-kawrt,         "Condition Rate
            kwert1 LIKE konv-kwert,         "Volume Discount
            kwert2 LIKE konv-kwert,         "Promo Discount
            fkimg  TYPE p DECIMALS 2,       "Billed Quantity
            kwmeng LIKE vbap-kwmeng,
            counter TYPE i,
         END OF it_total_stock_final.
    Start of Internal tables for Held
    DATA: BEGIN OF it_total_held1 OCCURS 0,
            erdat     LIKE vbak-erdat,
            bukrs_vf  LIKE vbak-bukrs_vf,
            knumv     LIKE vbak-knumv,
            kunnr     LIKE vbak-kunnr,
            werks     LIKE vbap-werks,           "Plant
            vkbur     LIKE vbak-vkbur,           "Sales office
            vkorg     LIKE vbak-vkorg,           "Sales organization
            vkgrp     LIKE vbak-vkgrp,           "Sales group
            vbeln     LIKE vbap-vbeln,
            posnr     LIKE vbap-posnr,
            matnr     LIKE vbap-matnr,
            kwmeng    LIKE vbap-kwmeng,         "Order Quantity
            cmgst     LIKE vbuk-cmgst,
          END OF it_total_held1.
    DATA: BEGIN OF it_total_held2 OCCURS 0,
            zcusno    LIKE zcust-zcusno,
            zregion   LIKE zcust-zregion,
          END OF it_total_held2.
    DATA: BEGIN OF it_mara_totals_held OCCURS 0,
            matnr LIKE mara-matnr,
            matkl LIKE mara-matkl,
            spart LIKE mara-spart,
          END OF it_mara_totals_held.
    DATA: BEGIN OF it_tspat_totals_held OCCURS 0,
            spart LIKE tspat-spart,
            vtext LIKE tspat-vtext,
          END OF it_tspat_totals_held.
    DATA: BEGIN OF it_t023t_totals_held OCCURS 0,
            matkl  LIKE t023t-matkl,
            wgbez  LIKE t023t-wgbez,
          END OF it_t023t_totals_held.
    DATA: BEGIN OF it_konv_totals_held OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            kschl LIKE konv-kschl,
            kawrt LIKE konv-kawrt,
            kwert LIKE konv-kwert,
          END OF it_konv_totals_held.
    DATA: BEGIN OF it_total_held_final OCCURS 0,
            cnt1   TYPE i,
            cnt2   TYPE i,                  "DPM Category
            werks  LIKE vbap-werks,         "Plant
            spart  LIKE mara-spart,         "Division Description
            matkl  LIKE mara-matkl,         "Material Type
            vbeln  LIKE vbrk-vbeln,         "Billing Doc
            aubel  LIKE vbrp-aubel,         "Sales document
            aupos  LIKE vbrp-aupos,         "Sales document item
            erdat  LIKE vbak-erdat,
            vkbur  LIKE vbak-vkbur,         "Sales office
            vkorg  LIKE vbak-vkorg,         "Sales organization
            vkgrp  LIKE vbak-vkgrp,         "Sales group
            kunnr  LIKE vbak-kunnr,         "Customer
            matnr  LIKE vbrp-matnr,         "Material
            vtext  LIKE tspat-vtext,        "Material Group Desc
            kwmeng LIKE vbap-kwmeng,        "Order Quantity
            kawrt  LIKE konv-kawrt,         "Condition Rate
            kwert1 LIKE konv-kwert,         "Volume Discount
            kwert2 LIKE konv-kwert,         "Promo Discount
         END OF it_total_held_final.
    End of Internal tables for Held
    DATA: l_quantity LIKE vbap-kwmeng.
    DATA: g_div(20),      "Division
          g_mat(20),      "Material Group
          g_maktx(40),
          g_name1(40),
          v_net_value TYPE p DECIMALS 2.
            CONSTANTS DECLARATION
    Constants are named data objects that you create statically using
    a declarative statement. They allow you to store data under a
    particular name within the memory area of a program.
    The value of a constant cannot be changed during the execution of
    the program.
    CONSTANTS: header01(10)    TYPE c VALUE 'Invoice #',
               header02(06)    TYPE c VALUE 'Item',
               header03(10)    TYPE c VALUE 'Sales Doc.',
               header04(03)    TYPE c VALUE 'Div',
               header05(20)    TYPE c VALUE 'Division Desc',
               header06(10)    TYPE c VALUE 'Customer #',
               header07(35)    TYPE c VALUE 'Customer Name',
               header08(18)    TYPE c VALUE 'Material No.',
               header09(40)    TYPE c VALUE 'Material Text',
               header10(09)    TYPE c VALUE 'MType',
               header11(20)    TYPE c VALUE 'Material Grp Desc',
               header12(20)    TYPE c VALUE 'Condition Rate',
               header13(20)    TYPE c VALUE 'Vol Discount',
               header14(20)    TYPE c VALUE 'Promo Discount',
               header15(12)    TYPE c VALUE 'Date Created',
               header16(12)    TYPE c VALUE 'Invoice Date',
               header17(20)    TYPE c VALUE 'Net Value',
               header18(12)    TYPE c VALUE 'Sales office',
               header19(10)    TYPE c VALUE 'Sales Org',
               header20(10)    TYPE c VALUE 'Sales Grp',
               header21(20)    TYPE c VALUE 'Quantity',
               header22(04)    TYPE c VALUE 'Plnt'.
    End of Internal tables for Out of Stock
    Start of selection screen criteria
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_zreg  FOR zcust-zregion,               "Region
                    s_matkl FOR mara-matkl,                  "Material Group
                    s_spart FOR mara-spart,                  "Division
                    s_vkorg FOR vbak-vkorg,                  "Sales Org
                    s_vkbur FOR vbak-vkbur,                  "Sales Office
                    s_class FOR zcust-zaclass.               "Account Class
    SELECT-OPTIONS: s_curr  FOR vbrk-fkdat OBLIGATORY.       "Date
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS p0 RADIOBUTTON GROUP radi.
    PARAMETERS p1 RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    Start of Selection
    START-OF-SELECTION.
      IF p0 = 'X'.
    ****Get the Out of Stock
        PERFORM out_stock.
        PERFORM write_report.
      ELSEIF p1 = 'X'.
        PERFORM held_order.
        PERFORM write_report1.
      ENDIF.
    *&      Form  out_stock
          text
    -->  p1        text
    <--  p2        text
    FORM out_stock.
      DATA: l_cnt1 TYPE i,
            l_cnt2 TYPE i,
            l_spart LIKE mara-spart,
            l_matkl LIKE mara-matkl,
            l_text  LIKE tspat-vtext,
            l_amount TYPE p DECIMALS 2,
            l_aupos LIKE vbrp-aupos,
            l_aubel LIKE vbrp-aubel.
      SELECT vbrk~fkdat
             vbrk~bukrs
             vbrk~knumv
             vbrp~vbeln
             vbrp~posnr
             vbrp~aubel
             vbrp~aupos
             vbrp~matnr
             vbrp~fkimg
           vbap~werks
             vbak~auart
             vbak~kunnr
             vbak~vkbur           "Sales office
             vbak~vkorg           "Sales organization
             vbak~vkgrp           "Sales group
             zcust~zcusno
             zcust~zregion
             INTO TABLE it_total_out_stock1
             FROM vbrk
             INNER JOIN vbrp
             ON vbrkvbeln = vbrpvbeln
             INNER JOIN vbak
             ON vbrpaubel = vbakvbeln
             INNER JOIN zcust
             ON vbakkunnr = zcustzcusno
             WHERE vbrk~fkdat IN s_curr
               AND vbrp~matkl IN s_matkl
               AND vbrp~spart IN s_spart
               AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA', 'ZDTA', 'ZQTO')
               AND zcust~zregion IN s_zreg
               AND zcust~zaclass IN s_class
               AND vbak~vkorg IN s_vkorg
               AND vbak~vkbur IN s_vkbur
               AND vbak~bukrs_vf IN ('5116', '5106')
               AND vbak~vkbur <> '5100'.
      IF sy-subrc = 0.
        IF NOT it_total_out_stock1[] IS INITIAL.
    ***Check if the Order is Out of Stock compare to billing invoice
          SELECT vbap~vbeln
                 vbap~posnr
                 vbap~matnr
                 vbap~netwr
                 vbap~kwmeng
                 vbak~bukrs_vf
                 vbak~knumv
                 vbak~kunnr
                 vbap~werks
                 vbak~vkbur           "Sales office
                 vbak~vkorg           "Sales organization
                 vbak~vkgrp           "Sales group
                 INTO TABLE it_vbap
                 FROM vbap
                 INNER JOIN vbak
                 ON vbapvbeln = vbakvbeln
                 FOR ALL entries IN it_total_out_stock1
                 WHERE vbap~vbeln = it_total_out_stock1-aubel
                   AND vbap~posnr <> it_total_out_stock1-aupos
                   AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA',
                                  'ZDTA', 'ZQTO')
                   AND vbak~vkorg IN s_vkorg
                   AND vbak~vkbur IN s_vkbur
                   AND vbap~matkl IN s_matkl
                   AND vbap~spart IN s_spart.
    ***Check if the Order is Out of Stock by Quantity
          SELECT vbap~vbeln
                 vbap~posnr
                 vbap~matnr
                 vbap~netwr
                 vbap~kwmeng
                 vbak~bukrs_vf
                 vbak~knumv
                 vbak~kunnr
                 vbap~werks
                 vbak~vkbur           "Sales office
                 vbak~vkorg           "Sales organization
                 vbak~vkgrp           "Sales group
                 INTO TABLE it_vbap_stock
                 FROM vbap
                 INNER JOIN vbak
                 ON vbapvbeln = vbakvbeln
                  FOR ALL entries IN it_total_out_stock1
                   WHERE vbap~posnr = it_total_out_stock1-aupos
                     AND vbap~vbeln = it_total_out_stock1-aubel
                     AND vbap~kwmeng NE it_total_out_stock1-fkimg
                     AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA',
                                        'ZDTA', 'ZQTO')
                     AND vbak~vkorg IN s_vkorg
                     AND vbak~vkbur IN s_vkbur
                     AND vbap~matkl IN s_matkl
                     AND vbap~spart IN s_spart.
        ENDIF.
        IF NOT it_vbap[] IS INITIAL.
          SORT it_vbap BY vbeln posnr.
          SORT it_total_out_stock1 BY aubel aupos.
          LOOP AT it_vbap.
            READ TABLE it_total_out_stock1
              WITH KEY aubel = it_vbap-vbeln
                       aupos = it_vbap-posnr.
            IF sy-subrc NE 0.
              it_out_stock-vbeln    = it_vbap-vbeln.
              it_out_stock-posnr    = it_vbap-posnr.
              it_out_stock-matnr    = it_vbap-matnr.
              it_out_stock-netwr    = it_vbap-netwr.
              it_out_stock-knumv    = it_vbap-knumv.
              it_out_stock-bukrs_vf = it_vbap-bukrs_vf.
              it_out_stock-kunnr    = it_vbap-kunnr.
              it_out_stock-werks    = it_vbap-werks.
              it_out_stock-vkbur    = it_vbap-vkbur.  "Sales office
              it_out_stock-vkorg    = it_vbap-vkorg.  "Sales organization
              it_out_stock-vkgrp    = it_vbap-vkgrp.  "Sales group
              it_out_stock-kwmeng   = it_vbap-kwmeng.
              APPEND it_out_stock.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF NOT it_vbap_stock[] IS INITIAL.
          SORT it_vbap_stock BY vbeln posnr.
          SORT it_total_out_stock1 BY aubel aupos.
          LOOP AT it_vbap_stock.
            LOOP AT it_total_out_stock1 WHERE aubel = it_vbap_stock-vbeln
                                         AND  aupos = it_vbap_stock-posnr
                                         AND  fkimg NE it_vbap_stock-kwmeng.
              it_out_stock-vbeln    = it_vbap_stock-vbeln.
              it_out_stock-posnr    = it_vbap_stock-posnr.
              it_out_stock-matnr    = it_vbap_stock-matnr.
              it_out_stock-netwr    = it_vbap_stock-netwr.
              it_out_stock-knumv    = it_vbap_stock-knumv.
              it_out_stock-bukrs_vf = it_vbap_stock-bukrs_vf.
              it_out_stock-kunnr    = it_vbap_stock-kunnr.
              it_out_stock-werks    = it_vbap_stock-werks.
              it_out_stock-vkbur    = it_vbap_stock-vkbur.  "Sales office
              it_out_stock-vkorg    = it_vbap_stock-vkorg.  "Sales org
              it_out_stock-vkgrp    = it_vbap_stock-vkgrp.  "Sales group
    ****Begin Insert by Ron
              it_out_stock-kwmeng   = it_vbap_stock-kwmeng.
              it_out_stock-fkimg    = it_total_out_stock1-fkimg.
              it_out_stock-counter  = 1.
    ****End Insert
              APPEND it_out_stock.
            ENDLOOP.
          ENDLOOP.
        ENDIF.
      ENDIF.      "it_total_out_stock1
      IF NOT it_out_stock[] IS INITIAL.
    ***get the value of material and material group
        SELECT matnr
               matkl
               spart
               INTO TABLE it_mara_totals_stock
               FROM mara
               FOR ALL ENTRIES IN it_out_stock
               WHERE matnr = it_out_stock-matnr.
      ENDIF.
    ***Get the Value of Division Description
      IF NOT it_mara_totals_stock[] IS INITIAL.
        SELECT spart
               vtext
               INTO TABLE it_tspat_totals_stock
               FROM tspat
               FOR ALL ENTRIES IN it_mara_totals_stock
               WHERE spart = it_mara_totals_stock-spart AND
                     spras = sy-langu.
      ENDIF.
    ***Get the Material Group Description
      IF NOT it_mara_totals_stock[] IS INITIAL.
        SELECT matkl
               wgbez
               INTO TABLE it_t023t_totals_stock
               FROM t023t
               FOR ALL ENTRIES IN it_mara_totals_stock
                WHERE matkl = it_mara_totals_stock-matkl AND
                      spras = sy-langu.
      ENDIF.
    ***Get the Value of Condition Type
      IF NOT it_out_stock[] IS INITIAL.
        SELECT knumv
               kposn
               kschl
               kawrt
               kwert
               kbetr
               INTO TABLE it_konv_totals_stock
               FROM konv
               FOR ALL ENTRIES IN it_out_stock
                WHERE knumv = it_out_stock-knumv
                  AND kposn = it_out_stock-posnr
                  AND kschl IN ('ZQPR', 'ZQD3', 'ZQP3',
                                'ZDPR', 'ZDD3', 'ZDP3').
      ENDIF.
      SORT it_out_stock          BY vbeln posnr.
      SORT it_mara_totals_stock  BY matnr.
      SORT it_tspat_totals_stock BY spart.
      SORT it_t023t_totals_stock BY matkl.
      SORT it_konv_totals_stock  BY knumv kposn.
      LOOP AT it_out_stock.
        CLEAR: it_total_stock_final-kawrt,  it_total_stock_final-kwert1,
               it_total_stock_final-kwert2, it_total_stock_final-vtext,
               it_total_stock_final-matkl,  it_total_stock_final-spart,
               it_total_stock_final-aubel,  it_total_stock_final-aupos,
               it_total_stock_final-cnt1,   it_total_stock_final-cnt2.
    ***Begin Insert by RONCR
        CLEAR: it_total_stock_final-kwmeng, it_total_stock_final-fkimg,
               it_total_stock_final-counter.
    ***End Insert by RONCR
        CLEAR: it_mara_totals_stock, it_tspat_totals_stock,
               it_t023t_totals_stock, it_konv_totals_stock,
               l_cnt1, l_cnt2.
    **Counter for Total Orders Column
        l_cnt1 = 4.
        READ TABLE it_mara_totals_stock
            WITH KEY matnr = it_out_stock-matnr.
        IF sy-subrc EQ 0.
          it_total_stock_final-matnr = it_mara_totals_stock-matnr.
          it_total_stock_final-matkl = it_mara_totals_stock-matkl.
          it_total_stock_final-spart = it_mara_totals_stock-spart.
    ***DPM
          IF it_total_stock_final-matkl EQ 'DPM' OR
             it_total_stock_final-matkl EQ 'SSN'.
            READ TABLE it_tspat_totals_stock
             WITH KEY spart = it_mara_totals_stock-spart.
            IF sy-subrc EQ 0.
              it_total_stock_final-vtext  = it_tspat_totals_stock-vtext.
            ENDIF.
    ***Non Dole
          ELSE.
            READ TABLE it_t023t_totals_stock
             WITH KEY matkl = it_mara_totals_stock-matkl.
            IF sy-subrc EQ 0.
              it_total_stock_final-vtext  = it_t023t_totals_stock-wgbez.
            ENDIF.
          ENDIF.
        ENDIF.
        IF it_total_stock_final-matkl = 'DPM' OR
           it_total_stock_final-matkl = 'SSN'.
          l_cnt2 = 1.
        ELSE.
          l_cnt2 = 2.
        ENDIF.
    ***Condition Value for Comapny Code 5116
        IF it_out_stock-bukrs_vf EQ '5116'.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQPR'.
          IF sy-subrc EQ 0.
            it_total_stock_final-kawrt = it_konv_totals_stock-kawrt.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQD3'.
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert1 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr1 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr1 = it_total_stock_final-kbetr1 * -1.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQP3'.
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert2 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr2 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
        ENDIF.
    ***Condition Value for Company Code 5106
        IF it_out_stock-bukrs_vf EQ '5106'.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDPR'.      "Base price
          IF sy-subrc EQ 0.
            it_total_stock_final-kawrt = it_konv_totals_stock-kawrt.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDD3'.      "Volume Discount
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert1 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr1 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDP3'.      "Promo Discount
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert2 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr2 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
        ENDIF.
        it_total_stock_final-cnt1  = l_cnt1.
        it_total_stock_final-cnt2  = l_cnt2.
        it_total_stock_final-aubel = it_out_stock-vbeln.
        it_total_stock_final-aupos = it_out_stock-posnr.
        it_total_stock_final-kunnr = it_out_stock-kunnr.
        it_total_stock_final-werks = it_out_stock-werks.
        it_total_stock_final-vkbur = it_out_stock-vkbur.  "Sales office
        it_total_stock_final-vkorg = it_out_stock-vkorg.  "Sales org
        it_total_stock_final-vkgrp = it_out_stock-vkgrp.  "Sales group
    ***Begin Insert by RONCR
        it_total_stock_final-kwmeng = it_out_stock-kwmeng.
        it_total_stock_final-fkimg = it_out_stock-fkimg.
        it_total_stock_final-counter = it_out_stock-counter.
    **End of Insert by RONCR
        APPEND it_total_stock_final.
      ENDLOOP.
    ENDFORM.                    " out_stock
    *&      Form  write_report
          text
    -->  p1        text
    <--  p2        text
    FORM write_report.
      ULINE (360).
      FORMAT COLOR 1.
      WRITE: / sy-vline, header01,
            12 sy-vline, header02,
            19 sy-vline, header03,
            30 sy-vline, header04,
            35 sy-vline, header05,
            55 sy-vline, header18,
            75 sy-vline, header19,
            87 sy-vline, header20,
           100 sy-vline, header06,
           112 sy-vline, header07,
           150 sy-vline, header08,
           170 sy-vline, header09,
           215 sy-vline, header10,
           225 sy-vline, header11,
           247 sy-vline, header21,
           271 sy-vline, header12,
           293 sy-vline, header13,
           315 sy-vline, header14,
           337 sy-vline, header17,
           360 sy-vline, header22,
           363 sy-vline.
      ULINE (360).
      FORMAT COLOR 2.
      SORT it_total_stock_final BY cnt2 cnt1 spart aubel aupos.
      LOOP AT  it_total_stock_final.
        CLEAR: g_div, g_mat, g_maktx, g_name1, v_net_value.
        SELECT SINGLE vtext INTO g_div
           FROM tspat
           WHERE spart = it_total_stock_final-spart
             AND spras = sy-langu.
        SELECT SINGLE wgbez INTO g_mat
           FROM t023t
           WHERE matkl = it_total_stock_final-matkl
             AND spras = sy-langu.
        SELECT SINGLE maktx INTO g_maktx
           FROM makt
             WHERE matnr = it_total_stock_final-matnr
               AND spras = sy-langu.
        SELECT SINGLE name1  INTO g_name1
           FROM kna1
              WHERE kunnr = it_total_stock_final-kunnr.
        IF it_total_stock_final-counter = 1.
          CLEAR: l_quantity.
          l_quantity = it_total_stock_final-kwmeng -
                       it_total_stock_final-fkimg.
          it_total_stock_final-kawrt = it_total_stock_final-kawrt /
                      it_total_stock_final-kwmeng.
          it_total_stock_final-kawrt = it_total_stock_final-kawrt *
                       l_quantity.
          it_total_stock_final-kbetr1 = it_total_stock_final-kbetr1 /
                                         1000.
          it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 /
                                         1000.
          it_total_stock_final-kwert1 = it_total_stock_final-kawrt *
                                        it_total_stock_final-kbetr1.
          it_total_stock_final-kwert2 = it_total_stock_final-kawrt *
                                        it_total_stock_final-kbetr2.
              clear:  it_total_stock_final-kawrt,
                      it_total_stock_final-kbetr1,
                      it_total_stock_final-kbetr2,
                      it_total_stock_final-kwert1,
                      it_total_stock_final-kwert2.
        ENDIF.
        v_net_value = it_total_stock_final-kawrt -
                      it_total_stock_final-kwert1 -
                      it_total_stock_final-kwert2.
        WRITE: / sy-vline, it_total_stock_final-vbeln,
              12 sy-vline, it_total_stock_final-aupos,
              19 sy-vline, it_total_stock_final-aubel,
              30 sy-vline, it_total_stock_final-spart,
              35 sy-vline, g_div,
              55 sy-vline, it_total_stock_final-vkbur,
              75 sy-vline, it_total_stock_final-vkorg,
              87 sy-vline, it_total_stock_final-vkgrp,
             100 sy-vline, it_total_stock_final-kunnr,
             112 sy-vline, g_name1,
             150 sy-vline, it_total_stock_final-matnr,
             170 sy-vline, g_maktx,
             215 sy-vline, it_total_stock_final-matkl,
             225 sy-vline, it_total_stock_final-vtext.
        IF it_total_stock_final-counter = 1.
          WRITE:  247 sy-vline, l_quantity,
                  271 sy-vline, it_total_stock_final-kawrt,
                  293 sy-vline, it_total_stock_final-kwert1,
                  315 sy-vline, it_total_stock_final-kwert2,
                  337 sy-vline, v_net_value,
                  360 sy-vline, it_total_stock_final-werks,
                  363 sy-vline.
        ELSE.
          WRITE:  247 sy-vline, it_total_stock_final-kwmeng,
                  271 sy-vline, it_total_stock_final-kawrt,
                  293 sy-vline, it_total_stock_final-kwert1,
                  315 sy-vline, it_total_stock_final-kwert2,
                  337 sy-vline, v_net_value,
                  360 sy-vline, it_total_stock_final-werks,
                  363 sy-vline.
        ENDIF.
      ENDLOOP.
      ULINE (360).
    ENDFORM.                    " write_report
    *&      Form  held_order
          text
    -->  p1        text
    <--  p2        text
    FORM held_order.
      DATA: l_cnt1 TYPE i,
            l_cnt2 TYPE i,
            l_spart LIKE mara-spart,
            l_matkl LIKE mara-matkl,
            l_text  LIKE tspat-vtext,
            l_amount TYPE p DECIMALS 2,
            l_aupos LIKE vbrp-aupos,
            l_aubel LIKE vbrp-aubel.
      SELECT vbak~erdat
             vbak~bukrs_vf
             vbak~knumv
             vbak~kunnr
             vbap~werks
             vbak~vkbur                          "Sales office
             vbak~vkorg                          "Sales organization
             vbak~vkgrp                          "Sales group
             vbap~vbeln
             vbap~posnr
             vbap~matnr
             vbap~kwmeng                         "Order Quantity
             vbuk~cmgst
             INTO TABLE it_total_held1
             FROM vbak
             INNER JOIN vbap
             ON vbakvbeln = vbapvbeln
             INNER JOIN vbuk
             ON vbapvbeln = vbukvbeln
             WHERE vbak~erdat IN s_curr
               AND vbak~vkorg IN s_vkorg
               AND vbak~vkbur IN s_vkbur
               AND vbap~matkl IN s_matkl
               AND vbak~bukrs_vf IN ('5116', '5106')
               AND vbak~vkbur NE '5100'
               AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA', 'ZDTA', 'ZQTO')
               AND vbak~kkber = '5116'
               AND vbuk~cmgst = 'B'
               AND vbap~spart IN s_spart.
      IF sy-subrc = 0.
        SELECT zcusno
               zregion
               INTO TABLE it_total_held2
               FROM zcust
               FOR ALL ENTRIES IN it_total_held1
                WHERE zcusno = it_total_held1-kunnr
                  AND zcust~zregion IN s_zreg
                  AND zcust~zaclass IN s_class.
        IF sy-subrc EQ 0.
    ***get the value of material and material group
          SELECT matnr
                 matkl
                 spart
                 INTO TABLE it_mara_totals_held
                 FROM mara
                 FOR ALL ENTRIES IN it_total_held1
                 WHERE matnr = it_total_held1-matnr.
    ***Get the Value of Division Description
          IF NOT it_mara_totals_held[] IS INITIAL.
            SELECT spart
                   vtext
                   INTO TABLE it_tspat_totals_held
                   FROM tspat
                   FOR ALL ENTRIES IN it_mara_totals_held
                   WHERE spart = it_mara_totals_held-spart AND
                         spras = sy-langu.
          ENDIF.
    ***Get the Material Group Description
          IF NOT it_mara_totals_held[] IS INITIAL.
            SELECT matkl
                   wgbez
                   INTO TABLE it_t023t_totals_held
                   FROM t023t
                   FOR ALL ENTRIES IN it_mara_totals_held
                    WHERE matkl = it_mara_totals_held-matkl AND
                          spras = sy-langu.
          ENDIF.
    ***Get the Value of Condition Type
          IF NOT it_total_held1[] IS INITIAL.
            SELECT knumv
                   kposn
                   kschl
                   kawrt
                   kwert
                   INTO TABLE it_konv_totals_held
                   FROM konv
                   FOR ALL ENTRIES IN it_total_held1
                    WHERE knumv = it_total_held1-knumv
                      AND kposn = it_total_held1-posnr
                      AND kschl IN ('ZQPR', 'ZQD3', 'ZQP3',
                                    'ZDPR', 'ZDD3', 'ZDP3').
          ENDIF.
        ENDIF.
      ENDIF.
      SORT it_total_held1       BY vbeln posnr.
      SORT it_total_held2       BY zcusno zregion.
      SORT it_mara_totals_held  BY matnr.
      SORT it_tspat_totals_held BY spart.
      SORT it_t023t_totals_held BY matkl.
      SORT it_konv_totals_held  BY knumv kposn.
      LOOP AT it_total_held1.
        CLEAR: it_total_held_final-kawrt,  it_total_held_final-kwert1,
               it_total_held_final-kwert2, it_total_held_final-vtext,
               it_total_held_final-matkl,  it_total_held_final-spart,
               it_total_held_final-aubel,  it_total_held_final-aupos,
               it_total_held_final-cnt1,   it_total_held_final-cnt2.
        CLEAR: it_mara_totals_held, it_tspat_totals_held,
               it_t023t_totals_held, it_konv_totals_held,
               l_cnt1, l_cnt2.
        READ TABLE it_total_held2
            WITH KEY zcusno = it_total_held1-kunnr.
        IF sy-subrc = 0.
    **Counter for Total Orders Column
          l_cnt1 = 3.
          READ TABLE it_mara_totals_held
              WITH KEY matnr = it_total_held1-matnr.
          IF sy-subrc EQ 0.
            it_total_held_final-matnr = it_mara_totals_held-matnr.
            it_total_held_final-matkl = it_mara_totals_held-matkl.
            it_total_held_final-spart = it_mara_totals_held-spart.
    ***Dole
            IF it_total_held_final-matkl EQ 'DPM' OR
               it_total_held_final-matkl EQ 'SSN'.
              READ TABLE it_tspat_totals_held
               WITH KEY spart = it_mara_totals_held-spart.
              IF sy-subrc EQ 0.
                it_total_held_final-vtext  = it_tspat_totals_held-vtext.
              ENDIF.
    ***Non Dole
            ELSE.
              READ TABLE it_t023t_totals_held
               WITH KEY matkl = it_mara_totals_held-matkl.
              IF sy-subrc EQ 0.
                it_total_held_final-vtext  = it_t023t_totals_held-wgbez.
              ENDIF.
            ENDIF.
          ENDIF.
          IF it_total_held_final-matkl = 'DPM' OR
             it_total_held_final-matkl = 'SSN'.
            l_cnt2 = 1.
          ELSE.
            l_cnt2 = 2.
          ENDIF.
    ***Condition Value for Comapny Code 5116
          IF it_total_held1-bukrs_vf EQ '5116'.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQPR'.
            IF sy-subrc EQ 0.
              it_total_held_final-kawrt = it_konv_totals_held-kawrt.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQD3'.
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert1 = it_konv_totals_held-kwert.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQP3'.
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert2 = it_konv_totals_held-kwert.
            ENDIF.
          ENDIF.
    ***Condition Value for Comapny Code 5106
          IF it_total_held1-bukrs_vf EQ '5106'.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDPR'.      "Base price
            IF sy-subrc EQ 0.
              it_total_held_final-kawrt = it_konv_totals_held-kawrt.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDD3'.      "Volume Discount
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert1 = it_konv_totals_held-kwert.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDP3'.      "Promo Discount
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert2 = it_konv_totals_held-kwert.
            ENDIF.
          ENDIF.
          it_total_held_final-cnt1   = l_cnt1.
          it_total_held_final-cnt2   = l_cnt2.
          it_total_held_final-aubel  = it_total_held1-vbeln.
          it_total_held_final-aupos  = it_total_held1-posnr.
          it_total_held_final-kunnr  = it_total_held1-kunnr.
          it_total_held_final-erdat  = it_total_held1-erdat.
          it_total_held_final-werks  = it_total_held1-werks.
          it_total_held_final-vkbur  = it_total_held1-vkbur.  "Sales office
          it_total_held_final-vkorg  = it_total_held1-vkorg.  "Sales Org
          it_total_held_final-vkgrp  = it_total_held1-vkgrp.  "Sales group
          it_total_held_final-kwmeng = it_total_held1-kwmeng. "Order qty
          APPEND it_total_held_final.
        ENDIF.     "it_total_held2
      ENDLOOP.
    ENDFORM.                    " held_order
    *&      Form  write_report1
          text
    -->  p1        text
    <--  p2        text
    FORM write_report1.
      ULINE (360).
      FORMAT COLOR 1.
      WRITE: / sy-vline, header01,
               12 sy-vline, header02,
               19 sy-vline, header03,
               30 sy-vline, header15,
               45 sy-vline, header04,
               50 sy-vline, header05,
               75 sy-vline, header18,
               90 sy-vline, header19,
              103 sy-vline, header20,
              115 sy-vline, header06,
              127 sy-vline, header07,
              167 sy-vline, header08,
              184 sy-vline, header09,
              227 sy-vline, header10,
              237 sy-vline, header11,
              260 sy-vline, header21,
              282 sy-vline, header12,
              306 sy-vline, header13,
              330 sy-vline, header14,
              354 sy-vline, header17,
              376 sy-vline, header22,
              380 sy-vline.
          ULINE (376).
          FORMAT COLOR 2.
          SORT it_total_held_final BY cnt2 cnt1 spart aubel aupos.
          LOOP AT  it_total_held_final.
            CLEAR: g_div, g_mat, g_maktx, g_name1, v_net_value.
            SELECT SINGLE vtext INTO g_div
               FROM tspat
               WHERE spart = it_total_held_final-spart
                 AND spras = s

    Hi,
    790072 wrote:
    Hi Gurus,
    Need your help in writing an sql to search records which has length of 4000 bytes from an varchar2(4000) column and inserting the same records to another table by truncating the record to 3500 bytes .Something like this:
    INSERT INTO new_table (txt_column)
    SELECT  SUBSTRB (txt_column, 1, 3500)
    FROM    old_table;SUBSTR returns a string with a specified number of characters , SUBSTR<b>B</b> has a specified number of bytes .

Maybe you are looking for

  • Can't access files in Time Capsule in WIN7 64 Bit- says folder is empty

    Hi there. I can't seem to access my files in Time Capsule using WIN7 64 BIT, it works fine as a router , i can see the time capsule online and how much space it's occupied, however whenever i click on it , it says folder it empty. I can access the fi

  • Where should folders be?

    I noticed I have a Application Folder and a Library Folder (both with icons on it) directly on my Hard Disk, as well as in my Home (house) folder. They're not all duplicates. This shouldn't be, should it ? Two questions: 1) Where should these be? 2)

  • Get error when trying to create iCloud e-mail alias

    When I try to create an email alias on iCloud I get the error: "Address couldn't be saved because a server error occurred. Please try again." I've tried repeatedly. No luck.

  • 2 Switches - 2 Routers - 2 ISP , I need to configure auto failover

    Hello, I need a help please. I have 2 switches connected to 2 Routers and then 2 different ISPs.      SW -----> Router(1) -----> ISP (Main)       ||       ||      SW -----> Router -----> ISP (secondary) on R1 I did this: interface GigabitEthernet0/2

  • The program "Nokia Suite" is in all languages, exc...

    Hello, Nokia. The program "Nokia Suite" is in all languages, except the Azerbaijan. We, as Azerbaijanians, want that the program "Nokia Suite" will be in Azerbaijan language too. Whether probably to add to "Nokia Suite" Azerbaijan language? Whether t