cancel
Showing results for 
Search instead for 
Did you mean: 

How to show item/lines in gateway output

Former Member
0 Kudos

Hi

I want to show following:

PM order

  |

  Notification 1

  |     |

  |     lines from read_text for one object

  |     lines from read_text for another object etc.

  |

  Notification 2

  |    |

  |    lines from read_text for one object

  |    lines from read_text for another object etc.

etc.

I have created it so far, in method "ORDERS_GET_ENTITY", where I can show my PM order.

My issue is to show the notification below the PM order, and below each notification I need to show texts.

Can anyone help me, or navigate me to a good guide?

Thanks

Aikon

Accepted Solutions (1)

Accepted Solutions (1)

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aikon,

You can do this by adding two more entity types in your model:

  • OrderNotification and
  • NotificationObject.

Order has a navigation property Notifications with cardinality "*" to OrderNotification.

OrderNotification has a navigation property Objects with cardinality "*" to NotificationObject.

The NotificationObject contains a string property "Text" with the text lines.

Then you can

     GET ~/Orders?$expand=Notifications,Notifications/Objects

to retrieve your object graph in a hierarchically structured response.

Hope this helps!
--Ralf

Former Member
0 Kudos

Thanks for the feedback.

I have now managed that, but my next issue is:
How do I show a lot of lines below the header line?
As I see it, the method "GET_ENTITY" does only have a structure to show.

In my case, I want to show the notifications one by one, below the specific PM order.

PM order

|

notification 1

  |     lines from read_text for one object

  |     lines from read_text for another object etc.

notification 2

notification 3

And my call looks like this:

CALL FUNCTION 'ZMM_PM_ORDER_DETAILS' DESTINATION lv_destination
     EXPORTING
       i_aufnr          = lv_aufnr               "my PM order
     TABLES
       et_details       = <tab_head>       "multiple notifications related to above PM order
       et_descrA      = <tab_descr_A> "descrA related to any of the notifications in ET_DETAILS
       et_descrB      = <tab_descr_B> "descrB related to any of the notifications in ET_DETAILS
       et_descrC      = <tab_descr_C> "descrC related to any of the notifications in ET_DETAILS


   LOOP AT <tab_head> INTO <li_head>.  "my notifications
     MOVE-CORRESPONDING <li_head> TO er_entity.
    
   ENDLOOP.

The problem is that er_entity is a structure, and can not handle more than one line (or?).

Further, I would like to show my single PM order, and below that all the notifications, and below each notification the text lines, that I got in my describtion tabs.

In et_descrA/B/C the qmnum is the key, so I can see the difference between the notification-texts.

Thanks


Aikon

Former Member
0 Kudos

Hi Aikon

This isn't a great approach to a common document model scenario, especially as you are using the RFC modelling concept with a self-written FM

You'd find it a lot easier to work outside-in but if you are really keen to stay inside-out, maybe this will help.

http://scn.sap.com/community/developer-center/netweaver-gateway/blog/2013/10/17/improved-inside-out-...

Answers (0)