Upload
elena-puscu
View
105
Download
0
Embed Size (px)
DESCRIPTION
SHDB – Record a transaction
Citation preview
SHDB – Record a transaction
Note:
To use SHDB and LSMW transactions it is better the SAP screen to be in format “Default size”.
To set in this format use from menu:
In this situation the recording will have exactly the same number of lines like in screen.
SHDB – Record a transaction
SHDB - Record a transaction
This transaction allows a user to record keystrokes and other keyboard actions so that they may be incorporated into a BDC session. While any session may be recorded, it does not mean that the recording can be used to create a session. Within a recording individual screens may not be allowed.
Customized screens may present a problem. Only use the non-customized screens to record sessions.
In this example, the transaction MM is recorded.
Enter transaction SHDB, also called The Transaction Recorder: Recording Overview.
Click on the "New Recording button"
To start a new recording, enter a recording name (up to 10 letters) in the field labeled "Recording," and the Transaction Code MM01. Click either the "Start Recording" button or the green check mark at the bottom of the screen.
Recording the session:
SHDB – Record a transaction
Once the Start Recording button is pressed, the system displays the screens for the transaction code requested. Enter each field needed for the transaction, and proceed to the following screen. A "recording running" message may appear between screens. During a recorded session screen interaction time is extended.
Completing the transaction
End the transaction normally. When completed, the Transaction Recorder: Edit Recording screen is shown, Click the Save icon, which saves the recording. Green arrow back to the starting point (Transaction Recorder).
SHDB – Record a transaction
SHDB: Recording a transaction
The BTCI recorder is the power tool for the developer of inbound processing IDocs. It is not only creating ABAP code for you, which can be replayed at ease. It is most helpful, because, you always can ask an application consultant or key user, to record a working example for you.
HiatusScreen
First screen of MB1C
HiatusScreen
First screen of MB1C
SHDB – Record a transaction
HiatusScreen
Detail Screen
SHDB – Record a transaction
HiatusScreen
Screen
SHDB – Record a transaction
Record a session with transaction
SHDB
You will be asked for a session name and the the name of the transaction to record.The you can enter the data into the transaction as usual. Activating the recording sessionFirst screen of MB1CDetail ScreenEnd the recording First screen of MB1C
Detail Screen Processing: There
are mostly menu functions that allow exact item positioning
There is something to say on detail screen processing, ie. screens with table controls.If you enter many lines or try to extend a list, where you do not know before, how many lines the list contains, you will not know, where to place the cursor. Therefore most transactions provide a menu option, that positions the list in a calculable manner. If you choose a new item, most transaction will either pop up a detail screen or will position the list, so that the next free line is always line 2.
From the recorded session, you can
generate an ABAP
The SHDB transaction creates an ABAP from the recording. When you run this ABAP, it will generate a BTCI group file, with exactly the same data as in the recording.
Replace the include with modified FORM
routines to allow CALL TRANSACTION
It will use a set of predefined FORM routines, which are stored in an include file. If we modified this FORM routines a little bit, we can make the ABAP run with a CALL TRANSACTION, which is much more suitable for our development and testing purposes. If you replace the standard include BDCRECXX with this one zz_bdcrecxx.txt , you can replay the recording online. Try it out, to check if the recording worked the way you expected it. It is often a good idea to deactivate
SHDB – Record a transaction
the recorded SAVE button OK-CODE, so you may test without saving your tests. You know, many examples work only once with the same example, eg. a goods delivery or a shipment.
Put the coding into a function module
To make the recorded code usable for other program, you should make a function module out of it. For that purpose you would create a function group, eg. YBTCI, which will take all the recorded BTCI functions. Include zz_bdcrecxx.txt in the global data of YBTCI, so that all function will have access to the FORM routines in there. In addition, you would replace all the recorded constant values with variables, to make the function flexible.
With a little trick program, you can
generate the function module
We have written a little bootstrap program, that actually allows to create the function module more or less automatically. It is not meant as an automation routine, but a tool that generates code, which can then be refined manually as needed. You simply need to replace the include BDCRECXX line in the generated ABAP with include zzbdcrecxx_fb_gen and run the program. It will ask for the function group and function name and create the function module. Try it out :-)
Test the function module with the test
tool and add eventual loops for detail processing.
The function module should work without modification for testing at least. However, you probably will need to modify it, eg. by adding a loop for procesing multiple entries in a detail screen.
SHDB – Record a transaction
Generate program from SHDB recording made in another clienthttp://www.sapdev.co.uk/tips/tips_shdb.htm
Creating a program from a recording is sometimes difficult as data is in one client and ability to create the program is in another. The simple solution to this is to create the recording in the data rich client (i.e. QAS), then export this recording to a file and import it into the DEV client. Your program can then be created from the recording made in QAS.
Steps:1. Execute transaction SHDB in QAS(where data is)2. Make recording and save, return to SHDB front screen3. Press 'Overview', then select the created recording(double click)4. Go into change mode(press ‘Change-Display icon)5. Now go into editing mode(press editing icon or F6)6. Select ‘Export’ from the ‘Recording’ menu7. Enter file name and path to store temporary file8. Press the ‘Transfer’ button9. Breathe...10. Execute transaction SHDB in DEV client11. Make new recording and save it, but don’t worry about what it does as data will be over written (just create one for SE38 or something).12. Return to SHDB front screen13. Press 'Overview', then select the created recording(double click)14. Go into change mode(press ‘Change-Display icon)15. Now go into editing mode(press editing icon or F6)16. Select ‘Import’ from the ‘Recording’ menu17. Enter file name and path of temporary file created before18. Press the ‘Transfer’ button19. Hit save and you can now use this recording to generate your program as usual (SHDB->Overview-> Program).