Creating a UDF in SAP XI

Hi,
I have Idoc to File Mapping in SAP XI, where I need to populate "Spaces" in most of the Target fields Dynamically. I need to create a UDF for this mapping. Since I have n no.of Target fields where I need to populate Sapces and Target fileds has different lengths. As of now I have cretated a simple UDF which is usefull only for one field mapping. Below is the UDF:
String s;
     char []c = new char[10];
     for(int i=0; i<10; i++)
        c<i> = 'S';
     s = new String(c);
     return s;
2. My source file will be having 1000 records where 999 records will be mapped to Traget sturucture and the end of the Record should be mapped to the other Traget structure(Traget sturcture is same in the both the cases).
Please let me know how can I go about on this.
Thanks in Advance.
Jose

Hi Joseph,
Give a try to use the below UDF for the fields where you want to have some hardcoded values :
a : Field you would like to change
b : New hardcoded value for the field.
for( int i=0; i<a.length; i++)
  if (i==(a.length-1))
      result.addValue(b[0]);
  else
     result.addValue(a<i>);
input_field_1   --------------------
                                       UDF  -------------------- target_field_1
new_constant_EOD  ------------------
Rest all mappings should remain as it is.
Let me know if you face any issue.
Thanks,
Pooja

Similar Messages

  • How to create a UDF on BP Master Data that will not save any data?

    I need to create several UDFs on the BP Mater Data screen that will be configured to automatically show a balance of 0-30Days, 31-60Days, 61-90Days etc.
    I am currently able to do this although I cannot seem to find a way to only show the current data without saving it.
    Eg. I have a UDF with an SQL statement that shows the current BPu2019s 0-30Day Balance, but the BP Master Data screen always changes to u2018Updateu2019 every time the UDF balance is updated.
    I am looking for a way to show this information on the BP Master Data screen similarly to the default BP Account Balance without saving the data.
    I am working with SAP B1 8.81 PL09 and B1UP 4.3.0.0. Thank you.

    Thanks Gordon, I appreciate your assistance. I can get all the fields to display as I want them, but my issue is having to save the BP Master Data form every time I wish to move away from it.
    Is there anywhere in SAPB1 that stores a running total of account balance for 30Days, 60Days, etc..? (just to be sure)
    I might also try to create a new tab on the BP Master Data form that shows an SQL Aging Report and see if I can pick up the info from that embedded report.
    Any other ideas would be also appreciated.

  • While creating the UDF in the Marketing Document  ERRor

    Dear to ALL
    Please give me some solution to the my problem
    My problem is
    While i am creating the UDF in the marketing document I am getting the error message 131-183 could not able to create the data base.
    Any one can help me out releated to this problem
    Please  .....................................................
    With regards to all ........................
    Gopi J N
    [email protected]
    [email protected]

    Hi JN,
    There is no limit in number of UDF but in record length. This a SQL        
    Server 2000 limitation which establish 8060 bytes as maximum for a         
    record. This limitation does not exist in MSSQL 2005.                                                                               
    Therefore, in order to be able to add more UDFs you should reduce the      
    size of the existing UDFs or upgrade the system to MSSQL 2005.                                                                               
    Please refer to the SAP note 816387                                                                               
    The solution to this problem is to decrease the size of the                
    User Defined Fields. Either by decreasing the length or changing           
    the definition of "Alpahnumeric" fields to Text, or the last resort        
    is to remove the fields.                                                                               
    All these actions have to be done via the SAP Business One application.    
    The change of field type alphanumeric to Text might influence the          
    performance.

  • Executing/debugging udf in sap nwds

    Hi,
    I need to test/debug a udf in sap nwds.
    I have installed the nwds tool.
    I tried searching for step by step approach in google/sdn.
    if anybody knows the links or can provide the steps to do the same........will be helpfull....
    i need to create the udf in nwds & test/debug it........
    santosh.

    http://www.conspicio.dk/blog/bjarne/using-eclipse-for-developing-sap-xi-user-defined-functions

  • How to log in to Service Desk to create sample message to SAP?

    Dear all,
    How to log in to Service Desk under my Solution Manager server to create sample message to SAP under Component: SV-SMG-SUP?
    Regards
    GN

    Hi GN,
    You have different options to create messages in test component SV-SMG-SUP-TST:
    1. if you are on 7.1 you can create message using CRM_UI
    2. If you are using lower vrsion then either you can create message using Workcenter or using transaction NOTIF_CREATE or using menu --> Help --> Create support message.
    Thanks
    Regards,
    Vikram

  • Error while creating an UDF in a PI 7.1 Mapping

    Hi experts,
    I'm having problems after creating an UDF in a Message mapping. I receive the error:
    the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions.
    It seems like forgeting initializing something...
    Regards
    Gonzalo

    Upgrading my JDK to 1.6 in my PC almost solved the problem. Anyway, sometimes that happens again.
    What I actually do:
    1.-Creating my Message Mapping
    2.-Saving it
    3.-Developping my UDF
    The problem occcurs when you create an UDF and just in that moment you don't save it. It will be a bug...
    Hope that helps you
    Regards
    Gonzalo

  • How  to  create an infotype in sap ecc6.0 ?

    Hi all,
    I know i how to create an infotype   in   sap 4.7, but i am facing the problem while
    creating an infotype in sap ecc6.0 version. could u plz provide me  the info with screen shots how to create an infotype and how to enhace that infotype ?
    Waiting for u r response.
    Regards,
    Ravi

    Hi ,
    To create OM infotype:
    1. Go to SE11 and create a structure HRI9XXX (9XXX --> name of the infotype). Add the required fields to this structure and save and activate. then come out of it.
    2. Go to PPCI and enter Infotype number (9XXX) and description.
    3. Click create.
    4. In the infotype category select details for the infotype.
    5. Click create button. It should create the infotype.
    6. Click on Check. A window with menu will open.
    7. In that window navigate to Table Entries.
    8. Under table Entries, select T777I and click on change.
    9. It opens SM30. Click on Maintain.
    10. Select the infotype and add information for "Time Constraint" and "Infotype Per Object Type".
    11. Save.
    12. Go back to check menu, see if all entries exist. Do not worry last 5 table entries. And you are done

  • How to create a hypertext in SAP script

    Hi All,
    I want to create a hypertext in SAP script.I read 'Creating hypertext in SAP script' posted on www.sdn.sap.com, but I am not able to get desired output.Kindly suggest the soloution.
    Regards,
    Pranjali Silimkar

    Hi,
    I read the document 'Creating hypertext in SAP script' posted on the link 'http://wiki.sdn.sap.com/wiki/display/ABAP/CreatingHypertextinSAPScripts', but I am not able to get the desired output.It is displaying the same text again on the same page which is not the desired output.Kindly suggest me some solution.
    Regards,
    Pranjali Silimkar

  • HOW TO CREATE A VARIABLE IN SAP SCRIPT

    HI ALL,
    CAN ANYONE TELL ME HOW TO CREATE A VARIABLE IN SAP SCRIPT.
    THANK YOU,
    BYE
    TAKE CARE.

    Hi Ravi,
    You can use like this
    A text in the editor contains the following DEFINE commands:
    /: DEFINE &mysymbol& = 'xxx xxx xxxxx xxxx'
    &mysymbol&
    /: DEFINE &mysymbol& = 'yyyyy yyy yyyy'
    / &mysymbol&
    The printed text appears

  • Slow performance creating UDT/UDF

    When creating UDT/UDF via SAPbobsCOM.UserTableMD and SAPbobsCOM.UserFieldMD OR via SAPbobsCOM.Company.GetBusinessObjectFromXML(...) we experience extreme slow performance. One field of a table takes at least a second to be created.
    We already checked the DB/Server, no problems there (in fact, it does not even show up as laggy.
    Any hints? Is there so much data to be transported from client to server or what might be wrong?
    Krischan

    My setup takes between 8 and 15 seconds to create 65 user defined fields and one user defined table.
    As I am able to watch the progress, I experience that creating user defined fields for documents is much slower than creating a user defined field for a user defined table.
    Personally I think it's because every time a document udf is created, every document table is altered by mssql (the udfs are physically added to every table).
    At least it don't take a whole second per table, which definitly sounds like "too much" to me...

  • Creating a package in SAP BI

    Hi experts,
                         I need to create a package for my project .Please tell me how to create a package in SAP BI .
    Regards,
    Khan

    Hello,
    TCODE SE80 -> Give the name for the package and from drop dwn select package -> hit enter -> it will ask u want to create -> click yes.
    Regards,
    Shashank

  • To upload SH customers in Temporary table and create customers master in SAP

    Hope you are doing great ---Need you help/advice  on the below thought
    we receive  an excel file listing accounts that need to be set up as customer recipients I.E customer master in SAP system . we receive a file in the from of spread sheet and then we manually create the same in SAP system. Since this size of this indirect customers is growing day by day  business has decided to automate this process
    proposed solution-
    1.Modify the file received from external system  to format required for loading in SAP and add all the mandatory fields in the customer master
    2.Load the file into a temporary tablein SAP ( transaction code)
    3.verify the data and approve for actual customer creation in SAP ( create inbound idols  to create customer master data in SAP)
    4.check how many customers created in SAP with standard T.code
    From the step 3 above the idea is to create an an inbound idoc . Debmas and etc to create the customers in SAP system .
    Not sure how to go about this to achieve this functionality. I need to understand what all does it takes to  see this functionality work
    will be great help if any of you can forward me the technical specs or details if you have worked on the same
    Appreciate your help----
    Mohit

    Hi Mohit,
    I think you are mixing solutions. I think you don't need to create an inbound idoc, because this requirement could be achieve using a LSMW. Create a batch recording, use the Excel structure, even you could add the missing (necessary) fields to create the customer.  By standard, the LSMW will create a temporal table and will check duplicate customers, using for example the tax number (assuming this number can't be repeated).
    Another solution if you are planning to upload data directly from the source system, on this case you could use the inbound idoc.
    Regards.

  • Create XML transformation in SAP R/3 4.7

    Hi Experts,
    Kindly let me know the transaction for creating xml transformation in sap r/3 4.7, if there is any.
    Though i could not find anything through tstc or se93.
    Is there any other way of creating xml transformation in r/3 4.7. There is a tcode STRANS in ecc6.0 but not in 4.7.
    Also, please help me resolving this issue of converting abap data to xml file: -
    is the following xml structure possible with transformation or by any other method.
    <Process_Order>
         <item>
                   <PO Number> PO123334 </PO Number>
                   <Header_mat> Mat123 </Header_mat>
                   <BOM>
                          <PDLabels>
                                  <PDLabel>
                                         <PCode>P123456</PCode>
                                         <Batch>123ABC</Batch>
                                         <Quantity>6000</Quantity>
                                         <PDDCode>1234567890</PDDCode>
                                 </PDLabel>
                                 <PDLabel>
                                        <PCode>P234567</PCode>       
                                        <Batch>567DEF</Batch>
                                        <Quantity>6000</Quantity>
                                        <PDDCode></PDDCode>
                                 </PDLabel>
                        </PDLabels>
                       <PDCartons>
                                <PDCarton>
                                       <PCode>P556677</PCode>
                                       <Batch>589GFT</Batch>
                                       <Quantity>1200</Quantity>
                                       <PDDCode></PDDCode>
                                </PDCarton>
                      </PDCartons>
                 </BOM>
        </item>
         <item>
                   <PO Number> PO123334 </PO Number>
                   <Header_mat> Mat123 </Header_mat>
                   <BOM>
                          <PDLabels>
                                  <PDLabel>
                                         <PCode>P123456</PCode>
                                         <Batch>123ABC</Batch>
                                         <Quantity>6000</Quantity>
                                         <PDDCode>1234567890</PDDCode>
                                 </PDLabel>
                                 <PDLabel>
                                        <PCode>P234567</PCode>       
                                        <Batch>567DEF</Batch>
                                        <Quantity>6000</Quantity>
                                        <PDDCode></PDDCode>
                                 </PDLabel>
                        </PDLabels>
                       <PDCartons>
                                <PDCarton>
                                       <PCode>P556677</PCode>
                                       <Batch>589GFT</Batch>
                                       <Quantity>1200</Quantity>
                                       <PDDCode></PDDCode>
                                </PDCarton>
                      </PDCartons>
                 </BOM>
        </item>
    </Process_Order>
    What i mean to ask is, is the hierarchy to this structural level is attainable using either transfomation or any other alternative.
    Thanks a lot in advance !
    Shreya

    oops the message structure has gone bad ........
    What i meant was : --
    <Process_Order>
      <item>
                   <PO Number> PO123334 </PO Number>
                   <Header_mat> Mat123 </Header_mat>
                   <BOM>
                          <PDLabels>
                                  <PDLabel>
                                         <PCode>P123456</PCode>
                                         <Batch>123ABC</Batch>
                                         <Quantity>6000</Quantity>
                                         <PDDCode>1234567890</PDDCode>
                                 </PDLabel>
                                 <PDLabel>
                                        <PCode>P234567</PCode>       
                                        <Batch>567DEF</Batch>
                                        <Quantity>6000</Quantity>
                                        <PDDCode></PDDCode>
                                 </PDLabel>
                        </PDLabels>
                       <PDCartons>
                                <PDCarton>
                                       <PCode>P556677</PCode>
                                       <Batch>589GFT</Batch>
                                       <Quantity>1200</Quantity>
                                       <PDDCode></PDDCode>
                                </PDCarton>
                      </PDCartons>
                 </BOM>
        </item>
    </Process_Order>

  • How to creat purchase register in SAP r/3 system?

    Dear All,
    Please tell me how to creat purchase register in sap R/3 system.

    HI
    I think there is no standard functionality in sap u need to develop with abaper help with proper logic
    if it is for venijula s_alr_87009936  try this t.code
    Thanks & Regards
    Phaneendra
    Edited by: phaneendra Reddy on Jun 12, 2009 9:24 AM

  • Proceedure of how to create a logo in SAP R/3

    Dear Techie's,
    Please tell me the Proceedure of how to create a logo in SAP R/3 and how to include in the ALV.
    I suppose its to be included in the ALV_comentary_write function module.
    Please guide me in full.
    Regards,
    -=Virendra=-

    HI,
    Please follow below steps
    (1)Create a class name
    SBDSV1 (TRANSACTION) --> New Entries --> Class name (SOME NAME) --> Class type (OT).
    2)After entering the above details and saving, the fields Class object name fields   will be blank, make entries as shown  below .
    1)     Class : BDS_LOC1
    2)     Class : BDS_POC1
    3)     Class : BDS_REC1
    4)     Object name : BDS_CONN00
    3)- Now next time logging in to OAOR you can directly refer to this Class name.
    4)1)     Go to transaction OAOR, give the class name created.
       2)     Give class type as OT
       3)     Give some name in object key it’s like sub folder
    5) a) Click on create drag down standard doc types will get no. of option chose one
        b) double click on the class name in this new screen.
        c)in the below screen are, you have tabs for  details,documentinfo,keywords,create, click on create TAB,
       d)By double clicking on screen you can browse the folder where image is located and select it
       e)Once the image is selected it will be stored in the folder that is created with object key
    6) now double click on the image you uploaded & in below screen area select the Details tab, you will get object id,use this object id & code as below
    7)form FILL_EVENTS .
    DATA: wa_events TYPE SLIS_ALV_EVENT.
    CLEAR: LS_EVENTS.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       IMPORTING
         ET_EVENTS             = LS_EVENTS
    wa_events-form = 'STD_TOP_OF_PAGE'.
    MODIFY ls_events FROM wa_events TRANSPORTING FORM WHERE NAME =
    'TOP_OF_PAGE'.
    CLEAR: wa_events.
    endform.                    " FILL_EVENTS
    FORM STD_TOP_OF_PAGE.
    DATA: it_listheader TYPE SLIS_T_LISTHEADER,
           is_listheader TYPE SLIS_LISTHEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_listheader[]
         I_LOGO                   = 'ZTEST'  "this is object id mentioned in 6 step
        I_END_OF_LIST_GRID       =
      ENDFORM.
    Regards,
    Raghavendra

Maybe you are looking for