Showing posts with label Guide. Show all posts
Showing posts with label Guide. Show all posts

Saturday, 31 March 2012

SAP eCATT Step by Step

eCATT (extended Computer Aided Test Tool) is an SAP Testing Tool used to automate & test business scenarios in SAP R/3. Each test that was executed on eCATT will generate a detailed log on test process and results. If the testing is successful without any errors log we can say that the business scenario mapped in SAP is correct. If the test results shows error then the problem can be analyzed using the error log that is generated by the system

You will get to know what eCATT is, how we can use it, how we can load a test data from a file in ECC 6.0 with an example

Transaction Code: SECATT

1) Create Test Script


Click Create or F5 and the following screen will be displayed


Enter Title as required and the Component as BC-TWB-TST-ECA and Click on the Pattern Button on the menu bar

An Insert Statement dialog box appears


Select Group as UI Control, Command as TCD (Record), Transaction code as MM01 and Press Enter. The system generates a default interface as a MM01_1
Click the Enter

System will start Record the function that you are attempting to perform i.e creation of Material Master


Select the material views, organizational elements as required and follow the views of the material master. After creating material master system will be returned to the eCATT and prompt the alert box with message

You will see following screen


Now double-click on the interface. In this example the interface was named MM01_1, 

you will get following screen


By using split screen now you can navigate through various screens you are recorded and replace the fixed values with variables


This is done by opening the Dynpro menu and going through each numbered screen to review your input

From the above screen print you can see the values Industry sector “M “and Material Type “FERT” as in input values i.e. VALIN. You must change it to a value as shown in the next screen


he variable names are MBRSH and MTART for industry sector and Material type respectively. Once you enter the variable name and press ENTER, the following screen will appear


The default parameter will be Local. You can change this to Import and click on the "Yes" button

The screen will now look like the following screen. Note the icon on screen 1 has changed from the Green Square. This icon indicates a variable is present


Now you can change the all the variables in same process
Click on SAVE icon after completing and save as a local object or place in a development class to transport the eCATT



Click on the SAVE icon you can see the message” Test Script: “………..” saved successfully is generated

2) Creating Test Configuration
Before executing eCATT first you need to create a Test Configuration. Use Transaction code SECATT to executing and entering a name for the Test Configuration and clicking on the Create icon. (In this Example I have given same name as Test Script)



Give Test Configuration a Name and Component and then click on the configuration tab to see the following screen


Enter the name of the Test Script you would like to execute
 Download icon or just press ctrl+shift+F11. You will be prompted with a window "save as" dialog box. Accept the default name and directory and click save, here file will be saved in text format (ex: VAR_ECTC_Z_MATERIALMASTER_MM01.TXT)

After click on SAVE system will prompt the following alert box


This appears since we did not create a Test Container. Click on the YES icon and you can see the message at the bottom of the screen "variants successfully downloaded"

Now click on the Variants tab and you should see the following screen


We must now set the default mode for each time the Test Configuration is executed. Since you will always be running the script with an external file choose the External Variants /Path option


Now click on the drop-down on the File and choose the variant file you just created in the previous step. Your screen should look similar to the one shown below:


Now click on the SAVE icon and save as a local object or place into a development class (package) so that it can be transported

The message
appears at the bottom of the screen
Now you are ready to execute your new eCATT Test Script via the Test Configuration. Open your .txt file and convert the file in to excel file (ex: VAR_ECTC_Z_MATERIALMASTER_MM01.xls) enter your variables


Convert the same Excel file to text file to upload during the execution. If you upload it in .xls format, then SAP will not be able to read it
Now go back to SAP and run tcode SECATT and enter your Test Configuration and click Execute. You can see the below screen


You can choose your Error behavior. Change it to "NO termination, Continue with Next Script Command"
Click on the Variants tab and validate the mode and file path are correct


Click on the UI control and specify whether you would like to execute in the foreground or background. The test configuration will normally default to the background. As with the CATT the foreground method of execution is very helpful when trying to troubleshoot errors in the test script


