Skip to Content
Author's profile photo Former Member

How to configure Fiori News App by using SICF service and RSS2.0

This document is written to shown step by step guide to configure news app in Fiori. In all, there are three steps:

  1. Configure Fiori title
  2. Create Table to store news information
  3. Generate SICF service and provide RSS 2.0 format

Step one: Configure Fiori title

Click on News Tile

/wp-content/uploads/2016/01/1_876004.png

Fill in SICF service name in the Feed, Article Refresh Interval means the refresh interval of news apps. Prefer to set to 15min.

SICF service name: znews (which will later be created)

/wp-content/uploads/2016/01/1_876004.png

Step two: Create a Table to store news information

This table should contain all essential information needed for news.

/wp-content/uploads/2016/01/1_876004.png

Step three: Generate SICF service and provide RSS 2.0 format

For the news app itself we need to provide RSS document.

Please refer XML RSS for the principle of RSS 2.0.

We create a SICF service called znews to generate this kind of RSS document (This is the service name you bind in Step one).

Create a class called ZCL_NEWS_SERVICE. Fill in IF_HTTP_EXTENSION in Interface.  Fill below code in IF_HTTP_EXTENSION~HANDLE_REQUEST.  Check and active this class. 

/wp-content/uploads/2016/01/1_876004.png

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

  method IF_HTTP_EXTENSION~HANDLE_REQUEST.

    DATA action TYPE STRING .

    DATA xmlcstr TYPE STRING .

    DATA newscontent TYPE TABLE OF ZNEWSCONTENT.

    DATA newscontent_l LIKE LINE OF newscontent.

    DATA guidstr TYPE STRING.

    DATA titlestr TYPE STRING.

    DATA descriptionstr TYPE C LENGTH 400.

    DATA imagestr TYPE STRING.

    DATA linkstr TYPE STRING.

    action = server->request->get_form_field( name = ‘type’ ).

    CASE action.

      WHEN ‘news’.

        SELECT * FROM ZNEWSCONTENT INTO TABLE newscontent.

        xmlcstr = ‘<?xml version=”1.0″ encoding=”utf-8″?><rss version= “2.0”> <channel>’.

        LOOP AT newscontent INTO newscontent_l.

CLEAR: guidstr, titlestr, descriptionstr, imagestr, linkstr.

          CONCATENATE xmlcstr ‘<item>’ INTO xmlcstr.

          guidstr = newscontent_l-guid.

          titlestr = newscontent_l-title.

          descriptionstr = newscontent_l-description.

          imagestr = newscontent_l-imagelink.

          linkstr = newscontent_l-contentlink.

          CONCATENATE xmlcstr ‘<guid>’ guidstr ‘</guid>’

                              ‘<title>’ titlestr ‘</title>’

‘<description>’ descriptionstr ‘</description>’

                              ‘<image>’ imagestr ‘</image>’

                              ‘<link>’ linkstr ‘</link>’ INTO xmlcstr.

         CONCATENATE xmlcstr ‘</item>’ INTO xmlcstr.

       ENDLOOP.

       CONCATENATE xmlcstr ‘</channel></rss>’ INTO xmlcstr.

server->response->set_header_field(

       name = ‘Content-Type’

       value = ‘application/xml’ ).

server->response->set_header_field(

       name = ‘accept-origin’

       value = ‘*’ ).

       server->response->set_cdata( data = xmlcstr ).

    ENDCASE .

  endmethod.

Run traction SICF.

In path default_host/sap/bc, right click on bc and choose New Sub-Element. Fill in your SICF service name.

/wp-content/uploads/2016/01/1_876004.png

Fill in a description and Handler List, leave other as default.

/wp-content/uploads/2016/01/1_876004.png

Check and Active this service.

You can have a test the SICF service now. Right click on the service name and click Test Service.

/wp-content/uploads/2016/01/1_876004.png

Also if you have configure the Fiori Launchpad correct, you can see the real news app.

/wp-content/uploads/2016/01/1_876004.png

2.PNG

Assigned tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      nice !

      Author's profile photo Giridharan Somaskandan
      Giridharan Somaskandan

      Thanks Eric ..useful info on how to use ABAP ICF service for generating news feed ..

      Author's profile photo Former Member
      Former Member

      Dear Eric,

      thank you a lot. Just one question; How did you solved the issue with the relative path?

      In the seond screenshot we can see that the Input field is red. So I can't save it. I'm not able to insert a absolute path because of Developer and Test Domains.

      Can you help me here?

      Thank you!

      Author's profile photo SAP Seeker
      SAP Seeker

      Hello Simon,

      Were you able to overcome the issue of relative path ? Only full path with http/https is working.

      Thanks.

      Author's profile photo Larry Hampton
      Larry Hampton

      This is a very nice blog and I realize it's old.  I've been scouring forums, for weeks, trying to figure out why my news tile, using this method does not auto refresh at the 15 minute time intervals.  Any suggestions?  I have an open message with SAP, but I'm not getting any helpful information.

       

      I have another news tile that uses and SAP RSS feed and that is updating as expected.

       

      Any ideas how to force the refresh without closing the browser and reopening?

       

      Thanks all!

       

      Author's profile photo rakesh singh
      rakesh singh

      Hi Larry,

      I am trying to create table for custom news tile and have followed the steps as in blog, but not getting expected result. The sicf output is coming blank page .

      Can you help with steps you have followed as i can see the blog is 2 yrs old and many things have changed.

      I am on S/4Hana 1709 FPS02.

      Please let me know if any information needed from my end.

      Thanks,

      Rakesh

       

       

       

       

      Author's profile photo rakesh singh
      rakesh singh

      Hi Experts,

      I have followed the above steps but i am getting a blank page when i am testing the sicf service in gateway.

      Any suggestion.

       

      I have used exact same steps in gateway. Please help. I am on S/4Hana 1709.

       

      Thanks,

      Rakesh

      Author's profile photo Amita Jain
      Amita Jain

      I am also getting same... Any solution ?

      Author's profile photo Larry Hampton
      Larry Hampton

       

      Hi Rakesh,

      Unfortunately we were never able to get the auto refresh to work, so the work was abandoned and our sandbox environment has been overwritten.  This means I’m unable to see the previous work and am not able to help you.

      Best of luck,

      Larry

      Author's profile photo Kanchanapalli Sridhar
      Kanchanapalli Sridhar

      How do i filter / archive old news – Is it through “Inclusion Filters” or “Exclusion Filters”? Any idea how to set up?

      Author's profile photo KIRAN KULKARNI
      KIRAN KULKARNI

      I have created class ZCL_NEWS_SERVICE and when i am attaching this class in SICF i am getting error "ZCL_NEWS_SERVICE is not an ABAP OO class" Please advise

      Author's profile photo Rajat Chaurasiya
      Rajat Chaurasiya

      To change this "20 days ago" date format to "3/18/2021" OR to display ”Today” / ”Yesterday” in Sap News Tile (Standard News Tile). We have configured this News Tile using SICF Service.

      Kindly let us know if any one has done the similar customization to change the date format of Standard News Tile. Any Information/Links/Documents would really help.