|
Blogs
BackgroundThe table parameters in Remote Enabled Function modules do not work well with the Guided Procedure. According to the sap note it’s a coding error in NW 7.0 SP14. When the table parameter is tested with a single record it throws "Technical Exception" and with two records it gives an error "<Field Name>has more than one value." The intention of this blog is to figure out how to use the RFCs with minor modification to overcome the flaw in the above mentioned patch level (provided you don't want to upgrade to the next release immediately). ScenarioHere’s a scenario to explain how to use the external services to validate a standalone form. It is a part of the Procure-To-Pay process, where the process begins with an adobe form. The requestor fills in the items to be ordered, which in turn will be submitted to an approver; on being approved a purchase requisition is created. The Standalone form has RFCs as pre-filling and validation services. For validation we will be using the standard BAPI_PR_CREATE in test mode to check if the details entered by the requestor are valid to create a purchase requisition. To get started, the form has some header details and table details to be filled by the requestor. The dropdowns are prefilled using RFC (note RFC with table parameter as output works fine :). We will be just considering validation service to which the table contents will be passed.
Interactive Form Callable object's output structure has two useful attributes Content and ContentType which will be used to retrieve the data from the form.
The code given below is to read xml type of data submitted by the form, so make sure the Submit button has the given settings:
LogicBAPI_PR_CREATE is wrapped in another RFC which will read the xml content of the form, pick up the contents filled in the form map it to structures which will be finally passed to the above mentioned BAPI. The interface of the function module is as follows:
Got a head start with the code, thanks to this link https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7651
Since the data submitted is already xml content we do not need to make a call to the ADS. This section of the code deals with fetching the relevant content into the local variables and internal tables. Note this function module will have to be tweaked according to the field names available on the form.
Once the contents are read into the appropriate internal tables and local fields, these can be then passed to the standard function module for further processing.Error occurring in the function module can be reported in the ‘Return’ structure which in turn can be used for error handling when the callable object is created.
In case incorrect data has been filled by the requestor, he will be notified on submission of the form. An email can also be send to the processor depending on the error handling selected for the form. With this small change the existing BAPIs can be used for modeling the business process!! Pinky Varghese is a SAP Netweaver consultant for Larsen and Toubro Infotech Ltd.
| |||||||||||||||||||||||||||||||||||