Reg:UDF

H i Guys,
             I have requirement like to send mail through UDF if Some condition fail in Mapping
Please give answer urgently
Thanks

Hi,
Have you find a solution ?
Because I tried to do this wiki in a PI 7.1 and I have the same issue.
https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=90570965
I created the Imported Archive "IA_Mail" inside a namespace N1 and Folder F1. Activation is ok.
In my existing Function Library (defined in namespace N1 and Folder F2),
   - I added the UdF of this wiki,
   - inside the tab "Archived Used", I added a line with my Imported Archive "IA_Mail"
   - inside the tab "Import instructions", I added at the line 7 the sentence "mail.sdn.*"
No problem here, the Function Library is well activated.
Then I used this UdF inside my Message Mapping (defined in Namespace N1 and Folder F3).... but when I try to activate the Message Mapping, I have the following error:
Java Area import, Line 7:
package mail.sdn does not exist import mail.sdn.*; ^ Note: /usr/sap/XYZ/aaaaaaaa/j2ee/cluster/server0/./temp/classpath_resolver/Mapb067fb3075f711deb809d28fa0003002/source/com/sap/xi/tf/_MM_File_2_File_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/XYZ/aaaaaaaa/j2ee/cluster/server0/./temp/classpath_resolver/Mapb067fb3075f711deb809d28fa0003002/source/com/sap/xi/tf/_MM_File_2_File_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
So even if Function Library is well activated, it seems that something is bad !
Have you an explanation ?
Thanks
Mickael
Edited by: Mickael Huchet on Jul 21, 2009 1:48 PM

