Dynamically selecting template when submitting conc program in XML Reports

Hi Experts,
I am working on XML Publisher reports with EBS-R12 and database-10g.
I have two RTFs,(one for USA country and another for Japan) for my report. I created one data defintion, and two templates for same data defintion in XML Publisher responsibility.
When i submit the concurrent program, i can manually select the template from the available list. My requiremet is, based on input parameter(ORG ID), the template should be selected automatically.
Is there anyway template can be automatically selected based on condition when submitting concurrent program?
Waiting for your responses.
Thanks.

Look up FND_REQUEST package details.
Here's some sample code to get you started.
PROCEDURE submit_report (
               errbuf out VARCHAR2,
retcode out NUMBER ,
               i_conc_prog in varchar2,
               i_country in varchar2
          ) IS
lv_req_id number := 0;
xml_layout boolean;
lv_template_code varchar2(30);
lv_template_appl_code varchar2(30);
lv_output_format varchar2(30);
cursor c_output_format (p_conc_prog in varchar2, p_country)
is
.... Enter your select statement to get your template code and output type based on your criteria
BEGIN
     open c_output_format(i_conc_prog, i_country) ;
     fetch c_output_format into lv_template_appl_code, lv_template_code, lv_output_format ;
     close c_output_format ;
xml_layout := fnd_request.add_layout
     template_appl_name => lv_template_appl_code,
                    template_code => lv_template_cide,
                    template_language => lv_template_lang,
                    template_territory => lv_template_territory,
                    output_format => lv_output_format
IF (NOT xml_layout) THEN
fnd_file.put_line(fnd_file.log,'Unable to apply ' || lv_template_code || ' template');
ELSE
lv_req_id := fnd_request.submit_request
application => <>,
                    program => i_conc_prog ,
description => NULL,
          start_time => NULL,
          sub_request => FALSE,
                    argument1 => <>,
                    argument2 => <>,
                    argument3 => chr(0)
END IF;
IF lv_req_id <> 0 THEN
fnd_file.put_line(fnd_file.log,'Submitted '|| lv_req_id );
ELSE
fnd_file.put_line(fnd_file.log,'Error submitting request ');
END IF;
commit ;

