Friday, July 12, 2013

Copy fields from one structure/table into another structure/table

Introduction:
Today apparently, I found that we can copy fields from one structure/table into another structure/table while creating/changing it.
Here are the steps.
Steps:
1.     Go to transaction SE11, enter the table/structure name. Click on change.

2.     The table maintenance screen will appear.
3.     Go to Edit->Transfer Fields.
4.     Below pop up window will appear. Enter the table/structure name and click on “Selection” if you want to select specific fields or click “Copy All” if you want to copy all fields of the table/structure.
5.     Here I have clicked “Selection”. Below screen will appear.
6.     Select the fields and click copy.
7.     Below message will appear at eth status bar.
8.     Put a cursor where you want to copy the fields and click paste as below or right click and paste.
9.     The selected fields will appear.
Note: Here the Key and Initial Values also copied. So change it as per the requirement.
10.  Activate the table.
Output:
Summary: In this way we can copy fields from one table/ structure into another table/ structure

Working with Screen Variants

Screen Variants
Screen variants allow you to simplify screen editing by:
  • Providing default values on the screen fields
  • Hiding and changing the ready for input status of fields
  • Hiding and changing the attributes of table control columns
A screen variant contains field values and attribute for exactly one screen. A screen variant may be assigned to multiple transaction variants. Screen variants are always cross-client; they may, however, be assigned to a client-specific transaction. They can also be called at runtime by a program. The different possibilities for calling screen variants guarantee great flexibility of use.
Normally when we create sales order, we can change the “ship to party” which comes based on sold to party, now for the demo purpose, we would disable “ship to party” so that the end-user cant make changes to it.

Transaction code: SHD0.  
Enter the transaction code, for which you want the field to be disabled, give a transaction variant name, this transaction variant will be assigned to order type later.
Here in this case transaction code is ‘VA01’.
Click on Create button
Enter the order type and press enter.
If you want to hide a field in sales order, then in this screen you can make necessary changes, according to our scenario we are just going to make changes only to ship to party so do not make any changes in the screen, Click on enter
Click on enter
Click on enter until you get the below screen where you are going to make modifications to ship to party field
Check the ship to party checkbox in output only (means display purpose) as shown below.  

After checking the checkbox, just click on EXIT and SAVE button shown in the below screen shot.
Enter the short description
Click on save
Assign it to a package.
Assign it to a transport request, and click on enter, you may get the same package and transport request, just click on save and go on until you encounter with the last screen.
Now this is the final screen.
Now go to transaction VOV8.
After selecting the order type, either double click or click on details button, it will take you to the next screen where you have to maintain the variant name.
Now when you try to create a sales order using the same document type then you can see that the ship to party field is in display mode.  

Tracking the Transaction Code for the IMG activities

Go to SPRO -> SAP Reference IMG  
Now click on “Additional Information” à Additional information à Display Key à IMG Activity
 
You would see the activity names on every transaction in IMG now (as shown below)
 
Note the corresponding activity.  
Now to transaction SE16 and enter the name CUS_IMGACH  
Enter the activity name as shown below:
 
Execute and you would get the transaction code  

Unit of Measure - Rounding of decimal places

Before we proceed to configuration settings, we first check the default behavior of decimal places for a unit of measure. 
Let us try creating a Purchase Requisition. 
We have entered the following entry for buying Coffee of 52.5KG.

 
Press Enter and enter the other necessary information like valuation price, G/L account, cost center and others. Come back to the above screen. 
Now the screen would look like:
 
You could notice that three decimal points are shown. 
Now let’s create one more entry, without any decimal points. 
 
You could notice that no decimal points are shown in the case of second line item. 
Now, let us look at the configuration settings for the Unit of Measure (UoM). 
Go to transaction CUNI. 
 
Now select “Mass” as the dimension. 
 
Click on “Units of measurement”. Following screen appears:
 
Now double-click on KG. 
In the above screen, you can notice that “Decimal pl. rounding” is set as 3. Due to this, the quantity in our Purchase Requisition has automatically set to 3. If the decimal places entered by the user are more than this, then it would be rounded to 3 decimal places. 
Also, you can notice that the “Decimal places” is set to blank. If this is set, then the quantity would be displayed with that number of decimal places. For example, if you enter the quantity as 50, system would display as 50.00. 

Transporting Table entries from one server to another

Scenario:  In this scenario, we would try to transport the table entries of table SCARR.
 
Go to transaction SE10. Click on Create.  
 
Following pop-up appears. Select Workbench request. (If the table is customizing table, then select customizing request)
 
Provide a short description to the request.
 
The request is displayed as shown below
 
Now double-click on the request, 
 
Go to change mode, and enter the following details:
 
Now click on the key button available under the name “Function” (As shown in the screenshot above). Following screen appears. Double-click on the first empty line. 
 
Here we can provide the entries that we would need to transport. For our demo purpose, we are transporting all the entries in SCARR belonging to client 800. 
 
Press Enter. Screen would look as follows:
 
Now you can check for the entries that would be transported as per the given condition, by clicking on the table button highlighted in the screenshot above. 
Select the third radio button “Table contents specified by current key”. 
 
Following entries would appear:
 
Click on Save. A warning message would appear. 
 
SAP issues a warning message when an application table is used. Following is the SAP help that would appear when we click on the message:
Ignore the warning message and click on Save. The request would appear as follows: 
 
Now transport this request to transport the data to any other system.