Template inclusion/Javascript issue for doc header's custom fields

Hi all gurus,
premise: I'm absolutely a newbie about templates and Jscript.
I'm facing a strange behaviour for a field and I'd like to get your help on it, I'm running out of ideas.
I modified a custom field, a checkbox, which automatically makes a second custom field active and editable.
The logic is really simple: if the checkbox ( ZZ0LEGGE ) is checked, then the second field ( ZZ0DESCR ) is editable.
This is managed in the template by using a Jscript function that is triggered by the event OnClick related to the checkbox.
These two field are part of a template, say T1, which is used as an include in a pair of "main", custom templates, say T2 (additional header custom data) and T3 (document variant). These two screens are custom on an old SRM3 system.
When working on the additional header custom data (Template T2), both buttons work fine; each time the checkbox is checked/unchecked, the screen is updated and the second field turns into active/not active as consequence.
Working instead on the document variant screen (Template T3) leads to a wrong behaviour.
Checking/unchecking the checkbox doesn't refresh the screen accordingly to the selection, but loads the T2 template.
Guess there's something missing on the Javascript fuction associated with the checkbox in T1, because it will always trigger a refresh of T2, no matter the template in which it is included.
Here are the templates:
Template T1: [SAPLBBP_PDH_CUF 100 |http://pastebin.com/U39i5j7N]
Template T2: [SAPLBBP_CTR_UI_ITS 9001|http://pastebin.com/3AhKRjt7]
Template T3: [SAPLBBP_CTR_UI_ITS 9003|http://pastebin.com/4ZHtjz0r]
The checkbox field in T1 is called ZZ0LEGGE; the "controlled" field is instead ZZ0DESC.
Waiting for your help... thanks once again

Ok I found an interesting starting point to focus on... I changed the simple fuction associated to the event onClick(), triggered when the checkbox is set/unset, simply using the parameters for TargetOkCode used in Template 3:
function zOkRefresh(){
        TargetSetOkCode('`PB_OKCH.okcode`','','`bbpformname`'); //new (works for T3)
//        TargetSetOkCode('=ZCTR_CUST1','','BBPForm');                //old one (worked for T2)
and now the checkbox works properly in Template 3 but - obviously - stops working in Template 2.
So it seems that zOkRefresh should dynamically decide which parameters must be used, depending on the "upper" template:
- if the template that includes T1 is T2, then call TargetSetOkCode('=ZCTR_CUST1','','BBPForm'); if T1 is used in T3, then call TargetSetOkCode('`PB_OKCH.okcode`','','BBPForm').
Since I'm not able to write down the script described above, can anyone help me putting that IF statement in script code? How to determine what's the "including" template in Javascript?
Thanks again!

Similar Messages

  • Got multiple values for non null local custom field

    Hi,
    I get the following error message while saving a MPP from Project Professional to MS Project Server:
    Got multiple values for non null local custom field.
    I checked the MPP and found that there are fields with same alias as Enterprise field names. However, these fields are at a Task level, whereas the Enterprise fields are at a Project Level.
    I would like to know why this is happening and the resolution for this issue. I don't want to delete the local fields.
    Any help in this regard will be appreciated.

    Then try to find any inconsistencies in the project plans with the issues, like required values not entered. Also try to save the plan as XML format and save it back as an mpp file to see if it helps (be aware that any formatting will be lost).
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • BADI or User exit  for FB50 to update custom field in table COEP

    Hi all,
    i have added one custom field in table COEP through include CI_COBL .
    when i do posting through sales order(VA02) or purchase order(ME22n) that custom fields in COEP get updated with controlling document
    and through BADI AC_DOCUMENT i m updating that custom field in COEP.
    but when i do manual posting through FB50 controlling document is generated in COEP but i m not able to update that custom field
    because in this case BADI AC_DOCUMENT  is not get triggered.
    is there any BADI or User exit or enhancement spot for FB50 through which i can update that custom field in table COEP

    Hi Sandy,
    Thanks for u r reply,
    RFAVIS01 is not getting triggered through FB50
    and F180A001 ( EXIT_SAPLF048_001) is getting triggered but it doesnt contain COEP field in its parameter
    import - F180A_DOC_HEAD_TAB
                 F180A_DOC_ITEM_TAB
    changing - RELATION_TAB

  • Use of warehouse for 'as of' balance custom fields

    we captured custom fields on each account/contact for current balance, current deposits, current trade volume
    we are updating these fields daily based on the transactional system integration
    how/will i be able to report on the day over day #'s or month over month given the built in warehouse -
    client wants a report to track the historical progression of these balances. Do we need to capture any additional fields?
    I thought this was a better approach then capturing the individual transactions (e.g. deposits, withdrawals, trades) as
    custom objects. Please would someone confirm?
    Edited by: user8903936 on Dec 8, 2010 11:01 AM

    Hi,
    my Ora-Trigger-Solution works well on R/3 development system.
    On quality assurance system it dumps with ORA-04098.
    It looks like, that required object privileges have been never granted.
    Do someone know, what priviliges or authorisations have to be maintained and where to maintain this?
    Thanks and regards,
    Wolfgang

  • How to implement Change pointers for Purchase order - ME22N - Custom Fields

    Hi Experts,
    Can you please tell me how to implement - Change Pointer for Custom fields in IDOC.
    I am working on IDOC - For purchase order - acknowledgements - in custom screen/tab in ME22N.
    Everything is working fine according to my requirement.
    All i need to know is the process of - Creating/Change - Change pointers for Custom fields.
    1.How to implement change pointers for custom fields.
    2.Can we maintain - Change Document - for custom fields at data element level?
    P.S. - I have browsed many previous - forums before posting a new discussion.
    please share your inputs...
    explaining how to create/implement - change pointers for custom fields will help me .
    Regards,
    Karthik Rali.

    Hi,
    To maintain Change Document for custom field:
    1. Check if "Change document" checkbox is set in data element.
    2. Find Change Document Object for transaction.
       You can use SQL trace - ST05.
       Look there for line with table CDHDR and statement insert values
       (for example for transaction KA02 Change Document Object is KSTAR)
    3. Regenerate update program for this Change Document Object in transaction SCDO
    Change documents for z-fields schould be generated.
    I am not sure about change pointers but they are configured somehow in BD61 and BD50.

  • For  Jeroen Widdersh reagrding custom field addition .

    Jeroen
    It seems you have added custom field in standard SAP screen.Can you tell me how did you do that.?

    Hi,
    You can use the function group SAPLZQQM to create a new tab/screen for IW21/22. But to create the screen you need to do some configurations in SPRO. After doing the configuration you can see the screen in this function group. Proceed accordingly.
    Let me know if you need more help and reward if useful.
    Thanks,
    Anil.

  • Javascript issue for fragment in jspx page cannot find regionId

    I am using Jdev 11.1.1.4.0
    When i am calling the javascript function its not able to find the region thus my component is not found in the jsff page.
    Please help !!!
    Below is my jspx page :-
    <f:view>
        <af:document id="d1" title="Home Page" partialTriggers="pt1">
             <af:resource type="css" source="/com/ge/vacancy/css/GECustomStyle.css"/>
          <af:form id="f1">
            <af:pageTemplate viewId="/com/ge/vacancy/pageTemplate/GEVacancyPageTemplate.jspx"
                             value="#{bindings.pageTemplateBinding}" id="pt1">
              <f:facet name="Content">
                <af:region value="#{bindings.defaultflow1.regionModel}" id="r1" clientComponent="true"/>
              </f:facet>
    </af:form>
           <af:group id="g1">
    <![CDATA[
            <script>
        function charChecker(evt){
    region=AdfPage.PAGE.findComponentByAbsoluteId("r1");
                        if(region!=null)
                    counter             = region.findComponent("ot17");
                    counter_value       = counter.getValue();
                      }else {
    alert('Region not found')
      </script>]]>
          </af:group>
        </af:document>
    </f:view>
    In my frgment jsff page i have the following :
    <af:inputText id="it2" rows="08" maximumLength="500"
                                      value="#{bindings.Role.inputValue}"
                                      autoSubmit="true" immediate="true"
                                      partialTriggers="::gli11:soc15" columns="175"
                                      clientComponent="true"
                                      valueChangeListener="#{pageFlowScope.JobDescriptionBean.roleVC}"
                                      binding="#{pageFlowScope.JobDescriptionBean.roleInputText}">
                                      <af:clientListener method="charChecker" type="keyDown"/>
    </af:inputText>
    <af:spacer id="sp22" width="2"/>
                          <af:outputText id="ot17" clientComponent="true"
                                                                              value="500"/>

    Hi,
    Why not use findComponent as in below.
    findComp=function(event){
    var source=event.getSource();
    var component=source.findComponent("componentId");
    For this to work the component ot19 which i am assuming is a outputtext has to have value of clientComponent set to true.  Here event will automatically be passed if invoking the component via a clientlistener.
    Use findComponentByAbsoluteId only if you know the absolute id of the component. To be sure of the absolute id bind the component to a managed bean and then invoke the javascript as in the example shown below.
    public String someAction() {
          FacesContext context = FacesContext.getCurrentInstance();
          ExtendedRenderKitService erks =
          Service.getRenderKitService(context, ExtendedRenderKitService.class);
          erks.addScript(context,"someJSAction('"+textBinding.getClientId(context) +"')");
          return null;
    ADF JS
    someJSAction=function(clientId){
    var component= AdfPage.PAGE.findComponentByAbsoluteId(clientId);

  • Javascript issues for a PDF form

    Hi everyone,
    I hope someone can help me, i posted a few days ago but managed to find a script somewhere online to do half of what i needed.
    //-----------------Do not edit the XML tags--------------------
    //<Document-Level>
    //<ACRO_source>Numbering</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: Document-Level:Numbering ***********/
    var f = this.getField("Tracking Number");
    if (f.value=="") f.value = "0001001";
    else f.value = util.printf("%04d", (Number(f.value)+1));
    //</ACRO_script>
    //</Document-Level>
    Problem I have now is that it will only update the Tracking Number field (field is after the A) when i save the original document, not when i save as a copy. This will be accessed by multiple people and what i want is the number to update each time it is saved as a copy (so there will never be two documents with the same number, VERY IMPORTANT). This document is essentially a digital carbon copy form then sales reps use.
    I was also hoping there can be a script written to update the file name with the tracking number, so it rules out human error - the script will Save a copy, in a designated folder, with a set file name (Booking_form_#customername_#trackingnumber.pdf)
    Am i just hoping for too much?

    Regarding the server, I was referring to setting up a web server with a script that the form could sumit a request to whenever it needed an new number, not a file server where the PDF resides. The server would check a database and reserve a new number and return it to the form for use. This would require some server programming, but it's the best way to do it. The problem is it won't work with Adobe Reader on mobile devices.
    This type of thing is indeed a common thing to want, but it's hard to do from within the document itself since there's no way of knowing what other users are doing. With a physical book or invoice pad, it's not possible to use a number more than once like it is with a multi-user e-form that's not controlled by a server.

  • Customize bapi for sales orders with customer fields

    The situation is a following.
    Customer has added a structure on table VBAP. They used Append but without include.
    Now I have to make a BAPI that will be able to write on those fields. I have used several posts and documentation, but with on change : Instead of passing on BAPE_VBAP, BAPE_VBAPX, etc the original structure, i pass another that is an exact copy.
    Could this be the source of the fact that i Dont write anything? The return struct contains tthese :
    ORDER_HEADER_IN has been processed successfully
    return..:                                     
    ITEM_IN has been processed successfully       
    return..:                                     
    But nothing is shown on vbap

    thanks for the reply, but this is something I knew. My problem was whether the structure added to those BAPE_* has to be exaxtly the structure appended to VBAP, or just an identical structure (eg if I appended VBAPEXT to VBAP, should I append VBAPEXT to BAPE_*, or could I use VBAPEXT_copy, which is exactly the same with different name)?
    Anyway, we solved the problem and it seems that we can use an identical structure with same name.

  • Need to populate text/ref fields for docs generated by allocation cycles

    When executing distribution or assessment cycles the doc header text, reference field and line item text are all left blank in the generated accounting document.  We would like to populate these fields with some reference to the cycle or segment names.  Is there any doc type or cycle setting or standard config that would allow us to populate these fields without the use of an exit?  Thank you in advance.

    Hi
    Goto GGB1 TCode
    under Cost Accounting you can find three allocation areas
    Find out right one and create new substitution rule to update text or ref
    Reg
    Vishnu

  • Need help with BBP_CUF_BADI - Adding your own screens for custom fields.

    We are on SRM 5.0 and we need your help to add the custom fields to a separate screen.
    All the item level custom fields are visible in Item Details screen under Basic Data and Header level custom fields are visible under Additional Specifications. Instead we like to add a new Tree as Custom fields just like Basic data or Cost Assignment in item details screen.
    The documentation for the BADI BBP_CUF_BADI does not say how to include a new tree structure. I did everything mentioned in the BADI like creating a screen and two funciton modules and generating the template. But it does not work. Any help is greatly appreciated.
    I went through other threads on this forum. So please do not waste your time pointing me to the old threads.
    Please provide sample code if possible.
    Thanks
    KM

    It seems that you are looking for exact solution but many a times you get pointers on this forum which lead you in correct direction.
    I have heard from one project site that they are able to fulfill the requirement via creating a webdynpro and linking the same to user role.
    if this doesn't help, just ignore.
    BR
    Dinesh

  • Customer fields do not display in Define Field Groups for Cust. Fields IMG

    I am customizing to display cusotmer fields in cporjects IMG actviity 'Define Field Groups for Customer Fields'.
    I am able to see the main tab in object category and multiple sub tabs in it. However customer fields that have been added by Enhance database tables in DPO are not shown or visible in the sub tabs.
    Am I missing any config? Please let me know.
    Senthil

    Hi Senthil,
    If you can see the tabs and not the fields, pl check if you have covered field control for these newly created custom fields.
    To have field control for these fields, you will have to copy the standard SAP provided field control, include the structure that has you custom fields and give it authorizations etc as per your requirement.
    Pl read carefully the documentation provided with field control.
    Refer note 947963 - Setting up field control
    Regards,
    Reema.

  • XD01 Custom screen for custom fields,need to update tables kna1,knvv

    Hi all,
             I have designed a custim screen for XD01 with four custom fields five from kna1 other one from knvv table.  i need to update the respective tables with these fields in badi GET_DATA of method IF_EX_CUSTOMER_ADD_DATA how to update the database table. Please help me in the same.

    see the help
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
    Regards
    Kiran Sure

  • Adding a custom field in a sap standard screen in pa30 for an infotype.

    Hi to all..
    i'm in a requirement to add a custom field in a standard screen of pa30. for the infotype 0442.
    I googled up.. but i was not getting proper solution for it.. can any one provide a solution for it..
    With regards.
    Aahbha.

    Hello Sirs,
    Step by step instructions on:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/4f/d52552575e11d189270000e8322f96/frameset.htm
    The below thread provide more info on how to create an infotype from scratch, but this is just for the reference:
    add custom fields to standard infotype
    Regards,
    Bentow.

  • Is doing configuration for FB60 using customer field a core mod?

    Hello,
    For our project, a customer field 'ZZAPPROVER' was added in FB60 transaction code.
    It is possible through configuration through the following path:-
    SPRO --> Financial Accounting (New) --> Financial Accounting Global Settings (New) --> Ledgers --> Fields --> Customer Fields --> Edit Coding Block --> Customer-Defined Account Assignments --> Customer Include Structure
    This basically added the customer field 'ZZAPPROVER' to the include structure CI_COBL.
    The important point to note here is that it adds to BSEG table too.
    Now the business is asking whether this is considered as a core modification to SAP.
    Can anyone update where it is a core mod or not, and if there is any documentation to prove this?
    Your comments are highly appreciated!
    Regards,
    Sanjiv Janardhanan

    Hi,
    The adding of additional Customer field is available from ECC 6.0 onwards. This is a standard functionlity to enable the customer to add their own fields for better reporting. But SAP cautions that it is better to take backup before doing this addtioin. No posting transactions shall be performed while you are including the customer field. SAP recommends using the u201Clightu201D mode. For this, you only need to make the following entries so that all necessary changes to the dictionary and to the tables are performed automatically in the background:
    ●      Collection (package)
    ●      Field name
    ●      Field description
    ●      Data type
    Character field (CHAR)
    Character field with digits only (NUMC)
    Trust this helps much!
    Cheers!

Maybe you are looking for

  • Is there a way to play two radios at once?

    I usually listen to music using the Songza, Pandora, or iHeart Radio app. Recently I started listening to a news talk radio through the iHeart Radio app. I want to continue listening to the news talk shows, but I'd like to listen to music in the back

  • RFC - Receber chamada do R/3 ao gravar VENDA

    Caros, Sou novato nas tecnologias SAP e estou em um projeto para desenvolvimento da integração "Payment Card Interface to R/3". Estamos desenvolvendo com o SAP Java Connector 3 e a princípio já tenho o meu JCOServer executando e conectado no sistema

  • Is there any API tracing available?

    We are using Netscape LDAP JDK to write app programs which interact with Directory Server (All vendors). Is there any standard way of turning JDK tracing ON? Any examples will be great. Chet

  • Movie Download Slow

    Check with the CNET speed check and I'm operating at 1.5M download. The system has been downloading OLD DOGS for the last 24 hours and is only a seventh of the way done. In parallel I downloaded to 1G movie rentals in 10 minutes each. Why HD - OLD DO

  • ANN: HTML5 Video Player Dreamweaver Extension Released!

    Hi All, Just wanted to let you know about the great HTML5 Video Player we just released at DMXzone! Meet the present and future of HTML5 Video - the HTML5 Video Player Dreamweaver extension! DMXzone's plug-in free, easy to use and fast  video player