Similar Messages

  • Reg: UDF for removing values after decimals

    HI,
      Please help me on the below issue,
      I need an UDF for the follwing requirement,
    as my input value is 12354.12354875 then the result will be like 12345.123,
    After deceimal it should get only 3 values.
    Please help me points will be awarded.
    Edited by: UDAY on Apr 5, 2010 3:56 PM

    >
    UDAY wrote:
    > yes its needed to be truncated only not rounded.
    In that case even the standard function FormatNum can also help.
    Regards,
    Abhishek.

  • 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

  • Reg. Query for UDFs.

    Hello All,
    I've created a multiple UDFs Like, Vendor Name,Vendor Address,Vendor Excise Details like ECC No,Range, Division,VAT No,CST No. in Marketing Documents.
    I want to write a query, for example if I select the Vendor Name, the vendor address and excise details should pick up automatically from that vendor master record. Please help.
    Thanks,
    Pratheeviraj.

    Dear Avijit,
    Thanks for your reply.
    I can't understand your solution.  Can you please explain me in detail?
    I'm giving the scenario in detail,
    In the marketing document 'Outgoing Excise Invoice', I've created UDFs like vendor name, vendor address, vendor excise number, etc., my requirement is the moment I select the vendor in Vendor Name UDF, the address and excise number should get populated in the respective UDFs.
    Thanks,
    Pratheeviraj

  • UDF for Replace first 4 char

    Hi Friends,
    Can anyone please provide me UDF for following Condition
    my input is 123456 or 1234567.i need read first 4 char and replace it by sw..the output should be sw56 or sw567
    Thanks in adv.
    Reg,
    dinesh
    Edited by: Dineshbabu.M on Feb 18, 2011 2:20 PM

    Hi,
    This simple UDF will do what you want:
    The UDF takes a single String array as input, say s[ ] and it has a single ResultList item result as output.
    The complete code is as follows:
    s[0]="sw"+s[0].substring(4,s[0].length());
    result.addValue(s[0]);
    Pass the output of the UDF to the required target field. That's it.
    HOPE IT HELPS YOU BUDDY!!!
    THANKS
    BISWAJIT
    Edited by: 007biswa on Feb 18, 2011 7:04 PM

  • Update em UDF

    É permitido fazer update via SQL em campos definidos pelo usuário (UDF)?

    Boa tarde,
    até onde sei, não é permitido realizar UPDATE em nenhuma tabela registrada incluindo seus respectivos campos.
    para poder realizar Qualquer manipulação de dados(delete, insert e update), Somente em tabelas não registradas.
    Ailton Douglas
    UNION TECNOLOGIA DA INFORMAÇÃO.
    SAP BUSINESS ONE.
    Atendemos na Região de Bauru,
    São José do Rio Preto e Presidente Prudente

  • Udf Data is not being displayed in the report

    Hi all,
    i have designed one report in which i am displaying some udf fields along with other system fields.
    i have not used any selection criteria.
    when i run report it doesn't display udf data of some random rows in the report even if data is peresent in that udf field.
    If i open sales order and press 'Shift-F2'  and update the document and now if i run report then i get that udf value in the report.
    why this happening. data is there in the udf field only its not displayed in the report with out updating the that udf.
    pls suggest some solution.
    regsrds,
    Chetan.

    Hi Ashish,
    I ran the "ZPS/!ZPS" in RSRT where ZPS is the infoset name. In Dev, it displayed the values. In QA, it displayed the below messages:
    ECharacteristic 0TCAKYFNM does not exist. Check authorizations
    WThere are calculated elements. These results are bracketed [  ]
    and below that, it displayed the values for Number of records. But, it has not displayed the values for the other figures.
    Does this has any impact in QA.
    Thanks & Regards,
    AVN Rao.

  • Error while setting a value into an UDF of type date

    Hello,
    i get the following error while trying to set a value to an udf with the type "date":
    Exception from Server: RPC_E_SERVERFAULT
    This code is used:
    objDate = CDate(objLineRecordSet.Fields.Item("U_TESTDATE").Value)
    objDocument.Lines.UserFields.Fields.Item("U_ACTDATE").Value = objDate '### Here comes the error
    The application is in PL 29

    Christian,
    If you search this forum on "date UDF" you will find many posts that may assist you such as this one ...
    Format of string passed to Date/Time Hour UDF
    HTH,
    Eddy

  • 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

  • Issue in RFCLookup UDF

    Hi All,
    Requesting your help in fixing an UDF issue.
    This UDF is to check for a table entry and if not found it will create an alert with some source values.
    Now the problem is, alert mails are getting created but the values are not getting passed.
    Here is the source code:
    AbstractTrace trace;
    trace = container.getTrace();
    MappingTrace trace1;
    trace1 = container.getTrace();
    Object cachedValue = null;
    String result = null;
    String sender = null;
    String receiver = null;
    //Check if source is null or blank. If so then pass blank value to target 
    if(((sourceValue1.trim()).equals("")) ||  ((sourceValue2.trim()).equals("")) || ((sourceValue3.trim()).equals("")))
      result="";
    else
                                 Map map = container.getTransformationParameters();
    //Sender System name which is the same as the Sender Business System name in Integration Directory
    sender = (String) map.get(StreamTransformationConstants.SENDER_SYSTEM);
    //Receiver System name which is the same as the Receiver Business System name in Integration Directory
    receiver = (String) map.get(StreamTransformationConstants.RECEIVER_SYSTEM);
    // Parameter for cache value. A semicolon is used as a separator between keys
    String CONTAINER_PARAMETER = subCat.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue1.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue2.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue3.trim();
    trace1.addWarning("CONTAINER PARAMETER: " + CONTAINER_PARAMETER + "\n");
    trace.addDebugMessage(UDFReader.getString("CACHE_CONTAINER_PARAMETER_TEXT") + CONTAINER_PARAMETER);
    // Retrieve cached value
    cachedValue = container.getParameter(CONTAINER_PARAMETER);
    if(cachedValue!=null)
      // Cached value found
      result = cachedValue.toString();
      trace.addDebugMessage(UDFReader.getString("CACHE_RESULT_TEXT") + result);
    else
      // Cached value not present. Fetch value from database
      // Build key column names array to be passed to java class
      String keyColNames[] =new String[6];
      keyColNames[0]=UDFReader.getString("SAP_SYSTEM_COLUMN_NAME");
      keyColNames[1]=UDFReader.getString("LEGACY_SYSTEM_COLUMN_NAME");
      keyColNames[2]=UDFReader.getString("SUBCATEGORY_COLUMN_NAME");
      keyColNames[3]=sourceField1;
      keyColNames[4]=sourceField2;
      keyColNames[5]=sourceField3;
      trace1.addWarning("KeyColNames" + keyColNames[0] + "\n" + keyColNames[1] + "\n" + keyColNames[2] + "\n" + keyColNames[3] + "\n" + keyColNames[4] + "\n" + keyColNames[5] + "\n");
      // Build key column values array to be passed to java class
      String keyColValues[] = new String[6];
       //Check whether sender system is SAP or Legacy
                             if(sourceField1.startsWith(UDFReader.getString("SAP_SYSTEM_PREFIX")))
       //Sender system is SAP
       keyColValues[0]=sender;
       //Receiver system is Legacy
       keyColValues[1]=receiver;
                             else
       //Receiver system is SAP    
       keyColValues[0]=receiver;
       //Sender system is Legacy
       keyColValues[1]=sender;
      keyColValues[2]=subCat.trim();
      keyColValues[3]=sourceValue1.trim();
      keyColValues[4]=sourceValue2.trim();
      keyColValues[5]=sourceValue3.trim();
      // Fetch result using java class
      result=RfcLookupHandler.RFCLookup(table,keyColNames, 
    keyColValues,targetField,trace);
    trace1.addWarning("Result:" + result);
      if(!result.equals(RfcLookupHandler.VALNOTFOUND))
       // Record found in database
       container.setParameter(CONTAINER_PARAMETER,result);
      else
       // Record not found in database
                                              //Autogenerated message id generated at runtime
       String msgId = (String) map.get ( StreamTransformationConstants.MESSAGE_ID);
       //Dynamic alert message details-Trigerred through RFC SALERT_CREATE
       String element[] = new String[9];
       String tabIndex[] = new String[9];
       String elementLength[] = new String[9];
       String type[] = new String[9];
       String value[] = new String[9];
       //Container names for alert message
       element[0] = UDFReader.getString("CONTAINER_NAME_MESSAGE_ID");
       element[1] =UDFReader.getString("CONTAINER_NAME_INTERFACE_NAME");
       element[2] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
            //element[2]="SAP_MAT_NO";
       element[3] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE"); ;
       element[4] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
            //element[4]="PLANT";
       element[5] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[6] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[7] =UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
       element[8] ="TABLE";
       trace1.addWarning("Warning: \n" + element[0]  + "\n" + element[1]  + "\n" + element[2]  + "\n" + element[3]  + "\n" + element[4]  + "\n" + element[5]  + "\n" + element[6]  + "\n" + element[7]  + "\n" + element[8]);
       //Tab index of container variables in alert message
       tabIndex[0] = "000001";
       tabIndex[1] = "000002";
       tabIndex[2] = "000003";
       tabIndex[3] = "000004";  
       tabIndex[4] = "000005";  
       tabIndex[5] = "000006";  
       tabIndex[6] = "000007";  
       tabIndex[7] = "000008";
       tabIndex[8] = "000009";
       //Length of containers
       elementLength[0] = elementLength[1] = elementLength[2] =elementLength[3] = elementLength[4] = elementLength[5] = elementLength[6] =  elementLength[7]=elementLength[8]=UDFReader.getString("CONTAINER_VALUE_LENGTH");
       //Data type of containers
       type[0] = type[1] = type[2]  = type[3] = type[4]=type[5]  = type[6]  =type[7]  ="C";
       //Values supplied to containers
       value[0] =msgId;
       value[1] =interfaceName;
       value[2] =  sourceField1;
       value[3] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue1.trim();
       value[4] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA")  + sourceField2;
       value[5] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue2.trim();
       value[6] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA")  + sourceField3;
       value[7] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue3.trim();
       value[8] =table;
    trace1.addWarning("Table: "+table);
       // Check error handling flag
       if(errorHandlingFlag.equalsIgnoreCase("E"))
       //Throw Error and generate alert message
       trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_E_TRACE"));
    trace1.addWarning("Error Flag: E");
    for (int i=0; i<9; i++){
    trace1.addWarning("Parameters["+i+"]: " +value[i]);
       result = SUPPRESS;
       RfcAlertHandler.RFCAlert(alertCat,element,tabIndex,elementLength,type,value,trace);
       throw new ValueMappingException(UDFReader.getString("NO_RESULT_FLAG_E_EXCEPTION"));
       else if(errorHandlingFlag.equalsIgnoreCase("N"))
        //Pass 'NA' value to target
        result=UDFReader.getString("NO_RESULT_FLAG_N_VALUE_PASSED");
        trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_N_TRACE"));
    trace1.addWarning("Error Flag: N");
       else if(errorHandlingFlag.equalsIgnoreCase("B"))
        //Pass blank value to target
        result="";
        trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_B_TRACE"));
    trace1.addWarning("Error Flag: B");
       else
        //Incorrect Error Handling Flag
        trace.addInfo(UDFReader.getString("INCORRECT_FLAG_TRACE"));
    trace1.addWarning("Error Flag: INCORRECT");
        result = SUPPRESS;
        throw new ValueMappingException(UDFReader.getString("INCORRECT_FLAG_EXCEPTION"));
    return result;
    Can someone check where could be the problem?
    Thanks,
    Glory.

    What is RfcLookupHandler? And where is RFC channel settings?

  • Get dynamic filename in a Java Mapping (NOT UDF)

    Hi,
    we are using a Java Mapping step in XI (not UDF). We need to have access to the filename. In the File Adapter we set the message attributes and can see the filename value in the SXMB_MONI.
    We use the following code fragment to have access to the filename:
    Container container = new Context(new FunctionWrapper(0));
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    This doesn't work. We think the declaration of the container class is wrong. Does anybody have some information about using the dynamic attributes in Java Mappings?
    Thanks in advance
    Michael

    import com.sap.aii.mapping.api.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.HashMap;
    import java.util.Map;
    public class JavaProgram
        implements StreamTransformation
        public JavaProgram()
        public void setParameter(Map map)
            param = map;
            if(param == null)
                param = new HashMap();
        public void execute(InputStream inputstream, OutputStream outputstream)
            try
                DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
                DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                String s = dynamicconfiguration.get(dynamicconfigurationkey);
             //Your logic
            catch(Throwable throwable)
                throwable.printStackTrace();
        private Map param;

  • Unable to see custom Trace messages in Log Viewer which were defined in UDF

    Hello Experts, I am not able to see my trace messages in Log Viewer. I have a small user defined fuction which takes a variable and returns its uppercase and while do that it writes few warning level trace messages in the trace file. I've tried changing the levels from Warning to Info but I still don't see anything in my Log Viewer. At this point I am not even sure if I am looking at right place. When I test my mapping in Message Mapping's Test tab it works fine and shows me all my trace messages. But when I do end to end it is not writing anything to the trace file. I've tried to use instructions from following blogs:
    1. /people/michal.krawczyk2/blog/2007/04/30/xipi-personalized-logging-tracing(logging and tracing)
    2. /people/michal.krawczyk2/blog/2005/05/10/xi-i-cannot-see-some-of-my-messages-in-the-sxmbmoni (logging and tracing)
    3. /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi(for my UDF)
    but I still don't see traces in my Log Viewer. Please let me know if I am doing anything wrong here.
    Thanks in advance!!
    ==============================================================
    public String TraceVar(String var1, Container container) throws StreamTransformationException{
    AbstractTrace importanttrace; //create an instace of AbstractTrace
    importanttrace = container.getTrace(); //get trace
    importanttrace.addWarning("FiletoFileMP:MyUdflibrary: " + var1); //write first message to the trace
    // fix the naming conventions later
    String SenderName; // declare multiple vars to store infos
    String ReceiverName;
    String interface_name;
    String message_ID;
    String time_Sent;
    java.util.Map map;
    map = container.getTransformationParameters();
    //get interface info into the variables
    time_Sent = (String) map.get(StreamTransformationConstants.TIME_SENT);
    message_ID = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
    interface_name = (String) map.get(StreamTransformationConstants.INTERFACE);
    SenderName = (String) map.get(StreamTransformationConstants.SENDER_NAME);
    ReceiverName = (String) map.get(StreamTransformationConstants.RECEIVER_NAME);
    //post interface info to the trace
    importanttrace.addWarning("Time Sent: " + time_Sent);
    importanttrace.addWarning("Message ID: " + message_ID);
    importanttrace.addWarning("Interface Name: " + interface_name);
    importanttrace.addWarning("Sender Name: " + SenderName);
    importanttrace.addWarning("Receiver Name: " + ReceiverName);
    //convert var1 to uppercase to make sure this function has be executed
    return var1.toUpperCase();
    Edited by: Mayur Patel on May 5, 2009 11:03 PM

    Thank you Prateek for a quick response.
    Yes I was able to see my trace messages in SXMB_MONI. Below is my the info... This is great. I am still not sure why this info is not showing up in Log Veiwer's (default trace) window. Any ideas? Since this XML file contains lots of other information I was wondering how to put my trace messages into the log viewer.
    Thanks!!
      <Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>
      <Trace level="2" type="T">FiletoFileMP:MyUdfLibrary: Honda</Trace>
      <Trace level="1" type="T">FiletoFileMP:MyUdfLibrary: Honda</Trace>
      <Trace level="1" type="T">Time Sent: 2009-05-05T16:16:39Z</Trace>
      <Trace level="1" type="T">Message ID: 366CEAF14D3B410033AFDDB71CD2AF73</Trace>
      <Trace level="1" type="T">Interface Name: SIC_Car_Outbound</Trace>
      <Trace level="1" type="T">Sender Name: SIC_Car_Outbound</Trace>
      <Trace level="1" type="T">Receiver Name: SI_Car_Inbound</Trace>
      <Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>

  • Mail can't send email from 123-reg accounts

    Hi all,
    I've got an issue with Mac Mail can’t send email from 123-reg accounts.
    I know there is a lot of articles on simular matters and some I have tried out with no luck, others are just speaking a whole other language.
    Any help would be greatly recived, here's my situation below:
    Running a iMac 2.8GHz Intel Core i5 on OS X 10.8.3
    I’m using 3 accounts on Macs Mail client, one is my iCloud account that is working fine and the other two are my 123-reg accounts that I use for business purposes. I’ve been working like this for a couple of years now and about 6 months ago I upgrade my operating system from Snow Leopard to Mountain Lion.
    2 or 3 months ago I randomly got a problem where I was unable to send any emails from my 123-reg account, I could only receive emails. I checked my settings and they were all correct and unchanged so I attempted to delete them and recreate the account but with no such luck.
    I then decided to check if it was a problem at 123-regs end and attempted to log into web mail. This worked and was able to both send and receive emails so eliminated that possibility.
    I also have these accounts set up on my iPhone, so checked if there was any issues and everything was working fine. I then checked my iphone details and made sure the same was on my desktop and still no such luck.
    I’ve tried out some of the articles I’ve found on here (the ones written in plain English) still no results. I’m not very IT illiterate and just wondered if anyone else has got any ideas, whether there is something specific with 123-reg accounts and Mac Mail?
    Many thanks.

    Thanks
    I just had another hunt around looking at posts and discovered that it was because I recently changed to BT Infinity and they had a block on.
    I didn't even think to question the ISP.
    https://discussions.apple.com/message/21173608#21173608

  • Checking if UDF in System Table Exists

    Hi all,
    I want to add a UDF in the RDR1 table (Sales Order Lines).  I'm having a problem checking if the field exists!  This is my code...
    If Not oUserFieldMD.GetByKey("RDR1", 0) Then
      oUserFieldMD.TableName = "RDR1"
      oUserFieldMD.Name = "NJ_OpnTpoQty"
      oUserFieldMD.Description = "Open TPO Qty"
    End If
    The problem is that I have previous UDF's from other Add-Ons in that table and so I cant use a Hard Code 0 "Zero" in the "FieldID" Parameter for the GetByKey Method! It could vary depending on the number of existing UDFs.  How do I check for the this UDF with using the "TableID" and "AliasID".  I could use a oRecordSet.DoQuery and check if the RecordCount = 0....but I am having a "-1120 Ref Count..." error problem with having two BoObjects open simultaneously.
    Does any1 have any other way of checking if UDFs exists in System Tables?
    Thanks

    Hi Noor
    I know 2 ways:
    1st:
    Dim mRs As SAPbobsCOM.Recordset
    mRs.DoQuery("SELECT TableID FROM CUFD WHERE TableID = 'RDR1' AND FieldID = 'NJ_OpnTpoQty'")
    If Not mRs.EoF Then
       'Add Field
    End If
    The problem is that you can have this field with other TableId and your code will crash
    2nd:
    Put your "add field" code in a Try..Catch block with no code in catch section.
    HTH

  • How to get a UDF value inside print event.

    I'm designing an add-on that will print 3 labels based on different criteria when and Invoice or a Delivery ticket is print.  Each label will go to a different printer since these are specifilly dedicated to each type of label/form.
    My problem is that that I have 2 UDF in the header of the marketing documents (Y/N fields) that flag me when 2 of the labels needs to be printed.  I have tried unsuccessfully to get the value from the UDF items in the form, I got several information like cardname, shipto address and total from the marketing document form, but no UDF can be access. 
    Below find copy of my routine (tPOTD is my UDF), this code will only work if there is only one instance of the form open, now is there's a way of knowing the instance number of a specific form?
    Private Sub SBO_Application_PrintEvent(ByRef printeventInfo As SAPbouiCOM.PrintEventInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.PrintEvent
            Dim s As String
            Dim DocType As String
            Dim oForm As SAPbouiCOM.Form
            Dim tInvNum As SAPbouiCOM.EditText
            Dim tName As SAPbouiCOM.EditText
            Dim tshipto As SAPbouiCOM.EditText
            Dim ttotal As SAPbouiCOM.EditText
            Dim tPOTD As SAPbouiCOM.ComboBox
            If printeventInfo.BeforeAction = True And printeventInfo.PrintEventType = SAPbouiCOM.BoPrintEventTypes.pet_Print Then
                oForm = SBO_Application.Forms.Item(printeventInfo.FormUID)
                If oForm.TypeEx = "133" Or oForm.TypeEx = "60090" Then
                    DocType = "Invoice"
                Else
                    DocType = "Delivery"
                End If
                tInvNum = oForm.Items.Item("8").Specific
                tName = oForm.Items.Item("54").Specific
                tshipto = oForm.Items.Item("92").Specific
                ttotal = oForm.Items.Item("29").Specific
    ' Next line is to get the value of the UDF but it fails finishing the routine and no exceptions raise
                tPOTD = SBO_Application.Forms.GetForm("-" + oForm.TypeEx, oForm.TypeCount - 1).Items.Item("U_PrintOTD").Specific
                s = tName.Value + Chr(13) + Chr(10) + Replace(tshipto.Value, Chr(13), Chr(13) + Chr(10)) + Chr(13) + _
                    Chr(10) + Chr(13) + Chr(10) + DocType + ": " + tInvNum.Value + "   Total: " + ttotal.Value
            End If
    EndSub

    First off, do you have the UDF form visible?  If not, I'm not aware of a way to retrieve the UDF data without the DI-API.
    Assuming you're printing with the form active, you can use the SBO_Application.Forms.ActiveForm.TypeCount value to obtain the "instance" of the form, I'd guess.  I haven't tried it, but I assume it would work:
    UDFForm = SBO_Application.Forms.GetFormByTypeAndCount(-133, SBO_Application.Forms.ActiveForm.TypeCount)
    Then your field would be:
    UDFValue = oUDFForm.Items.Item("U_MYFIELD").Specific
    Message was edited by:
            Curtis Fry

Maybe you are looking for

  • HT1338 XSERVE 10.6.8 is running very slow, and Workgroup Manager is not responding

    XSERVE 10.6.8 is running very slow, and Workgroup Manager is not responding. There is no more updates to download.

  • My Droid froze up after call

    Anyone know how to turn on the phone after screen goes black.  Seems to be frozen or something.  After a call when they hung up screen went black and now won't turn on.....Any suggestions?

  • Ipod Software 1.3

    Does the new Ipod software 1.3 solve any problems or create more? I have a 20gig gen3 that was rendered useless after going up to 1.2 but my Nano is fine at 1.1. Anymore I am leary of updating anything unless it's not working!!

  • Can I upgrade from CS5 to CS6 and stay off the cloud?

    I have CS5 on my Mac and would like to upgrade to CS6;  isit possible to buy the upgrade, or is the cloud the only option?

  • Nokia 5310 - Virus'd

    Hey guys this is my problem I think my phone is virus'd, after putting some songs on today after i tried going onto my menue, turning off my bluetooth, or anything, it keeps crashing, and freezing, i may have a virus on my computer i dont know if tha