Comparasions of records between two dsos using abap program
Hello Experts,
As per my business requirements we Implemented 30 DSO (EDW Layer) for x Reason with the reference from Y Reason DSOs. and for x reson dso we created transformations and dtp. through process chains we loaded the data to X Reason Dsos. after loading i want to comare these two dso records through ABAP Progrm.
here my source is : X Region Dsos
here Trget is : Y Region Dsos
these two are the mandatory fields
and the optional fields are:
1. Sales org
2. Sales division
3. document creation date.
for this type of requirement i want to implement ABAP Program.i want to abap code for this type of requirement. anyone have abap code for similar type of requirement please send the abap code.
Thanks & Regards,
Hi saurabh,
If your requirement if to comepare both the values based on the sales org, sales div, data, u can build a report or if you want to look up the both the DSO and want to perform any operation we need to write routine at transforamation level.
I'm sending u a sample code where i had used for look up two ods and delete the exisitng saled docs.in the BI.
DATA : BEGIN OF i_uxxx OCCURS 0,
/bic/zaw LIKE /bic/aZD_UDLIT00-/bic/zaw,
END OF i_uxxx.
DATA : wa_udlit LIKE i_uxxxt.
DATA : BEGIN OF i_uxxxx OCCURS 0,
/bic/zaw LIKE /bic/aZD_UDAN00-/bic/zaw,
END OF i_udxxx.
DATA : wa_uxxxx LIKE i_uxxx.
case 1 : For uxxxx lite data
CLEAR i_uxxx.
DATA: wa_srcpack TYPE tys_sc_1,
zindex TYPE sy-tabix.
BREAK-POINT.
CLEAR: zindex.
SELECT /bic/zaw
FROM /bic/aZD_UDLIT00
INTO TABLE i_uxxx.
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE /bic/zaw = SOURCE_PACKAGE-/bic/zcustomer.
LOOP AT SOURCE_PACKAGE INTO wa_srcpack.
zindex = sy-tabix.
CLEAR wa_xxx.
READ TABLE i_uxxx INTO wa_uxxx
WITH KEY /bic/zaw = wa_srcpack-/bic/zcustomer
IF sy-subrc = 0.
Delete SOURCE_PACKAGE.
ENDIF.
MODIFY SOURCE_PACKAGE INDEX zindex FROM wa_srcpack.
CLEAR: zindex.
ENDLOOP.
*case 2 : For uxxxx data
CLEAR i_uxxxx.
DATA: wa_srcpack1 TYPE tys_sc_1,
zindex1 TYPE sy-tabix.
BREAK-POINT.
CLEAR: zindex1.
SELECT /bic/zaw
FROM /bic/aZD_UDAN00
INTO TABLE i_uxxxx
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE /bic/zaw = SOURCE_PACKAGE-/bic/zcustomer.
LOOP AT SOURCE_PACKAGE INTO wa_srcpack1.
zindex1 = sy-tabix.
CLEAR wa_uxxx.
READ TABLE i_uxxxx INTO wa_uxxx
WITH KEY /bic/zaw =
wa_srcpack1-/bic/zcustomer
IF sy-subrc = 0.
Delete SOURCE_PACKAGE.
ENDIF.
MODIFY SOURCE_PACKAGE INDEX zindex FROM wa_srcpack.
CLEAR: zindex1.
endloop.
Hope this helps...
Regards
KP
Similar Messages
-
Synchronizing Two Custom Z Tables Using Abap Program
Hi,
My requirement is Synchronizing two custom z tables using abap program me.
I have vendors in two tables, i have to select the common vendors from first which are existing in second table also.
In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
different fields.
My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
I have to pass X value for each depending in Second table depending upon supplier type in first table.
. How to do it can any one suggest with code.
Thanks in Advance,
Vivek
<subject edited by moderator>
Message was edited by: Manish KumarHi,
Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
If the key of Table2 is vendor no & vendor type, then do a read table for the key.
The logic in pseudo-code:
Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
extract the vendor types in to itab Table1New.
Select the vendor & types from Table2 by using the for all entries option (better performance).
loop at Table1New
check in Table2:
if the unique key is vendor no: check all fields for the vendor type from Table1New
if the unique key combo is vendor no & type: check by using a read table.
If not found => add entry to Table2
endloop.
endselect Table1 (when using package size)
I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
Good luck!
Best regards,
Zhou -
Count the number of records between two key values (BTREE)
How can I count the number of keys between two values?
I'm using python driver, and BTREE access method.
====>
ideally what I want is to average a whole time-series data set (the intervals can change) to a given number of points. The keys are the time stamps and the values are the data that needs to be averaged. I need to count the number of records between two time stamps so that I can divide that number by the number of points i need, and average the data. What is the best way to do this? Or should I just keep the intervals for the time stamp constant and use RECNO access method?
Thank you
(first post btw.. and why aren't there many people in stackoverflow who answer Berkeley DB questions?)BDB is an embedded db and it does not have any internal counters or statistics that you could grap to use for this. You will need to do it manually.
You can create a cursor, grap the records you want, each time you get the next record you bump a counter.
If you are using RECNO, you can use a cursor to get the record number of the record (DB_GET_RECNO), and if all you data is in
sequentail records with no missing records you can figure out the total count by take last rec # - initial rec # + 1 to get a total count.
If you switch over to the SQL API, you can issue a SQL query to give you a count. Select count(*) Where .......
Since you have to grab the data anyway, then best may be to count records as you go along.
thanks
mike -
How to fetch records between two seq uence numbers?
We have thousands of records with seq uence numbers in the oracle database, we need to retrieve a number of records between two seq uence numbers, i.e. to retrieve records between 100 and 200 seq uence numbers. Could some one help me to find a query to fetch records.
I'll be waiting for your response..
Edited by: sumant on Jul 27, 2010 12:42 PMIs this is what you are looking for?
SQL> create table tab1 (id number);
Table created.
SQL> insert into tab1 values (1);
1 row created.
SQL> insert into tab1 values (2);
1 row created.
SQL> insert into tab1 values (3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from tab1;
ID
1
2
3
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
43
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
39
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
13 This will generate a random number that will be greater then the maximum value in the table and lower then the maxvalue + 50. Having the range starting from maxvalue in the table you will never get a number generated which already exists in the table.
As you see in the above number genrated they are all between 4 and 53.
If you want to increase the range from where the number are generated just increase the value 50 that I used in the query. -
Delta broken between two DSO ??
Hello,
We are on BI 7.0.
We have copied our productive system into our develoment system in order to have refresh datas. But since this copy with a big problem in our development system : one DTP on delta is broken between two DSO.
I Try to reactivate any objects (DTP, DSO, transformation...). Nothing ! Then I delete all datas in target DSO and relaunch an init with same DTP in delta ! all data are correctly transfered in target DSO, but when I add new datas in source DSO, it's impossible to load them into target DSO with same DTP : "no more data avaible "
Could you help me ? In our system we have severals DTP in delta between DSO, and there are correct ! only this one is broken.Hi Eric,
When a system is refreshed all the data sources and other DTPs might show the refreshing system details.
BASIS would be running BDLS job to change those entries and point correctly the Source system.
After refresh there are many possibilities that the INITs would be corrupted.
Check with your BASIS team whether BW relevant post refresh jobs are completed or not?
Thanks & Regards.
Ganesh Thota. -
How to draw a line(shortest distance) between two ellipse using SWING
how to draw a line(should be shortest distance) between two ellipse using SWING
any help will be appreciated
regardsimport java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
import javax.swing.event.MouseInputAdapter;
public class ELine extends JPanel {
Ellipse2D.Double red = new Ellipse2D.Double(150,110,75,165);
Ellipse2D.Double blue = new Ellipse2D.Double(150,50,100,50);
Line2D.Double line = new Line2D.Double();
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setPaint(Color.green.darker());
g2.draw(line);
g2.setPaint(Color.blue);
g2.draw(blue);
g2.setPaint(Color.red);
g2.draw(red);
private void connect() {
double flatness = 0.01;
PathIterator pit = blue.getPathIterator(null, flatness);
double[] coords = new double[2];
double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
double min = Double.MAX_VALUE;
while(!pit.isDone()) {
int type = pit.currentSegment(coords);
switch(type) {
case PathIterator.SEG_MOVETO:
case PathIterator.SEG_LINETO:
Point2D.Double p = getClosestPoint(coords[0], coords[1]);
double dist = p.distance(coords[0], coords[1]);
if(dist < min) {
min = dist;
x1 = coords[0];
y1 = coords[1];
x2 = p.x;
y2 = p.y;
break;
case PathIterator.SEG_CLOSE:
break;
default:
System.out.println("blue type: " + type);
pit.next();
line.setLine(x1, y1, x2, y2);
private Point2D.Double getClosestPoint(double x, double y) {
double flatness = 0.01;
PathIterator pit = red.getPathIterator(null, flatness);
double[] coords = new double[2];
Point2D.Double p = new Point2D.Double();
double min = Double.MAX_VALUE;
while(!pit.isDone()) {
int type = pit.currentSegment(coords);
switch(type) {
case PathIterator.SEG_MOVETO:
case PathIterator.SEG_LINETO:
double dist = Point2D.distance(x, y, coords[0], coords[1]);
if(dist < min) {
min = dist;
p.setLocation(coords[0], coords[1]);
break;
case PathIterator.SEG_CLOSE:
break;
default:
System.out.println("red type: " + type);
pit.next();
return p;
public static void main(String[] args) {
final ELine test = new ELine();
test.addMouseListener(test.mia);
test.addMouseMotionListener(test.mia);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(test);
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
EventQueue.invokeLater(new Runnable() {
public void run() {
Graphics g = test.getGraphics();
g.drawString("drag me", 175, 80);
g.dispose();
private MouseInputAdapter mia = new MouseInputAdapter() {
Point2D.Double offset = new Point2D.Double();
boolean dragging = false;
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
if(blue.contains(p)) {
offset.x = p.x - blue.x;
offset.y = p.y - blue.y;
dragging = true;
public void mouseReleased(MouseEvent e) {
dragging = false;
public void mouseDragged(MouseEvent e) {
if(dragging) {
double x = e.getX() - offset.x;
double y = e.getY() - offset.y;
blue.setFrame(x, y, blue.width, blue.height);
connect();
repaint();
} -
Is it possible to reset password for any user using abap program
Hi friends,
Is it possible to reset password for any user using abap program by specifying client number and user id. in selection screen.
if any code for that to reset password please mail me.
Thanks & Regards,
YogeshHello Yogesh,
Yes you can reset the password for any body using ABAP Code. But for that you really don't need any client number.
If this process is on regular basis, then recommended is to use BAPI for changing the user details Otherwise BDC also works fine.
=> Function Module - BAPI_USER_CHANGE
Call this in the program for resetting the password.
=> CALL TRANSACTION 'SU01' USING InternalTable
This will be executed in the BDC of SU01 transaction recording. Use the Password Change button in the application toolbar of transaction while recording.
Hope this helps.
PS If the answer solves your query, plz close the thread by marking it solved and rewarding each reply.
Regards -
Access table using ABAP program in other database
Dear SAP Expert,
We have requirement that related to SAP interface.
Our SAP system run on Oracle database 11g (Unix).
Illustration: SAP system = A non SAP system = B
We need to access a table using ABAP program (from SAP system A) in other database (system B) that are not necessarily SAP database. The non-SAP system using SQL Server 2008 (Windows).
What is the best practice for this interface
Do we need database link? If yes, please help to inform me the details step to configure it.
Thanks and RegardsHi Friend,
You try using an intermediate system..passing your input required to fetch the data..and PI should call the respective query to retrive record..once the full flow is completed you should get the return through some table in the calling program.
else.
ask the other system guy to write a function with select query and ask him to expose as RFC and that RFC we have to call it as RFC in our program to get the required values and only thing we need here is a proper connector in place.
Regards
S.Janagar -
Read Data From DSO - In ABAP Program
HI Friends,
Can any one tell how to read Data from a DSO in a Abap Program on BI System itself......
Which is the better way to read data from DSO in Abap Program... Is it
1. Reading Data Directly From the Active Table Of the DSO ... or
2. Reading Data From DSO....
In case of reading data from DSO.... Which function module is used to do this work....When i searched the forum i came across 2 function Modules.... BAPI_ODSO_READ_DATA_UC and RSDRI_INFOPROV_READ..... Please let me know which one should be used....
Regards,
Shyam.Hi Shyam,
The active content of any ods will be stored in the database tables( SE11) with the naming convention /BIC/A<odsname>00 for Custom-defined DSO and /BI0/A<odsname>00 for Business content delivered DSO.
For example if the technical name of the ods is TEST , then the active content table name in SE11 will be /BIC/ATEST00.
You can write your own program to read the contents of this database table.
Regards,
Krishna. -
Fork in process chain using ABAP program
Hello everyone.
I need a fork in my chain. Depending on the values in some db table I will make a decision: do some process or skip and go further. The only solution I can see is using ABAP program. But unfortunately It doesn't return status. Any suggestion will be appreciated.Hi,
You have few process to run after the abap program. So make all those process as a different chain, and at the end of the ABAP program include a function module to trigger this chain, based on your condition.
If you like this idea, please revert for more information.
Hope this helps.
Thank you, -
Unzip files using ABAP program
Hi All,
Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
Thanks in advance
Bhaskerhi
good
parameters: command(236) lower case.
data: std_lines(255) occurs 0 with header line.
call function 'RFC_REMOTE_PIPE'
destination 'SERVER_EXEC'
exporting
command = command
read = 'X'
tables
pipedata = std_lines
exceptions
communication_failure = 1
system_failure = 2.
You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
reward point if helpful.
thanks
mrutyun^ -
How to print external file using ABAP program
Hello
I want to print an external file which is located in server (
20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
thank you
Vikram.
Message was edited by:
Vikram Bojjaextract the data and pass to script or smartform for printing
-
Can a transaction be called in background dynamically using ABAP program??
Hi Experts,
Can a transaction be called in background dynamically using ABAP program without BDC???
Regards,
Mansi.u can create job dynamically through programming..Try this sample code..
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
Insert process into job
SUBMIT zreport and return << Here it is a static call but u can make it dynamic
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards,
JOy. -
HOW TO creat BAR CHART using ABAP Programming
DEAR ALL,
I want some help as to how to creat GRAPHICAL display using ABAP programing (BAR CHART) any sample codes Example will be very helpful.
Regards,
VJOn earlier versions, you can do something like this.
[code]
REPORT ZRICH_0005 .
DATA: BEGIN OF ITAB_DATA OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
END OF ITAB_DATA.
Data: BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.
ITAB_DATA-DATANAME = 'Maple'.
ITAB_DATA-QUANTITY1 = 5500.
ITAB_DATA-QUANTITY2 = 6200.
ITAB_DATA-QUANTITY3 = 5900.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Oak'.
ITAB_DATA-QUANTITY1 = 3500.
ITAB_DATA-QUANTITY2 = 5200.
ITAB_DATA-QUANTITY3 = 4400.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Cherry'.
ITAB_DATA-QUANTITY1 = 1800.
ITAB_DATA-QUANTITY2 = 2200.
ITAB_DATA-QUANTITY3 = 1900.
APPEND ITAB_DATA.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
COL1 = 'Jan'
COL2 = 'Feb'
COL3 = 'Mar'
TITL = 'Lumber Usage in $'
TABLES
DATA = ITAB_DATA
OPTS = ITAB_OPTIONS
EXCEPTIONS
OTHERS = 1.
[/code]
Regards,
Rich Heilman -
Name the infotypes we uplode using abap programs
Hi,
can anyboby let me know, Name the infotypes we uplode using abap programs?
ThanksIT0008
IT0045
IT0589 ETC
some of them can be made through LSMW also but we use BDC . the main reason is we wont find Feilds to upload those data in templates
Maybe you are looking for
-
IPhone 4s syncing with computer
on my iPhone i have been trying to sync my itunes playlists and music but it says on the computer this is what is on the phone yet nothing changes on my phone. weeks ago it worked just fine now it wont sync.. any ideas?
-
I have a 1.25ghz emac running leopard with 1.5gb ram and 80gb HDD. Ram is about to be bumped to 2gb, and HDD to at least 160gb (if you have any recommendations let me know please! I would love to have 250-500gb). I'm looking to install either apertur
-
Hello together, how I can fix a Payment Method to a customer no.? We have some different Payment Method and we would fixed this, on the sales are data. Thanks for your help. Best regards Petra Schober
-
Issue with Weblogic services in Linux OBIEE 11G
Hello All, I have a OBI 11G set up on a linux OS.I am facing a issue with weblogic service. Whenever I am trying to start the Admin server from command line using its .sh , it is starting successfully. But whenever I am closing that Linux session or
-
Spotlight hangs on mirrored RAID Drive
Spotlight is always hanging while trying to index. I've deleted the index file(by showing hidden files) on my 2TB RAID and determined that it is that RAID that has the prob. I've also verified that the RAID is in a proper state via disk utility. Any