Saturday, September 10, 2011

BC427: Classic BAdI


The following figure shows how a program exit that is implemented using the classic BAdI technology works.


A BAdI definition is called and a BAdI interface is specified in TCODE SE18.This automatically generates a BAdI adapter class and the corresponding bridging method, which SAP application calls to branch to the relevent program.The only task for this bridging method is to call existing active implementation methods of industry solutions , partners and customers one after the other. The sequence in which they are called is not specified.
The following figure shows the syntax that is used to prepare and call the bridging method in the SAP program.


in the SAP program, after you define the BAdI and generate the adapter class including the bridging method, a type is assigned to a reference variable using the BAdI interface.
when the static method GET_INSTANCE of the standard class CL_EXITHANDLER is called , an instance of the adapter class (BAdI instance) is created.
The briding method in the BAdI instance is then called and it branches to the relevant program.

The following figures show how to find the classic BAdI in SAP programs and how to use them for enhancements.

Tuesday, September 6, 2011

WebMethods , REPEAT Step


REPEAT Step :
The REPEAT step allows you to conditionally repeat a sequence of child steps based on the success or failure of those steps.You can use REPEAT to :
.  Re-excute (retry) a set of steps if any step within the set fails.
.Re-execute a set of steps until one of the steps within the set fails.


.Specifying the REPEAT Condition : Repeat on (FAILURE or SUCCESS) .


.Specifying the REPEAT Counter :
0 : does not re-execute children.
Any value > 0 : re-execute children up to this number of times.
-1 or blank : re-execute children as long as the specified Repeat on condition is true.


Important :
 note that the children of a REPEAT always execute at least once. The Counter property specifies the maximum number the children will be re-executed.




Using REPEAT to Retry a Failed Step
If your flow invokes services that access external systems, you can use the REPEAT step to accommodate network errors, such as busy servers or connection errors, at run time. If you use the REPEAT step for this purpose, keep the following points in mind:
􀂄 The following types of failures satisfy the FAILURE condition:
􀂄 Expiration of a child step’s Timeout limit
􀂄 An exception thrown by a Java service
􀂄 A document query that returns an unpermitted null value
􀂄 If you specify multiple children under a REPEAT step, the failure of any one of the children will cause the entire set of children to be re-executed.
􀂄 The REPEAT step immediately exits a set of children at the point of failure (that is, if the second child in a set of three fails, the third child is not executed).
􀂄 When Repeat on is set to FAILURE, the failure of a child within a REPEAT step does not cause the REPEAT step itself to fail unless the Count limit is also reached.
􀂄 The Timeout property for the REPEAT step specifies the amount of time in which the entire REPEAT step, including all of its possible iterations, must complete. When you use REPEAT to retry on failure, you may want to leave the Timeout value at 0 (no limit) or set it to a very high value. You can also set the property to the value of a pipeline variable by typing the name of the variable between % symbols.
􀂄 As a developer, you must be thoroughly familiar with the processes you include  within a REPEAT step. Make  certain that the child steps you specify can safely be repeated in the event that a failure occurs. You don’t want to use REPEAT if there is  the possibility that a single action, such as accepting an order or crediting an account balance, could be applied twice.

Using REPEAT to Retry a Successful Step
Apart from using REPEAT to retry a failed step, you can also use it as a looping device to repeat a series of steps until a failure occurs.
If you use the REPEAT step to re-execute successful child steps, keep the following points in mind:
􀂄 The success condition is met if all children of the REPEAT step execute without returning a single exception.
􀂄 If one child in the set fails, the REPEAT step exits at the point of failure, leaving the remaining children unexecuted.
􀂄 The failure of a child does not cause the REPEAT step to fail; it merely ends the loop.
(In this case, the REPEAT step itself succeeds and execution of the flow proceeds normally).

NET100 : ITS , Introduction

















BC427 , Unit3 (cont) : Enhancements in Other SAP Objects


Other Implicit Enhancement Points :

What else Can We Implicitly Enhance :

How to Enhance these objects (subroutine , include , structure) :
1. Display the source code of the corresponding SAP object
2. in the GUI status , choose the enhancement button
3.choose the options Edit-->Enhancement Operation -->Show Implicit Enhancement Options to show the implicit enhancement options.
4. in the editor , put the cursor on one of the implicit enhancement points/options to and from the context menu create the enhancement implementation.
5.Insert the source code.
6. In GUI status , choose 'Activate Enhancements'.