Then click execute and you are done
eCATT display log appears



Also see


Saturday, 3 December 2011

ABAP Reports


REKH0004SAP demo program that shows how to do 2D, 3D, and 4D graphics.
RGUGBR00Substitution/Validation utility
RHGEN00Regen PD and PA inconsistencies
RHGRENZ0Delimit IT1000 and related 1001s. Program will delete any 1001 infotypes whose start date is after the delimit date.
RHGRENZ1Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.
RHGRENZ2Delimit IT1001 only.
RKCTSEARSearch source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.
RPDTRA00List all HR transactions.
RPR_ABAP_SOURCE_SCANSearch ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.
RPUAUD00HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.
RPUAUDDLHR Report to delete audit data from the PCL4 Audit Cluster.
RPUDELPNDelete all info for an employee number, including cluster data and infotypes
RPUP1D00/10View/Delete data from PCL1 Cluster
RPUP2D00/10View/Delete data from PCL2 Cluster
RPUP3D00/10View/Delete data from PCL3 Cluster
RPUP4D00/10View/Delete data from PCL4 Cluster
RSABAPIVMass print/display of ABAP/4 help text
RSAVGL00Table adjustment across clients
RSBDCBTCSubmit a BDC job with an internal batch number and wait for the end of the batch input session.
RSBDCDRUPrints the contents of a Batch Input session. No options for error transactions only.
RSBDCOS0Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0
RSBDCSUBRelease batch input sessions automatically
RSBTCDELClean the old background job records
RSSDOCTBR/3 Table Manual - prints a list of all fields in the selected tables with the field name and the field documentation.
RSCLTCOPCopy tables across clients
RSDBCREOClean batch input session log
RSINCL00Extended program list
RSNASTEDProcess message control output for entries in the NAST table
RSORARELGet the Oracle Release
RSPARAMDisplay all instance parameters
RSPO0041Removing old spooling objects
RSRSCAN1Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
RSSNAPDLClean the old ABAP error dumps
RSTBSERVCompare a contents of a table between clients
RSTXFCONConverts SAPScript page formats
RSTXSCRPSave a SAPScript layout set to disk, and load it back into SAP.
RSTXSCRPTransport SAPscript files across systems
RSTXSCRPUpload and download SAPScript layout sets
RSTXTPDF4Pass the spool number of a report's output to this program to have the output converted to PDF format.
RSTXTRANAdd standard texts to a transport so they can be moved between systems.
RSUSR003Check the passwords of users SAP* and DDIC in all clients
RSUSR006List users last login
RSWBO052Change development class of a sapscript (provided by Alan Cecchini)
RSWBO060put objects into a request and transport it to any other system
 

Saturday, 5 November 2011

SAP SmartForms step by step

SmartForms  it’s a very robust program which is far much better than the good old SAP script, it’s very recommended to use SmartForms when creating print out form such as Invoice, Sales Order, Delivery Order, etc.

1. First execute TCODE smartforms

2. Create a new smartform program, just name it as ZSFEXERCISE and click CREATE.


3. On Global Settings, click Form Interface and on your right select the TABLES tab. Here you can define internal table to use for the report fields structure, you can define more than 1 table depending on your program requirements. In this example let’s create 1 internal table named ITAB using table SPFLI field structure.


4. Next go to Pages and Windows section (Below Global Settings), open the %PAGE1 New Page folder until you find MAIN Main Window folder, after that Right click > Create > Table This will create an internal table that can get the query result from the report interface.


5. In this next screen, you will see an empty box that will act as the main body of your report to display the report data.

But first we need to define how many columns we want to have on this report, to do this just click Draw Lines And Columns (Pencil button) button and draw a vertical lines on the box to create the report columns. In this example, I drew 3 vertical lines that will create 4 report columns.


6. Now go to Main Area (below the header), right click the Main Area > Create > Table Line. This will one new line 1 just below the main area section, on the right screen you can see the Output Table section, now select the Line Type selection box and click on %LTYP1. After that, you can see that all 4 columns we created earlier in step 5.


