This website is not affiliated with, sponsored by, or approved by SAP AG.

How to look for data sources - beginners, please read

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

How to look for data sources - beginners, please read

Postby ilya » Mon Feb 09, 2004 4:21 pm

NOTICE: There is a newer version of this article, as well as other information in Rich's ABAP Know1edge Corner, which has moved to w w w . s a p s u p e r u s e r s . c o m

Hi!

Below are some tips for beginners that can help to find out the data sources in SAP, in particular, the database tables. It assumes you know some basics already. Learning the data model is a hard work that will pay back after at least several months of sweating with ABAP code, but everyone has to do this because SAP doesn't document those things. I will appreciate your feedback on how to improve my wording to make it more "understandable" by beginners. Good luck.

If you don't know where to find or process the data your are asked to find:

Some information can be found here: http://www.sapfans.com/forums/viewtopic.php?p=261750
Something else may be given to you as a part of SAP functional training. The rest will be your own experience.

1. Go to your user/analyst/functional guy. Ask them to show this data in a standard SAP transaction (or some custom report they use). Write down how they do that, and do the following later (or do it as they do that):

- On the field of interest (say, sales order), position the cursor there, hit F1, find the Technical Info button, click it. You get the name of the structure and field in the program your are running. The structure can be either the table you need or just a memory field. The latter is trickier. I normally double click on the structure name to get into its definition in SE11. Then I double click on the data element used for the field of interest (data element is at the right of the field name). You get the SE11 screen for the data element. Now you can run Where Used List (look for a toolbar button) to get the list of real database tables that use the same data element. It's very likely that you will find the needed table there.

- From the previous point, you can find a global field name of the SAP program/transaction that is used to update or read the data. If you will be running this under debugger, you can set a watchpoint on this field. SAP will stop when this field is changed, so it will be easier for you to find the place where the data is read. Of course, the field may be filled from another field and so on - you will have to examine a lot of stuff. C'est la vie...

- While looking at the data in the business transaction, run SQL trace. Right before going into your data, go to ST05, enable trace. When you reached the screen with data, disable the trace (don't forget! it's a heavy load for the system), and analyse it. It lists all the tables being accessed - you will find the table you need there.

- While looking at the data, click menu System-Status. You get the program name. Go to SE80 with this program name, Display. There will be a tree with a node Dictionary Structures. Expand it to see the database tables being accessed. You can analyse the source code as well.

- If users can give you an example of custom report that is using the data - look at the source code to find the tables you need and see how they are used (keys, relations etc).

2. When you already know the table you need, but not sure how the data is organized, go to SE11, enter the table name and use Where Used List (button on the toolbar) to get the programs using the table. See the source code then.

3. You can build a list of all the database tables present in the system (alas! it should be about 40000!). Go to SE16, enter table DD02T, press Enter. On the selection screen enter the code for your preferred language. Clear the field that limits the maximum number of hits to get the whole list. Run it (F8). Be patient, it takes time! Download the list to your PC using menu System-List-Save.

4. If you want to use some function to update the data, you can get the list of all the functions similarly to point 3 above, using the table TFTIT. To get an example on how to use this function, use Where-Used List from SE37. In the list, probably the best would be to look at the Y* and Z* programs. Those are most likely the report created specifically for your system - they should show you sample code, maybe with your company/client specifics.

5. Both tricks 3 and 4 can be used on demand. Just go to SE16 every time and enter some search pattern like *sales order* .

6. BAPIs. A nice way to work with your data without learning the SAP data model. Go to transaction BAPI to get the tree of the functions by functional areas. Simple enough? Yes! That's why I like BAPIs! In addition to simply using them for data extracts or updates you can look into their source code to understand how the data is organized (but this is not an easy task).
Last edited by ilya on Wed Sep 14, 2005 5:05 am, edited 2 times in total.
ilya

More input data: http://abaplog.wordpress.com
Sapfans ABAP FAQ: http://www.sapfans.com/forums/viewtopic.php?t=94198
Rich's ABAP Knowledge Corner: http://www.richard-harper.me.uk/Kb/default.html
Function modules documentation: http://www.se37.com
ilya
 
Posts: 2327
Joined: Thu Oct 31, 2002 4:49 am

Postby thurwang » Mon Feb 09, 2004 8:41 pm

best docs!

tks!
thurwang
 
Posts: 38
Joined: Sun Oct 12, 2003 9:19 pm

Postby Guest » Sun Aug 08, 2004 9:29 pm

*bump*

Good post! Am sure every beginner will appreciate this.
Guest
 

Postby malikna » Tue Dec 21, 2004 2:27 am

Realy very helpful Doc for the bigners
thanks a lot.
malikna
 
Posts: 341
Joined: Sat Aug 28, 2004 2:16 am
Location: Saudia Arbia

the tips are awesome

Postby azeem » Wed Oct 19, 2005 12:37 am

hi the tips are awesome, even i am having some experience in abap, but by reading that i learnt some additional things, appreciate your work, thanks a lot on behalf of all sapfans user.
azeem
 

Postby Emanem » Wed Oct 19, 2005 1:31 am

props to ilya for this :)

mods, could this be made into a sticky?
My ABAP Program does what I tell it to do... not what I want it to do...
Emanem
 
Posts: 234
Joined: Tue Feb 17, 2004 8:41 pm
Location: The Emanem Show

Postby ilya » Wed Oct 19, 2005 2:35 am

Emanem wrote:mods, could this be made into a sticky?

The topic is dead old and to my mind should locked. (Rosie, Snowy, would you mind please?) After all, there is a new version of it.

We don't need it to be sticky as it is the first link in the FAQ, whis is in turn sticky.
ilya

More input data: http://abaplog.wordpress.com
Sapfans ABAP FAQ: http://www.sapfans.com/forums/viewtopic.php?t=94198
Rich's ABAP Knowledge Corner: http://www.richard-harper.me.uk/Kb/default.html
Function modules documentation: http://www.se37.com
ilya
 
Posts: 2327
Joined: Thu Oct 31, 2002 4:49 am


Return to ABAP

Who is online

Users browsing this forum: No registered users and 13 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.