Important  :
when you enhance a structure (type ) decleration (before 'END OF ...') you must use the syntax.
DATA: <additional field1> TYPE <TYPE1>,<Additional field 2 > TYPE <TYPE2> ,..
otherwise it would give a syntax error.


BC427 : Unit 3(Cont) : Enhancements in local Classes


Implicit Enhancement Classes:

What  Can We Implicitly Enhance in local SAP Classes:

How to Enhance Local SAP Classes   :
1. Display the source code of the local   class
2. in the GUI status , choose the enhancement button
3.choose the options Edit-->Enhancement Operation -->Show Implicit Enhancement Options to show the implicit enhancement options.
4. in the editor , put the cursor on one of the implicit enhancement points/options to and from the context menu create the enhancement implementation.
5.Insert the source code.
6. In GUI status , choose 'Activate Enhancements'.




Monday, September 5, 2011



Branching on an Expression :

When you branch on an expression , you assign an expression to each child of a branch step. At run time , The BRANCH step evaluates the expression assigned to the child steps. It excutes the first child step with an expression that evaluates to true.


To Branch on an expression :

1.Create a list of the conditional steps (target steps) and make them children of the BRANCH step.

2 In the Properties panel for the BRANCH step, set Evaluate labels to True.

3 In the Label property of each target, specify the expression that, when true, will cause the target step to execute. The expressions you create can include multiple variables and can specify a range of values for variables. Use the syntax provided by webMethods to create the expression. For more information about expression syntax, see Appendix D, “Conditional Expressions”.





* only one step will be executed .

* To define a default step , write $default  in the label property of the default step.


Branch to Null  or Empty ?




Branch
on

When
to use it ?

how ?

Null

if the switch variables is
explicitly set to null or does not exist in the pipeline. you can use $null with
any type of switch variable

set label property to $null

Empty

if the switch variable is present but
contains no characters . you can use it with type
string only.

leave the label property blank



Important!
If you branch on expressions (Evaluate labels is set to True), you cannot branch on null or empty values. When executing the BRANCH step and evaluating labels, the server ignores target steps with a blank or $null label.




example :

The following example shows a BRANCH step used to authorize a credit card number based on the buyer’s credit card type (CreditCardType). It contains three target steps. The first target step handles situations
where the value of CreditCardType is null or where
CreditCardType does not exist in the pipeline. The second target step handles cases where the value of CreditCardType is an empty string. (Note that the first two target steps are EXIT steps that will return a failure condition when executed.) The third target step has
the $default label, and will process all specified credit card types.












Important!

You can only have one default target step for a BRANCH step.
Developer always evaluates the default step last. The default step does not need to be the last child of the BRANCH step.




If you want to use the value of a pipeline variable for this property, type the variable name between % symbols (e.g. %expression%).





Sunday, September 4, 2011

WebMethods: Invoke Step , Branch on Value

You use the INVOKE step to request a service within a flow. You can use the INVOKE step to:
 

When you build a BRANCH step, you can:


􀂄 Invoke any type of service, including other flow services and Web service connectors.

􀂄 Invoke any service for which the caller of the current flow has access rights on the local webMethods Integration Server.

􀂄 Invoke built-in services and services on other webMethods Integration Servers.

􀂄 Invoke flow services recursively (that is, a flow service that calls itself). If you use a flow service recursively, bear in mind that you must provide a means to end the recursion.
* Built-in services reside in the WmPublic package
 

Invoking a Service on Another webMethods Integration
Server You can use the built-in service pub.remote:invoke to invoke a service on a remote Integration Server and return the results. The remote server is identified by an alias, which is configured on the Remote Servers screen in the Integration Server Administrator. The
pub.remote:invoke service automatically handles opening a session and authentication on the remote server.


The pub.remote:invoke service resides in the WmPublic package and requires the alias of the remote server and the fully qualified name of the service that you want to invoke as input.


The BRANCH Step
The BRANCH step allows you to conditionally execute a step based on the value of a variable at run time. For example, you might use a BRANCH step to process a purchase order one way if the PaymentType value is “CREDIT CARD” and another way if it is “CORP ACCT”.

When you build a BRANCH step, you can:
 

􀂄 Branch on a switch value. Use a variable to determine which child step executes. At run time, the BRANCH step matches the value of the switch variable to the Label property of each of its targets. It executes the child step whose label matches the value of the switch.
􀂄 Branch on an expression. Use an expression to determine which child step executes. At run time, the BRANCH step evaluates the expression in the Label property of each child step. It executes the first child step whose expression evaluates to “true.”
  

