UDF for iDoc

Can somebody please write 3 UDF's for me.
1. From right hand side of the field E1IDKU3-INSTEXT1, all characters upto reaching of special character "/". This is because the field may appear like "/ /MAIL"  or simply "/ /". In the first case it is expected to take data MAIL and in second case blank.
2. E1EDKA1-STRAS  & STRS2, E1EDKA1-ORT01, PSTLZ (Qualifier : AG) . Split the full data into three lines of 35 characters each
    not sure whether I need to write UDF or Splitbyvalue will work for this.
3. Count the total number of Idocs that are going to be included into the file as one idoc represents one payment instruction
   not sure whether I need to write UDF or count function of Arithmetic will work.
Can somebody please reply me urgently.

>
Muhammad  iqbal wrote:
> Can somebody please write 3 UDF's for me.
>
> 1. From right hand side of the field E1IDKU3-INSTEXT1, all characters upto reaching of special character "/". This is because the field may appear like "/ /MAIL"  or simply "/ /". In the first case it is expected to take data MAIL and in second case blank.
>
use a UDF.
psedo code is
len = complete length of string
a = last index of ("/")
subString(a+1, len);
> 2. E1EDKA1-STRAS  & STRS2, E1EDKA1-ORT01, PSTLZ (Qualifier : AG) . Split the full data into three lines of 35 characters each
>     not sure whether I need to write UDF or Splitbyvalue will work for this.
>
You will need a UDF here
> 3. Count the total number of Idocs that are going to be included into the file as one idoc represents one payment instruction
>    not sure whether I need to write UDF or count function of Arithmetic will work.
>
> Can somebody please reply me urgently.
http://wiki.sdn.sap.com/wiki/display/XI/CountofRecords-%27Countontheeasiestway+through%27

