Making Custom Idoc Script function

Hi all,
I am making a custom Idoc Script function. I have merged the resource
table into the core IdocScriptExtensions table. But i am not able to call the custom function in SiteStudio. Find below the steps that i have taken
step1) I have added a resource (Static Table) in my component which merges to "IdocScriptExtensions" fucntion.
Step2) I have already created the java class.
Step3) Edited <td>Myname</td><td>Myclass</td><td>MyloadOrder</td> in the resource with corresponding values.
Step4) From component settings added the custom classes.
Step5) made a build of the component.
Step6) Installed the component in my server.
now when i go to SS Designer and call this function then no response is generated.
This component will return me a boolean by quering DB. I have number of sysouts and traces but none of them is printed on the console. Can somebody please provide insited into what probably might be amiss here.
ANY pointers will be hightly appriciated. waiting for a quick response.
reagrds,
sapan

Hi Sapan,
For the most part your steps look correct. Personally I would probably do the following:
1. move your component's classes folder back inside the component
2. register the folder in the component
3. add the folder to the class path
4. in the component's hda file, check to make sure there the merge rule is set for your IdocScriptExtensions entry.
if all of those are correct, occasionally the content server can be tempermental when new classes are added and so I would try disabling the component, restarting, then enabling and restarting.
If everything is compiled, it has to be either a classpath issue or an issue merging your IdocScriptExtensions table.
Also, if you go to Administration>Configuration Info, expand enabled components and find yours, it will tell your the classpath registered for your component(though your code is in the content server classes folder).
Sounds like you are really close though...did you get the debugger working?
David