BC427 : Enhancement Framework , Unit 3(Cont) : Enhancements in SAP Classes

What Can We implicitly enhance in SAP Classes ?



How to Enhance SAP Classes ?


Enhancing interfaces for global SAP methods and defining additional attributes/methods for global SAP classes :
1.Display the class in class builder SE24
2.choose menu options Class-->Enhance and specify an enhancement implementation to add new attributes , methods and interface parameters to existing methods.
3. in GUI status , choose 'Activate Enhancements'.
 


Defining a pre/post/overwrite method for the method of a global SAP class :
1.Display the class in the class builder SE24
2.Choose the menu class-->enhance to specify/create an enhancement implementation
3.Use the cursor to mark the required SAP method
4.Choose the menu ooptions Edit-->Enhancement Operations then choose one of the menu entries : Inset Pre-Method,Insert Post-Method or Add overwrite method.
5.Choose the new button in the coloumn "Pre/Post/Overwrite-Exit" to implement the corresponding method.
6.Save the method.
7.in GUI status , choose 'Activate Enhancements'
 

These methods are automatically called before,after or instead of the SAP method.They are instance methods of an automatically generated ,local class and are avaliable via an instance attribute named CORE_OBJECT. This attribute is a reference to the corresponding current instance in the application program that this SAP is being used.


Enhance source code in methods of global SAP classes :

1.Display the source code of the method.
2.in GUI status , choose the enhancement button
3.Choose the menu options Edit-->Enhancement Operations-->Show implicit enhancement options to show the implicit enhancement options.
4.in the editor, use the context menu of one of the implicit enhancement points displayed to create an enhancement implementation.
5.insert the source code.
6.in GUI status , choose 'Activate Enhancements'.

Saturday, September 3, 2011

WebMethods : Flow Service

What is a flow Service?
 
basic unit of work that instructs WebMethods Integration Server about what to do with data at each stage of flow service.
Using Flow Service , you can :
 

.Invoke a service such as flow service , Jave , C service or Web service connector (INVOKE).


.Conditionally escute one step from a set of specified alternative (BRANCH)


.Repeat a set of flow steps up to a specified number of times or until a step in the set fails or succeeds as specified (REPEAT)


.Repeat a set of flow stepsover the elements of the specified array (LOOP)


.Group a set of flow steps and control the way in which the failure of a member of set is processed (SEQUENCE).


.Exit the entire flow or exit a single flow step (EXIT)


.Link,add,edit,delete pipline variables or invoke several services that operate on the same st of pipline variables (MAP)

BC427 Enhancements Framwork , Unit3(Cont):Enhancements Points , options , sections

Implicit Enhancemtn Points:
options to insert source code in SAP programs, FMs and methods without making modefications (without explicit preperation by SAP). 

To implement additional functions , customers can use the Enhancement Framwork (as of NW 7.0) to insert additional source code in certain , generally specefied points without making modefications.The corresponding SAP object may be derived from earlier releases and it may not require any preperation by SAP application programmers (implicit enhancement point).

To use implicit enhancement points and options , implement an enhancement implementation.



 
What Can you implicitly enhance in FM ?
How to Enhance interfaces in FM ? 

1.Display FM in FM Builder SE37
2.Choose Menu options 'Function Module'-->Enhance Interface and specify an enhancement implementation to add a new interface parameter with type assignment.
3.in GUI status , choose 'Activate Enhancements'.



 How to Enhance Source Code in SAP FM ?

1.Display source Code for FM
2.in GUI Status , choose the enhancement button
3.Choose the menu Option Edit-->Enhancement Operation-->Show Implicit Enhancement Options to show the implicit enhancement options.
4.in the editor , put the cursor on one of the implicit enhancement points , from the contect menu create enhancement implementation.
5.Insert the source code.
6.in GUI Status , Choose 'Activate Enhancement'.





 

Friday, September 2, 2011

BC427:Enhancements Framwork , Unit 3: Enhancements Points, options and Sections


* In the graph above , the enhancements points and sections and BAdIs that have been created using the new technology are grouped together and managed using enhancements spots.

*Collected enhancements spots comprise both simple enhancements spots and/or other collected enhancements spots.They serve to semantically bundle enhancements spots.

-------------------------------------------------------------------------