Similar Messages

  • UDF for file to IDoc.

    Hi,
    I could like to create an UDF for file to IDoc secenario.
    Srouce:
    MTCashPosting_
    Header
    CashPosting
    PubDiv
    DocType
    DocDate
    PostDate
    RefDocNo
    HeaderTxt
    Customer
    Value
    Currency
    ExchangeRate
    Ledger
    Item
    Material
    TaxValue
    VAtValue
    Trailer
    Traget: (IDOC Type: FIDCCP02 Message Type: FIDCC2)
    FIDCCP02
    IDoc (Under FIDCCP02)
    Begin (Under IDoc)
    EDIDC40_:DISABLED
    E1FIKPF (Under IDoc)
    E1FISEG (Under E1FIKPF)
    Segment
    buzei
    bschl
    shkzg
    mwskz
    dmbtr
    hkont
    matnr
    "The secenario is the 'Value,TaxVAlue & VatValue' should be handled by replicating E1FISEG like (HAve used External definition for IDoc)"
    Value -> Line item 1
    IF TaxValue exists->Line Item 2
    IF VatValue exists-> Line item 3
    Finally Line item 4 for cerdit.All above are debit
    Value____________UDF______________E1FISEG
    TaxValue_________|
    VatValue_________|
    Value____________UDF______________DMBTR
    TaxValue_________|
    VatValue_________|
    How should I map?? Inputs plzzzzz

    Hi
    I am not sure whether my understanding is correct.
    As per my understanding
    You need to duplicate E1F1SEG segment 4 times as there are 4 conditions
    and those nodes need to be enabled or suppressed based on your condition .
    Regards
    sandeep

  • UDF For Retrieving the Tax Code based on PO

    Hi all,
    Mine is a file to Idoc scenario.
    I wrote a FM to retrieve the Tax Code based on PO .
    Created the udf which directly gets the Taxcode from the r/3 with out importing in to the imported objects,is this correct i never tried this before.
    Find the UDF for the Same.
    final String    CHANNEL_NAME = "GeneratedReceiverChannel_RFC",
         VALNOTFOUND = "VALUE_NOT_FOUND",
         SAPRFCNS = "urn:sap-com:document:sap:rfc:functions",
         TAG_FM = "Z_P_INT012_RFC_LOOKUP",
         TAG_TAX_CODE = "T_TAX_CODE",
         TAG_TAX_CODE_P = "TAX_CODE";
    AbstractTrace trace = container.getTrace();
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = null;
              factory.setNamespaceAware(false);
              factory.setValidating(false);
              try {
                   builder = factory.newDocumentBuilder();
              } catch (Exception e) {
                   trace.addWarning("Error creating DocumentBuilder - " + e.getMessage());
              Document docReq = null;
              try {
                   // Building up RFC Request Document
                   docReq = builder.newDocument();
                   Node root = docReq.appendChild(docReq.createElementNS(SAPRFCNS, TAG_FM));
                   Node nodeTbOpt = root.appendChild(docReq.createElement(TAG_TAX_CODE));
                   for (int i = 0; i < pernr.length; i++) {
                        Node nodeTbOptItem = nodeTbOpt.appendChild(docReq.createElement("item"));
                        nodeTbOptItem.appendChild(docReq.createElement(TAG_TAX_CODE_P)).appendChild(docReq.createTextNode(TAX_CODE<i>));
              } catch (Exception e) {
                   trace.addWarning("Error while building RFC Request  - " + e);
              trace.addInfo("RFC Request XML: " + docReq.toString());
                                                    //trace.addWarning("RFC Request XML: " + docReq.toString());
              // Lookup
              Payload load = null;
              try {
                   Channel channel = LookupService.getChannel(receiver[0], CHANNEL_NAME);
                   RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   InputStream is = new ByteArrayInputStream(docReq.toString().getBytes());
                   XmlPayload payload = LookupService.getXmlPayload(is);
                   load = accessor.call(payload);
              } catch (LookupException e) {
                   trace.addWarning("Error during lookup - " + e);
              // Parsing RFC Response Document
              Document docRsp = null;
              try {
                   docRsp = builder.parse(load.getContent());
              } catch (Exception e) {
                   trace.addWarning("Error when parsing RFC Response - " + e.getMessage());
              trace.addInfo("RFC Response XML: " + docRsp.toString());
                                                    //trace.addWarning("RFC Response XML: " + docRsp.toString());
              try {
                   NodeList res = docRsp.getElementsByTagName("item");
                   for(int i=0;i<res.getLength();i++){
                        NodeList itemNodes = res.item(i).getChildNodes();
                        Map itemMap = new HashMap();
                        for(int j=0;j<itemNodes.getLength();j++){
                             itemMap.put(itemNodes.item(j).getNodeName(), itemNodes.item(j).getFirstChild().getNodeValue());
                        rows.add(itemMap);
                                                            catch (Exception e) {
                   trace.addWarning("Result value not found in DOM - " + e);
                   result.addValue("true");
    Error:
    16:24:08 Start of test
    Source code has syntax error:  /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:598: 'class' or 'interface' expected public void TaxValues$(String[] a,String[] b,ResultList result,Container container){ ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:618: 'class' or 'interface' expected } ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:619: 'class' or 'interface' expected ^ 3 errors  Source code has syntax error:  /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:598: 'class' or 'interface' expected public void TaxValues$(String[] a,String[] b,ResultList result,Container container){ ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:618: 'class' or 'interface' expected } ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:619: 'class' or 'interface' expected ^ 3 errors
    16:24:11 End of test.

    Hi Potharaju,
    Why don't you try this, that really works:
    If you are using PI 7.1:
    http://help.sap.com/saphelp_nwpi71/helpdata/en/33/1ec6ced273493a993a80c2301c03da/frameset.htm
    If you are using XI 3.0, PI 7.0
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Try with these.
    Regards,
    Juan

  • UDF for sorting date

    Hi Guys,
    I am doing scenario File to Idoc, i have to sort date in acending order, the date format will be in either 22.10.2007 or 22/10/2007 . can any one send UDF for this.
    Regards,
    venu gopal

    Hi Venu
    You can execute this without UDF. Use " Transform" function in the Date functions.
    When you are using the UDF....you keep the strucure as "yyyMMddhhmmss" for that clickon Trnasform function and there you can see ShowAdvancedProperties...there u can find the format of the source which you are expecting and also change the strucutre of you target expected format.
    You please try this and check the mapping it will get execute.
    Use Standard Date Function DATATRANS. It have the property for format and input is the source date field. It will convert the date format to required specified format which you menstion in the DARTATRANS function
    for UDF
    Re: UDF  for this mapping rule
    Re: Problem in UDF please Help?
    Thanks!

  • Reg: UDF for varchar to smalldatetime

    Hi guys,
    I am trying to post DATA date field  in PI (EX : 20080406 from IDOC )   to smalldatetime in the SQL database.(JDBC) .
    The communication channel throws error :  cannot convert nvarchar to smalldatetime.
    The possible solution is including the java.sql import functions and write a UDF for the same.
    Can anyone help me with a UDF for the same so that i can pass the source field  to database using the UDF.

    Hi Kushee,
    smalldatetime format is: 2007-05-08 12:35:00
    See this help: http://msdn.microsoft.com/en-us/library/ms182418.aspx
    So use the standard datetime function with a separator space in between date and time. It should solve your issue. No need for udf.
    Regards,
    ---Satish

  • Help in creation of XML file for IDOC postings

    Hi All,
    Need help if anyone has knowledge/experience in creating XML files for IDOC processing.
    We need to design an input file (in XML format) for creation of IDOCu2019s for purchase Invoices through Interface.
    We have an existing input file, which is working correctly.  We are trying to modify this existing input file for a new Tax Code (Non-deductible inverse tax liability).   This tax code is working fine for manual postings.   But, through IDOC, tax postings are not correctly triggering.
    Could you please confirm if any one has experience on this, so that I can share more details for resolving.
    Thanks & Regards,
    Srini

    Hello,
    you can use CALL TRANSFORMATION id, which will create a exact "print" of the ABAP data into the XML.
    If you need to change the structure of XML, you can alter your ABAP structure to match the requirements.
    Of course you can create your own XSLT but that is not that easy to describe and nobody will do that for you around here. If you would like to start with XSLT, you´d better start the search.
    Regards Otto

  • Create UDF for table not in the List of tables

    Hi all,
    I know that my question maybe easy or been asked before, but I couldn't find the answer.
    To create a UDF in SAP B1 version 9.0 you should go Tools -> Customization Tools -> User-Defined Fields - Management...
    which is ok and working perfect. but my question is:
    If I want to create UDF for a table not in the list of tables there what should I do? I need to create 2 UDFs for table OMRC [Manufacturers], and can't find it in master data tables.
    anyone had this issue before?
    EDIT  : Is it good to add the field by using sql server? I know it's possible, but will it be visible in SAP
    thank you
    Message was edited by: Samira Haroun

    Hi Samira,
    There is noit a simple link for this, I advise you to study the documentation for TB1300 SBO Development Certification.
    Ypu should also have knowledge of .net, and C# or VB, because you have to make a small program/addon to add the fields
    Kind regards
    Ad Kerremans

  • Mandatory Fields for IDOC ORDERS01 for Pricing Condition EDI1 to trigger

    Hi ,
    I'm Testing an Inbound ORDRSP using we 19  for Pricing Conditions EDI1. What are the Mandatory Fields for IDOC ORDERS01
    Thanks

    hello,
    I think it's better to execute VA01 to create a sales order; in that way you should have an idea of mandatory fields.
    Thanks.

  • MATERIAL LINK TO ONE SAP SYSTEM TO ANOTHER SAP SYSTEM FOR IDOC TRANSFER

    Hi Experts,
    How the  MATERIAL LINK TO ONE SAP SYSTEM TO ANOTHER SAP SYSTEM FOR IDOC TRANSFER?
    Scenario : when 2nd system create the invoice,it will create a po in the 1st system.
    51 error msg we are getting material does not exists.but the material is available in the receiving plant.
    Please suggest

    If you say the material master is available in the 1st system (where you create the order), then the material number in the IDOC  may not match with the material number in your database.
    leading zeros. material number stored as alphanumeris instead of numeric.

  • Business  system for idoc reciver communication channel.

    hi gurus,
    iam doing one file to idoc scenerio.
    for defining reciver idoc adapter ,which type of businees system i required that is configured in SLD.
    pls guide me .
    warm regards.

    Hi
    You can use th Buiness system as a receiver for IDOC.
    Making sure
    1. the LS of the system(R/3) is same in the SLD and it is also reflecting in the adapter specific attributes in the ID.
    2. Use the same LS name for the BS pointng to FIle in the SLD.
    Complete the IDOC configuration from XI
    1. Create the RFC dest from XI to ECC
    2. Create the Trfc port and call this RFC dest created..
    3. Use this Trfc port in the IDOC receiver
    On ECC:
    Make sure the Partner Profiles is created properly.
    it is suggested to use always the business systems when you deal with IDOC and Proxies.
    Edited by: Nisar Khan on Feb 27, 2008 1:31 PM

  • Purchase Order Row UDF for Received Qty

    Hi experts,
    Can someone please recommend a way to create a row UDF for purchase orders to show the qty received? We cannot use a simple calculation like Qty-Open Qty because if the row is closed manually, the open qty becomes zero. Another problem is how to prompt the PO to update this value if additional GR PO's or AP Invoices are created. Thanks.

    I should explain the circumstances more clearly. There is no problem with the standard GR PO or AP invoice receiving method. What I want is a reference field on the original PO showing the total qty received to date. For example: total of 1,000 pcs ordered -> 900 pcs received against several GR PO's -> want to see that 900 has been received back on the PO. Then let's say we want to close the PO line 100 pcs short.
    I can think of 2 ways to go about this:
    Method 1: Change the ordered qty from 1,000 to 900 -> row is closed, but lose the reference of the original order qty being 1,000.
    Method 2: Close row manually and maintain the original order qty as reference, but lose b/o qty and it is difficult to tell how many pcs where received/closed short.
    Is there another way to keep all the reference information?

  • UDF for leading zero's in message mapping

    Dear team,
    I need UDF for leading zero's in my message mapping.
    Source and Target both structures contains matnr field.But we have to maintain total 18 chars at target matnr , because RFC in R/3 needed.So I want to add leading zero's when mapping. Can anybody provide the UDF code.
    Matnr[source]--->split by value(eachvalue) ->UDF->Matnr[Target]
    Ex::if source matnr conatains value "9846538" ; I need matnr value at target side like "000000000009846538"[total 18 chars].
    -Drumi

    Hi Ambrish,
    Good day...
    I have enterd what you said and I got below error... and I gave "input" in place of var1, 18 in place of filedlenght in below program...
    =================================
    int len = Integer.parseInt(18);
    int inputLength = input.length();
    try {
    Integer.parseInt(input);
    // If it is an integer, add 0 (len - inputLength) times
    for (int i=0; i< len-inputLength;i++)
        input = "0" + input;
    return input;
    } catch (NumberFormatException numForEx) {
    // return as it is, if alphanumeric
    return input;
    ====================================
    ERROR:
    Source text of object Message Mapping: Lubrisur_SHPMNT_SHPMNT05_TO_WMMBXY_WMMBID02_TransferPosting | urn:bp:xi:dwn:lu:common:Logistics:100 has syntax errors:
    Function LeadingZeros, Line 1:
    cannot find symbol symbol  : method parseInt(int) location: class java.lang.Integer int len = Integer.parseInt(18);                  ^ 1 error
    =======================
    Please suggest

  • Issue loading Meta Data for IDoc Type WPUKSR01 in XI Integration Repository

    Hi,
    I want to load the Meta Data for IDoc Type WPUKSR01 in XI Integration Repository out of BI. Unfortunately, this IDoc is not available in the IDoc List. I checked in BI and the IDoc Type is available in WE60 and WE30. Also, I can load the Meta Data for the Idoc in XI ABAP (IDX2).
    Can someone tell me why the IDoc doesn't show up in XI Integration Repository Import Object List?
    Thanks in advance.
    Best Regards.
    Alex

    Hi Aamir,
    The Idoc is released since Release 30A. I also tried to load the IDoc Meta Data from ERP with the same result: it does not show up in the list.
    Thanks anyway.
    Alex

  • UDF for JDBC lookup in PI 71

    I am facing some issue while importing the SQL meta-data from db2 in PI 7.1 , guess the db2 version is old and not compatible with 7.1 or could be problem with drivers, I want to go head with writing UDF for the jdbc lookup, can you please let me know  the code and how it can be written or blogs, thanks

    >>> can you please let me know the code and how it can be written or blogs, thanks
    You can try this link if you dont want to use graphical jdbc lookup... Follow this link , it has code to use ...
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    Also refer these links
    For 7.0 -  http://scn.sap.com/people/william.li/blog/2007/03/30/using-jdbc-connection-pool-in-xi-message-mapping
    For 7.1 http://scn.sap.com/people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups

  • EOIO for IDOCs to XI

    Hi,
    My scenario is IDOC ---> xi ---> File.
    Need to implement EOIO(serialization) for IDOCs coming from ECC.
    Checked "Queue Processing" and assigned rule "FIRST_16_OF_MESTYP".
    When I send the IDOC using WE19, I get message "IDocs are stored in the queue".
    But, IDOCs are not coming to XI. Please help.
    Versions: ECC 6.0 & PI 7.0 SPS 13.
    Also, do I need to maintain an entry in IDXQUEUE table?

    Hi
    use similar thread
    How to implement IDOC Serialization(EOIO) using IDOC Adapter
    Re: Posting idocs in sequence in SAP from file (without BPM)

Maybe you are looking for