Similar Messages

  • Creating a custom IDoc inbound function module

    I have created a custom idoc.I wanted to create a custom IDoc inbound function module, this Function module will provide to launch a BAPI .Tell me how to "create" inbound function module for the custom idoc ?

    Goto any standard for the Paramtetres
    *"  IMPORTING
    *"     REFERENCE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"     REFERENCE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     REFERENCE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"     REFERENCE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"     REFERENCE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     REFERENCE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"     REFERENCE(DOCUMENT_NUMBER) LIKE  VBAK-VBELN
    *"  TABLES
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"      EDI_TEXT STRUCTURE  EDIORDTXT1 OPTIONAL
    *"      EDI_TEXT_LINES STRUCTURE  EDIORDTXT2 OPTIONAL
    Do the below configs.
    1.Recognise the funcmod as Inbound -BD51
    2.Register the Function  module in WE57 .
    3.we42 Process code .
    4. WE20 -PARTNER Profile
    I hope it resolves ur Query.
    Rgds
    Sree M

  • Idoc script function to count string

    Hi,
    Does anyone know if there is any build in function in idoc script to count the number of string.
    For example:
    A, B, C, D, E
    I want to count how many comma's are there using idoc script. If there is no build in function, what would be the best approach to achieve this.
    Many thanks.

    There is no built in function, but I would simply do this:
    <$rsMakeFromString("MyStringRS", "A, B, C, D, E")$>
    <$numCommas = MyStringRS.#numRows - 1$>
    Good Luck, and please award points as you see fit.

  • Sample Custom idoc inbound function module

    Hi Friends
    I am receiving Inbound Idoc ,I Need to save the IDOC data into  ZTable
    Plz ..Can any one give me Sample idoc inbound FM to Config the  WE20(partner profile)
    Regards
    Ram

    HI Rama,
    I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
        CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
        TABLES
          idoc_control_rec_40 = gt_edidc
          idoc_data_rec_40    = gt_edidd.
      IF sy-subrc NE 0.
    *    MESSAGE e000 WITH text-003.
    *  ELSE.
    *    MESSAGE i000 WITH text-004  .
      ENDIF.
    just prepare edidc and edidd record in and pass it to the FM..
    Hope this will work for you...
    Thanks

  • Idoc scripting in workflow tokens

    Greetings,
    A question for developers: up to what extent of Idoc Script calls can be made inside Workflow tokens? Only the function wfAddUser or other Idoc Script functions as well?
    I'm trying to develop a dynamic workflow component that involves reading possible user, alias or ad-hoc metadata values from a database table using a custom Idoc Script function, into a token. So basicly, something like this:
    <$wfAddUser(customIdocScriptFunctionToFetchUsers(dDocType),"user")$>
    Is anything like this possible at all? Tests done so far result in the content item entering and exiting the workflow automatically due to probably being unable to load the users, the strange thing is that no erros are being output, not even in the content server output with "workflow" or "idocscript" sections being traced...
    The point of this mechanism is to avoid having to create large ammounts of (hidden) metadata to serve as support to store users/alias to be loaded into workflow steps as tokens. Feel free to suggest any other alternatives tho :p
    Thanks in advance,
    - Tiago Vidigal

    Hey Tiago,
    Typically you try to limit your token script to just wfAddUser. It is possible to use basically any idoc script in a token but any failure at all will result in the behavior you are seeing with the item skipping straight through the step.
    Using your current design here is what I would do:
    -In the entry script for that step make your call via the custom script function
    -Store the result of the lookup into a workflow variable: <$wfSet("usersForStep", getCustomUsers(dDocType))$>
    -do your wfAddUser in the token: <$wfAddUser(wfGet("usersForStep"), "user")$>
    -Sidenote: You can add multiple users at once in one wfAddUser call if you pass a comma delimited string of the usernames
    Reason this works: the Entry script is always evaluated before a token when entering a step, meaning you can put any complex logic there where it is easier to debug and keep your token code clean.
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw >
    Edited by: Andy Weaver on May 18, 2009 10:55 AM
    (Fixed one of my code snippets)

  • Custom calculation script for a lease (please help)

    I have so little experience with this it isn't funny.  I prior to now have never used javascript.  But Im trying to get my lease form to auto calculate a tenants pro-rate that would be due if they moved in on the middle of the month for example.
    I created the below script and im sure there is a few things or more than a few things wrong with it...can anyone give me some pointers.
    // Custom Calculate script
    (function () {
        // Get the input field values, as strings
        var leasemonth = getField("LeaseBegMonth").valueAsString;
        var leasestartday = getField("LeaseBegDay").valueAsString;   
        var rentamount = getField("MonthlyRent").valueAsString;
        // calculate how many days in the month
        if ( leasemonth=1
                var leasedays = 31
        elseif (leasemonth=2
                var leasedays = 28
        elseif (leasemonth=3
                var leasedays = 31
        elseif (leasemonth=4
                var leasedays = 30
        elseif (leasemonth=5
                var leasedays = 31
        elseif (leasemonth=6
                var leasedays = 30
        elseif (leasemonth=6
                var leasedays = 30
        elseif (leasemonth=7
                var leasedays = 31
        elseif (leasemonth=8
                var leasedays = 31
        elseif (leasemonth=9
                var leasedays = 30
        elseif (leasemonth=10
                var leasedays = 31
        elseif (leasemonth=11
                var leasedays = 30
        elseif (leasemonth=12
                var leasedays = 31
        //CALCULATE HOW MANY DAYS REMAIN
        var daysremain = LeaseBegDay-leasedays   
        //CALCULATE THE PRORATE AND DISPLAY IT
        event.value = (rentamount/leasedays)* daysremain
    Thanks for your help!!

    Thank you thank you thank you!  Here is the revised script with the changes.  about to go plug it in and see if it works.
    // Custom Calculate script
    (function () {
        // Get the input field values
       var leasemonth = Number(this.getField("LeaseBegMonth").valueAsString);
       var leasestartday = Number(this.getField("LeaseBegDay").valueAsString);   
       var rentamount = Number(this.getField("MonthlyRent").valueAsString);
       var leasedays = 0
        // calculate how many days in the month
    if ( leasemonth==1)
           leasedays = 31;
    else if (leasemonth==2)
           leasedays = 28;
    else if ( leasemonth==3)
           leasedays = 31;
    else if (leasemonth==4)
           leasedays = 30;
    else if ( leasemonth==5)
           leasedays = 31;
    else if (leasemonth==6)
           leasedays = 30;
    else if ( leasemonth==7)
           leasedays = 31;
    else if (leasemonth==8)
           leasedays = 31;
    else if ( leasemonth==9)
           leasedays = 30;
    else if (leasemonth==10)
           leasedays = 31;
    else if ( leasemonth==11)
           leasedays = 30;
    else if (leasemonth==12)
           leasedays = 31;
        //CALCULATE HOW MANY DAYS REMAIN
        var daysremain = leasestartday-leasedays   
        //CALCULATE THE PRORATE AND DISPLAY IT
        event.value = (rentamount/leasedays)* daysremain

  • Calling GET_WORKFLOW_INFO_BYNAME service from idoc script

    Hi, i need to call service GET_WORKFLOW_INFO_BYNAME in custom idoc script on documents to determine if the document is in workflow. If it is there is no problem. But if it is not, calling if GET_WORKFLOW_INFO_BYNAME cause exception which is writen to server log.
    I don't want to write this exception to log because of log size.
    Is there any way how to suppress the exception or other method to find if the document is in workflow?
    Best regards

    Hi
    I guess you can check the status of the content to verify if a content is any WF or not . If the status is Review / Edit etc then it indicates the content to be part of a WF .
    Hope this helps .
    Thanks
    Srinath

  • IDOC script to get list of users in alias

    Hi ,
    In Workflow script, I want to check if dDocAuthor exists in some alias. IF exists then do some processing.
    I am not able to compare dDocAuthor with users in alias. Infact I could not find any IDOC script function that returns users in alias.
    Please help.
    thanks

    Check out my blog post on how to bypass workflow via idoc if the author is part of a specific alias (:

  • Is it possible to use extensive formulas (e.g. "if" or vlookup functions) in the "Custom Calculation Script"?

    I am working on a form fill PDF converted from MS excel. This is for others to use who don't have MS excel that need to use my spreadsheet.
    1. I would like to know how complex can the formulas be in the custom calculation script in the calculate tab under properties in a cell menu?
    2. Where can I find what formulas will work in the custom calculation script along with the format for those formulas to work correctly (tutorials would help)?
    I have tried writing an "if" function but received and error so I am assuming either functions don't work in the script or there is a different format than standard spreadsheet formats.
    Bruce

    In that case the for loop would be:
        for (var i = 0; i < 8; i += 1) {
            sum += +getField("Total." + i).value;
    So initially, the counter i is equal to zero, so the field name used with the getField method is:
    "Total." + 0, which results in the string "Total.0". With each iteration, the variable i is incremented by 1, so the subsequent field names are the following:
    "Total.1"
    "Total.2"
    "Total.3"
    "Total.4"
    "Total.5"
    "Total.6"
    "Total.7"
    The script gets the value of each field, converts it to a number, and adds the number it to the running sum.

  • How do I create an "if" function in a custom calculation script?

    I need to take a simple "value is the sum of" and make it so if one field is less than 1 then the result of the formula will equal "0".
    For example here is a simple "sum of" script:
    Incent Bns.26, Time Bns.26, Spec Bns.26.
    Now converted to a custom calculation script:
    event.value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    Where Time Bns is calculated by looking at another field Hours26 using a special formula to calculate the bonus.
    I would like to add something like an "if" function to the script so that if the Hours26 field is less than 1 then the output of the script will equal "0".
    I tried this already:
    var rank = this.getField("Hours26").value
    var value = 0
    if (rank < 1) {
      value = 0
    else  (rank > 0) {
       value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    event.value = value
    But get the error: SyntaxError : missing ; before statement 7 at line 8:
    Thanks ahead of time for any help.
    Bruce

    Try this:
    var rank = this.getField("Hours26").value;
    var value = 0;
    if (rank < 1) {
      value = 0;
    } else {
       value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    event.value = value;

  • IDOC script in custom element forms

    Hi,
    I am using Site Studio 10gr4.
    I was wondering if its possible to use IDOC script inside custom element forms. What I want to acheive is to display a combox box inside a custom element in a static list. The values inside the combobox are retreived from one of the views (created inside Configuration Manager in the content server).
    Your help will be appreciated.
    Many Thanks

    OK, I found the answer :).
    I checked in the custom element element form as an HTM. Chaning it to HCSP fixed the issue :).

  • Inbound function module for  custom IDOC

    HI,
    I have created custom IDOC.I need to create inbound function module for that custom IDOC.Can any one send me sample
    function module for custom IDOC.(what are all the import Export,tables  parameters and exceptions  that I need  to create for function module)
    Thanks&Regards
    Rama.Mekala

    HI Rama,
    I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
        CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
        TABLES
          idoc_control_rec_40 = gt_edidc
          idoc_data_rec_40    = gt_edidd.
      IF sy-subrc NE 0.
    *    MESSAGE e000 WITH text-003.
    *  ELSE.
    *    MESSAGE i000 WITH text-004  .
      ENDIF.
    just prepare edidc and edidd record in and pass it to the FM..
    Hope this will work for you...
    Thanks

  • Custom idoc [ related to function module]

    HI ALL,
    sorry for repeating the question
    i had an requirement to create a custom idoc for catsdb table with 4 fields
    1. pernr
    2. workdate
    3. lstar ......
    and to transfer it from one application server to another.i had created it n transfered it to another application server. now my problem is in receiver side the data in idoc is not posted into database of catsdb [ at receiver side].
    can any one give the code for Custom function module at receiver side so that when idoc is received [from sender] it must be updated to databse tables via this FM.
    its very urgent . help me ........................
    any suggestions are highly appreciated.
    with regards,
    Suresh Aluri.

    Hi Suresh,
    In the receiver system you have to :
    1. Create a process code and link with message type using WE42
    2. Create an inbound function module using SE37.
        For example: BAPI_IDOC_INPUT1
    3. Link function module with basic type and message type using WE57
    Regards,
    Hendy

  • FUNCTION MODULE RELATED TO CUSTOM IDOC

    HI ALL,
    i have an requirement to create a catsdb custom idoc with four fields
           1.Personnel Number
            2. Date
            3. Activity Type
            4. Counter
       I created a custom idoc and had successfully send to receiver. now that idoc should be updated into databse tables.  here my problem is how to create a function module which should take care of updating data into database table at receiver side and also when i checked using WE02 at receiver side its showing an error 'Function module not allowed: IDOC_INPUT_STATUS' . for creating a process code i used IDOC_INPUT_STATUS function module at receiver side.
    is there any fm that automatically takes data and updates into databse table ctasdb at receiver side or if u want to create a custom Fm how to do it.
    any help will be highly appreciated.
    with regards,
    Suresh.A

    Hi,
    So for creating a process code you used IDOC_INPUT_STATUS function module at receiver side. whats that?
    Process code is created using tcode: we42 isn't it?
    What did you do please tell me.
    Thanks
    Dan

  • How to Assign a function module for customized IDOC

    Hi,
           I have created a customized IDOC. Can any body explain how to assign a FM for customized IDOC? Is same IDOC can be used for both Outbound and Inbound Process? In WE41 and WE42 we have to give the outbound and inbound function module name. can we give same function module? Is process code is same for both outbound and inbound process?
          Valuable suggetions are appreciated.
    Regards,
    Ram

    Hi ,
    Here is the Procedure for the Inbound Idoc Funtion Module
    Function Module : SE37
    Message : WE81
    Assign message : WE82
    Assgin FM : we57
    Process Code : WE42.
    Assign Partner Profile - WE20,
    To test the Inbound IDOC.
    In WE19, Give the IDOC number & execute ... then put the cursor on the idoc control record . then click on the Standard Inbound push button on the application tool bar.it will show show all the details like partner no,type , message type , process code & function module name ...
    now put a break point in the function module .. & debug .
    if u r using customised inbound function module , then click on inbound function module .. there u will get a pop screen with FM name & debugging option in both background & foreground mode...
    Reward Points if it is Useful.
    Thanks,
    Manjunath MS

Maybe you are looking for

  • File Share Search problem with Compress file

    I have a content source in SharePoint 2013 search which crawl files from a file share. Some of the files have "Compress contents to save disk" attribute set to true.  These files are being crawled as I can see them in Crawl logs. But when I search fo

  • Moved library to external HD....how?

    Hello, My iTunes library is taking up more and more space on my Mac Mini's HD. So to help it breathe more easily, I got an external drive, copied my iTunes library from the Music folder of the Mini's HD and pasted it (all 35GB) to a folder on my exte

  • Substr function not working in coldfusion sql

    Hi all, I am using coldfusion 7.0.2 with oracle 10g. I've the following simple query select substr(colname,1,3) from tablename this query works fine if i run it using TOAD or SQLPLUS but when i run this query in coldfusion script i get the following

  • Mail links do not open in Safari automatically

    Problem started today, when I click on a link in an email, the link does not open in Safari, repaired disk permissions, restarted mail and safari, Safari is the default browser, restarted MacBook Pro a few times, not working. Any ideas? Cowboy Bill

  • No icon for iPod touch.

    Ok, so I used to have an iPod nano that when I would plug it into my Mac, an icon would show up and when I wanted to eject it I would drag the icon down to the trash can. Now, with the iPod touch, nothing shows up. Did I do something wrong or does th