Explicit enhancement point :
 option provided by SAP to allow you to enhance SAP source code without making modefications.It is implemented using the syntax 'ENHANCEMENT-POINT ...'

Explicit enhancement section :
option provided by SAP to allow you to replace SAP source code section without making modefications.The replaced SAP source code is enclosed by the statements 'ENHANCEMENT-SECTION ...' and 'END-ENHANCEMENT-SECTION'

*Explicit enhancements points/sections are always embeded in enhancements spots.

*Explicit enhancement points/sections that alow you to enhance/replace source codes are called dynamic.

*Explicit enhancement points/sections that alow you to enhance/replace declerations are called static.

 

How to use the explicit enhancements points/sections?
To use explicit enhancement points and sections , implement an 'enhancement implementation' (an implementation of the heiger-level enhancement spot).
The following steps describe how to use explicit enhancement points and enhancement sections:

1.Display SAP object (FM,program , method)
2.search for the required enhancement point/section
3.In GUI status,choose the enhancement button
4.Create the enhancement implementation using the context menu of the enhancement point/section
5.specify the name of the enhancement implementation (starts with Y or Z)
6.Enter the source code
7.In GUI status , choose 'Activate Status'

Webmethods : Service Auditing

Service Auditing:*Service auditing is a feature in the Integration Server that you can use to track which services executed, when services started and completed, and whether services succeeded
or failed.

*You perform service auditing by analyzing the data stored in the audit log

*The audit log can contain entries for service start, service end, and service failure.

*The audit log can also contain a copy of the input pipeline used to invoke the service

*At run time,services generate audit data at predefined points. The Integration Server captures the generated audit data and stores it in the audit log. If the audit log is a database, you can reinvoke services using the webMethods Monitor.

Service Auditing Use Casses

Error Auditing
In error auditing, you use the audit log to track and reinvoke failed services. To use the audit log for error auditing:
- services must generate audit data when errors occur,
-and the Integration Server must save a copy of the service’s input pipeline in the audit log.


Service Auditing
When you perform service auditing, you use the audit log to track which services execute successfully and which services fail. You can perform service auditing to analyze the audit log and determine how often a service executes, how many times it succeeds, and
how many times it fails. To use the audit log for service auditing, services need to generate audit data after execution ends.
For this property... Select this option...

Enable auditing When top-level service only
Include pipeline Never
Note: Configure a service to save a copy of the input
pipeline only if you intend to reinvoke the service
using the resubmission capabilities of the
webMethods Monitor.
Log on Error and success


Auditing for Recovery
Auditing for recovery involves using the audit log to track executed services and service input data so that you can reinvoke the services. You might want to audit for recovery in the event that a resource experiences a fatal failure, and you want to restore the resource
to its pre-failure state by resubmitting service invocations.
When auditing for recovery, you want to be able to resubmit failed and successful services. The audit log needs to:
- contain an entry for each service invoked by a client request or a trigger.
-The audit log also needs to contain a copy of each service’s input
pipeline.

Auditing Long-Running Services
If a service takes a long time to process, you might want to use the audit log to verify that service execution started. If the audit log contains a start entry for the service but no end or error entry, then you know that service execution began but did not complete. To enable auditing of long-running services:
- select the Error, success, and start option for the Log on property.

Thursday, September 1, 2011

BC427:Enhancements Framwork , Unit 2: Enhancements in ABAP Dictionary

*Extension Index
*Fixed Value Append

----------
*Extension Index for SAP Tables:creating a secondary index is a modefication even though the customer name space is retained.In SAP NW7.0 , you have the option of creating secondary indexes without making modefications.

---------
*Fixed Value Append for SAP Domains:previously, you had to use modefications to add additional fixed values to SAP domains. In SAP NW7.0, you can use fixed value appends to add additional fixed values and you dont have to use modefications


 

BC427 : Enhancements Framework

- enhancement framework : new enhancements
- before nw7.0 , how was the enhancements done
- enhancements points , options , sections

*Classic enhancements :
-program exit: jump from sap code to a customer code , many techniques to do this :
 a.subroutine  (user exit )
 b.function module ( customer exit )
 c.function module (BTE)
 d.Method (BADI)
