Documente Academic
Documente Profesional
Documente Cultură
CA :
What is a client in SAP?
If the data of One Client to be acessed from Another Client, is also cross
Applications.
By default select statement can get the data of the table only from the current client.
* client specified is the option used in Select statement to use criteria based on field
"MANDT" to specify the other client of SAME r/3 for fetching data.
Syntax:
Select <fields_list> from <tab> client specified where mandt = <req_client>.
abap statements.
endselect.
* DEMO EXAMPLE
TABLES KNA1.
SELECT * FROM KNA1 CLIENT SPECIFIED WHERE MANDT = '800'.
WRITE : / KNA1-MANDT , KNA1-KUNNR , KNA1-LAND1 , KNA1-ORT01.
ENDSELECT.
WRITE : / SY-DBCNT.
Note : This query can be used only between Same R/3 For fetching data from other
clients.
When ever we need to Access the data from Other R/3 then we need to depend on RFC
( Remote Function Call ).
Any Function Module added with a remote Enable Property is called as Remote Function
Call.
This function Module can be accessed by SAME r/3 networks , other R/3 networks and
even Non R/3 systems also.
Search help as Dictionary Object can be assigned as a property to Parameter fields using
"match code object" option.
It can be assigned to Data Elements to add Search Help Functionality for I/O Fields.
Under this statement we can use Module Statement or Field Statement of Flow logic
editor to invoke the ABAp code or to provide search help functionality.
By default all statements in Flow logic editor are executed based on Type of action and
type of event. But This chain - endchain statement executes all statements in one after
another.
example code in Flow logic editor.
* STEP #1.
* STEP #2.
* come back to Invoking system (192.8.8.3)
* Create a Logical System.
i) DEFINE LOGICAL SYSTEM
SALE -> ALE -> SENDING AND RECEIVING SYSTEM -> LOGICAL
SYSTEMS -> DEFINE LOGICAL SYSTEMS ( CLICK ON CLOCK ICON) -> OPENS
AN INTERFACE WITH LIST OF ALL LOGICAL SYSTEMS -> CLICK ON NEW
ENTRIES FROM APPLICATION TOOLBAR -> OPENS ANOTHER INTERFACE ->
NAME THE LOGICAL SYSTEM (SAPCLASS ) -> ENTER DESCRIPTION (ANY) ->
SAVE THE ENTRIES -> ASSIGN WITH A REQUEST NUMBER -> COME BACK.
ii) Assign Client To Logical System
This step is used in Logical system, to activate the object. When ever Logical system
is assigned to any Client is activated.
SALE -> ALE -> SENDING AND RECEIVING SYSTEMS -> LOGICAL SYSTEMS ->
ASSIGN CLIENT TO LOGICAL SYSTEM ( CLICK ON CLOCK ICON ) -> Open the
List of Clients in SAP -> Double click on Required Client ( 800) -> Opens an interface ->
replace the logical system name with created ( SAPCLASS ) -> save the Entries -> come
back.
SALE -> ALE -> SENDING AND RECEIVING SYSTEM -> SYSTEMS IN
NETWORK -> DEFINE TARGET SYSTEM FOR RFC CALL (CLICK ON CLOCK
ICON) -> SELECT R/3 CONNECTIONS FROM THE LIST -> CLICK ON CREATE
FROM APPLICATION TOOLBAR -> SPECIFY LOGICAL SYSTEM NAME AS RFC
DESTINATION (SAPCLASS) -> SET THE CONNECTION TYPE AS "3" -> ENTER
THE DESCRIPTION ( ANY ) -> CLICK ON LOGON SECURITY TAB -> SPECIFY
LANGUAGE AS "EN" -> CLIENT (800) -> SET THE USERNAME (SAPUSER) ->
PASSWORD ( MONEY ) -> Press Enter -> Click on Technical Settings -> Specify target
host as ( 192.3.3.1 ) -> Save the Entries -> Click On Remote Logon to test the connection
-> Come back.
* STEP #3. Create ABAP code and Invoke remote Function Module.
REPORT ZDEMO_RFC2 .
DATA : ITAB LIKE VBAK OCCURS 1 WITH HEADER LINE.
CALL FUNCTION 'ZRFCGET'
DESTINATION 'SAPCLASS'
TABLES
KTAB = ITAB.
LOOP AT ITAB.
WRITE : / ITAB-VBELN ,ITAB-ERDAT , ITAB-ERNAM , ITAB-KUNNR.
ENDLOOP.
When ever we use arguments as Pass by value , variable value is send as argument and
Formal parameters are allocated with New memory in Remote R/3, and values are
manipulated in Function module code and Returned to Invoking R/3.
When ever we are executing RFC code, By default there are two processes are executed
in invoking and Remote R/3 Networks. For the current program executed, the memory
allocated in Current R/3 is internally executed with a name called as "main thread". Using
Function Module destination option if the request is redirected to remote R/3, in second
server a new process will be created to execute the Function Module , Second process
created in Remote system is called as "Child Thread" Process.
By default When ever Main thread is passing a request to Child thread, Main thread
process will be suspended till Child thread process is completed , as the response
received by the main thread executes the remainging statements.
This type of execution is called as "Synchronus process" execution. Due to this effiency
of the program code reduces.
To increase Coding Effiency between R/3 Communication we can use a concept called
"RFC asynchronus process".
* EXAMPLE CODE FOR ASYNCHRONUS PROCESS RFC.
REPORT ZTEST_F.
PARAMETERS : NUM1 TYPE I,
NUM2 TYPE I.
DATA : RES TYPE I.
DATA : AAA TYPE I.
WRITE : / 'ABAP STATEMENT 1'.
WRITE : / 'ABAP STATEMENT 2'.
WRITE : / 'ABAP STATEMENT 3'.
WRITE : / 'ABAP STATEMENT 4'.
CALL FUNCTION 'ZRFC_ARG'
DESTINATION 'PO800'
STARTING NEW TASK 'TSK1'
PERFORMING SUB1 ON END OF TASK
EXPORTING
A = NUM1
B = NUM2.
WRITE : / 'ABAP STATEMENT 9'.
WRITE : / 'ABAP STATEMENT 10'.
WRITE : / 'ABAP STATEMENT 11'.
WRITE : / 'ABAP STATEMENT 12'.
WRITE : / 'ABAP STATEMENT 13'.
WAIT UNTIL AAA = 100.
WRITE : / 'RESULT ', RES.
FORM SUB1 USING T1.
RECEIVE RESULTS FROM FUNCTION 'ZRFC_ARG'
IMPORTING
C = RES.
AAA = 100.
ENDFORM.
RFC:
Any Function Module added with Remote Enabled property is called as "RFC".
These can be invoked by Same R/3 Systems, Other R/3 system and even Non R/3
systems.
To invoke these Function Modules From Remote R/3 Networks we require a concept
called as "logical system".
Logical System Is a network which reprents One R/3.
SALE is the TCODE used to Create the Logical System.
1st JUNE EDI architecture
RFC :
using RFC we can fetch data from remote System to Current System. But current
system data can't be sent to Remote System.
TRFC : is a port in sap EDI SUB System uses a logical system to identify the remore R/3
where data to be populated.
Process code: is a technique To execute the Function module in SAP for EDI Sub
system. By default Function modules can be executed with Help of "CALL FUNCTION"
Statement only.