Similar Messages

  • Unable to use the Copy function while submitting the program for XML output

    Hi
    when i submit the concurrent program with XML output type, getting the output..
    when i submit he concurrent program using the copy button not able to get the output,
    my observation
    while submitting the program the xml template is not called....
    Diagnostics--> view xml -- able to view the ouput.
    do let me know if any of the steps is missing while registration in the xml responsibility..
    this is only with the custom conc program.. the standard program is working fine...
    do help me out..
    Regards
    Yram

    It's really a little difficult to answer your question without a bit more information. What version of JDeveloper are you using? What's your technology stack?
    If this is JDeveloper 11+g+, with the Fusion technology stack, you can use a technique like the one described here:
    http://groundside.com/blog/GrantRonald.php?title=jdeveloper_11_business_services_cascadin&more=1&c=1&tb=1&pb=1
    If it's JDeveloper 10.1.3, with the default Web technology stack, look here:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#62
    If, as it looks like, this is really a question about generic JSPs (no JSF), you might actually have a bit more success on a generic JSP forum--using scriptlets hasn't really been best practices within JDev since...well, since JSTL became available, really. That was a number of years ago.
    Like I said, there's really no direct way to use Javascript output in a scriptlet--unless you mean something like storing Javascript output in a hidden field, and using the value in a scriptlet on the next request. But by the time Javascript runs, any scriptlet from the current request will already have executed.

  • Dynamically selecting Templates:

    When we submit Invoice printing concurrent program, we select templates for
    different countries.How to make it defaulting like without manual intervention
    we want the template to be selected automatically.
    For eg, if we choose invoice no 3001 and it is US invoice then US Template
    should be selected automatically.
    Simlarly, if we select some other invoice number like 1001 and it belongs to singapore then SINGAPORE Template should be selected dynamically(automatically without human intervention).How to achieve this?
    I appreciate your immediate help.We are approaching deadlines here.
    Thanks
    Prasanna

    Hi
    As far as i know ,and i achieved this as well.You can try following,it works.
    You have to write seperate PL/SQL or Java Concurrent Program. User will submit this Program rather than directly RDF report.
    This Program ultimately fire your RDF report.
    You have to place following code before Report Trigger of RDF.
    IF ( Country = 'SINGAPORE') THEN
    l_result:=fnd_request.add_layout (
    template_appl_name => 'SQLAP',
    template_code => 'Singapore_TEMPLATE_NAME',
    template_language => 'en',
    template_territory => '00',
    output_format => 'PDF');
    els if ( Country = 'USA') THEN
    l_result:=fnd_request.add_layout (
    template_appl_name => 'SQLAP',
    template_code => 'USA_TEMPLATE_NAME',
    template_language => 'en',
    template_territory => '00',
    output_format => 'PDF');
    END IF;
    l_req_id := fnd_request.submit_request(
    application => 'SQLAP'
    ,program => 'ACTUAL_RDF_REPORT_Program_Short_name'
    ,description => 'Format Payments (Evergreen, Laser)'
    ,start_time => TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MI:SS')
    ,argument1 => payment_batch);
    Thanks
    Darshan

  • How to use dynamic selection screen inputs in main program

    hi all,
      its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program.
    regards,
    vara..

    Hi,
    i think u have created that dynamic selection screen in seperate program and calling to ur main program.instead of that u just create that synamic selection screen program as include program and include it in ur main program.
    or u need to use set/get parameter id concept.
    rgds,
    bharat.

  • Date format when submitting concurrent program

    I am getting some odd behavior off of a new PC build when trying to submit a concurrent program. This occurs only on this PC. CPs using the PER_DATES_STANDARD value set will no longer accept the Oracle standard of '01-AUG-2011'. The following message displays:
    Please enter date value 01-AUG-2011 in correct format: MM/DD/RRRR
    I have looked at the 'Preferences' link in the Self Service area and also all of the 'DATE' profiles within Applications and I cannot find anything that would cause this. I even tried forcing a format for my user profile without success. Can anyone tell me where to change this format?
    We are using Apps version 11.5.10.2.

    scott_h wrote:
    Scott,
    Please see these docs.
    IE8 AND R12 SECURITY SETTING REQUIREMENT ON CROSS SITE SCRIPTING (XSS) [ID 1069497.1]
    Date Fields in Forms render like dd#mm#yyyy When Using Internet Explorer 8 [ID 1061707.1]
    Thanks,
    HusseinThanks to both of you for looking at this with me, here is what we found: the date format was dependent on how we logged into the Applications session. When logging in directly to the forms server bypassing the self-service page login, the date format within Applications was based on the OS format. When logging in through the self-service page, it was using the format specified in the Preferences link of the page. This is new behavior after our recent move to a secure https URL. Not sure why but we know the issue. I will look at those docs to see if they relate. Thanks again.This makes little sense - if this issue was linked to settings in Preferences, then the issue should be able to be replicated from any PC, not just a specific one.
    HTH
    Srini

  • Getting warning while running concurrent program for XML report

    HI,
    Am trying to run a xml-publisher report by converting a D2k report and am getting the following warning message and not getting the out put.
    Receivables: Version : 11.5.0 - Development
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XX_EMPLOYEES module: XX_EMPLOYEES
    Current system time is 04-DEC-2007 12:25:37
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    APPLLCSP Environment Variable set to :
    XML_REPORTS_XENVIRONMENT is :
    /dplay/applmgr/product/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    XENVIRONMENT is set to /dplay/applmgr/product/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    AMERICAN_AMERICA.UTF8
    Report Builder: Release 6.0.8.25.0 - Production on Tue Dec 4 12:25:38 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 2057165 on node CRMAP102.ASHOKLEYLAND.COM at 04-DEC-2007 12:25:42.
    Post-processing of request 2057165 failed at 04-DEC-2007 12:27:43 with the error message:
    The Output Post-processor is running but has not picked up this request.
    No further attempts will be made to post-process this request, and the request will be marked
    with Warning status.
    Setting the profile option Concurrent: OPP Response Timeout to a higher value may be necessary.
    ------------- 2) PRINT   -------------
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 04-DEC-2007 12:27:43
    pls help
    Thanks

    Hi
    pls see this post
    OPP Timing out
    Thanks
    Rahul

  • Selection screen when regarding from other program

    Hi all
    i am passing one input to selection screen of zreport from my module pool program.
    I have to enter another input at the selection screen as one input is retrieved from module pool.
    my problem,
    the user can still change the input that has been retrieved from module pool which i don't want to change.
    You can say that to remove that field from selection screen but the problem is that sometimes the zreport is run directly in that case the user
    has to enter two input fields in selection screen.
    Is there a way that when i come to zreport from module pool the field for which i am bringing value from module pool can be greyed out.
    pls let me know the solution.
    Thanks

    Sure,  all you need to do is set up a selection-screen flag,  then you can set this flag when SUBMITing the program,  then check this flag and then turn the field to output only.  HEre is what I mean.
    report zrich_0001.
    parameters: p_fld1(10) type c,
                p_fld2(10) type c.
    parameters: p_flg type c no-display.
    at selection-screen.
      if p_flg = 'X'.
         loop at screen.
            if screen-name = 'P_FLD2'.
               screen-input = '0'.
               modify screen.
            endif.
        endloop.
      endif.
    See here that P_FLG is the flag which is NO-DISPLAY,  when it is "X", we will deactivate the P_FLD2.  So when you submit it,  set the flag.
      submit zrich_0001 via selection-screen
                with p_fld1 = 'Value1'
                with p_fld2 = 'Value2'
                with p_flg  = 'X'.
    Regards,
    Rich Heilman

  • Passing values to a dynamic selection screen via a report

    Hi,
    I have the following problem and need to seek your expertise urgently.
    In my program, I need to call another report by passing in parameters to the selection screen of other report. However, I could not pass values into a dynamic selection screen. I tried to use submit (report) with free selection but do not know how it works.
    Currently, I tried calling the function RS_REFRESH_FROM_DYNAMICAL_SEL and FREE_SELECTIONS_RANGE_2_EX. Using the object the first function has returned to me, I tried to append values such as fieldname etc to it. However, I realised the field names of a dynamic selection screen keeps changing. So I would not know how to pass a particular value to a selection field.
    Appreciate any help given.
    Thanks,
    CK

    Hello CK,
    Are you using logical database in your selection screen program attributes? If it is, look at include file DBxxxSEL for parameter named xxxDYNSE where xxx = logical database. Debug the program that has that dynamic selection, and look at field xxxDYNSE. This should give you a hint on how to populate the parameter when you submit the program.

  • RFDOPR10 dynamic selection to add customer group field

    Hello,
    I am trying to add the customer group field in the dynamic selection
    option, when running the RFDOPR10 report. I don't seem to find the
    option to add the customer group field (KNVV-KDGRP). I tried looking in
    the config, but was not able find this report. I also looked for any
    OSS notes, but didn't find anything either.
    Can anyone please tell me if this possible to do? Thanks.
    Ahsan

    you have to update all the following routines in program RM07MLBD which load stock
    IF      BWBST = 'X'.
    *   select the valuated stocks
        PERFORM                  AKTUELLE_BST_BWBST.
      ELSEIF LGBST = 'X'.
    *   all own stock from storage locations or batches
        IF XCHAR = ' '.
          PERFORM                AKTUELLE_BST_LGBST_MARD.
        ELSEIF  XCHAR = 'X'.
          PERFORM                AKTUELLE_BST_LGBST_XCHAR.
        ENDIF.
      ELSEIF   SBBST = 'X'.
    *    special stocks
        CASE    SOBKZ.
          WHEN  'O'.
            PERFORM              AKTUELLE_BST_SBBST_O.
          WHEN  'V' OR  'W'.
            PERFORM              AKTUELLE_BST_SBBST_V_W.
          WHEN  'K' OR  'M'.
            PERFORM              AKTUELLE_BST_SBBST_K_M.
          WHEN  'Q'.
            PERFORM              AKTUELLE_BST_SBBST_Q.
          WHEN  'E'.
            PERFORM              AKTUELLE_BST_SBBST_E.
          WHEN  OTHERS.
    *       Angegebener Sonderbestand nicht vorhanden.
            MESSAGE S290.
            PERFORM              ANFORDERUNGSBILD.
        ENDCASE.
      ENDIF.
    But as material group is in MARA, you could fill a table from MARA using the SELECT-OPTIONS FOR MARA-MAKTL, then update the routine using a FOR ALL ENTRIES OF the result table (if not empty) (you could also use a JOIN with MARA)
    Regards

  • Dynamic Selections for the F.42 report

    Hii Experts,
    I want to add a field called Business Place(BUPLA) in dynamic Selection in tcode F.42.
    So, in F.42 KDF Logical Database is used, so i make a Custom Selection view for KDF database.
    Business place is successfully added in Dynamic Selection, but it doesn`t reflect when i execute F.42.
    When i test from SE36, it reflects.
    Nitin Garg

    Note 50370 explains in full detail how the system works for selecting the documents with dynamic selection.
    Balance report reads the transaction figures which are stored with the help of several different fields, so the selection according to further fields cannot be proceed. This is standard design.
    The dynamic selection for Document Data does not work for reports which use customer / vendor transaction tables (KNC1 LFC1),i.e., document data like doc.number and Doc.date is not stored in transaction tables.
    Dynamic selections can only be used with customer / vendor, company code
    or fiscal year fields.  The following reports are affected by this
    program design.
    S_ALR_87012186 - Customer sales
    S_ALR_87012082 - Vendor Balances in Local Currency
    S_ALR_87012093 - Vendor Business
    S_ALR_87012079 - Transaction Figures: Account Balance
    S_ALR_87012080 - Transaction Figures: Special Sales
    S_ALR_87012081 - Transaction Figures: Sales
    S_ALR_87012105 - List of Down Payments open at Key Date - Vendors
    S_ALR_87012172 - Customer balances in local currency
    RFKSLD00       - F.42
    RFDSLD00       - F.23
    Hope this clarifies.
    Kind Regards
    Soumya

  • Problems creating dynamic selection screen

    Hi all,
    i'm trying to dynamically generate a selection screen and show it as subscreen using the two function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. I call the function modules in the PBO of the therefor defined subscreen. The FREE_SELECTIONS_DIALOG fm has the two import parameter "as_subscreen" and "as_window". If i use the "as_window" parameter the selection screen comes up as popup. If i use the "as_subscreen" parameter, i can't see anything in my defined subscreen.
    Any suggestions ?
    Thanks in Advance
    Dirk

    Hi,
    The above requirement is not possible without using logical database.
    The reason is that the compiler identifies the below syntax only inside a LDB program .
    SELECTION-SCREEN DYNAMIC SELECTIONS
                     FOR {NODE|TABLE} node [ID id].
    The above syntax creates a subscreen container on the standard selection screen of the program during generation
    and we are able to view the dynamic selections icon on the selection screen.
    Hence it is not possible to use the FM 'FREE_SELECTIONS_DIALOG' as a subscreen without using a
    logical database of the relevant table.
    However if you dont want to create a new LDB for each table, there is a trick which needs to be performed
    once in your SAP system and all custom programs can use this FM to create a dynamic selection screen
    as a subscreen of the standard selection screen.
    The prerequisite steps are as follows:
    1: Create a dummy  / test database table in SE11 with a single field i.e. for example mandt , matnr
    2: Create a new logical database program for this table in SE36. Save and activate.
    This will create dynamic selections for the fields of the table created in step 1.
    Steps to be followed in the required custom ABAP program to create the dynamic selection screen as a subscreen.
    A: Include the LDB program created in step 2, in the attributes of the custom ABAP program.
    Now when you execute the program, you can see the dynamic selection icon for the dummy table created in step 1.
    B: In your custom program we need to suppress the icon for 'Dynamic Selections' from the standard selection screen.
       We need to perform this action, because the 'Dynamic Selections' icon always triggers a call to the
       dynamic selection screen of the included LDB progam. ( In our case a dummy table created in step 1 ).
       Whereas we want to trigger a call of the dynamic selection screen of our desired table.
       Logic is as follows:
       In 'AT SELECTION-SCREEN OUTPUT' event call the FM RS_SET_SELSCREEN_STATUS to exclude the fcode 'DYNS'.
    C: Add a pushbutton / checkbox on your selection screen to trigger a call to the FM 'FREE_SELECTIONS_INIT' &
       'FREE_SELECTIONS_DIALOG' in the 'AT SELECTION-SCREEN' event.
    D: When the user clicks the pushbutton / checkbox for dynamic selections call the above 2 FM for the desired table
        with the AS_SUBSCREEN flag of FREE_SELECTIONS_DIALOG = 'X'
    Result: Your dynamic selections screen will be created as a subscreen of the standard selection screen and not as a pop-up.
    Advantage: With the creation of the single custom table & LDB, you are now able to create dynamic selections as subscreen
    in any program in the system. All we need to do is follow the steps A, B & C in each program.
    Note: Your other restrictions with dynamic selection screen ie. submit in background , save as variant still remain and
    you need to handle them accordingly.
    let me know if you need sample code.
    Regards,
    Bhawit Kumar

  • Parameter Passing from Concurrent Program to XML Data Template

    Hi All,
    I have a xml data template which is attached to a data definition. The data template contains a SQL query and some parameter definitions. One of the parameters is p_emp_id. The data type of the parameter is "number" and the where clause that uses the parameter is as follows:
    AND employee_id in (:p_emp_id,DECODE(:p_emp_id,126,130,-99).
    The data definition is attached to a concurrent program which has a parameter based on a valueset. Format type of valueset is char. Validation type is table. Inside the table definition, the table is employees. value column is emp_name type is char. meaning column is emp_name type is char. ID column is emp_id type is number.
    The above where clause condition fails when the conc program is run. In the log file I can see that the value passed is 126 from the valueset. If the query is run independently in TOAD and value passed is 126, the where clause returns rows.
    Kindly let me know what could be the possible issue. Let me know if the question is not clear enough.
    Thanks,
    Amit

    Hi Ashish,
    Thanks for replying.
    I mentioned that the Id column of the VSet is emp_id right ? Isn't the Id column value passed ?
    Moreover I also mentioned that I could see in the log file that the emp_id value is being passed and not the name. I could see in the log file p_emp_id=126. There seems to be some problem with the data types and all.
    Thanks,
    Amit

  • Adding field in Dynamic Selection in FAGLL03

    HI all,
    I would like to filter date based on Document header Text for a particular GL account.
    But when i am executing FAGLL03, i am not able to find in Dynamic Selections, Document Header Text field.
    In the report iam able to find Doc header text.
    How can i get the Documen header Text in Dynamic Selections pf FAGLL03.
    regards
    Jaya

    Hi,
    Thanks for your reply. Sorry i am not the original poster of the message. I posted on http://scn.sap.com/thread/3303233 but there was no answer over there. I already tried the note. But as vendor/customer code are not in SKA1 or SKB1 or BSIS tables, even though I added LIFNR and KUNNR fields to BSIS_FS append structure and they appear in dynamic selection of FAGLL03, the report output does not select based on the customer code I input in the dynamic selection. It has no effect. Anything that I missed out?
    Many thanks.

  • Problem in calling FBL3N and passing Dynamic Selection Screen Parameters

    Hi Experts,
    I am calling the standard report FBL3N in one of my reports using Submit.
    I am passing the GLcode, Company code and Open at key Date in the selection screen.
    Now my requirement is that I need to pass the Posting Key as '40' in my report.
    40 signifies a Debit Entry.
    Now the Posting key comes as a Dynamic Selection parameter in the FBL3n program.
    I am unable to determine the name of the field to which I should pass the value 40.
    Please advice.
    Regards

    Hi,
    Each GL Account belongs to Field status group--> table SKB1.
    Each Field Status group will have specific field combinations --> We can get this using the tables TMODO and TMODP.
    Pls design ur BDC depending on the values from these table.
    (Note: I have done same like this for populating values to dynamic fields ).
    Let me know if u need any information.
    Thanks,
    Senthil

  • Dynamic Selection screen in FDK43 transaction

    HI,
    The transaction FDK43 has a dynamic selection screen used from LDB DDF .It does not show all selections views in the dynamic selection but when I test the LDB from se36 its shows all the selections in dynamic selections.
    Any idea why it is not showind in the transaction FDK43 ??
    Regards,
    Shital

    Hi,
    LDB fields are nothing to do with Dynamic Selection. It is not necessary that all the field of LDB should be visible in Dynamic Selection. FDK43 is a standard screen and SAP has designed the dynamic selection with limited option. If you want additional fields, you need to do the enhancement with the help of ABAPer.
    Regards,
    Ravi

Maybe you are looking for