Problem in Reports(ralated to table BSEG)

Dear ALL,
when programs(standard and Z programs) Retriving the data from BSEG, i am getting timeout error.
I have one more problem  that is, in BSEG table we have around 25 Million records (around 100+ companies implemented fico), so while accessing this table most of the time we are getting timeout error. From the last 6 years we did not do data archiving.
If one or more programs accessing this table then it will affect the performance. So what do you propose is Data Archiving is the solution?
Thanks for your time.
Regards
Manohar

Hi Manohar,
                Archiving may compact your table size, but those data may not be available to view.
I prefer you to execute the report in background. Ckeck in SM37, if the job is finished, it ready for executing.
Abhisek

Similar Messages

  • Linking table BSEG and PA0001 to display PA0001-SNAME

    I am working on a report where I am facing problem with field length compatibility.
    I have to pass value of field BSEG-HZUON to PA0001-PERNR and display SNAME in the output.
    But the field length of HZUON and PERNR does not match each time, hence SNAME is displayed as blank in the output for these cases.
    Please suggest a solution to this problem or possibility of using some other field as a linkage between tables BSEG and PA0001.

    Hi,
    Yes, you are right. You can not link based on these fields.
    Possible solutions:
    1. Within a SELECT and ENSSELECT on bseg
        move hzuon to a workfield
        SELECT on pa0001 using the workfield
    2. SELECT all BSEG data into an internal table (with an additional field PERNR)
        Loop over the internal table filling the pernr.
        SELECT all PA0001 data into an other internal table with the FOR ALL ENTRIES
        Combine the internal tables.
    Succes.

  • Getting data from table BSEG taking too long ... any solutions.

    Hello people I am currently trying to get data from table BSEG for one particular G/L Account Number With restrictions using For All Entries.
    The problem is that even with such tight restrictions its causing my report program to run way too slow. I put an option where you dont have to access table bseg. And it runs just fine. (all of this is done during PRD Server).
    My question is
    1.) How come BSEG seems to make the report slow, even though I put some tight restrictions. <b>Im using For All Entries where Zuonr eq i_tab-zuonr</b>it seems to work fine in DEV and <b>hkont EQ '0020103101'</b>(Customer Deposits).
    2.) Is there a way for me to do the same thing as what I mentioned in #1 but only much faster.
    Thanks guys and take care

    Hi
    It should be better you don't read BSEG table if you haven't the keys BUKRS and BELNR, because the reading could take many times if there are many hits.
    If you want to find out the records of G/L Account it's better read the index table BSIS (for open items) and BSAS (for cleared items), here the field HKONT is a key (and ZUONR too). So you can improve the performance:
    DATA: T_ITEMS LIKE STANDARD TABLE OF BSIS.
    SELECT * FROM BSAS INTO TABLE T_ITEMS
      FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
                               AND HKONT = '0020103101'
                               AND ZUONR = I_ITAB-ZUONR.
    SELECT * FROM BSIS APPENDING TABLE T_ITEMS
      FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
                               AND HKONT = '0020103101'
                               AND ZUONR = I_ITAB-ZUONR.
    Remember every kind of item has an own index tables:
    - BSIS/BSAS for G/L Account
    - BSIK/BSAK for Vendor
    - BSID/BSAD for Customer
    These table have the same informations you can find out from BSEG and BKPF.
    Max

  • Form and report on a table - redirecting to report on submit

    Hi,
    I've created a form and a report on a table...
    in a form, one of the item is a radio group (with submit) with static list of values... I've set it up to submit as I am hiding/displaying other items based on the selection... for example, when user select the location value then only city and country fields are displayed and so on...
    my problem is that when I make a selection it saves the state and takes me back to the report... when I come back to the report then I see items (hidden/displayed based on the selection that I made before I left the form)
    any way to fix it...? please advice
    Thanks

    Hi,
    OK - we can't use a Dynamic Action but we can use Javascript to do this.
    Firstly, change the item type to an ordinary Radio button - that is, remove the Submit
    Secondly, in your page attribute's HTML Header setting, add in:
    &lt;script type="text/javascript"&gt;
    function submitByRadioButton()
    if ($v('P1_PKITEM') != '')
      doSubmit('P1_RADIOITEM');
    &lt;/script&gt;Replace P1_PKITEM with the page item name for the hidden primary key and P1_RADIOITEM with the page item name of the radio button.
    Then, on the radio button item, add the following in the HTML Form Element Attributes setting:
    onclick="javascript:submitByRadioButton()"Finally, create a branch that returns to the same page - make sure that the Sequence number puts it before any Unconditional branch. Set the Condition for this to "Request = Expression 1" and enter P1_RADIOITEM (or whatever the page item name is for the radio button) into the Expression 1 setting.
    Now, when the user creates a new record, the hidden P1_PKITEM value will be blank. Clicking the radio button at this time will not trigger a submit and the function checks this. For existing records, P1_PKITEM will contain a value, so the function will allow the doSubmit to run.
    Andy

  • Nee help on ALV report for Total of BSEG-BUZEI & F1 document in FB03

    Hi friends,
    I need to diplay line items total & when double clicked on BELNR field it should open the F1 document in FB03.
    Could anyone plz guide me on this.
    Waiting for response.
    below is my code,
    Kindly needed help.
    REPORT  YALV_1.
    TABLES : BKPF,BSEG.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data : int_fcat type SLIS_T_FIELDCAT_ALV,
           fieldcatalog type slis_t_fieldcat_alv with header line.
    DATA:  wa_sortinfo TYPE slis_sortinfo_alv,
           i_sortcat TYPE slis_t_sortinfo_alv.
    TYPES  : BEGIN OF T_BKPF,
            BUKRS TYPE BKPF-BUKRS,
            BELNR TYPE BKPF-BELNR,
            GJAHR TYPE BKPF-GJAHR,
            BLART TYPE BKPF-BLART,
            BLDAT TYPE BKPF-BLDAT,
            BUDAT TYPE BKPF-BUDAT,
            END OF T_BKPF.
    types: begin of t_bseg,
           BUZEI TYPE BSEG-BUZEI,
           end of t_bseg.
    DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
          wa_bkpf TYPE t_bkpf,
           it_bseg type standard table of t_bseg.
          wa_bseg type t_bseg.
    field to store report name
    DATA :  i_repid like sy-repid.
    select bukrs belnr gjahr blart bldat budat from bkpf into table
    it_bkpf where blart = 'AA'.
    field to check table length
    *data i_lines like sy-tabix.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    PERFORM sortcat_init CHANGING i_sortcat.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but
    *can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such
    *as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'BUKRS'.
      fieldcatalog-seltext_m   = 'Company Code'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 4.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BELNR'.
      fieldcatalog-seltext_m   = 'Doc No'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'GJAHR'.
      fieldcatalog-seltext_m   = 'Fiscal Year'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLART'.
      fieldcatalog-seltext_m   = 'DOC Type'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Doc Date'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'Popsting Date'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUZEI'.
      fieldcatalog-seltext_m   = 'Line Items'.
      fieldcatalog-col_pos     = 6.
      fieldcatalog-do_sum      = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    FORM sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'BUKRS'.
      wa_sortinfo-tabname = 'T_BKPF'.
      wa_sortinfo-spos = 1.            " First sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'BELNR'.
      wa_sortinfo-tabname = 'T_BKPF'.
      wa_sortinfo-spos = 2.            " Sec sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
    ENDFORM.                    " sortcat_init
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      i_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = i_repid
               i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
               is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_sort                = i_sortcat
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = IT_BKPF
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    form data_retrieval.
    IF it_bkpf[] IS NOT INITIAL.
       select buzei from bseg into
         table it_bseg for all entries in it_bkpf
         where bukrs = it_bkpf-bukrs
         and belnr = it_bkpf-belnr
         and gjahr = it_bkpf-gjahr.
         endif.
    endform.                    " DATA_RETRIEVAL.

    Hello
    1.
    form display_alv_report.
    i_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = i_repid
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = fieldcatalog[]
    i_save = 'X'
    tables
    t_outtab = IT_BKPF
    exceptions
    program_error = 1
    others = 2.
    2.
    * FORM USER_COMMAND
    FORM user_command USING u_com LIKE sy-ucomm sel_lin TYPE slis_selfield.
    CASE u_com.
      WHEN '&IC1'. 
        CASE sel_lin.
          WHEN 'BELNR'.
          read TABLE IT_BKPF INDEX sel_lin-tabindex.
          SET PARAMETER ID 'BLN' FIELD IT_BKPF-BELNR.
          SET PARAMETER ID 'BUK' FIELD IT_BKPF-BUKRS.
          SET PARAMETER ID 'GJR' FIELD IT_BKPF-GJAHR.
          CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN. 
        ENDCASE.
    CLEAR u_com.
    ENDCASE.
    ENDFORM. "USER_COMMAND

  • Update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK

    Hi FI Gurus,
    I am looking after a Support Project in SAP IS-Retail. I am from the FI functional and possess very limited knowledge in FI.
    My client has done the sales posting in SAP using IDOC's. During the postings, it was found that wrong Profit Centers were assigned. Due to this, the sales reports based on Profit Center are coming wrong. It was suggested to the client to reverse the IDOCs, do necessary changes in Profit Centers and re-post the IDOCs. The client wanted a short method to get the reports right. A senior consultant (Non FI) in the Company and the Management are forcing me to write a ABAP program to update certain (not all) FI tables. According to me, it will have some negative impact on the system for which reason I am not ready to take the call as a Project Manager. The management wants me to do the following (I am quoting the same mail which I received from the consultant ) :
    We need to update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK / BSID / BSAD, wherever the records exists against billing document numbers provided.
    BAPI for updating profit center in Accounting documents: BAPI_ACC_DOCUMENT_POST
    Function Module : 'BAPI_DOCUMENT_CHANGE'
    Also look at SAP Note: Note 966428 - FB02: Functional area (FKBER) can be changed on coding block
    Based on the above, the ABAPer has written the program, the program will update the tables BSEG, BSIS, BSIK, according to the selection criteria of document number, company code and line item number with the new profit centers.
    Please clarify me about the following :
    1. This program is updating profit center in just the FI tables (BSEG, BSIS, BSIK etc.), but the New GL tables (faglflexa and faglflext) which have approx. 65 lakh entries in PRD do not get updated with the correct profit center.
    2. The Controlling tables also do not get updated with this program yet. Also since the previoius updation of Profit centers did not happen correctly, most of the times the controlling document has not been generated at all. Since we will be updating the profit center in just the FI tables, the controlling document will not be created still. Though there are SAP notes suggesting re-creation of the Controlling documents, which is still an option you can choose. Please confirm.
    3. The Special GL also does not get updated because of this.
    This is a very critical and hot issue. My job is at Stake as the Management has threatened me of sacking if I do not follow their directives as they are only concerned with their money.
    Is the consultant who suggested this change RIGHT ?
    Your early replies will help me take the decision.
    Regards

    Hi,
    There is no standard program or BAPI that would update profit centre in a posted document. You should either develop your own process for it,which is not recommended, but sometimes is essential, or reverse the existing documents and post them with the correct profit centre.
    Regards,
    Eli

  • OBIEE 11g - serious problem when rotating columns into "table prompt" area

    Hi, I'm hitting an OBIEE 11g issue that's causing huge problems on reports. Essentially, the problem is this - if I dump all the columns of a query to a table, everything looks fine. But if I rotate one of the columns into the "table prompts" area, OBIEE is actually resubmitting a WRONG query. The query format changes from:
    WITH
    SAWITH0 AS (select sum(T38965.ORIGINAL_BUDGET) as c1,
    T12637.ORG_ID_DESC as c2
    from
    GL_ANALYTICS.DIM_ACCOUNT T12582,
    GL_ANALYTICS.DIM_ORG T12637,
    GL_ANALYTICS.DIM_ACCOUNTING_PERIOD T12597,
    GL_ANALYTICS.FACT_LEDGER T38965 / FACT_LEDGER_ytd */*
    where  ( T12582.ACCOUNT_KEY = T38965.ACCOUNT_KEY and T12582.STATEMENT_TYPE_CODE = 'Income Statement' and T12597.ACCOUNTING_PERIOD = 11 and T12597.FISCAL_YEAR = T38965.FISCAL_YEAR and T12597.FISCAL_YEAR = 2012 and T12637.ORG_KEY = T38965.ORG_KEY and T38965.FISCAL_YEAR = 2012 and (T12637.DEPARTMENT_CODE_DESC in ('D0200 - Arts Administration', 'D0206 - Film Studies')) and T12597.ACCOUNTING_PERIOD >= T38965.ACCOUNTING_PERIOD )
    group by T12637.ORG_ID_DESC)
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from ( select distinct 0 as c1,
    D1.c2 as c2,
    D1.c1 as c3
    from
    SAWITH0 D1
    order by c2 ) D1 where rownum <= 65001
    and changes to:
    WITH
    SAWITH0 AS (select distinct T12637.ORG_ID_DESC as c1
    from
    GL_ANALYTICS.DIM_ACCOUNT T12582,
    GL_ANALYTICS.DIM_ORG T12637,
    GL_ANALYTICS.DIM_ACCOUNTING_PERIOD T12597,
    GL_ANALYTICS.FACT_LEDGER T38927 / FACT_LEDGER_period */*
    where  ( T12582.ACCOUNT_KEY = T38927.ACCOUNT_KEY and T12597.ACCOUNTING_PERIOD = T38927.ACCOUNTING_PERIOD and T12597.FISCAL_YEAR = T38927.FISCAL_YEAR and T12582.STATEMENT_TYPE_CODE = 'Income Statement' and T12597.ACCOUNTING_PERIOD = 11 and T12597.FISCAL_YEAR = 2012 and T12637.ORG_KEY = T38927.ORG_KEY and T38927.ACCOUNTING_PERIOD = 11 and T38927.FISCAL_YEAR = 2012 and (T12637.DEPARTMENT_CODE_DESC in ('D0200 - Arts Administration', 'D0206 - Film Studies')) ) ),
    SAWITH1 AS (select sum(T38965.ORIGINAL_BUDGET) as c1,
    T12637.ORG_ID_DESC as c2
    from
    GL_ANALYTICS.DIM_ACCOUNT T12582,
    GL_ANALYTICS.DIM_ORG T12637,
    GL_ANALYTICS.DIM_ACCOUNTING_PERIOD T12597,
    GL_ANALYTICS.FACT_LEDGER T38965 / FACT_LEDGER_ytd */*
    where  ( T12582.ACCOUNT_KEY = T38965.ACCOUNT_KEY and T12582.STATEMENT_TYPE_CODE = 'Income Statement' and T12597.ACCOUNTING_PERIOD = 11 and T12597.FISCAL_YEAR = T38965.FISCAL_YEAR and T12597.FISCAL_YEAR = 2012 and T12637.ORG_KEY = T38965.ORG_KEY and T38965.FISCAL_YEAR = 2012 and (T12637.DEPARTMENT_CODE_DESC in ('D0200 - Arts Administration', 'D0206 - Film Studies')) and T12597.ACCOUNTING_PERIOD >= T38965.ACCOUNTING_PERIOD )
    group by T12637.ORG_ID_DESC),
    SAWITH2 AS ((select distinct 0 as c1,
    D1.c1 as c2,
    cast(NULL as  DOUBLE PRECISION  ) as c3
    from
    SAWITH0 D1
    union all
    select distinct 1 as c1,
    D1.c2 as c2,
    D1.c1 as c3
    from
    SAWITH1 D1))
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from ( select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3
    from
    SAWITH2 D1
    order by c1, c2 ) D1 where rownum <= 65001
    I completely do not understand what is going on here. The second query has a ton of problems. First off, it's doing some type of UNION operation - no idea why it's doing that. And the real problem is that it's unioning results from a different fact table, FACT_LEDGER_period instead of FACT_LEDGER_ytd, which is completely screwing up our results.
    Long and short, I simply don't understand at all why the query should change just from rotating a column up into the table prompt area.
    Any ideas?
    Thanks,
    Scott

    Hi Scott,
    I see the query to be valid with each CTE doing the following Jobs.....
    1. I understand that this particular query is being generated to get the unique "ORG_ID_DESC " to fill up the table prompts.
    SAWITH0 AS (select distinct T12637.ORG_ID_DESC as c1
    from
    GL_ANALYTICS.DIM_ACCOUNT T12582,
    GL_ANALYTICS.DIM_ORG T12637,
    GL_ANALYTICS.DIM_ACCOUNTING_PERIOD T12597,
    GL_ANALYTICS.FACT_LEDGER T38927 / FACT_LEDGER_period /
    where ( T12582.ACCOUNT_KEY = T38927.ACCOUNT_KEY and T12597.ACCOUNTING_PERIOD = T38927.ACCOUNTING_PERIOD and T12597.FISCAL_YEAR = T38927.FISCAL_YEAR and T12582.STATEMENT_TYPE_CODE = 'Income Statement' and T12597.ACCOUNTING_PERIOD = 11 and T12597.FISCAL_YEAR = 2012 and T12637.ORG_KEY = T38927.ORG_KEY and T38927.ACCOUNTING_PERIOD = 11 and T38927.FISCAL_YEAR = 2012 and (T12637.DEPARTMENT_CODE_DESC in ('D0200 - Arts Administration', 'D0206 - Film Studies')) ) )
    2. This particular query is to get each prompt value and its corresponding data
    SAWITH1 AS (select sum(T38965.ORIGINAL_BUDGET) as c1,
    T12637.ORG_ID_DESC as c2
    from
    GL_ANALYTICS.DIM_ACCOUNT T12582,
    GL_ANALYTICS.DIM_ORG T12637,
    GL_ANALYTICS.DIM_ACCOUNTING_PERIOD T12597,
    GL_ANALYTICS.FACT_LEDGER T38965 / FACT_LEDGER_ytd /
    where ( T12582.ACCOUNT_KEY = T38965.ACCOUNT_KEY and T12582.STATEMENT_TYPE_CODE = 'Income Statement' and T12597.ACCOUNTING_PERIOD = 11 and T12597.FISCAL_YEAR = T38965.FISCAL_YEAR and T12597.FISCAL_YEAR = 2012 and T12637.ORG_KEY = T38965.ORG_KEY and T38965.FISCAL_YEAR = 2012 and (T12637.DEPARTMENT_CODE_DESC in ('D0200 - Arts Administration', 'D0206 - Film Studies')) and T12597.ACCOUNTING_PERIOD >= T38965.ACCOUNTING_PERIOD )
    group by T12637.ORG_ID_DESC)
    3. This particular query, I understand is to get the following data (Sample data) relating the prompts and their corresponding data
    column (c1) ;column (c2 ie ORG_ID_DESC); column(C3 ie sum(T38965.ORIGINAL_BUDGET))
    0;               ORG_ID_DESC1; NULL
    1;               ORG_ID_DESC1;10
    0;               ORG_ID_DESC2;NULL
    1;               ORG_ID_DESC2;40
    0;               ORG_ID_DESC3;NULL
    1;               ORG_ID_DESC3;29.8
    SAWITH2 AS ((select distinct 0 as c1,
    D1.c1 as c2,
    cast(NULL as DOUBLE PRECISION ) as c3
    from
    SAWITH0 D1
    union all
    select distinct 1 as c1,
    D1.c2 as c2,
    D1.c1 as c3
    from
    SAWITH1 D1))
    4. The last select statement does nothing but selecting the needed data which later gets arranged in the format as needed by the OBIPS
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from ( select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3
    from
    SAWITH2 D1
    order by c1, c2 ) D1 where rownum <= 65001
    Now, on the table being chosen for picking up "ORG_ID_DESC" might be pretty much depending on the best source available as you know. If you would like BI Server to pick up any particular source, probably you could try the "LTS Priority Group" way.
    Hope I was clear and it helps.
    Thank you,
    Dhar

  • Problem while comparing two internal tables

    I have to modify work start date which are initial in the data base table for the records in the flat file.
    my code is:
    REPORT  ZAUFK_WORKSTARTDATE_UPDATE                 .
    Tables Declaration
    TABLES: AUFK.
    Type pools Declaration
    TYPE-POOLS : SLIS.
    Internal Table Declaration
    DATA: I_AUFK LIKE AUFK OCCURS 0 WITH HEADER LINE,
          IT_AUFK LIKE AUFK OCCURS 0 WITH HEADER LINE,
          ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF I_AUFK1 OCCURS 0,
            AUFNR(12),
            AUART(4),
          END OF I_AUFK1.
    Data Declaration
    DATA I_FIELDCAT TYPE SLIS_FIELDCAT_ALV OCCURS 0.
    DATA WA_FCAT LIKE LINE OF I_FIELDCAT.
    DATA: B1 TYPE I VALUE 1,
          C1 TYPE I VALUE 1,
          B2 TYPE I VALUE 256,
          C2 TYPE I VALUE 65536.
    Selection Screen Declaration
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
      SELECT-OPTIONS: S_AUFNR FOR AUFK-AUFNR,
                      S_AUART FOR AUFK-AUART.
      PARAMETERS: P_USER7 LIKE AUFK-USER7 DEFAULT '20070101' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND UCOMM1, " Upload using File Path
                R2 RADIOBUTTON GROUP G1. " Uplaod using particular IO's
    SELECTION-SCREEN END OF BLOCK B2.
    To get F4 Help for File path on selection screen.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_FILE.
    To disbale the filepath when r2 radiobutton is selected
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    Check if R1 is checked
    IF R1 = 'X'.
        IF SCREEN-NAME = 'S_AUFNR-LOW' OR
          SCREEN-NAME = 'S_AUFNR-HIGH' OR
          SCREEN-NAME = 'S_AUART-LOW' OR
          SCREEN-NAME = 'S_AUART-HIGH'.
    Make the Internal order number and order type field disable from the selection screen
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
        ENDIF.
    ELSEIF R2 = 'X' AND SCREEN-NAME = 'P_FILE'.
    Make the file path field disappear from the selection screen
            SCREEN-INPUT = 0.
            MODIFY SCREEN.
        ENDIF.
    ENDLOOP.
    Start of executable code
    START-OF-SELECTION.
    To get the relavent IO data from the order master data table
    SELECT *
           FROM AUFK
           INTO TABLE I_AUFK
           WHERE AUFNR IN S_AUFNR
           AND AUART IN S_AUART
           AND ( AUART = '5200' OR AUART = '5500'
           OR AUART = '5700' OR AUART = '8500'
           OR AUART = '8700' ).
    Table must be updated using flat file
      IF R1 = 'X'.
    To Upload Excel sheet data into an internal table
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            FILENAME                = P_FILE
            I_BEGIN_COL             = B1
            I_BEGIN_ROW             = C1
            I_END_COL               = B2
            I_END_ROW               = C2
          TABLES
            INTERN                  = ITAB1
          EXCEPTIONS
            INCONSISTENT_PARAMETERS = 1
            UPLOAD_OLE              = 2
            OTHERS                  = 3.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    To organize the data in the internal table(excel data) as per our requirement
        PERFORM ORGANIZE_UPLOADED_DATA.
       <b> LOOP AT I_AUFK1.
    Comparing the excel data and the database table data
           READ TABLE I_AUFK WITH KEY AUFNR = I_AUFK1-AUFNR.
             IF SY-SUBRC EQ 0.
    Check if the the work start date is initial(blank)
                IF I_AUFK-USER7 IS INITIAL.
    If work start is initial move the value in p_user7 to the work start date field in i_aufk
                 MOVE P_USER7 TO I_AUFK-USER7.
                 MODIFY I_AUFK.
    Moving the data which is changed into it_aufk internal table(this table is for displaying the updated records)
                 MOVE-CORRESPONDING I_AUFK TO IT_AUFK.
                 APPEND IT_AUFK.
              ENDIF.
          ENDIF.
        ENDLOOP.
    endif.</b>
    WA_FCAT-FIELDNAME = 'AUFNR'.
      WA_FCAT-TABNAME = 'I_AUFK'.
      WA_FCAT-SELTEXT_M = 'Internal Order Number'.
      WA_FCAT-OUTPUTLEN = 12.
      APPEND WA_FCAT TO i_fieldcat.
      WA_FCAT-FIELDNAME = 'AUART'.
      WA_FCAT-TABNAME = 'I_AUFK'.
      WA_FCAT-SELTEXT_M = 'Order Type'.
      WA_FCAT-OUTPUTLEN = 4.
      APPEND WA_FCAT TO I_FIELDCAT.
      WA_FCAT-FIELDNAME = 'KTEXT'.
      WA_FCAT-TABNAME = 'I_AUFK'.
      WA_FCAT-SELTEXT_M = 'Description'.
      WA_FCAT-OUTPUTLEN = 40.
      APPEND WA_FCAT TO I_FIELDCAT.
      WA_FCAT-FIELDNAME = 'USER7'.
      WA_FCAT-TABNAME = 'I_AUFK'.
      WA_FCAT-SELTEXT_M = 'Work Start Date'.
      WA_FCAT-OUTPUTLEN = 10.
      APPEND WA_FCAT TO I_FIELDCAT.
    Updating the AUFK(Internal Order Data Table) using i_aufk
    *MODIFY AUFK FROM TABLE I_AUFK.
    Check if the database table is modified
    *IF SY-SUBRC = 0.
    Display the modified data
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-REPID
       I_GRID_TITLE                      = 'List of updated Records'
       IT_FIELDCAT                       = I_FIELDCAT[]
      TABLES
        T_OUTTAB                          = IT_AUFK[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDIF.
    *&      Form  ORGANIZE_UPLOADED_DATA
          text
    FORM ORGANIZE_UPLOADED_DATA .
      SORT ITAB1 BY ROW COL.
      LOOP AT ITAB1.
        CASE ITAB1-COL.
          WHEN 1.
            I_AUFK1-AUFNR = ITAB1-VALUE.
          WHEN 2.
            I_AUFK1-AUART = ITAB1-VALUE.
        ENDCASE.
        AT END OF ROW.
          APPEND I_AUFK1.
        ENDAT.
      ENDLOOP.
      LOOP AT I_AUFK1.
      CONCATENATE '000000' I_AUFK1-AUFNR INTO I_AUFK1-AUFNR.
      MODIFY I_AUFK1.
      ENDLOOP.
    ENDFORM. " ORGANIZE_UPLOADED_DATA
    The bold are is were i'm facing problem. Please help me .its urgent.

    Hi try using the below code... 
    LOOP AT I_AUFK1.
    Comparing the excel data and the database table data
    READ TABLE I_AUFK WITH KEY AUFNR = I_AUFK1-AUFNR.
    IF SY-SUBRC EQ 0.
    Check if the the work start date is initial(blank)
    IF I_AUFK-USER7 IS INITIAL.
    If work start is initial move the value in p_user7 to the work start date field in i_aufk
    MOVE P_USER7 TO I_AUFK-USER7.
    [<u>b]MODIFY I_AUFK from i_aufk transporting user7.</b></u>
    Moving the data which is changed into it_aufk internal table(this table is for displaying the updated records)
    MOVE-CORRESPONDING I_AUFK TO IT_AUFK.
    APPEND IT_AUFK.
    ENDIF.
    ENDIF.
    ENDLOOP.
    endif.
    if you can't still solve some more questions
    what is teh sy-subrc of teh read ..
    what does the header line contain after teh read
    and what happens after modify.. does the contents change?

  • Problem in report

    Hi,
    All,
    I am developing time evalouation hr report for T-CODE - PA30.  I want to write one record into another record.
    acctually if any employee join one company for example 01-01-2006 and he is getting 1.5 earn leave per month. then at the end of year he has total earn leave 15 in one year. so in next year  31-01-2007 his earn leave will be total 16.5 . then problem is this 
    how i can add  privious year total earn leave into next year january earn leave. Please  provide  me solution. how i need to perform coding.
    Thanks,
    Regards,
    Saurabh

    Hi,
    I have been developed this report.below is coding.
    REPORT  ZHR_PA30_TIME.
    TABLES : PA2001, PA2006, RP50G .
    TYPE-POOLS : SLIS.
    DATA : BEGIN OF ITAB OCCURS 0 ,
           KTART LIKE PA2006-KTART,
           ANZHL LIKE PA2006-ANZHL,
           KVERB LIKE PA2006-KVERB,
           DESTA LIKE PA2006-DESTA,
           DEEND LIKE PA2006-DEEND,
           AWART LIKE PA2001-AWART,
           STDAZ LIKE PA2001-STDAZ,
           ABWTG LIKE PA2001-ABWTG,
           KALTG LIKE PA2001-KALTG,
           ANZHL1 LIKE Q2000-ANZHL,
           BEGDA LIKE PA2001-BEGDA,
           ENDDA LIKE PA2001-ENDDA,
           CHOIC LIKE RP50G-CHOIC,
        END OF ITAB.
    DATA : BEGIN OF ITAB1.
            INCLUDE STRUCTURE Q2000.
    DATA : END OF ITAB1.
    DATA : BEGIN OF ITAB2.
            INCLUDE STRUCTURE RP50G.
    DATA : END OF ITAB2.
    **--ALV DECLERATION *--
    DATA : W_CONTAINER TYPE SCRFNAME VALUE 'CL_GRID',
           W_CPROG TYPE LVC_S_LAYO,
           G_REPID LIKE SY-REPID,
           W_SAVE TYPE C,
           W_EXIT TYPE C,
           CL_GRID TYPE REF TO CL_GUI_ALV_GRID,
           CL_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
           IT_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV,
           WA_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE ,
           LAYOUT TYPE SLIS_LAYOUT_ALV,
           COL_POS  LIKE SY-CUCOL ,
           ALVFC TYPE SLIS_T_FIELDCAT_ALV.
    ***-- SELECTION SCREEN--
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : PERNR FOR  PA2006-PERNR NO-EXTENSION NO INTERVALS .
    SELECT-OPTIONS : CHOIC FOR  RP50G-CHOIC NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN : END OF BLOCK B1.
    PERFORM FILL_CATALOG1 USING :
    'KTART'  'ITAB'  'Category',
    'ANZHL'  'ITAB'  'Quata Number',
    'KVERB'  'ITAB'   'Deduction',
    'DESTA'  'ITAB'   'Deduction From',
    'DEEND'  'ITAB'   'Deduction To',
    'BEGDA'  'ITAB'   'Start',
    'ENDDA'  'ITAB'   'TO',
    'AWART'  'ITAB'   'Absence Type',
    'STDAZ'  'ITAB'   'Absence hours',
    'ABWTG'  'ITAB'   'Absence Days',
    'KALTG'  'ITAB'   'Calender Days',
    'ANZHL1' 'ITAB'   'Quota Used'.
    SELECT   M1~PERNR
             M1~KTART
             M1~ANZHL
             M1~KVERB
             M1~DESTA
             M1~DEEND
             M2~AWART
             M2~STDAZ
             M2~ABWTG
             M2~KALTG
             M2~BEGDA
             M2~ENDDA  INTO CORRESPONDING FIELDS OF TABLE ITAB
                       FROM PA2006 AS M1 INNER JOIN PA2001 AS M2
                       ON M1PERNR = M2PERNR WHERE
                          M1~PERNR IN PERNR.
      LOOP AT ITAB.
      SELECT ANZHL1 INTO (ITAB-ANZHL1) FROM Q2000 WHERE M1~PERNR = PERNR.
      MODIFY ITAB INDEX SY-TABIX TRANSPORTING ANZHL1.
      ENDLOOP.
    IF ITAB-BEGDA > ITAB-ENDDA .
    APPEND ITAB-ANZHL TO ITAB-ANZHL.
    ENDIF.
    BREAK-POINT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM = 'SY-REPID'
        IS_LAYOUT          = LAYOUT
        IT_FIELDCAT        = IT_FLD_CATALOG
        I_DEFAULT          = 'X'
        I_SAVE             = 'A'
      TABLES
        T_OUTTAB           = ITAB
      EXCEPTIONS
        PROGRAM_ERROR      = 1
        OTHERS             = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *ENDFORM.
    FORM FILL_CATALOG1  USING   P_FIELDNAME TYPE ANY
                                P_REF_TABLE TYPE ANY
                                P_SCRTEXT   TYPE ANY.
      CLEAR : WA_FLD_CATALOG.
      WA_FLD_CATALOG-FIELDNAME  = P_FIELDNAME.
      WA_FLD_CATALOG-TABNAME    = P_REF_TABLE.
      WA_FLD_CATALOG-SELTEXT_S  = P_SCRTEXT.
      WA_FLD_CATALOG-SELTEXT_M  = P_SCRTEXT.
      WA_FLD_CATALOG-SELTEXT_L  = P_SCRTEXT.
      APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.
    ENDFORM.                    " fill_catalog1

  • Crystal Reports 2008 - Changing Table Locations

    Hello,
    we have several reports which we use by different customers. The customers use different name spaces (table locations) for the same data. To use the same reports with different table locations, we wrote a piece of software replacing the connection strings and table locations. 
    Example:
    A report should be used in a test environment as well as in a production environment:
      The original SQL is (using a DB2 database on a AS400):
        SELECT alias.name FROM as400.production.users alias
      The modified SQL looks like:
        SELECT alias.name FROM as400.test.users alias
    Up to now we used Crystal XI and developed using RDC. We solved the above described problem by reading the report SQL string, replacing the table location in this string and assigned it back to the report object. Modifying the SQL string has the advantage that it works fine also for reports which contain a SQL command.
    Since Crystal Reports 2008 this is not possible anymore (no RDC, no direct way to modify the report SQL string).
    My first approach was to use the CrystalDecisions.CrystalReports.Engine.Table object. First I just wanted to see what really was the content of the Location and Name property:
    for (int i = 0; i < rdReport.Database.Tables.Count; ++i)
      Table rt = rdReport.Database.Tables<i>;
      Console.WriteLine("Table Nr : {0}", i);                   
      Console.WriteLine("  Table Loc  : {0}", rt.Location);
      Console.WriteLine("  Table Name : {0}", rt.Name);
    My problem with this is that the output for the report with the SQL in the above example is:
    Table Nr: 0
      Table Loc : users
      Table Name: alias
    So obviously not the real table location and table name is returned, but instead the table name for the table location and the alias for the table name. Unsurprisingly setting the location had not the originally desired effect.
    Furthermore if the report was designed using a SQL command, the location and in the name property contain the string COMMAND. Therefore the table object doesn't seems to be the solution to my problem.
    Thanks to the help of a user in this forum here, I figured out how to read the SQL string of a report. Unfortunately I did not found a way to assign it back to the report.
    Has anybody here an idea how to solve my problem? I'm open for every kind of hint.
    Thanks in advance,
    Ron

    My solution looks like this:
    ReportDocument rdReport = new ReportDocument();                   
    rdReport.Load(sReportName, OpenReportMethod.OpenReportByTempCopy);
    CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rcDocument = rdReport.ReportClientDocument;                   
    for (int i = 0; i < rdReport.Database.Tables.Count; ++i)
        CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable rctTable = rcDocument.DataDefController.Database.Tables<i>;
        if (rctTable.ClassName == "CrystalReports.CommandTable")
            Console.WriteLine("Processing CommandTable {0}",rctTable.Name);
            Console.WriteLine("  Old Qualified Name: {0}", rctTable.QualifiedName);
            Console.WriteLine("  Old Alias:          {0}\n" , rctTable.Alias);
            CrystalDecisions.ReportAppServer.DataDefModel.CommandTable tbOldCmd = (CrystalDecisions.ReportAppServer.DataDefModel.CommandTable) rctTable;
            CrystalDecisions.ReportAppServer.DataDefModel.CommandTable tbNewCmd = new CrystalDecisions.ReportAppServer.DataDefModel.CommandTable();
            tbNewCmd.Name = tbOldCmd.Name;
            tbNewCmd.Alias = tbOldCmd.Alias;
            tbNewCmd.CommandText = sNewSql;
            tbNewCmd.ConnectionInfo = tbOldCmd.ConnectionInfo.Clone(true);
            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pbAttr = tbNewCmd.ConnectionInfo.Attributes;
            // set dlls
            pbAttr["Database DLL"] = "crdb_ado.dll";
            pbAttr["QE_DatabaseName"] = "NL67S021OUD";
            pbAttr["QE_DatabaseType"] = "OLE DB (ADO)";
            pbAttr["QE_ServerDescription"] = "192.0.5.24";
            pbAttr["QE_SQLDB"] = "True";
            pbAttr["SSO Enabled"] = "False";
            // set connection string                  
            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pbLogOnProp = (CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag)pbAttr[sAttrLogOnProp];
            pbLogOnProp.RemoveAll();
            // strangely comma seperated values instead of semicolon seperated values are needed here
            pbLogOnProp.FromString("Provider=IBMDA400,Data Source=" + sServerName + ",Initial Catalog=" + sDBName + ",User ID=" + sUserId + ",Password=" + sPwd + ",Convert Date Time To Char=TRUE,Catalog Library List=,Cursor Sensitivity=3");
            tbNewCmd.ConnectionInfo.UserName = sUserId;
            tbNewCmd.ConnectionInfo.Password = sPwd;
            rcDocument.DatabaseController.SetTableLocation(tbOldCmd, tbNewCmd);                           
        else
            Console.WriteLine("Processing Table {0}",rctTable.Name);                           
            Console.WriteLine("  Old Qualified Name: {0}", rctTable.QualifiedName);
            Console.WriteLine("  Old Alias:          {0}\n", rctTable.Alias);
            CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable rctNew = new CrystalDecisions.ReportAppServer.DataDefModel.Table();
            rctNew.Name = rctTable.Name;
            rctNew.Alias = rctTable.Alias;
            rctNew.QualifiedName = sDBName + ".V41TSTDBF.CRGUOPF";
            rctNew.ConnectionInfo = rctTable.ConnectionInfo.Clone(true);
            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pbAttr = rctNew.ConnectionInfo.Attributes;
            // set dlls
            pbAttr["Database DLL"] = "crdb_ado.dll";
            pbAttr["QE_DatabaseName"] = "NL67S021OUD";
            pbAttr["QE_DatabaseType"] = "OLE DB (ADO)";
            pbAttr["QE_ServerDescription"] = "192.0.5.24";
            pbAttr["QE_SQLDB"] = "True";
            pbAttr["SSO Enabled"] = "False";
            // set connection string                  
            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag pbLogOnProp = (CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag) pbAttr[sAttrLogOnProp];
            pbLogOnProp.RemoveAll();
            // strangely comma seperated values instead of semicolon seperated values are needed here
            pbLogOnProp.FromString("Provider=IBMDA400,Data Source=" + sServerName + ",Initial Catalog=" + sDBName + ",User ID=" + sUserId + ",Password=" + sPwd + ",Convert Date Time To Char=TRUE,Catalog Library List=,Cursor Sensitivity=3");
            rctNew.ConnectionInfo.UserName = sUserId;
            rctNew.ConnectionInfo.Password = sPwd;                         
            rcDocument.DatabaseController.SetTableLocation(rctTable, rctNew);
            Console.WriteLine("  New Qualified Name: {0}", rctTable.QualifiedName);
            Console.WriteLine("  New Alias:          {0}\n", rctTable.Alias);
    Console.WriteLine("\nSetting parameter {0} to value {1}", rdReport.ParameterFields[0].Name, iDataId);
    rdReport.SetParameterValue(0, iDataId);
    Console.WriteLine("\nShow SQL: ");
    CrystalDecisions.ReportAppServer.Controllers.RowsetController rsController;
    CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rdClient = rdReport.ReportClientDocument;
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRGroupPath rdGroupPath = new CrystalDecisions.ReportAppServer.DataDefModel.GroupPath();
    string temp;
    string sql;
    rsController = rdClient.RowsetController;
    sql = rsController.GetSQLStatement(rdGroupPath, out temp);
    Console.WriteLine(sql);
    Console.WriteLine("Printing");
    PageMargins pmMargins = rdReport.PrintOptions.PageMargins;
    pmMargins.bottomMargin = 350;
    pmMargins.leftMargin = 350;
    pmMargins.rightMargin = 350;
    pmMargins.topMargin = 350;
    rdReport.PrintOptions.ApplyPageMargins(pmMargins);
    rdReport.PrintOptions.PrinterName = sPrinterName;
    rdReport.PrintToPrinter(1,     // copies
                            false, // collated
                            0,     // start page
                            0);   // end page
    rdReport.Close();
    Regards,
    Ron

  • Decimal error in table BSEG.

    Dear experts,
    I will present my problem in a scenario.
    I'm using txc FB70 to make an invoice in currency COP (columbian peso) or MXP (mexican peso).
    When using MXP it works fine, but with COP the amount entry in table BSEG gets divided by 100.
    The reason is that the amount field in bseg is packed with decimal 2 and FB70 automatically adds *.00 on every amount (that does not already have it) entered by me. Thus 150 becomes 150.00. This is fine except in my system the currency COP is not allowed to contain any decimal and therefore, somehow it get stored as 1.50 instead.
    I have tracked what I believe to be the fault to the FM CURRENCY_AMOUNT_IDOC_TO_SAP which returns the value of 1.50 when entering 150 in a currency that do not contain decimals. I also found a note that described this error (69944) but it was posted in 1998 referring to txc MR01, and should be taken care of in following releases.
    So my question is: Is this the way it should be? is my system obsolete (missing updates of some sort)? or is there an alternative way of reading the data from BSEG? for instance a flag that says I need to multiply by 100 in these scenarios. I know it is a long shot, but still I cannot imagine that this is something that only me have encountered.
    Thanks in advance.

    Hi Johan,
    I do not think, that there is something wrong with your definitions. Please, read the following note 126857 and you will see how the system treats these cases storage-wise.
    Regards,
    Eli

  • How do we join cluster table bseg?

    Friends ,
    i just wanna know as 2 how can we combine bseg and bkpf tables.
    since bkpf is a transparent table and bseg is a cluster table.
    regards
    Essam
    [email protected]

    Hi Essam,
        REPORT  ztestport_01.
    TABLES : bkpf,
             bseg.
       INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE         *
    DATA : BEGIN OF itab_bkpf OCCURS 0,
           bukrs LIKE bkpf-bukrs,            "Company Code.
           gjahr LIKE bkpf-gjahr,            "Fiscal Year.
           budat LIKE bkpf-budat,            "Posting Date in the Document.
           belnr LIKE bkpf-belnr,            "Accounting document number.
           blart LIKE bkpf-blart,            "Document Type.
           END OF itab_bkpf.
    DATA : wa_bkpf LIKE LINE OF itab_bkpf.
       INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE         *
    DATA : BEGIN OF itab_bseg_debit OCCURS 0,
           bukrs LIKE bseg-bukrs,            "Company Code.
           gjahr LIKE bseg-gjahr,            "Fiscal Year.
           belnr LIKE bseg-belnr,            "Accounting Document Number.
           buzei LIKE bseg-buzei,            "Line Item.
           hkont LIKE bseg-hkont,            "General Leadger Account.
           shkzg LIKE bseg-shkzg,            "Credit/Debit Indicator.
           wrbtr LIKE bseg-wrbtr,            "Amount in Document Currency.
           pswsl LIKE bseg-pswsl,            "Update Currency for Gen.Ledger
           dmbtr LIKE bseg-dmbtr,            "Amount in local currency.
           sgtxt LIKE bseg-sgtxt,            "Item Text.
           zuonr LIKE bseg-zuonr,            "Assignment Number.
           END OF itab_bseg_debit.
    DATA : itab_bseg_credit LIKE STANDARD TABLE OF itab_bseg_debit WITH
           HEADER LINE.
                      FINAL OUTPUT INTERNAL TABLE                        *
    DATA : BEGIN OF itab_output OCCURS 0,
           belnr(08)            ,
           bukrs(04)            ,
           budat LIKE bkpf-budat,
           buzei(03)            ,
           hkont(07)            ,
           blart(02)            ,
           shkzg(01)            ,
           wrbtr(08)            ,
           pswsl(05)            ,
           dmbtr(10)            ,
           sgtxt(19)            ,
           zuonr(10)            ,
    END OF itab_output.
    CONSTANTS : c_debit  TYPE c VALUE 'S',
                c_credit TYPE c VALUE 'H'.
                               SELECT-OPTIONS                            *
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-t01.
    SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs.
    PARAMETERS     : p_year LIKE bkpf-gjahr visible length 2.
    SELECT-OPTIONS : s_budat  FOR bkpf-budat,
                     s_dbacct FOR bseg-hkont,
                     s_cracct FOR bseg-hkont,
                     s_amt    FOR bseg-dmbtr.
    SELECTION-SCREEN END OF BLOCK input.
         SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION        *
    SELECT bukrs gjahr budat belnr blart
           FROM  bkpf INTO TABLE itab_bkpf
           WHERE bukrs IN s_bukrs AND
                 gjahr EQ p_year  AND
                 budat IN s_budat.
        SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT        *
                      NUMBER SELECTED FROM BKPF                          *
    IF NOT itab_bkpf[] IS INITIAL.
      SELECT bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             FROM bseg INTO TABLE itab_bseg_debit
             FOR ALL ENTRIES IN itab_bkpf
             WHERE bukrs EQ itab_bkpf-bukrs AND
                   belnr EQ itab_bkpf-belnr AND
                   gjahr EQ itab_bkpf-gjahr AND
                   hkont IN s_dbacct        AND
                   shkzg EQ c_debit         AND
                   dmbtr IN s_amt.
        SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT       *
                      NUMBER SELECTED FROM BKPF                          *
      SELECT bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             FROM bseg INTO TABLE itab_bseg_credit
             FOR ALL ENTRIES IN itab_bkpf
             WHERE bukrs EQ itab_bkpf-bukrs AND
                   belnr EQ itab_bkpf-belnr AND
                   gjahr EQ itab_bkpf-gjahr AND
                   hkont IN s_cracct        AND
                   shkzg EQ c_credit        AND
                   dmbtr IN s_amt.
    ENDIF.
    SORT itab_bkpf        BY bukrs gjahr belnr.
    SORT itab_bseg_credit BY bukrs gjahr belnr.
                         LOOPING THE DEBIT ENTRIES                       *
    LOOP AT itab_bseg_debit.
    READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER *
      READ TABLE itab_bseg_credit WITH KEY
                 bukrs = itab_bseg_debit-bukrs
                 gjahr = itab_bseg_debit-gjahr
                 belnr = itab_bseg_debit-belnr BINARY SEARCH.
      IF sy-subrc EQ 0.
    *READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT   *
           AND APPENDING THE DEBIT AND CREDIT ENTRIES                    *
        READ TABLE itab_bkpf INTO wa_bkpf WITH KEY
                   bukrs = itab_bseg_debit-bukrs
                   gjahr = itab_bseg_debit-gjahr
                   belnr = itab_bseg_debit-belnr BINARY SEARCH.
        itab_output-belnr = itab_bseg_debit-belnr.
        itab_output-bukrs = itab_bseg_debit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_debit-buzei.
        itab_output-hkont = itab_bseg_debit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_debit-shkzg.
        itab_output-wrbtr = itab_bseg_debit-wrbtr.
        itab_output-pswsl = itab_bseg_debit-pswsl.
        itab_output-dmbtr = itab_bseg_debit-dmbtr.
        itab_output-sgtxt = itab_bseg_debit-sgtxt.
        itab_output-zuonr = itab_bseg_debit-zuonr.
        APPEND itab_output.
        itab_output-belnr = itab_bseg_credit-belnr.
        itab_output-bukrs = itab_bseg_credit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_credit-buzei.
        itab_output-hkont = itab_bseg_credit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_credit-shkzg.
        itab_output-wrbtr = itab_bseg_credit-wrbtr.
        itab_output-pswsl = itab_bseg_credit-pswsl.
        itab_output-dmbtr = itab_bseg_credit-dmbtr.
        itab_output-sgtxt = itab_bseg_credit-sgtxt.
        itab_output-zuonr = itab_bseg_credit-zuonr.
        APPEND itab_output.
      ENDIF.
    ENDLOOP.
    SORT itab_output BY belnr budat shkzg.
    then loop your final itab_output
    and give write command to print
    your fields.
    <b>Regards,
    Jackie.</b>
    Message was edited by:
            Jackie

  • Unicode Export - unable to retrieve nametab info for logic table BSEG

    Hi
    We are performing a unicode export (CUUC from 4.6C upgrade to ECC 6.0) and we have incurred this error.
            Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    Our OS is HPUX11.31 & Database is 10.2.0.2
    myCluster (63.21.Exp): 1610: inconsistent settings for table position validity detected.
    myCluster (63.21.Exp): 1611: nametab says table positions are valid.
    myCluster (63.21.Exp): 1614: alternate nametab says table positions are not valid.
    myCluster (63.21.Exp): 1617: for field 310 of nametab displacement is 1877, yet dbtabpos shows 1885.
    myCluster (63.21.Exp): 1621: character length is 1 (in) resp. 2 (out).
    myCluster (63.21.Exp): 1257: unable to retrieve nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 8358: unable to acquire nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 2949: failed to convert cluster data of cluster item.
    myCluster: RFBLG      *400**AT10**0000100000**2004*
    myCluster (63.21.Exp): 322: error during conversion of cluster item.
    myCluster (63.21.Exp): 323: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed.  rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/SBX/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SBX/SYS/exe/run/R3load: END OF LOG: 20081102104452
    We checked the note 913783 as per the CUUC guide but the correction only for package SAPKB70004 to 6. but we are in package SAPKB70011.
    We had found two notes:
    1. Note 1238351 - Hom./Het.System Copy SAP NW 7.0 incl. Enhancement Package 1
    :Solution:
    There are two possible workarounds:
    1. Modify DDL<dbs>.TPL (<dbs> = ADA, DB2, DB4, DB6, IND, MSS, ORA) BEFORE the R3load TSK files are generated;
                  search for the keyword "negdat:" and add "CLU4" and "VER_CLUSTR" to thisline.
    2. Modify the TSK file (most probably SAPCLUST.TSK) BEFORE R3load import is(re-)started.
                  search for the lines starting with "D CLU4 I" and "D VER_CLUSTR I" and change the status (i.e. "err" or "xeq") to "ign" or remove the lines. "
    I tried the above solution by editing the file DDL*.TPL but it is skipping the table and marks it as completed but its not the good solution as we will be miss the data from the table RFBLG.
    2. Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion:
    Solution
    Activate the table.
    Then call the RADCUCNT report. Do not change the selected parameters, but ensure that 'Overwrite Entries' is selected.  Set the 'Unicode Length' to 2 and fill the last two fields 'Type' and 'Name' with TABL and TACOPAB respectively. Then select 'No Log' or specify a log name.
    Execute the RADCUCNT report and restart the export.
    We have not tried this solution, bcos SAP is still down and CDCLS job is still running.
    We would like to know whether you have faced any issues like the above one and what is your suggested approach and solution.
    Is it safe to start SAP now (when the CDCLS job runs) and then try to activate the table RFBLG?
    Regards
    Senthil
    Edited by: J. Senthil Murugan on Nov 3, 2008 1:41 AM
    Edited by: J. Senthil Murugan on Nov 3, 2008 3:36 AM

    Hi Senthil,
    If you have done your pre-conversion steps before upgrade and after upgrade successfully then you should not see the below errors. However changes to SPDD tables may some times also have some impact during conversion and throws nametab errors occurs. Program RADCUCNT runs in the end of upgrade to update nametab tables if any new changes happned during upgrade.
    You can do any no of exports to complete  jobs successfully.yeah When export running you shouldnt bring SAP up.
    The tables you have mentioned all are cluster tables and CDCLS being the biggest table it will take hrs to complete depending on your size of the database.
    Do not pay around with the .TSK file until if you are sure you want to re-execute it.Your first possiblility is skipped because there may be multiple same .TSK files present locally(where u r running distribution.monitor (or) sapinst ) and on the common directory. You may also look at the .TSK.bkp files because it get information and creates a new .TSK. This is not complicated but tricky.
    secound possibility is to update the changed tables(eg: RFBLG...)  to conversion tables.Follow the Note but make sure no R3load processes are running before you start SAP. If you dont want to wait long and sure to restart other processes which are running you can kill it and start SAP. Specify your error tables only and follow instructions given in the note.Once done bring down  SAP app. and restart the export process using ur sapinst or distribution monitor.
    Regards,
    Vamshi.

  • Unable to retrieve nametab info for logic table BSEG

    Hi
    We are performing a unicode export (CUUC from 4.6C upgrade to ECC 6.0) and we have incurred this error.
    Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    Our OS is HPUX11.31 & Database is 10.2.0.2
    myCluster (63.21.Exp): 1610: inconsistent settings for table position validity detected.
    myCluster (63.21.Exp): 1611: nametab says table positions are valid.
    myCluster (63.21.Exp): 1614: alternate nametab says table positions are not valid.
    myCluster (63.21.Exp): 1617: for field 310 of nametab displacement is 1877, yet dbtabpos shows 1885.
    myCluster (63.21.Exp): 1621: character length is 1 (in) resp. 2 (out).
    myCluster (63.21.Exp): 1257: unable to retrieve nametab info for logic table BSEG .
    myCluster (63.21.Exp): 8358: unable to acquire nametab info for logic table BSEG .
    myCluster (63.21.Exp): 2949: failed to convert cluster data of cluster item.
    myCluster: RFBLG *400**AT10**0000100000**2004*
    myCluster (63.21.Exp): 322: error during conversion of cluster item.
    myCluster (63.21.Exp): 323: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed. rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/SBX/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SBX/SYS/exe/run/R3load: END OF LOG: 20081102104452
    We checked the note 913783 as per the CUUC guide but the correction only for package SAPKB70004 to 6. but we are in package SAPKB70011.
    We had found two notes:
    1. Note 1238351 - Hom./Het.System Copy SAP NW 7.0 incl. Enhancement Package 1
    :Solution:
    There are two possible workarounds:
    1. Modify DDL<dbs>.TPL (<dbs> = ADA, DB2, DB4, DB6, IND, MSS, ORA) BEFORE the R3load TSK files are generated;
                  search for the keyword "negdat:" and add "CLU4" and "VER_CLUSTR" to thisline.
    2. Modify the TSK file (most probably SAPCLUST.TSK) BEFORE R3load import is(re-)started.
                  search for the lines starting with "D CLU4 I" and "D VER_CLUSTR I" and change the status (i.e. "err" or "xeq") to "ign" or remove the lines. "
    I tried the above solution by editing the file DDL*.TPL but it is skipping the table and marks it as completed but its not the good solution as we will be miss the data from the table RFBLG.
    2. Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion:
    Solution
    Activate the table.
    Then call the RADCUCNT report. Do not change the selected parameters, but ensure that 'Overwrite Entries' is selected.  Set the 'Unicode Length' to 2 and fill the last two fields 'Type' and 'Name' with TABL and TACOPAB respectively. Then select 'No Log' or specify a log name.
    Execute the RADCUCNT report and restart the export.
    We have not tried this solution, bcos SAP is still down and CDCLS job is still running.
    We would like to know whether you have faced any issues like the above one and what is your suggested approach and solution.
    Is it safe to start SAP now (when the CDCLS job runs) and then try to activate the table RFBLG?
    Regards
    Senthil
    Edited by: J. Senthil Murugan on Nov 3, 2008 1:40 AM
    Edited by: J. Senthil Murugan on Nov 3, 2008 3:37 AM

    Dear Senthil
    I had faced this issue earlier.
    Table BSEG Requires activity in the ACT phase, like activation etc.
    If we do the ACT phase using the transports and not perform manual activation of this table, this issue arrives.
    Please share the relevant information--- seems some steps are missed out or not carried properly in the CU&UC phase.
    Otherways, we had applied the solution  Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion and it worked well..
    But you need to be sure, that this table was changed(activated etc) during the Upgrade till export phase.
    Issue is Nametab info is created during the Upgrade phase in CU&UC and if this table is touched, that nametab info is not getting it right as the runtime object is changed.
    With RADCUCNT the nametab info will be created again.
    All the Best
    Best Regards
    Deepak Dhawan

  • How to generate report from two tables using DAO design pattern?

    Hi,
    Iam using struts with DAO pattern for my application. According to DAO design im creating model class for each table in my database with getter,setter methods. i have no problem when im generating report from one table. but if have i have to join two tables whatis the better way for doing that? is it good practise to create a new model contains properties from both the tables?
    Please help me
    Thanks in Advance
    Rajesh

    Dear Rajesh,
    As per the pattern you are creating equivalent java objects for every database table under consideration in which each db field will become a private attribute and public getter and setter methods.
    If you have to display data from one table the above approach is sufficient enough.
    But in case your database is normalised ..lets take an example of Bank having Branch and Accounts tables. We dont need to repeat the whole information of the branch for every account in that branch. so we prefer to have a branch id in that table....this approach lot of insertion/deletion/updatation anomlies that may exists with the database...
    now lets come back to our topic....we shall create two java objects 1) Branch 2) Account.....
    When ever u just need to display simple report u can do it staright forward,,,,,now if u want to display branch information along with the account information....the two objects just created are not sufficient
    So i suggest u the following approaches
    1) Create an attribute of type Branch in the Accounts Object......
    This shall serve the purpose of displaying the Btranch information
    2) Create a collection object of type ( Vector or ArrayList) which can have objects of Account in the Branch Object,,,
    Now its upto u how shall u fill up the objects with appropriate sql queries.
    The method that i mentioned is followed by Oracle Toplink and Hibernate ....which provide Object to relation mapping layers.
    Any queries ...revert back to me...
    Mahesh

Maybe you are looking for

  • Cannot connect to SQL server in ODI

    Hi, I am new to ODI & Im currently trying to access SQL server DB using ODI. I have downloaded the sql server jdbc driver 2.0 & placed the sqljdbc4.jar in driver folder of ODI_HOME. On creating the data server & testing connection, it says 'Successfu

  • All Apple Software removal

    I've been trying to delete all the APPLE SUPPORT SOFTWARE Bonjour,Support Mobile,etc.from the ADD AND REMOVE PROGRAMS and it's not working. The message is " The feature i'm trying to use is on a NETWORK RESOURCE that is unavailable"  Enter an alterna

  • Host command in OAF

    Hi, Is there a way we can execute host command in OAF. Like executing a shell script from OAF. Thanks.

  • Detect row lock during insert

    Hello, is there a way to detect whether another process is inserting same row into same table, at the point of insert? For eg create table p1 ( col varchar2(10) ); alter table p1 add constraint p1_pk primary key (col); Session 1: Insert into p1 value

  • Can i install cs4 design premium on a windows 8.1 ssd drive

    can i install cs4 design premium on a windows 8.1 ssd drive