Tables Proration/Spliting Logic required
Hi Friends
I have 3 internal tables:
IT_0001:
PERNR BEGDA ENDDA WERKS BTRTL ABKRS KOSTL ORGEH
10774 20080101 20081028 US11 14 CB 0
10774 20081029 99991231 US11 14 CB 1125100 30084829
IT_0008_1:
PERNR BEGDA ENDDA TRFGR BAND1
10774 20080101 20080803 1 1
IT_0008:
PERNR BEGDA ENDDA TRFST BAND
10774 20080804 20081231 6 6
WITH THE ABOVE TABLES COMBINATION,BY SPLITING THE TABLES BASED ON BEGDA,ENDDA
MY FINAL TABLE HAS TO COME AS FOLLOWS:
IT_FINAL:
PERNR BEGDA ENDDA WERKS BTRTL MOLGA BAND BONUSPRCNTAGE
10774 20080101 20080803 US11 14 10 1 8
10774 20080804 20081028 US11 14 10 6 8
10774 20081029 20081231 US11 14 10 6 8
Can any one please provide me the logic for this.
Thanks for your cooperation.
Regards,
Sree
Hi Gourav
Thanks for your suggestion!
Let me ask the same question in this way then:
Please correct me the code where I am wrong:
Logic for Proration calculation for Bonus Percentage when Band
maintained in TRFGR field.
SORT it_0001_1 BY pernr begda endda.
SORT it_0008_1 BY pernr begda endda.
LOOP AT it_0001_1 INTO wa_0001_1.
LOOP AT it_0008_1 INTO wa_0008_1 WHERE pernr = wa_0001_1-pernr.
To check the end date is 12/31/9999, if yes then set it to bonus year end date
IF wa_0008_1-endda = c_year OR wa_0008_1-endda0(4) > gv_endyear0(4).
wa_0008_1-endda = c_aug_e.
MODIFY it_0008_1 FROM wa_0008_1 TRANSPORTING endda.
ELSEIF wa_0001_1-endda = c_year.
wa_0001_1-endda = gv_endyear.
ENDIF.
***Condition to split the records based on the records in PA0001 and Pa0008 tables data
IF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda = wa_0008_1-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0001_1-begda.
wa_final-endda = wa_0001_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
EXIT.
ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda > wa_0008_1-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0001_1-begda.
wa_final-endda = wa_0008_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_final-begda < wa_final-endda.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
gv_date = wa_0008_1-endda.
IF ( gv_date+4(4) EQ c_leap ). " to check date is feb 28th
gv_mod = wa_0008_1-endda+0(4) MOD 4.
gv_mod1 = wa_0008_1-endda+0(4) MOD 4.
IF ( gv_mod EQ 0 OR gv_mod1 EQ 0 ). " to check for leap year
wa_0008_1-endda+4(4) = c_leap1.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0008_1-endda.
wa_final-endda = wa_0001_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
EXIT.
ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda < wa_0008_1-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0001_1-begda.
wa_final-endda = wa_0001_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_final-begda < wa_final-endda.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
gv_date = wa_0008_1-endda.
IF ( gv_date+4(4) EQ c_leap ). " to check date is feb 29th
gv_mod = wa_0008_1-endda+0(4) MOD 4.
gv_mod1 = wa_0008_1-endda+0(4) MOD 4.
IF ( gv_mod EQ 0 OR gv_mod1 EQ 0 ). " to check for leap year
wa_0008_1-endda+4(4) = c_leap1.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0008_1-endda.
wa_final-endda = wa_0001_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
ENDIF.
ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda >= wa_0008_1-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0001_1-endda + 1.
wa_final-endda = wa_0008_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
ENDIF.
ENDIF.
EXIT.
ENDIF.
CLEAR: wa_0008_1,
gv_date.
ENDLOOP.
***** 23/07/2008
LOOP AT it_0008 INTO wa_0008 WHERE pernr = wa_0001_1-pernr.
To check the end date is 12/31/9999, if yes then set it to bonus year end date
IF wa_0008-endda = c_year OR wa_0008-endda0(4) > c_end0(4).
wa_0008-endda = c_end.
MODIFY it_0008 FROM wa_0008 TRANSPORTING endda.
ELSEIF wa_0001_1-endda = c_year.
wa_0001_1-endda = c_end.
ENDIF.
***Condition to split the records based on the records in PA0001 and Pa0008 tables data
IF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda = wa_0008-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0008-begda. "CHANGED FROM 0001 TO 0008
wa_final-endda = wa_0008-endda. "CHANGED FROM 0001 TO 0008
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
EXIT.
ELSEIF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda > wa_0008-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0008-begda. "look here
wa_final-endda = wa_0008-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_final-begda < wa_final-endda.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
ENDIF.
ELSEIF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda < wa_0008-endda.
wa_final-pernr = wa_0001_1-pernr.
wa_final-begda = wa_0008-begda.
wa_final-endda = wa_0001_1-endda.
wa_final-werks = wa_0001_1-werks.
wa_final-btrtl = wa_0001_1-btrtl.
wa_final-kostl = wa_0001_1-kostl.
IF wa_final-begda < wa_final-endda.
IF wa_0001_1-kostl IS NOT INITIAL.
APPEND wa_final TO it_final.
ELSE.
APPEND wa_final TO it_costcenter.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
****23/07/2007
ENDLOOP.
***Updating the IT_0001_1 and IT_COSTCENTER tables with band information.
IF it_final[] IS NOT INITIAL.
LOOP AT it_final INTO wa_final.
gv_tabix = sy-tabix.
LOOP AT it_0008_1 INTO wa_0008_1 WHERE pernr EQ wa_final-pernr
AND begda LE wa_final-begda
AND endda GE wa_final-endda.
READ TABLE it_cgroup INTO wa_cgroup WITH KEY werks = wa_final-werks
btrtl = wa_final-btrtl.
IF sy-subrc EQ 0.
wa_final-band = wa_0008_1-trfgr.
wa_final-molga = wa_cgroup-molga.
MODIFY it_final FROM wa_final INDEX gv_tabix TRANSPORTING band molga.
CLEAR: wa_0008_1,
wa_final,
gv_tabix.
ENDIF.
ENDLOOP.
***TRFST CALCULATION.
LOOP AT it_0008 INTO wa_0008 WHERE pernr EQ wa_final-pernr
AND begda LE wa_final-begda
AND endda GE wa_final-endda.
READ TABLE it_cgroup INTO wa_cgroup WITH KEY werks = wa_final-werks
btrtl = wa_final-btrtl.
IF sy-subrc EQ 0.
wa_final-band = wa_0008-trfst.
wa_final-molga = wa_cgroup-molga.
MODIFY it_final FROM wa_final INDEX gv_tabix TRANSPORTING band molga.
CLEAR: wa_0008,
wa_final,
gv_tabix.
ENDIF.
ENDLOOP.
CLEAR: wa_final.
ENDLOOP.
ENDIF.
Actually I have developed code but it's not giving the required results.
That's why I asked for the solution .My intension in asking the solution is to get various types of approaches of the solution but not to waste the comunity time.
Anyhow thanks!
Regards,
Sree
Similar Messages
-
Logic required for Sort in ALV
Hi All,
I am dowloding the ALV report layout in excel sheet thorough mailing functionality.
I want to implenemnt the dynamic sort. Here I am writing this.but i want the logic for below code.
CALL FUNCTION 'LT_DBDATA_READ_FROM_LTDX'
EXPORTING
I_TOOL = 'LT'
IS_VARKEY = W_VARKEY_EU
TABLES
T_DBFIELDCAT = IT_DBFIELDCAT_EU
T_DBSORTINFO = IT_DBSORTINFO
T_DBFILTER = IT_FILTER_LAYOUT
T_DBLAYOUT = IT_DB_LAYOUT.
LIT_DBSORTINFO[] = IT_DBSORTINFO[].
SORT LIT_DBSORTINFO[] BY KEY1.
DELETE ADJACENT DUPLICATES FROM LIT_DBSORTINFO[] COMPARING KEY1.
LOOP AT LIT_DBSORTINFO[].
CLEAR: LW_SPOS,
LW_UP,
LW_DOWN,
LW_SUBTOT,
LW_COMP,
LW_EXPA,
LW_GROUP.
CLEAR IT_DBSORTINFO[].
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'SPOS'.
IF SY-SUBRC = 0.
LW_SPOS = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'UP'.
IF SY-SUBRC = 0.
LW_UP = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'DOWN'.
IF SY-SUBRC = 0.
LW_DOWN = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'SUBTOT'.
IF SY-SUBRC = 0.
LW_SUBTOT = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'COMP'.
IF SY-SUBRC = 0.
LW_COMP = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'EXPA'.
IF SY-SUBRC = 0.
LW_EXPA = IT_DBSORTINFO-VALUE.
ENDIF.
CLEAR IT_DBSORTINFO.
READ TABLE IT_DBSORTINFO WITH KEY
KEY1 = LIT_DBSORTINFO-KEY1
PARAM = 'GROUP'.
IF SY-SUBRC = 0.
LW_GROUP = IT_DBSORTINFO-VALUE.
ENDIF.
LOOP AT IT_ALV_DATA FROM W_LOOP_FROM_EU TO W_LOOP_TO_EU.
LW_TABIX = SY-TABIX.
READ TABLE IT_FIELDCAT INTO LW_FIELDCAT WITH KEY
FIELDNAME = LIT_DBSORTINFO-KEY1.
IF SY-SUBRC = 0.
ASSIGN COMPONENT SY-TABIX OF
STRUCTURE IT_ALV_DATA TO <LFS>.
IF SY-SUBRC = 0.
CLEAR LW_CHAR.
LW_CHAR = <LFS>.
IF LW_SPOS= 'SPOS'.
LOGIC Required
ENDIF.
ELSEIF LW_OPTION = 'DOWN'.
LOgic required
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
regards,
Ajay reddyHai,
Let
1)general data
2)all customers
3)company code data
4)sales organization data
are the check box names,Then
Just use the piece of code below:
<b>IF general data = 'X'.
COUNT = COUNT + 1.
ENDIF.
IF all_customers = 'X'.
COUNT = COUNT + 1.
ENDIF.
IF company_code_data = 'X'.
COUNT = COUNT + 1.
ENDIF.
IF sales_organization_data = 'X'.
COUNT = COUNT + 1.
ENDIF.</b>
Now check whether more than one Check Boxes are selected or not
<b>IF COUNT GT 1.
"* Do the oprations what ever you want here
ENDIF.</b>
<b>Reward points if it helps you.</b>
Regds,
Rama chary.Pammi -
ALV ...Logic required
Hi every body,
I have one requirement like an alv report will display
output which contains a material number.
<b>If i click On the material number it shud go to MM03...Accounting view
Logic required for this.</b>I am a beginner ...Plz help me...
Thanks in advance.
Message was edited by: raja gurralaHi,
See the code sample,
INCLUDE <icon>.
* Predefine a local class for event handling to allow the
* declaration of a reference variable before the class is defined.
CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA : o_alvgrid TYPE REF TO cl_gui_alv_grid ,
o_dockingcontainer TYPE REF TO cl_gui_docking_container ,
o_eventreceiver TYPE REF TO lcl_event_receiver,
wa_layout TYPE lvc_s_layo ,
wa_variant TYPE disvariant.
CONSTANTS : c_a(1) TYPE c VALUE 'A' , " All Layouts
c_x(1) TYPE c VALUE 'X'.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
* Hot Spot Click
handle_hotspot
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id
e_column_id
es_row_no,
* Double Click
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no,
ENDCLASS. "lcl_event_receiver DEFINITION
* Implementation
CLASS lcl_event_receiver IMPLEMENTATION.
*& Method handle_hotspot
* This method is called when the user clicks on a hotspot to drill down.
* The following types are exported from the ALV
* LVC_S_ROW
* LVC_S_COL
* LVC_S_ROID
METHOD handle_hotspot.
* The hotspot processing coded in the form below.
PERFORM f9900_handle_hotspot USING e_row_id
e_column_id
es_row_no.
ENDMETHOD. "handle_hotspot
*& Method handle_double_click
METHOD handle_double_click.
* The double click processing should be coded in the form below.
PERFORM f9901_handle_double_click USING e_row
e_column
es_row_no.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
FORM f9900_handle_hotspot USING p_row_id
p_column_id
p_row_no.
*Read internal table for proper value.
READ TABLE i_output
INDEX p_row_id
INTO wa_output.
* Call the transaction MMBE
SET PARAMETER ID 'MAT' FIELD wa_output-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .
ENDFORM. " f9900_handle_hotspot
*& Form f9901_handle_double_click
* Double Click
FORM f9901_handle_double_click USING p_row
p_column
p_row_no.
READ TABLE i_output INDEX p_row INTO wa_output.
CASE p_column.
WHEN 'MATNR'.
IF NOT wa_output-matnr IS INITIAL.
SET PARAMETER ID 'MAT' FIELD wa_output-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .
ENDIF.
ENDCASE.
ENDFORM. " f9901_handle_double_click
U can use either hot spot or double click event.
If u r using hotspot set the hotspot = 'X' in fieldcatalog.
Hope this helps.
OR another method without oops concept
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
data:lv_matnr LIKE v_mmim_lc-matnr, "Material
read table i_output into w_output index rs_selfield-tabindex.
lv_matnr = w_output-matnr.
SET PARAMETER ID 'MAT' FIELD lv_matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .
Clear: lv_matnr.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
<b> i_callback_user_command = 'USER_COMMAND'</b>
i_background_id = 'ALV_BACKGROUND'
IS_LAYOUT = I_LAYOUT
it_fieldcat = i_fieldcat "field catalog
I_SAVE = 'A'
IS_VARIANT = G_VARIANT
TABLES
t_outtab = i_output "output table
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.
Kindly reward points if this helps u, revert back with queries.
Message was edited by: Judith Jessie Selvi -
Adding a single table without a logical join to another table (OBIEE 10g)
Sometimes I want to just display a single table without a logical join to another table in the repository. However, everytime I move it to the Business Model and Mapping layer and perform a Global Consistency Check, it tells me that it needs a logical join and I am forced to create another table to join to it. Thus creating a dimension-fact relationship. There are times I don't need this relationship and just want to display some data. Is there anyway to get around this?
Thanks in advance!Yes,You have to create a join.You cannot take single table to BMM layer.You can create an alias of the table.Join this alias and base table through any common column and take both tables to BMM and desired table to presentation layer.
Another way is to create a view in physcial layer.Write a select statement like
Select primary_key from Table
Where primary_key is primary key of base table.Join this view ith base table and repeat the steps defined for Alias.
Regards,
Sandeep -
No fact table exists at the required level of detail
Hi All,
I am getting the below error in report level(11.1.1.6.4).
No fact table exists at the required level of detail.
Thanks & Regards,
ChandraHi Chandra,
One of the possibility for this error can be:
if you have 2 sets of dimension and fact say (D1 & F1) , (D2 & F2) and these are 2 sets are not connected to each other. In report criteria if you have columns from all the tables. Then the result will be.'No fact table exists at the required level of detail' error.
Regards,
Arjun. -
Tables/Joins for logical tables being combined
I have 2 logical tables set up that have multiple physical table sources (using map to these tables). Some of the physical sources are the same in each logical table. It seems that when I make selections from Answers and look at the SQL, it is picking tables from both logical tables (instead of just the one I used). It is also grabbing the content (additional 'where condition') from the other logical table as well. Why is it doing that?
Yes it is kind of limitation in obiee. But there are some solutions which might deviate from best practices.
Sol 1. Snowflake the dimensions in Business Model. Rather than merging both of them into single logical table, separate them into two different logical tables.
Sol 2. For the logical table , have two LTSs. First LTS will have both tables and all columns mapped to both tables. Second LTS will have only main table, Columns belong to that table only mapped. In this way when you selected columns related to first source system will use second LTS which has only only one table.
- Madan Thota -
Tables list and fields required
Table names and fields required for the list out stock quantity by product code or Stock Group in reports
Hi ,
Table- MARD , search for the required stock(type/group/quantity).
Hope this helps! -
CLIENTThe maintenance tables for the logical files; may we use any client
Please see this link http://help.sap.com/saphelp_47x200/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm
See the import parameter
CLIENT The maintenance tables for the logical files and paths are client-dependent. Therefore, the desired client can be imported. The current client is stored in the system field SY-MANDT.
Does it mean that we may use any client even if our client number is different?I put it back once more
-
Table name and field required for Project name
Hi Guys
I need to print Transfer order print out
Which Table and field I need to take to print Project number (Original format) BSA01.000045.00002hello,
if i am right in understanding your question, then you wanted to know the technical details about the project number or should i say project id, from which wbs elements are created, on which we finally place the orders.
if this is what you want, then for getting the prject number for a particular order, at the table level, follow the below steps -
using the po number or order number as an input in ekkn table, along with the po line item, you will get the wbs element for the order number for that particular po line item.
and using this wbs element as an input in prps table, you can find the current project number.
finally using this current project number as an input in the table proj, you can find the project id or project number = proj-pspid
so you will require 3 tables to get the required details.
hope this helps you.
Regards,
Zafar. -
Table Modifications in Logical Standby
Can I add a new column to a table in a logical standby for a table which is actively synchronized from the primary? In essence, I would like to add a column to the table in the logical standby, but not add the column to the corresponding table in the primary DB.
OK;
So I have convert a Physical Standby to a Logical database.
This table has been created:
CREATE TABLE RSTARS
ID NUMBER,
FIRST_NAME VARCHAR2(50 BYTE),
LAST_NAME VARCHAR2(50 BYTE)
TABLESPACE OTN_TEST
PCTUSED 40
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE BIGSHOW.RSTARS ADD (
CONSTRAINT RSTARS_PK
PRIMARY KEY
(ID));
This data exist in the table:
set linesize 200
select * from rstars;
ID FIRST_NAME LAST_NAME
1 Robert Plant
2 Jimmy Page
2 rows selected.
On the Primary add another row of data
INSERT INTO RSTARS
ID,
FIRST_NAME,
LAST_NAME
VALUES
3,
'Ted',
'Nugent'
commit;
Connect to the logical Standby and check for it.
set linesize 200
select * from rstars;
ID FIRST_NAME LAST_NAME
1 Robert Plant
2 Jimmy Page
3 Ted Nugent
3 rows selected.
MORE TO COME
So I will add the columns one by one and test after each
Add varchar2 to the table:
SQL> alter database stop logical standby apply;
Database altered.
SQL> alter session disable guard;
Session altered.
SQL> ALTER TABLE BIGSHOW.RSTARS ADD (CITY VARCHAR2(15));
Table altered.
SQL> alter session enable guard;
Session altered.
SQL> alter database start logical standby apply;
Database altered.
SQL>
INSERT INTO RSTARS
ID,
FIRST_NAME,
LAST_NAME
VALUES
4,
'Geddy',
'Lee'
commit;
LOGSTDBY Apply process AS02 server id=2 pid=38 OS id=31938 stopped
Errors in file /u01/app/oracle/diag/rdbms/stest/STEST/trace/STEST_as01_31936.trc:
ORA-26676: Table 'BIGSHOW.RSTARS' has 3 columns in the LCR and 4 columns in the replicated site
Fri Aug 09 13:34:18 2013
LOGMINER: session#=1 (Logical_Standby$), builder MS01 pid=34 OS id=31930 sid=34 stopped
So you have good reason to be concerned. Thanks for the question. I have it in my notes, so I would have bet and lost!
I thinking you can create a child table as a work around.
You were right about this too:
SQL> select * from DBA_LOGSTDBY_UNSUPPORTED;
no rows selected
ORA-26676 returns zero documents when I search Oracle Support today.
Best Regards
mseberg
How to fix
To correct all I did was this and Oracle added the row:
SQL> alter database stop logical standby apply;
Database altered.
SQL> alter session disable guard;
Session altered.
SQL> ALTER TABLE BIGSHOW.RSTARS DROP COLUMN CITY;
Table altered.
SQL> alter session enable guard;
Session altered.
SQL> alter database start logical standby apply;
Database altered.
SQL>
set linesize 200
select * from rstars;
ID FIRST_NAME LAST_NAME
1 Robert Plant
2 Jimmy Page
3 Ted Nugent
4 Geddy Lee
4 rows selected.
Message was edited by: mseberg ( as you can tell I'm from the 70's ) -
Manual update tables on 11g Logical Standby
Dear all,
I got one physical primary DB and one logical standby DB running 11.2.0.2 and SQL apply. Same configuration (32bit DB, same server spec) and same settings for both DB servers.
I don't know but for some reason, a table in the logical standby DB (which also exists in the primary DB) cannot be updated properly, a delete statement for a single row can end up generating ORA-4030 and there is no reason primary can complete the task but the logical cannot. Finally, I skipped the table in SQL apply.
As the table is a monthly statistics table computed from another daily statistics table, and it is so large that I dont want to re-instatiate the table via the network, nor re-program the queries.
Therefore I decide to trigger the computation on the logical side.
My question is, given that I skipped the table in SQL, will the manual update create trouble for the SQL apply process? I wonder how the redo procedure handles both tables under SQL apply and those under manual update.
BKNo!
One of the main benefits of a logical standby database would be the option of creating a local dataset.
See: ( Oracle® Data Guard Concepts and Administration 11g Release 2 (11.2) E10700-02 )
10.5 Customizing a Logical Standby Database
10.5.5 Adding or Re-Creating Tables On a Logical Standby Database
A materialized view may also be an option.
Best Regards
mseberg -
Table Cluster Creation - Help required.
Hi,
I need to create a Table Cluster. My requirement is to create Table Cluster for MARA and 3 more 'Z' tables.
I read through the SAP documentation for the creation of table cluster. <http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm>
But when i tried creating 'Cluster Table' i am getting errors.
Please suggest the precautions to be taken while creating a Table Cluster, It would be of great help if any Mock document can be provided for creation of Table Cluster.
Quick help in this regard is much appreciated.
Many Thanks
Ramesh.
Edited by: Ramesh Kajuru on Apr 10, 2008 3:49 AMhi ramesh,
Creating Pooled Tables/Cluster Tables
Procedure
In the initial screen of the ABAP Dictionary select object type Table, enter a table name and choose Create.
The field maintenance screen for the table is displayed. Table type Transparent table is set as default.
Make the necessary entries in the Short description and Delivery class fields on the Attributes tab page. Then define the fields of the table.
Proceed as when creating a transparent table. Save your entries.
Choose Extras ® Change table category.
A dialog box appears in which you have to select the table type Pooled table or Cluster table.
Choose Select.
You return to the field maintenance screen for the table. Field Pool/cluster name is displayed on the Attributes tab page in addition to the standard fields.
Enter the name of the table pool or table cluster to which you want to assign the pooled table or cluster table in field Pool/cluster name
Note that the total key length of a pooled table may not exceed the key length of the associated table pool. The key of a cluster table must correspond to the key of the associated table cluster.
Proceed as when creating a transparent table (see Creating Tables). Remember that you cannot create indexes for pooled or cluster tables.
All the attributes of the technical settings can be maintained for pooled tables and cluster tables. Before you can access these attributes, however, you must convert the table to a transparent table.
Creating Table Pools/Table Clusters
Procedure
In the initial screen of the ABAP Dictionary, choose Utilities ® Further Dictionary Objects.
A dialog box appears.
Select the object type Table pool/cluster and enter the object name. Choose .
A dialog box appears in which you must specify if it is a table pool or a table cluster.
Select the required object type and choose .
The maintenance screen for table pools/clusters appears.
The necessary entries will have been made automatically for the fields for table pools since a table pool has a fixed structure. You should not change these standard settings if you can avoid it.
The structure of a table cluster is also mostly fixed. Certain fields are therefore proposed when the table cluster is created. You can adjust this proposal to your requirements, for example by inserting further key fields. However, make sure you conform to the structure necessary for a table cluster.
Enter an explanatory text in the field Short text.
If necessary, select the activation type of the table pool/cluster with Utilities ® Activation type.
Create documentation about the table pool/cluster with Goto ® Documentation.
This documentation should describe what the table pool/cluster is used for. The documentation is also output when the table pool/cluster is printed.
Go to the maintenance screen for the technical settings by choosing Goto ® Technical settings.
In contrast to the table maintenance screen, you can only define the size category here. All other attributes of the technical settings are preset.
Activate the table pool/cluster with .
Result
The table pool/cluster is activated. You can look at the log of the activation with Utilities ® Activation log. If errors occurred during activation, the activation log is automatically displayed.
After the table pool/cluster has been activated, you need to create it in the database. To do this, use the database utility (Utilities ® Database utility).
Once a table pool contains data, it can no longer be changed.
thanks
karthik
reward me points if usefull -
Logic required for the following
hello all,
this is naveen.
i hope you will help me out with the following.
I'm creating a screen with vendor id,country,name and no push buttons.
in the next screen i'm having purchase doc., purchase group, company code along with insert and exit push buttons.
when i enter the data in the in both the screens and press insert only data from the second screen is uploading into the master table.
I request you to provide the correct PBO and PAI logic for this in a simple way.
points will be rewarded.
thanks
naveenPROGRAM ZVENDORMPOOL .
*& Module USER_COMMAND_0100 INPUT
text vendor first screen.
tables : lfa1.
DATA : BEGIN OF IT OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
LAND1 LIKE LFA1-LAND1,
NAME1 LIKE LFA1-NAME1,
END OF IT.
MODULE USER_COMMAND_0100 INPUT.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module USER_COMMAND_0110 INPUT
text vendor second screen
TABLES : EKKO.
DATA : BEGIN OF JT OCCURS 0,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
EKORG LIKE EKKO-EKORG,
EKGRP LIKE EKKO-EKGRP,
END OF JT.
MODULE USER_COMMAND_0110 INPUT.
CASE SY-UCOMM.
WHEN 'INSE'.
INSERT: LFA1, EKKO.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0110 INPUT
Following are the screens designed
Ist screen with out any push buttons(PB).
2nd screen with PB.
When we click the insert PB in second screen data from both screens should be updated in corresponding master data tables.
(both screen logic is written in pai only by me)
pls got through and give suggestion) -
Logic required for a Internal table issue
Hi All,
I have 2 internal table. I need STLNR value to another internal table. Both having same field. But while reading from one internal table to another internal table using IDNRK key, One idnrk having 2 different stlnr value. But its taking only one. How to take both the values?
The internal table value like below.
it_stpo--> This is first table, Here one Idnrk having different stlnr value. I need the same in to next table. Here i read with idnrk field but its taking one stlnr value only into next table.
How to change the logic ?
Below is it_stpo table and next one is it_mbew_1
it_stpo
STLNR IDNRK MENGE
17224 00439RM1 2.3
17225 00439RM1 4.2
172333 00849RM2 5.6
172158 00432TM3 7.2
152164 00583RM4 8.4
176123 00583RM4 2.3
it_mbew_1
STLNR IDNRK STPRS
00439RM1 111.22
00439RM1 126.45
00849RM2 3.3364
00432TM3 15.5888
00583RM4 0
00583RM4 0.235
My logic like below,
SORT it_stpo BY idnrk.
SORT it_mbew_1 BY matnr.
LOOP AT it_mbew_1 INTO wa_mbew_1.
READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr BINARY SEARCH.
IF sy-subrc = 0.
wa_mbew_1-stlnr = wa_stpo-stlnr.
MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
ENDIF.
ENDLOOP.
Kindly help us.
MohanaTry below logic.
add one more field to it_stpo flag type char01.
update the field with value 'X'.
SORT it_stpo BY idnrk.
SORT it_mbew_1 BY matnr.
LOOP AT it_mbew_1 INTO wa_mbew_1.
CLEAR WA_STPO.
READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr
flag = 'X'.
if sy-subrc eq 0.
move ' ' to wa_stpo-flag.
modify it_stpo from wa_stpo index sy-tabix.
wa_mbew_1-stlnr = wa_stpo-stlnr.
MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
endif.
ENDLOOP.
Regards
Vinod -
Hi ,
I have two internal tables having with different structures . Finally I need to pass data to final internal table.
In runtime we have data in only one table. The final internal table should take either internal1, or internal table 2.
it_final_data[] = it_first_data[].
or
it_final_data[] = it_sec_data[].
i have to one generic include , it will understands the IT_final_data internal table only.
please help me.
regards,
AjayHi Ajay,
Build your final internal table with all the fields from first and second internal table. Use the below logic to move the data to the final internal table depending on the internal table data which you want to display.
IF not it_first_data[] is initial.
loop at it_first_data.
move-corresponding it_frist_data to it_final_data.
append it_final_data.
endloop.
else.
loop at it_second_data.
move-corresponding it_second_data to it_final_data.
append it_final_data.
endloop.
endif.
Hope this works for you.
Regards,
Jayaram
Maybe you are looking for
-
Photoshop Elements 8 stopped working, won't run even after reinstall
I'm using Vista. I installed a couple weeks ago and it's been working fine until today. On startup I keep getting the message "Adobe Photoshop Elements 8.0 has stopped working. A problem caused the program to stop working correctly. Windows will
-
Safari crashing when opening + crash log
I just installed some software, and now safari is crashing instant every time i open it. I have checked, and i do not have Genieo, here is the crash log. Process: Safari [370] Path: /Applications/Safari.app/Contents/Mac
-
Serial Number? Running as trial
It seems like a pretty common thing. Phone Support has already hung up me and I don't have time to hang out and wait again so I'm going to post for the time being. Bought the CC today. I previous had an old copy of CS6 on here running as a trial. I g
-
Which tool is used for database designing
Hi, Can you please share which tool is used for database(Oracle) designing most Thanks
-
I want to replace my itouch 4? How much does Apple charge? $99 or $199?