7. Now we need to attach internal table columns to display on this smartforms columns, right click the first column > Create > Text this will create a new text icon just below the first CELL Column.


8. Click on the TEXT1 icon we just created earlier, and click on the General Attributes tab.


9. Click on the insert field button.


10. Now this is very important, to define internal table field column on smartforms, you must type &itab-columnname& (begin and ended with a &).

In this example I want this first column to display the carrid column in the SPFLI table, then I will write &itab-carrid&


11.  Now  repeat step 8 and 9 to display these other 3 columns.
&itab-connid&   (on Cell2)
&itab-cityfrom&  (on Cell3)
&itab-cityto& (on Cell4)

12. On the Main Window, click on the TABLE section. In this part you have to define the internal table name used to display the data. In this example we’re using ITAB.


See picture below for a clearer view.


13. After that Click Activate
Now the last step would be to create a program that will be the interface to call this smartform.

14.  Execute SE38, create a program ZRPTEXERCISE


15.  Now copy and paste this code below.


REPORT ZRPTEXERCISE.

DATA T_SPFLI TYPE TABLE OF SPFLI WITH HEADER LINE.
DATA FUNC_NAME TYPE RS38L_FNAM.
DATA ITAB LIKE STANDARD TABLE OF SPFLI WITH HEADER LINE.

START-OF-SELECTION.

SELECT * INTO TABLE ITAB FROM SPFLI.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname                 = 'ZSFEXERCISE'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
 IMPORTING
   FM_NAME                  = FUNC_NAME
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 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.

CALL FUNCTION FUNC_NAME
* EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
  TABLES
    itab                       = ITAB
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


15.  Now copy and paste this code below.


Sunday, 30 October 2011

Step by step LSMW Guide

LSMW to Update Customer Master Records with Transaction Recording
  
Call Legacy System Migration Workbench by entering transaction code LSMW. Every conversion task is grouped together as Project / Subproject / Object structure. Create a Project called LSMW_DEMO and a Subproject as CUSTOMERS and Object as CUST_REC as shown in Figure 1.


Figure 1  Conversion Task with Project, Subproject and Object

The main screen of LSMW provides wizard-like step-by-step tasks, as shown in Figure 2. To complete your data conversion, you need to execute these steps in sequence. Once a step is executed, the cursor is automatically positioned to the next step.

Note that these steps may look different depending upon your Personal menu settings. You could make step numbers visible by ‘Numbers on’ icon or hidden by ‘Numbers off’ icon. You can execute a step by double-clicking on the row. Toggle icon ‘Doubleclick=Display’ or ‘Doubleclick=Edit’, makes the step in ‘display’ mode or ‘change’ mode.


Figure 2 LSMW Wizard – initial screen


Step 1: Maintain Object attributes
In this example, you will be updating the customer master records with the help of recording a transaction (XD02). Choose radio button Batch Input Recording and click on the recording overview icon to record the R/3 transaction. Enter the Recording name as XD02_REC, the description as Customer Master Updates Recording, and the transaction code as XD02.


Figure 3  Object type ‘Transaction Recording’

The system calls the transaction code XD02 and prompts you to complete the Change
Customer transaction, as shown in Figure 4. Enter the key customer information (I entered customer number 1000, sales organization 1000, distribution channel 01, and division 00) and choose ‘Sales’ view within ‘Sales area data’. Make changes to these three fields (I entered, sales office 1010, sales group 110, and customer group 01) and save the transaction.


Figure 4  Transaction recording for Transaction Code ‘XD02’

Once the transaction is completed, R/3 records the flow of screens and fields and saves the information, as shown in Figure 5.




Figure 5  Transaction recording overview

Note that the fields are populated with default values. The values you entered when you recorded the transaction are set by default.

Note that if you have more fields in the recording than needed, you can remove them by clicking ‘Remove Screen field’ icon. 

Observe that the transaction-recording process stores field names in a technical format. By pressing the F1 key on individual screen fields and then pressing the F9 key, the system displays technical names. You then can replace the technical names with descriptive names. Double-click on the field RF02D-KUNNR and enter the name as KUNNR and the description as Customer Account Number and remove the default value. (See Figure 6.)


