While working with interactive forms, at any time there could be need to pre-populate the fields with database values.
In this blog I will explain how to initiate a simple text field and a dropdown list with database values
For this demo, I designed a simple RFC with following output.
1. Defining External Service.
- Configuring end point: For configuring end point, I had to navigate to Guided Procedure -> Administration -> SAP System -> Configure End Points
2. Creating an interactive form
3. Creating Callable Object for External Service
I logged into portal and I navigate to Guided Procedure -> Design Time and I clicked on Create Callable Object.
- On clicking next I could see screens with input parameters and output parameters
- On clicking next, I could see a screen for configuring Error handling. Since I did not want any error handling, I choose Error Handling Mode as “No Error Handling”.
- After clicking next, I clicked on Finish and Open
- On the next screen I just activate the object
4. Create Callable Object for Interactive Form
- Once again I followed the path Guided Procedure -> Design Time and I clicked on Create Callable Object. This time I selected type as Form - > Interactive form.
- I choose the XDP template that I designed above
- I clicked on “Select a prefilling service” link
- I choose External Service from the table and clicked Select button below. The process automatically took me to step-2. i.e. Define input for service
Then I defined prefilling for dropdown field. Since dropdown is treated as a structure, I cannot directly map a dropdown field with a simple parameter as I did in case of CompanyName. Instead here I had to map dropdown with a structure. For mapping structure, I had to expand prefill node under form parameters. I could see a Material Structure under prefill node. I simply mapped Material Structure with ZMATERIALS structure on the right hand side. When I defined the mapping between two structure, I could see attributes from both the structures being displayed. I could see Text, Value attributes of the dropdown list and MaterialNo, MaterialDesc attributes of ZMATERIALS structure. Now I could map each of these parameters individually. First I mapped Text property with MaterialDesc and then I mapped Value property with MaterialNo. This means the display Text of dropdown will be Material Description where as the Value associated with it will be Material Number
Note: Please check your ADS configuration before attempting this demo.