-menu exit : option to include additional menu entry with customer function in an SAP screen without doing modefication , can use BADI or customer exit only
-screen exit : option to include additional fields in an SAP screen without modefication, sap fields and customer append fields can be used for this.can use BADI or customer exit only
-----------------
why different technologies?
* user exit --> customer exit : modularization and supporting menu exit , screen exit
*BTE(business transaction events) : multiple use of a program exit
*BADI : modularization and multiple use of program exits
==============================
Enhancements Framwork :
- introduces new enhancements options (enhancements points , enhancements options , enhancements sections)
-BADI is managed under the enhancement framwork
----
*enhancement point : option to insert source code in SAP programs , Function modules and methods without making modefications.(implicit and explicit points)
----
*enhancement options:option to define the following without making modefications:
a.additional (optional)interface parameters in SAP function modules and SAP methods
b.additional attributes and methods in SAP classes
c.preparation/postprocessing functions for global SAP methods
d.replacements for global SAP methods.
enhancement options always implicitly avaliable
----
*enhancement section: option to replace source code in SAP programs , function modules and methods without making modefications.always explicitly avaliable

Friday, June 17, 2011

SCM601 - Unit 4 - Lesson 1

Goods Issue Posting for Cost Centers


When withdrawing warehouse materials to be debited to cost center , the goods issue in IM is the start of the process. If the issung storage location is linked to warehouse in customizing, a TR is generated for the material quantity to be be withdrawn , in addition to the material and accounting documents. At the same time , this quantity is mapped as a negative quant in the interim storage area goods issue zone.


A material withdraw for a work order for production is mapped in the same way, as long as you are not using the WM-PP interface . This means that a goods issue is posted for the work order in IM (standard movement type is 261) . This posting generates a negative quants in the goods issue zone for work order (standard storage area 914 ).

Wednesday, June 15, 2011

SCM601 : Lesson 4

Putaway Process for Inbound Delivery



In the inbound delivery , the system determines a putaway storage location for each delivery item from the purchase order or the customizing settings. If the plant/storage location is linked to a warehouse number in WM system , then the system displays the warehouse number in the inbound delivery.


If you have 'TO' for putaway refers to an inbound delivery for 24 pieces. The putaway takes place before the transaction is posted in IM, this means that temporarely 144 pieces of the material is already exists in the warehouse. However the IM only shows 120 pieces in the stock overview. The negative Quantity ( -24 ) in the good receipt zoone is subtracted from the total stock in the warehouse number. So that the stock overview in WM also shows 120 pieces.



Note:
The goods Receipt posting always refers to the inbound delivery. You can only post goods receipt once the putaway is complete for all items.


Note:
when you put away partial quantities , it results in the overall status B. If the transfer order for putaway has not yet been confirmed , the transfer order status is B.


  •  Total Stock Per Material ( WM System ) : LS26
  •  Total Stock Per Material ( IM System ) : MMBE
  •  Inbound Delivey monitor : VL06I

Monday, June 6, 2011

SCM601 , Unit 3 - Lesson 1

Process Flow : Purchase Order and Good Receipt Posting


If you post GR in a warehouse managed plant/storage location ... What is the effect ?

1. The system will generate transfer requirement automatically (which is the basis document for the subsequent putaway).
2. The system posts the Good Receipted quantity into the goods receipt zone for the external procurements This material is shown as quant(s) in the interim storage type.


In both IM and WM the flow of the goods is controlled using the movements types.

The WM has its own sets of movements types which are linked to its IM counterparts in customizing tables.

The document header of TR shows both movements types.

Some WM movements types are summarized to one IM movement type and vice versa.

SCM601 - Unit 2 Lesson 3

The Warehouse Management Views



In order to implement warehouse management , you need to create the warehouse views in material master.


The first view contains information about the specific warehouse but the second view contains storage-type-specific information.


Whan do you need to create the second warehouse view?
if you assign the material to fixed bins , then you need to create this view and assign the fixed bin (in the storage bin field).This means during the putaway , the warehouse management system assign the bin to the material automatically and can find it for use in the stock removal.


Palletization Data
if the material master contains palletization data then WM adopt this as default values for each putaway operation. If the material is pallitized from the vendor or from production in a certian way then the system can use the default values in material master to distribute the the overall putaway quantity and perform storage bin determination.



Before you enter the palletization data you have to maintain the storage bin types in customizing.


The palletization data is default value , you can change the palletization data before you perform the putaway operation.



Customer Master Record
in the customer master record there are three views :
General View : contains the address and the bank's account for the customer.
Company Code data : store among other things the payment procedure.
Sales Area Data : contains among other things the shipping conditions and delivering plants as default values for sales documents.