Figure 6  Field attributes

Similarly, double-click on all other fields with default values and make appropriate changes. Once you have made changes, the recording overview screen looks like what you see in Figure 7.


Figure 7  Transaction Recording Overview – with screen field attributes

Save your changes. When you go back to the initial screen, you will see that the initial screen steps have changed. Since you want to import data via the BDC method, the Direct Input and IDoc-related steps are hidden, as they are not relevant.


Step 2. Maintain Source Structures

Give a name and a description to the source structure (Figure 8).

Figure 8  Source Structure


Step 3. Maintain Source Fields
In this step, you need to list what fields are present in the source structure. The easiest way is to click on ‘Table Maintenance’ icon to enter Fieldname, Type and Length for each fieldas shown in Figure 9 


Figure 9  Source fields of source Structure

Note that your input file will have four fields as key fields and you need to update three fields in the system.

Step 4: Maintain Structure Relations

Execute a step to ‘Maintain Structure Relations’. (See Figure 10.) Since, there is only one Source and Target Structure, the relationship is defaulted automatically.


Figure 10  Structure Relation

Step 5: Maintain field mapping and conversion rules

Field RF02D-D0310 represents that you chose ‘Sales view’ for the customer Master screen accordingly its value should be set to X. Keep your cursor on field RF02D-D0310 and click on Constant rule icon to choose the constant value of ‘X’.

If your source file already has the field value, you choose rule ‘Source Field’.

Keep cursor on field ‘KUNNR’ and click on ‘Assign Source field’ icon to choose source field CUSTOMER from structure XD02S as shown in Figure 11.


Figure 11  Assign source fields

Similarly, assign ‘Source Field’ rules to the remaining fields.

Once all the fields are mapped, you should have an overview screen as shown in Figure 12.



























Figure 12  Field mapping and Conversion rules overview


Step 6: Maintain fixed values, translations, user-defined routines
You can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In this case, that step is not required.


Step 7: Specify files
In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field names. It is present on my PC (local drive) as C:\XD02.txt. (See Figure 13.)






























Figure 13  File attributes

Create an Excel file (Figure 14) with your data and save it as a Tab-delimited text file on your local drive (C:\) and name it XD02.txt.


Figure 14   Source data in Excel file (saved as Tab delimited file)


Step 8: Assign files
Execute step ‘Assign Files’ (Figure 15) and the system automatically defaults the filename to the source structure.


Figure 15 Assign file to Source Structure


Step 9: Read data
In this step, LSMW reads the data (Figure 16) from the source file (from your PC’s local drive). You have the option to read only selected rows and convert data values to Internal format.


Figure 16  Read Data


Step 10: Display read data
This step (Figure 17) is optional. If required, you can review the field contents for the rows of data read.

Figure 17  Display Read Data

Step 11: Convert data
This is the step that actually converts the source data (in source format) to a target format. Based on the conversion rules defined, source fields are mapped to target fields.

Step 12: Display Converted data
Again this is an optional step to view how the source data is converted to internal SAP format (Figure 18).


Figure 18  Display Converted Data


Step 13: Create batch input session
Once the source data is converted in an internal format, you can create a batch session to process updates (Figure 19).


Figure 19  Create Batch Input Session


Step 14: Run Batch Input Session
You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35 transaction for managing BDC sessions. Once you have successfully executed the batch input session, the customer master records are updated in the system. You can confirm this by viewing the customer master records (XD03).


Note! Browsing thru these 14 steps, you may get a feeling that this is a very lengthy and time-consuming activity. However, for the purposes of demonstration, I have made it detailed. Although it looks lengthy, actually it takes hardly few hours from start-to-finish! After playing around with few simple LSMW scripts, you will find it so easy to change and create more complex ones.

CIN configuration in SAP SD

CIN configuration in SAP SD In his video you will see the concept of CIN and step by step Configuration in SAP SD Also see ...