– Create an entity type with only one field. Logo (say).
– Create required associations — Association – PurchaseOrderNode is the primary node of PO based service. Hence adding association (Cardinality) will decide whether the GET_ENTITY will trigger or GET_ENTITYSET will trigger.Follow the below steps –
– A popup will come up.
Enter the required details.
In my case – I am creating an entity type of name mediaControl.
– After entering the details – Press OK.
– On pressing OK button – An entity type gets created under Data Model.
– If we expand the entity type. (in my case mediaControl). The properties are not available.
–Now, we need to create a property – LOGO.
–Double click on Properties Tab. A new view will open. On the right side.
There we can add the fields that are required to be added in the entity set.
In my case – I am creating a field name Logo of type Edm.String.
––Add the field LOGO in the properties tab.
–Now, the Entity set is added successfully. Save the project.
–Now in order to create the required data provider methods – we need to regenerate the project, in order to generate the runtime artifacts of mediaControl entity.
–Click on GENERATE (red) icon.
Check if there are any errors… If any resolve the same and then again click on regenerate icon.
–Now, Next step is to create the associations. However, it is not mandatory step. But, it is one of the factor, which decides the method ENTITY or ENTITYSET needs to be triggered.
Below is the screenshot of how to create associations.
–Select the Associations tab under Data Model folder. Right click on it. And select CREATE.
–A popup will open. Enter the Association Name.
In this case, I am creating ENTITYSET to print logo. Hence, the dependency is 1:1 considering PurchaseOrder as primary entity.
Now click NEXT.
In new window.
–Select the dependent property. In this case. It is LOGO.
–Select the field LOGO and click NEXT.
–In next window – You can see, all the properties already created. Press FINISH.
–After clicking the FINISH button, the Association and AssociationSet gets created.
–You will be able to see the log. If any error occurs, solve it and follow the same process again to create Association.
–If the operation is successful. You can see the created association under the node Associations.
–As the structure is now available in the form of ENTITYSET. Now the next step is to populate data into the ENTITYSET.
For that, we need to extend the Data provider class.
–You can find the Data provider classes under the node Runtime Artifacts in t-code SEGW.
For Purchase order, the class name is – CL_FDP_EF_PURCHASE_ORD_DPC_EXT.
–If we need to fill data in our custom ENTITYSET. Then we need to write code in DPC_EXT class. The method that we use to write code to populate data is similar to the name of ENTITYSET name.
For read operation we use GET_ENTITY method. For Query operation, we use GET_ENTITYSET method.
–Now, In order to write code. Double click on the class DPC_EXT under runtime artifacts. An ALV will open up.
–Double click on object name highlighted in the above screenshot.
–On clicking the object, The class will open up. Now go to the method relevant to our custom entity type.
OR
You can directly right click on the DPC_EXT class. Click on the option Go to Workbench. The class will open up. Select relevant method (mentioned in above screenshot).
OR
Directly open the DPC_EXT class in SE24. And write the code in relevant method.
–Now, the cardinality is 1:1. Hence, there will always be one record for one purchase order. Hence, we will enhance the GET_ENTITY method.
–Now, as we are enhancing the standard gateway service, we need to use implicit enhancements to populate our custom data. These classes are non-modifiable.
–In order to write our custom code – We need to redefine the method.
below are the steps.
1.Go to CHANGE mode.
2.Select the method, in which you are going to write our code. And click on Redefine button.
3. Please refer the below screenshot –
4.On clicking the redefine button – the window will open with some standard commented code. Which is non-modifiable.
Use implicit enhancement option to write custom code.
5.In Advanced Adobe, There is no option to create GRAPHIC Node. Because there is no provision of Context in advanced adobe. As available in ABAP based adobe form.
6.Hence, the alternative way to achieve this is – call the method
cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp.
7.As we normally do in ABAP based adobe form. This method converts the image in hexadecimal format.
8.The additional step is – Call function module ssfc_base64_encode And pass the output of cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp.
9.After execution of FM ssfc_base64_encode, The final output would be in a string format. This way, we can directly bind the string output to the IMAGE FIELD in our Adobe layout.
And, we can achieve the logo (available in SE78) in our form output.
Below is the code for the same.
-> Below is the code for the same :
___________________________________________________________________________
DATA:lv_objecttypetdobjectgrvalue‘GRAPHICS’,
lv_nametypestxbitmaps-tdnamevalue‘SAP_LOGO’,
lv_idtypetdidgrvalue‘BMAP’,
lv_btypetypetdbtypevalue‘BCOL’,
lv_fieldtypexstring,
gv_logo typestring.
*Callingclasstopopulatethetestprint.whichisavailableinSE78.
callmethodcl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
exporting
p_object=lv_object”‘GRAPHICS’
p_name=lv_name”NameoftheSE78logoinsideQuotes
p_id=lv_id”‘BMAP’
p_btype=lv_btype
receiving
p_bmp=lv_field”v_fieldandg_logomustbetypedxstring
exceptions
not_found=1
internal_error=2
others=3.
*Convertingthehexadecimalvalueofimagetostringformat(Base64Encoding)
CALLFUNCTION‘SSFC_BASE64_ENCODE’
EXPORTING
bindata=lv_field
IMPORTING
b64data=gv_logo.
IFsy-subrc=0.
er_entity-logo=gv_logo.
ENDIF.
___________________________________________________________________________
– After writing the code. Activate the enhancement and class.
– Important instructions regarding binding.
When we are binding the data in adobe layout, we need to know the ENTITY, ENTITYSET and PROPERTIES.
Sometimes, the ENTITYSET is different then what we use in adobe layout to bind the data. Hence, to get the exact name of the ENTITYSET. Open the MPC class and open the method DEFINE_ASSOCIATIONS.
Method will open up. Scroll down and go to NAVIGATIONS.
The highlighted property in above screenshot, is the updated entity type name, That we have to use to access the data in adobe.
Regarding Binding – In case of GET_ENTITY, the data can be accessed by entity_type only. But in case of entity_set, we need to use the path as -> EntitySet.EntityType[*].
– Nowbased on the examples discussed above for Media fetch.
The code is in place. Data is available in the respective ENTITYSETS.
But the method doesn’t gets triggered. The Logo doesn’t appear on the form.
In order to invoke those methods (Specially, in which the dependent property is not the primary key (like purchase order)).
in order to invoke the custom methods without having dependent property as primary key. We need to enhance the MPC_EXT class. Which is available under node Runtime Artifacts.
Because the model is now changed. After addition of one more entity.
Below are the steps to redefine the model –
1.Open CL_FDP_EF_PURCHASE_ORD_MPC_EXT class (t-code SE24).
2.In order to redefine the model, We need to redefine the corresponding method of MPC_EXT class. The method name to achieve the same is – DEFINE.
3.Go to change mode and Select the DEFINE method and click on redefine button.
4.Enhance the define method to add the required code mentioned below.
___________________________________________________________________________
super->define().
___________________________________________________________________________
–Same way – If we need to add any other field into the form, which standard is not providing. We need to create our custom entity set. Populate the data accordingly. Maintain the cardinality, redefine the required method. And bind it in the layout.
–Binding in the LAYOUT.
As the data is getting passed at runtime. When OData gets executed. Hence, While binding the data at layout, We cannot see the hierarchy. Hence we need to type the binding manually.
Email Templates –
The email templates can be accessed via FIORI tiles only.
The catalog for the FIORI tiles is – SAP_BASIS_TCR_T.
This needs to be added to your user ID. Security team helps you to add the catalog to your user ID.
When the catalog gets added successfully under the ID. You can see the tiles on your FIORI home page by executing the t-code – /UI2/FLP.
You can add the required tiles to your home page by click on Pin to Home page button.
When you execute the tile. You will get an error (Sometimes). Not able to fetch data.
In the details of error, You can find the service name.
In order to resolve the issue, You need to add the service in t-code – /IWFND/MAINT_SERVICE.
Same as mentioned in step – 1.
Regarding Email and print settings. Everything is maintained at BRF+ level.
E.g. Template, email address etc.
In order to use the email templates – Click on the FIORI application “Maintain Email templates”.
Click on predelivered email templates link. You can use standard or you can copy the same and make the required changes.
On clicking any of the email template – You can see the data sources i.e. the CDS view, that is going to provide data to the email body.
In my case, I have copied the PO default standard email template to custom one.
There are chances that you are not able to see all entries of Email templates in FIORI application.
This can happen only, If you front-end and back-end system is different.
The possible cause is – You have not maintained the destination system in /IWFND/MAINT_SERVICE t-code.
Creating Custom OData Service –
- If in case, there is a requirement to create a custom OData Service out of standard one then —
For Purchase Order ->
- Copy the project FDP_EF_PURCHASE_ORDER to custom one. Redefine the classes that are already defined in standard project. Because, the redefinition doesn’t get copied to custom project.
- After redefining all the required methods. Register the Z service in /IWFND/MAINT_SERVICE as specified in step – 1.
The service can be retrieved from the SEGW project only. Just expand the project. Goto Runtime Artifacts. - The term ending with SRV is the technical service name.
- Now assign the service name that you got in above step and assign it to the Adobe form in change mode.
- Still, If you trigger the form, It will result into ERROR.
- The last step is – Go to SPRO t-code -> SAP Reference IMG -> Cross Application Components -> Output Control.
- Execute – Define Output Types…..
A new screen will open….. - Search PURCHASE_ORDER in the list
- Double click on the PURCHASE_ORDER node. It will take you to the new screen… as available below.
- In the above screen – There is a callback class, which ultimately call the OData Service.
If at all we are copying the standard gateway service to Z. Then we need to create a copy of callback class to Z. - Now open the copied class in t-code SE24.
- Now access the method – GET_FDP_PARAMETER.
- Double clicking the method, will take you to the source code.
- At line number “12”, the standard service name is assigned. You need to change it to custom service in your custom class.
- After activation of your custom class. Assign the z class in SPRO on place of standard callback class.
- Now you can trigger your custom service.
Creating Custom Adobe Form –
The only process to create the adobe form is – Simply copy the standard form to Z.
Copy Email templates or Form templates in FIORI application
There are chances that you are not able to see all entries of Email templates in FIORI application. This can happen only, If you front-end and back-end system is different.
The possible cause is – You have not maintained the destination system in /IWFND/MAINT_SERVICE t-code.Sometimes, while trying to copy the email template or form template, The copy button remains disabled.
In Order to resolve this, you need to implement an SAP note – 2283716.
This task is done from BASISteam.
BRF+ configuration.
The possible issue could be – Necessary KPRO settings that needs to be maintained in the system. This is Basis team’s task.
The required SAP notes that needs to be used in the to setup KPRO is -Required BRF+ configuration needs to be maintained to use the Output channel.
This is Functional person’s task.
You can refer the SAP Blog on New Output Management in S4/HANA
Sometimes, Even after doing the required BRF+ configuration – The output channel doesn’t work. The output do not gets executed.2279725 – Content repository for category SOMU.
2462673 – Output remains with “To be output” status