Thursday, July 22, 2010

Dynamic pattern in se38 pattern.... ^^^^


This may seem little silly requirement but i did for fun. Normally we want to write all the descriptions about the program , that can can through dynamic pattern.
1. Goto SE38 and follow as below.

2. Give the name of your pattern.

3. Now click on ok and write below syntax and save it.

4. Now goto t-code CMOD and create one project.

5. Now click on Enhancement assignment button as given on above screen. Now pass the below user exit name .

6. Now click on component button , you will see below screen. Double click on red colored area.

7. Now you will a include program. Double click on the include program.
8. Write the below peice of code and activate it.

Wednesday, July 21, 2010

Get the F1 help in selection screen@@@@2

First goto t-code SE61 and create the text which you want for the F4 help and then follow the procedure as mentioned in below screen shot.




Tuesday, July 20, 2010

Difference between RFC and BAPI (Business application programming interface )

RFC :
External programs using RFCs can either make or receive remote function calls to or from an SAP system. Therefore, using RFCs an external program can act as either the client or the server to an SAP system. Conversely, the SAP system can take the role of either the client or the server to the external application.
You can use a combination of SAP Automation tools to incorporate remote function calls into your programming environment. SAP Automation offers several products that make programming RFCs easier. It offers products for programming of RFCs from languages such as C, C++, Java, or COM-compliant languages, such as Visual Basic and applications such as Excel.
SAP Automation also includes tools that help you browse the metadata of RFC function modules, meaning that they allow you to view the syntax of RFC functions, their parameters and fields.
Using RFCs requires knowledge of ABAP programming, because calling a remote function in R/3 is calling an ABAP function. You may also need to extend the existing set of available RFC with your own ABAP code.

BAPI :
R/3 systems contain a set of business objects, which are an object-oriented representation of real-world business objects. Examples of business objects are a purchase requisition, a G/L account, or an employee.
An R/3 system also contains Business Application Programming Interfaces (also called Business APIs, or BAPIs), which provide a programming interface to business objects. BAPIs are a set of methods for working with and manipulating SAP business objects.
Internally, BAPIs are implemented as function modules stored in the R/3 Function Builder. Each BAPI has an equivalent internally-named function module. However, you should use the BAPI and not the function module behind it, because the BAPI provides a stable, object-oriented view of R/3 applications and data. The internal function modules or even the fact that the BAPIs are implemented as function modules are not guaranteed to remain the same in future releases of R/3.
The advantage of using BAPIs over using RFCs is that using BAPIs requires no ABAP programming knowledge. You use BAPIs from standard programming languages such as C++ and Java.
Using BAPIs also offers the most stability to your application, because BAPIs stay consistent over different R/3 releases.
However, business objects and their BAPIs are created by SAP, and you can only use BAPIs that were implemented by SAP. If a certain BAPI for performing a certain application task was not implemented yet, you must seek alternative programming methods.

SAP Locks and Data Base Locks!!!

Some body asked me in one of the interview which i faced that when we have database locks then why we use SAP locks??
As a database we generally use ORACLE which is a third party tool and database has its own lock mechanism but on the application server level SAP has its own lock mechanism.
Below screen :

Wednesday, July 7, 2010

Web services from function module in adobe form!!!!

Requirement : You have to create an simple adobe form which can update the SAP database in offline ( PDF file will be stored on desktop and you can either get the data or update the data).

First create one remote enabled function module like below :

Now create the web service from the RFC by following the below path :

When you will click on from function module one Wizard will be opened as below

You have to complete the wizard and this you get a web service name which you can decide at the time of creation. In my case web service name is YRG_WEBSERVICE_RAHUL.
Now goto transaction code SOAMANAGER.

Give search pattern and field for easy search and you will be able to see the web service which you have created from RFC. Select the service name and click the apply selection. then you find the below screen . Now you will have click on " Open WSDL document for selected binding "
and you get a XML file but to get the XML file , we need to create the endpoint from overview tab.

Below is the screen which we can see while creating the endpoint.

Below is the file which you will get on clicking as mentioned above, now you have to save this file on your destop with extension" .WSDL ".
Now goto t-code SFP and create one empty interface and activate it after this you create the form and generate a new data connection , in the same process we have to upload the .WSDL file which we have saved on our desktop.

As soon as we upload the WSDL file all import , export , tables and chaging parameters appear automatically as per the RFC and one more button.

Now execute the form and save it to destop.
Pass employee number and press button.
And you will get the Employee name from SAP database.