Message Mapping using Left justified, right blank/space filled

Hi,
My Interface is outbound Interface.
Suppose source field named 'Filename' is mapped with Target field named 'Filename'.Condition is AS IS(Left justified, right blank/space filled).
How should i do this mapping?

Hi Sanghamitra Duttagupta,
                                            you can try this UDF below
public static String fieldJustified(String s)
          try
               final int fieldLength=20;
               char filler=' ';
               s=s.trim();
               int l=s.length();
               while(l<fieldLength)
                    s=s+filler;
                    l++;
          catch(Exception e)
               return s;
          return s;
Please reset the value of the variable "fieldLength",  in code above to the field length as per your need. The right side will be filled with extra spaces since value of "filler" variable is ' '. you can set this to any character of your choice so that total field length is equal to value of variable "fieldLength" (which is 20 here).
so if input is  "        hi"
output           "hi                  "
regards
Anupam
Edited by: anupamsap on Aug 1, 2011 1:53 PM

Similar Messages

  • Is it possible to do message mapping using different namespace message type

    Hi all,
    Is it possible to do message mapping using different namespaces message types
    Example :
    i am having message type MT_1 in namespace http://sap.com/abc
    and second message type MT_2 in namespace http://partner.com/xyz
    so MT_1 can be mapped with MT_2 or not having different namespace.
    Thanks

    Read through my reply in this thread for Defining Software component dependencies.
    Though it explains this for Improted Archives, it also holds true for Message Types to be used in message mappings.
    Re: Payload Extraction
    Regards
    Bhavesh

  • How to use left-justified with Move command??

    Hi,
    I have a field BKPF-XBLNR which I have to download to an final output table. I am using the command "Move"...
    Move T_BKPF-XBLNR to T_OUTPUT-XBLNR.
    My problem is that for some records this field is a combination of characters and numbers ... but some are purely numbers ... The records which are a combination of character & numbers are left justified where as the numeric one's are getting right justified once I get the output in the excel sheet ... How do I make these numeric ones left justified ... ??
    Thank You,
    SB.

    You can use this:
    shift T_BKPF-XBLNR left deleting leading space.
    Move T_BKPF-XBLNR to T_OUTPUT-XBLNR.
    if it does not work then
    data : temp_xblnr type char16.
    Move T_BKPF-XBLNR to temp_XBLNR.
    shift temp_XBLNR left deleting leading space.
    Move temp_XBLNR to T_OUTPUT-XBLNR.
    I am sure it will work.

  • Mapping.Take left to right

    Hi,
          I have a mapping requirement as follows.
    Map source to target and take left to right 5 digits.
    Can you please tell me the functionality and the procedure to do it?

    Hi,
    Use the following code in your  UDF. Give the input field as Source field and constant 5 in Length.
    variable 1 = SourceField
    variable 2 = Length
    String FinalTarget;
    int SourceLength=SourceField.length();
    int TargetLength = Integer.parseInt(Length);
    if (SourceLength>TargetLength)
    FinalTarget=SourceField.substring(0,TargetLength);
    else
    FinalTarget=SourceField;
    return(FinalTarget);

  • Message Mapping using UseOneAsMoney

    Hi Experts,
    I am doing the Message Mapping as mentioned in the below blog. I am getting the Error as
    05:15:46 Start of test
    Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue] in class com.sap.aii.mappingtool.flib7.NodeFunctions method useOneAsMany[[Ljava.lang.String;@478d13c, [Ljava.lang.String;@17f0bc6f, [Ljava.lang.String;@3de327b0, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@c42b38e, com.sap.aii.mappingtool.tf7.rt.Context@6f1a35eb]
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue] in class
    I have searched in other blog also and ended up with the same error. Please check and do the needful.
    The Basic Problem
    We have an IDoc ORDERS05 with purchase order information where each purchase order line item (represented by segment .<E1EDP01>) can contain multiple schedule lines (represented by segment <E1EDP20>). For example, we have 2 line items with 3, resp. 2 schedule lines. Then the corresponding portion of message ORDERS05 can look as follows:
       <E1EDP01>
          <POSEX>00010</POSEX>
          <E1EDP20 SEGMENT="1">
             <WMENG>15</WMENG>
          </E1EDP20>
          <E1EDP20 SEGMENT="1">
             <WMENG>44</WMENG>
          </E1EDP20>
          <E1EDP20 SEGMENT="1">
             <WMENG>3</WMENG>
          </E1EDP20>
       </E1EDP01>
       <E1EDP01>
          <POSEX>00020</POSEX>
          <E1EDP20 SEGMENT="1">
             <WMENG>32</WMENG>
          </E1EDP20>
          <E1EDP20 SEGMENT="1">
             <WMENG>12</WMENG>
          </E1EDP20>
       </E1EDP01>
    We want to map the information of the IDoc ORDERS05 to the message OrderCreate of the CIDX v4.0 standard. This message uses a more flat
    structure where the purchase order line items and the corresponding schedule lines are on the same level. The corresponding portion of the
    message OrderCreate (for the same information as in the IDoc) looks as follows:
       <OrderCreateProductLineItem>
    <PurchaseOrderLineItemNumber>00010</PurchaseOrderLineItemNumber>
          <ProductQuantity>15</ProductQuantity>
       </OrderCreateProductLineItem>
       <OrderCreateProductLineItem>
          <PurchaseOrderLineItemNumber>00010</PurchaseOrderLineItemNumber>
          <ProductQuantity>44</ProductQuantity>
       </OrderCreateProductLineItem>
       <OrderCreateProductLineItem>
          <PurchaseOrderLineItemNumber>00010</PurchaseOrderLineItemNumber>
          <ProductQuantity>3</ProductQuantity>
       </OrderCreateProductLineItem>
       <OrderCreateProductLineItem>
          <PurchaseOrderLineItemNumber>00020</PurchaseOrderLineItemNumber>
          <ProductQuantity>32</ProductQuantity>
       </OrderCreateProductLineItem>
       <OrderCreateProductLineItem>
          <PurchaseOrderLineItemNumber>00020</PurchaseOrderLineItemNumber>
          <ProductQuantity>12</ProductQuantity>
       </OrderCreateProductLineItem>
    The data in red correspond to data of the segment <E1EDP01>, while the information in blue correspond to data of the segment <E1EDP20> of the original IDoc. Note that the data in red need to be duplicated based on the occurence of segment <E1EDP20>.
    Solution 1
    A simple solution of this mapping problem exists under the assumption that in the IDoc ORDERS05 each segment <E1EDP01> contains at least one segment <E1EDP20>. Luckily this assumption holds true for IDocs created via the purchase order creation process in ERP.
    1. Mapping of <OrderCreateProductLineItem>
    The segment <OrderCreateProductLineItem> of the target structure needs to be created once for each occurrence of segment <E1EDP20> of our source structure. This can easily be achieved via the following mapping:
    Remember to change the context to IDOC.
    2. Mapping of <PurchaseOrderLineItemNumber>
    Since the information for the node <PurchaseOrderLineItemNumber> comes from the IDoc segment <E1EDP01>, this node needs to be replicated based on the occurrence of segment <E1EDP20> under each segment <E1EDP01>. This can be achieved using the node function useOneAsMany as follows:
    I will not describe the functionality of the node function useOneAsMany in detail since there is a lot of excellent documentation available on this function, for example in the SAP help . In our scenario you only need to change the context of the second input parameter to E1EDP01.
    With the sample input from above, the function useOneAsMany will give the following result:
    3. Mapping of <ProductQuantity>
    Since the <ProductQuantity> is derived from a value of the IDoc segment <E1EDP20> the mapping for this field is trivial (remember that <ProductQuantity> must occur once per <E1EDP20> segment):
    Please check the error and guide me how to proceed further.
    Regards,
    GIRIDHAR

    Hi
    The problem is that you the first and second input queue of UseOneAsMany function does not have the same number of context changes.
    Do your mapping like this
    E1EDP20(set context to Idoc level )----> OrderCreateProductLineItem
    First input of UseOneAsMany   --->POSEX ( set context to E1EDP01)
    Second input of UseOneAsMany--->  E1EDP20 ( set context to E1EDP01 )
    Third  input of UseOneAsMany--->  E1EDP20 ( set context to E1EDP01 )
    Then after UseOneAsMany use removeContext--->SplitByEachValue--->PurchaseOrderLineItemNumber
    WMENG ( set context to E1EDP20) ----> ProductQuantity
    This will give you the output in the format you are asked for.
    Let me know if any issues.

  • Controlling a projector (presentation) using left and right arrow keys

    Hello i have a cdr-rom im producing, im creating an
    interactive presentation and i would like the user to be able to
    move from page to page using the left and right arrow keys on the
    keyboard how (1) do you add the script ie, on the timeline etc (2)
    what is the exact script i need to use. Im fairly new to director
    so could you please make it as easy as possible to understand. Any
    help would be great thank you.

    You want to create a keyDown script in a movie script window.
    You can get the keycodes for the arrow keys here:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15887
    Do a search in the Lingo forum for more info on writing a
    keydown script. There are many examples to choose from.

  • Nokia Maps - Destinatation Left or Right

    I am a big fan of Nokia Drive Maps now called HERE. I wanted to see if the maps can tell my destination is on left or right. This is a very important feature I see missing. This is one of the reasons I switch to Garmin StreetPilot at times.

    have the same feel, this should be a basic and simple feature to implement in the next update. is there a nokia feature request page?

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

  • Using left and right arrow keys as accesskeys

    I am trying to remediate an online course and need to apply left arrow key to next button (advance to next page) and right arrow key to back button (return to previous page). Does anyone have javascript code that would allow this?

    This is already built into major browsers.  This assumes the browser history folder contains more than one page. If the browser's history folder is empty, nothing will happen.
    For Windows users:
    Alt+Left arrow = back one page.
    Alt+Right arrow = forward one page.
    http://en.wikipedia.org/wiki/Access_key
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Using Right-justified and left zero-filled condition in message mapping of

    Hi,
    My Interface is outbound Interface.
    Suppose source field named 'MobNumber' is mapped with Target field named 'MobileNumber'.Condition is AS IS(Right-justified and left zero-filled).
    How should i do this mapping?
    Thanks,
    Sanghamitra

    Hi Sanghamitra,
         Similar question ahs been answered earlier in this thread
    Re: Message Mapping using Left justified, right blank/space filled
    just replace the filler variable by zero in my post
    One small request, if you think your questions are being answered correctly and properly, please kindly, if possible, close down the threads. This way forum members/users  who later look up for solutions to similar problem, they know for sure that the problem was finally solved, with the solutions provided in the thread.   
    regards
    Anupam
    Edited by: anupamsap on Aug 3, 2011 11:27 AM

  • My "Messages" are all right justified.  How do I get them left justified?

    My "Messages" are all right justified.  How do I get them left justified?

    Hi,
    To be clear and for other readers,  Messages has dropped the number of Styles to three.
    Compact and Boxes are styles that have you and the Chatee on the left and the messages themselves are left justified.
    Balloons is the default (Speech bubble stylee), as mentioned, and your part of the chat or conversation is on the right but is also Right Justified.
    Part chat example
    9:31 PM      Friday; May 31, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Cp 8 - How to add ppt slides to an existing project with space to the left and right ?

    After much trial and error, i know exactly what I want. The priority for me is clear and unscaled captured video, and my project resolution shall be 1260x700. 
    now, i want to bring my ppt slides in and respect the aspect ratio- this means that there will be blank space to the left and right of the slides. The active area of the ppt slide should be about  700 h and 4/3 * 700 width. To avoid scaling, i would love them to be 699 x 932 and have the areas to the left and right blank. i am also willing to make my project 1260x702.
    The objective here is to avoid scaling. I have seen that things look great when scaling is avoided.

    Maybe you'll find some ideas here: Create and Use a "Knockout" Master Slide - Captivate blog

  • Problems using very large XSD in Message Mapping - POSLog

    Hi,
    I am trying to build a message mapping based on an external definition (.xsd) downloaded from the ARTS webpage (Association for Retail Technology Standards). In PI (7.0) I am able to succesfully create an External Definition based on the downloaded XSD. The resulting external definition syntax checks ok and contains the message type POSLog.
    Next I try to create a message mapping using the external definition as the source message type. This is where it all starts to wrong. When I select the external definition as the source message type PI seems unable to complete the task, I get an hour glass. No matter how long I leave it in this state, it never comes back.
    I'm thinking because the xsd is so large PI is having problems trying to render the mapping. I am working over a VPN but cannot see any network traffic. Windows task manager shows that process javaws is taking up the majority of the processing. My laptop slows to a crawl until I kill the repository. Though my laptop only has 504Mb of RAM we have another with 1Gb which has the same problem.
    Any ideas? The exact same xsd can be downloaded from...
    http://www.nrf-arts.org/
    ARTS Standards -> ARTS XML
    All public shemas -> download
    download the POSLog schema (which is free) not the documentation.
    Any help appreciated.

    Thanks Patrick,
    That did the trick and I like the idea of changing a local copy of the jnlp file. Finally had to run the task on a laptop with 2Gb of RAM with heap-size = 1536m and sap.theme = Tradeshow (not sure if this helps).
    It is still very slow moving around the graphical mapping so I have placed an order for more RAM (upto 4Gb). I think Win32 can use upto 3.5 Gb so i'm hoping for a further improvement.
    It is a ludicrously large xsd.
    Thanks Again
    Surbjeet

  • IMovie 08 Missing Buttons & Blank Space on Screen

    Hello,
    Sorry if this topic has been discussed in another post but I couldn't find it.
    I have been using iMovie08 for a few months now and everything has been working fine.
    This week I noticed that when I started the application all the buttons in the middle of the window were gone (voice over record, titles, audio edit, and the media buttons to the right) and all that is left is a blank space.
    Then to the top left where I have my Projects, I am only seeing two of the ten projects I have created (The actual names of the project).
    The weird thing is I can click on the empty window where my missing project names should be, it loads in the viewer, only very slow, but it plays alright, I just can't see the name in the project window.
    So as a result of not seeing the other buttons for editing, only empty space, I can't edit my projects.
    It also will freeze if I try and click around too much, and I have to force quit.
    I trashed the application, reinstalled it and nothing changed.
    I was thinking it was a problem with a quicktime file or something that might be on my desktop, so I cleaned all that off, but it didn't help.
    iMovie 08 was working great and I was pretty happy with it until now. The only new application I have recently installed is Firefox 3 Beta, unless that causes a problem, I don't think that it would but you never know.
    If anyone else has had the same problem, I would really appreciate any help I can get.
    Thank you!

    Do you use an external firewire drive? If the connection to the drive is not working, it could cause a hang like this. The solution might be to eject the external drive, if you can, turn off the computer, disconnect the firewire. Disconnect the power to the external drive. Then hook everything up again in reverse order and reboot.
    This could also happen if you are in the middle of a time machine backup or a spotlight indexing or an antivirus scan.
    Also, has anything changed with iPhoto? On startup, iMovie will try to scan the iPhoto library for new videos, and it can hang here.
    Also, this could be a symptom of fragmented virtual memory, but a simple reboot would cure this.

  • Message mapping in sap pi 7.3

    Hi all,
    I am using SAP PI 7.3. In ESR, I have declared one source data type & message type and one target data type & message type. I have also completed message mapping. But in message mapping, If I do right click on the target message type, I am getting one option "Add variable" in the context.
    Can anyone tell me what is the use of it?
    Thanks & Regards,
    Moumita

    Hi Moumita
    This is mainly used to store some values in it and then use it later in the same mapping.
    For example suppose there is a field which contains amount and it occurs in many times in the source structure.
    So we can populate the sum of all this fields into this variable and later used that for populating any target field.
    Another example is suppose we want to make an RFC look up in PI to store some data in ECC tables.
    In that also we map the RFC look up function to this variable.
    This variable will be not present in the map output.
    Check this
    SAP PI 7.1 Mapping Enhancements Series: Using Graphical Variable

Maybe you are looking for

  • Set the heap size

    Hi, I am wondering what's the default heap size if I don't add -ms -mx opation? I set the two options and the following is the output from -verbosegc. what's it means? Thanks. [GC 2598K->2145K(2696K), 0.0035829 secs] [GC 2656K->2201K(2824K), 0.003626

  • Syntax error in IDoc (too many repetitions of a segment)

    Hi, I tried to load master data from R/3 into BW system. The load is not ending and the IDoc error message is displaying, The error message is " EDI: Syntax error in IDoc (too many repetitions of a segment) with status 26"  . I tried to analise the i

  • How to color correct photos for iPhone 5C

    Hello! I am doing my high school physics project. I took pictures of LED lights and I need to find the wavelength of the emitted colors. My teacher said that photos taken by cameras have slightly different colors than the actual color. How would I ma

  • Where I'm wrong

    Hello, I use a Centura Database I want to read a file and then insert some data from each line into a database. The file I read has at least 640 lines. Everything works for 81 lines readed but then, I receive the following error message : " SQLExcept

  • Configuring JMS over a Weblogic Cluster

    I have a setup of 2 Weblogic managed servers configured as part of a cluster. 1) The requirement is to send requests to another system and receive responses using JMS as interface. 2) The request could originate from either of the Managed Servers. So