$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content

Mapping requirement using UDF in PI

Hi Experts,

We have requirement in SAP PI i.e., we need to generate target node "Date" in receiver XML structure with same number of occurrences as that of E1IDPU1 segment [XPath: /PEXR2002/IDOC/E1IDPU1] in PEXR2002 IDoc type. The values that need to be populated to "Date" node are from DATUM field which is under E1EDK03 [/PEXR2002/IDOC/E1EDK03] segment with IDDAT value = 017 only. Please note that there will be five E1EDK03 segments which will be present in the input IDoc structure triggered to PI. In short the requirement is firstly filter E1EDK03 segment with IDDAT value = 017 and then populate "Date" field with DATUM field value which is under same E1EDK03 segment [with IDDAT = 017] with same number of times as that of E1IDPU1 segments occurring in input structure. Kindly help to achieve this requirement in SAP PI either using UDF or message mapping in PI.In short the requirement is firstly filter E1EDK03 segment with IDDAT value = 017 and then populate "Date" field with DATUM field value which is under same E1EDK03 segment [with IDDAT = 017] with same number of times as that of E1IDPU1 segments occurring in input structure. Kindly help to achieve this requirement in SAP PI using UDF.

Thanks,

Ramu.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 03, 2017 at 02:43 PM

    There are two ways to do this without UDF:

    - Use a mapping variable (If /PEXR2002/IDOC/E1EDK03/IDDAT = "017", assign /PEXR2002/IDOC/E1EDK03/DATUM to variable. Then assign the variable to your line item level field)

    - Take a look at the UseOneAsMany function

    Regards,
    Patrick

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Ramu!

      Mapping variable acts as Constant in mapping. Since you've assigned some value to it you can use it as many times as you need. If you create variable at any target segment level (except of root element) it's recalculated on every segment change. So it can be used instead of UseOneAsMany function in most cases.

      Regards, Evgeniy.