Farmat number(UDF)

Hi Friends,
          I aneed to use userdefined function for format number .If i get charecter i should pass the charecte as it is and if i get the value in the source then i have to format the number.Could you please give me the UDF program for this.
Thanks in advance,
Kalam.

> For Example : Material number is of type character, so it can be either number or character.
> i want to add zeroes to Material number if it is only number. if it character or blank i have to leave it like that.
Try this UDF..
int k = 0;
int i = 0;
try {
i = Integer.parseInt (a);
} catch (Exception E){
return a;
k = 18 - a.length();          // suppose material's std. length is 18
for( int j = 0 ; j < k; j ++)
a = "0" + a;
return a;
Regards,
Sarvesh

Similar Messages

  • Serial Number UDF's Not Uploadable Thru DTW

    Hi,
    Our current warehouse is setup as serial number managed.  We had to create some UDF's in the serial number table to satisfiy some of our requirements.
    The problem I have is that I am unable to make a customize template for serial numbers via DTW including these UDF's.
    What can I do.  I have thousands of serial numbers and manually entry is not an option.
    Thanks,
    Joe

    Hi,
    Dunno if my problem exactly same case with Joe, but mine is, I want to update the UDF for existing serial numbers. You can't do it by update the original Goods Receipt document I believe, considering existing stock could be existed from various Goods Receipt and even some of the serial numbers maybe already issued.
    Isn't any template exist to update serial numbers information (UDF) for existing stock?
    Best Regards,
    Hendry Wijaya

  • Limiting Authorization of one of many UDF in marketing documents

    Hi
    I have created a Additional Authorization Creator for limiting the user from changing the values of  UDF Field and its working fine,  but the issue is i need to block only one UDF which i have created.
    For Eg.
    There are some 5 UDF (Header Level UDF) in a marketing document, namely
    UDF 1 - Transport Name
    UDF 2 - Transport Type
    UDF 3 - Vehicle Number
    UDF 4 - Driver Number
    UDF 5 - Driver Name
    I need to block only the UDF 5 from changing and the other UDF's can be changed.
    The Additional Authorization Creator which i created block's me from changing all the five UDF Values instead of only that UDF 5 .
    What could be reason?  Should i need to give any  Form Number like what i give  63771 which is for Form Settings?

    Hi
    you can open the document , open the user defined field
    go to tools---customization tools ---settings
    you will see the list of UDF you can just select which UDF you want to update
    you can mark 4 UDF as active and the 5-th UDF as not active but visible
    shachar

  • Dynamic directory name in Receiving File adapter

    Hi,
    In File to File senario, In receiving system i want to create directory name dynamically. In my mapping there is a field called name, the directory name in the receiving system will be value in the name field. Any one can help me how to do this one...
    Thanks
    Rao

    Hello,
    Please follow the below to achieve the same.
    input - Store number,
    UDF
    String dynaname = input;
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
    "http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,dynaname);
    return "";
    UDF mapping
    Source[input]   -
    > UDF -->    Rootnode of target structure.           
    Hope it helps.
    best regards,
    raj.

  • SQL Loader: Load empty clob field as null

    Howdy,
    I am trying to figure a way to load and empty clob from a text file as null rather than empty_clob().
    The database is 11.2.0.2.
    The file to be loaded was extracted from SQL Server 2008 via bcp.
    "my_table" definition;
    ID NUMBER
    UDF CLOBhere is my control file
    load data
    CHARACTERSET UTF8
    infile '/u01/home/oracle/data_text.dat' "str '%%%%'"
    into table  "scott.mytable"
    truncate
    fields terminated by '||' optionally enclosed by '^^'
    trailing nullcols
    (ID,
    UDF CHAR(8000) NULLIF (UDF="empty_clob()"))I've also tried:
    UDF CHAR(8000) NULLIF (UDF=BLANKS))After the table loaded successfully, I queried the table and found teh UDF field was not null, but rather an initialized clob.
    SQL>  select dbms_lob.getlength(udf) from mytable;
    DBMS_LOB.GETLENGTH(UDF)
                           0
                           0
    SQL> select udf from mytable where udf is not null;
    UDF
    2 rows selected.Thanks.

    According to the docs, NULLIF should work - http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_loading.htm#sthref1037
    Do you get the same results with both the control files ? Have you tried "UDF CHAR(8000) NULLIF UDF=BLANKS )" ?
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_field_list.htm#sthref862
    HTH
    Srini

  • Requirement  for Idoc-- File

    I am Doing Idoc----->File  mean R/3 -
    > Legasy.(at Receiver side save File as idoc no)
    I want save the file name    with number of Idoc(Receiver side).

    Follow the steps that is for dynamic file name ... using udf  in message mapping in IR and adapter specific mesage attributes in ID
    In the UDF,
    1. for file name == tGIve the name of the IDOC
    File propery--- Give the Source /IDOC field name which contains the IDOC number
    when performing mapping map    Source field (Field that contains IDOC number)->UDF--> Target/File root node..

  • How to limit the Font Settings Authorization ?

    Hi ,
    I have given NO Authorization for the Document Settings under the General for a User, but when i logged IN after limiting the Authorization i could find the Font Settings Icon when logged on.
    How to hide the Font Settings Icon for a User?

    Hi Nagarajan,
    It has worked out.   Thanks for your reply.
    I have one more doubt.
    i have created a Additional Authorization Creator for one of the UDF Field and its working fine,  but the issue is i need to block only one UDF which i have created.
    For Eg.
    There are some 5 UDF in a marketing document, namely
    UDF 1 - Transport Name
    UDF 2 - Transport Type
    UDF 3 - Vehicle Number
    UDF 4 - Driver Number
    UDF 5 - Driver Name
    I need to block only the UDF 5 from changing and the other UDF's can be changed.
    The Additional Authorization Creator which i created block's me from changing all the five UDF Values instead of only that UDF 5 .
    What could be reason?  Should i need to give any  Form Number like what i give  63771 which is for Form Settings?

  • Calculation delivery date for items

    Hello,
    I am looking for the option to set a delivery date calculation in master data so this will be automatically calculated in sales and purchase documents.
    The only thing that comes remotely close is the 'Lead Time' in tab 'Planning Data' but this will only be used in MRP runs.
    I want to set per Business Partner and/or Item a delivery date calculation. For instance it will take 5 (working) days before the item will be delivered. Therefore when entering a PO it will update the delivery date automatically from today plus 5 days.
    Same will go for the SO calculating the delivery date if there is no stock from the set delivery date calculation.
    It seems I have to set this up myself via UDF's with queries?!
    Kind regards,
    Petronella

    If the lead time is always the same length for the item irrespective of the BP then you could store this in an UDF on the item master. 
    If the lead time is per BP then it can be an UDF on the BP Master data.  However if its a matrix of per BP and Item then you can do this by creating a user defined table. 
    I have done something similar to this, a few quick pointers would be:
    Create User Defined Table (eg. @Leadtime)
    Add 3 user defined fields to the table, CardCode, ItemCode and Leadtime
    Open up the table and add a formatted search to the BP Code UDF (e.g. Select t0.CardCode, t0.CardName from OCRD t0 where t0.CardType = 'C')
    add a formatted search to the Item Number UDF (select t0.ItemCode from OITM t0)
    Add a UDF on the marketing document lines called Leadtime.
    Add a formatted search to the leadtime field (select T0.[U_Leadtime] FROM [dbo].[@Leadtime] T0 Where T0.[U_BPCode] = $[$4.CardCode] AND T0.[U_ItemCode] = $[$38.1.0])
    That should pull through the leadtime based on the BP and Item on the marketing document, you will then need to add a formatted search to the delivery date field on the rows by picking up the document date and adding the leadtime UDF days to it.  I'm afraid I don't have SBO open and I can't remember the variable for picking up the document date, you can find this out by clicking View | System Information.  To pick up the leadtime udf it will be $[$38.U_leadtime.0] i think.
    Regards,

  • Help with SP

    Hi All,
    I have the following SP TN in one of the db and its working fine.
    I wanted to add a condition that for the Sales order in which this claim number (udf: U_ClaimNo) is updated, a credit note is created (based on invoice which is based on this sales order), then while creating another Sales order with the same claim number, it should allow the addition of this SO.
    IF @OBJECT_TYPE = '17' AND @transaction_type IN (N'A', N'U')
            BEGIN
            IF EXISTS(select t0.docnum from ORDR  t0
                  where t0.docentry = @list_of_cols_val_tab_del and T0.U_ClaimNo IN
       (select U_ClaimNo from  ORDR  where  ISNULL (U_ClaimNo,'') <> '' and docentry <> @list_of_cols_val_tab_del))
             BEGIN
                  SELECT @ERROR=1,@ERROR_MESSAGE= 'This claim number has already been Invoiced!!'
    END
    END
    There cannot be partial delivery in case of claim and its one item per invoice. So there woudl not be cases with multiple items or partial returns.
    Any suggestions?
    Thanks,
    Joseph

    Hi Joesph...
    Try This
    IF @object_type = '17'
       AND (@transaction_type = 'A' OR @transaction_type = 'U')
    BEGIN
        IF EXISTS (
               SELECT DISTINCT     DocEntry
               FROM   ORDR         T0
               WHERE  T0.DocEntry = @list_of_cols_val_tab_del
                      AND T0.U_ClaimNo IN (SELECT C1.U_ClaimNo FROM   ORDR C1))
        BEGIN
            SET @error = 10
            SET @error_message = 'This claim number has already been Invoiced!!'
        END
    END
    Regards
    Kennedy

  • Field integration between Inventory Transfer and Sales Order?

    Dear Gurus,
    Hope to find you well, we have to redefine our processes of sales. Now stock from a remote site will be transferred to inventory in transit warehouse recorded. Truck Number(UDF) and Document Number  (Inventory Transfer) will be used to trace inventory status and creating Crystal Reporting from Stock Uploading till the A/R Invoice are created. My Query is how can this be achieved in SAP B1 2007 A Patch 10. Please advice. Its very important for us.
    Please find trail that will help you understand:
    Process Mapping Help Needed
    Faisal
    Edited by: Faisal Baloch on Nov 17, 2011 7:02 AM

    Dear Faisal,
    Unlike the higher package, B1 has no option to link between Inventory Transfer and Sales Order. You have to add UDF and manually maintain the link.
    Thanks,
    Gordon

  • PLD Check Stub Stub

    I need to match customers pre-printed "Check Stub Stub". After changing the settings If I somehow get to the point where the Check part and the first Stub matches, the second Stub doesn't. I don't understand how PLD is calculating where to print what?
    For example if I make the Height of the Repetitive Area Header to 30 points (which is approximately 1 cm), in the print it is less than 0.5 cm.
    Any help on the above or in general PLD output is appreciated.

    Hello,
    try to read this following tips (from tip and tricks manual pdf file) :
    Business Case:Often times Clients will use the Reference Number field on the AP invoice to store their Vendor’s invoice number. Their Vendors would like to see this field on the check layout. However, this field does not automatically appear on the check layout. We need to get the data from the Reference Number field to the check layout. Solution: Add a UDF to the Outgoing Payment window. Create a query to assign to the field that we just created. This query will identify the Reference Number for each line item in the Outgoing Payment window. We can then edit the Check Layout to display the Reference Number UDF.
    Implementation:
    3. The last step is to add the UDF to the check layout via PrintLayout Designer. You will add a Data Field to the Repetitive Area of the check. In the example below the field name that is being added is “Exhibit”.
    You will want to add a Text field to the Repetitive Area Header as well. Finally don’t forget to set the modified layout as the default template.
    The first implementation I did not write cause I am afraid if the above solution does not suit for you, but if you need it, let me know
    Rgds

  • Check a UDF of batch number when I create Goods Issue or Delivery

    Hello,
    I manage my items with batch number and I want to block the creation of all  Goods Issue or Delivery in function of the value of a UDF (created the OIBT table).
    I think I can achieve this by using the stored procedure SBO_SP_TransactionNotification, but I never used it and I don't know if (and how) I can retrieve the selected batchnumbers of my documents.
    Is it possible to do so, or do you have any better suggestions???
    Thank You,
    Xavier.

    Hi Xavier,
    You can find some additional information about the SBO_SP_TransactionNotification stored procedure here:
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e991e2b9-0901-0010-0395-ef5268b00aaf]
    The stored procedure only returns the following;
    - Object type
    - Transaction type
    - Num_of_cols_key (number of columns in the primary key of the object)
    - List_of_key_cols_tab_del (the list of the columns in the primary key)
    - List_of_cols_val_tab_del (the values of these columns)
    So the stored procedure doesn't directly return the information you want. You would have to link this with a DI application to access the document in question using the value of the primary key returned by the stored procedure. (Or through using an SQL query also using the primary key returned by the SP).
    Please note however, that SBO_SP_TransactionNotification is designed for notification purposes only. SAP can only support any issues arising out of use as a notification mechanism; the use of this stored procedure to block transactions or work as an authentication step are not supported. Please see SAP note 1011154 for more information.
    Regards,
    Niall

  • UDF for Line item number

    Hi All,
    Currently i'm working on a EDI2JDBC scenario. we have a field called LINE_ITEM_NUMBER at the target side. The incoming EDI signal doesn't contain the line item number and at the target side for every line item we need a create line item number. Lets suppose the incoming signals contains 3 line item number then at target side the value for LINE_ITEM_NUMBER should be 1,2 and 3. Can i achieve this functionality with any standard function or do i need to write an UDF? Can anyone provide the code for UDF?
    Your hekp is highly appreciated.
    Regards
    Faisal.

    Hi Faisal,
    The Below mapping will work for your requirement..
    Source(LineItemNumber)--->Index(Initial Value = 1, Increment = 1 )------\
                                                                             then
    Source(LineItemNumber)  ---->  Exisists      ----->  If                     ------>Target(LineItemNumber)
                                                                             else
                                                      Constant[0] ------------/
    If Input is
    <Source>
       <Line>aaaa</Line>
       <Line>bbbb</Line>
       <Line>cccc</Line>
    </Source>
    Your Target will be Like This
    <Target>
       <Line>1</Line>
       <Line>2</Line>
       <Line>3</Line>
    </Target>
    I have Tested That Mapping.. Working as shown below.
    Let me know For any clarifications..
    Regards
    Jyothi A.

  • DTW -- UDF does not appear in Serial Number

    Hi All,
    I am trying to update a UDF in serial number transaction table for GR PO. I have prepared a template where I have added a column at the end with the name of the column as defined in database. when I map these fields in DTW, I dont find this UDF in the list of serial number's columns. when I map the document header (GR PO), I am able to see the UDF of OPDN table but that does not happen for Serial number's mapping. any idea??? I am using 2005 B PL 44.
    thanks,
    Binita

    Hi Peter,
    thanks for the reply. I am using the third template viz SerialNumbers.xlt  only for updating UDFs in serial number's transaction table (OSRI). and all the default fields appear in the list while mapping which are there in the template. also the UDF column which I have added in the template does appear in the list on the left side (source fields)   but it does not appear on the right side (Target fields). so I have nothing to map it against.
    any idea?
    thanks,
    Binita

  • Udf to count the number of occurances

    Hello All
    I am trying to write an UDF which can count the number of occurances of charecter ' in a string and fives the result as number of occurances - 3 . For example if the char ' is present 20 times in a string , I want the result to be 17.
    Could you help me in creating this UDF please, I am a beginner to Java.
    Thank you

    Hi Sreeni ,
    I tried you code , but it has some compilation errors ,
    The cod ei used is
      //write your code here
    int count = 0;
    String str;
    for(int i=0; i=input.strlength();i++)
    if (input = '\'')
    count = count + 1;
    count = count - 3;
    str = integer.toString(count);
    return str;
    Just as you suggested ,
    for it I got these errors
    incompatible types
    found : int required: boolean
    for(int i=0; i=input.str.length();i++)
    cannot resolve symbol
    symbol : variable str
    location: class java.lang.String
    for(int i=0; i=input.str.length();i++)
    incompatible types
    found : java.lang.String
    required: boolean if (input = '\'')
    cannot resolve symbol
    symbol : variable integer
    location: class com.sap.xi.tf._MMPOFileToPayload_
    str = integer.toString(count);
    cheers

Maybe you are looking for