SAPScript and dynamic tray selection

Hi,
A customer of mine has 2 identical SAPScript layout sets defined with 1 minor difference - within the page attributes a different printer tray has been defined (attribute called resource name) in order to choose a different printer tray ...
I was wondering wether this value could not be dynamically set by the SAPScript output program (when opening the layout set or using a specific command) ?
I didn't really find any special function or parameter in the open_form function module ... I find it a shame that only for the tray functionality we have to maintain 2 layout sets ...
Or can this be achieved in a total different way?
Thanks,
Steven

I am not sure if you can change Tray attribute on a page dynamically from print program.
But I have a suggestion, Why don't you create two pages identical in one single SAPScript just with the Tray different on each one. And call appropriate page while printing dynamically from your program using Function "CONTROL_FORM".
Advantage in this approach is, you do not need to maintain two different SAPScripts. And all code maintenance in SAPScript is common to both the pages, so do not need to make changes twice.
Limitation is if you resize any window in one page need to do the same on the other page too. This is still OK because usually you do not resize as often as you make changes in the code.
Shashi Reddy

Similar Messages

  • Dynamic tray selection - SAPScript

    Hi,
    I need to dynamically select a tray to print a form using SAPScript, depending on some condition.
    Need to know how to do this?
    Thanks in advance!
    regards,
    Karen

    There are 2 options. The first one I have not used before but I think it is the better way.
    Example: You want print out an invoice on different paper.
    In SAPscript you have in this invoice 2 pages:  "FIRST" and "NEXT"
    Salesorganization 1000 = TRY01
    Salesorganization 2000 = TRY02
    **************************************************************************************** 1st option
    1st option: (As mentioned in this thread): Create not 2 but 4 pages:
    F_01 and N_01          both with Resource Name = TRY01
    F_02 and N_02          both with Resource Name = TRY02
    Page F_01:   in field "Next page":  N_01
    Page N_01:   in field "Next page":  N_01
    Page F_02:   in field "Next page":  N_02
    Page N_02:   in field "Next page":  N_02
    In the print-program you have to decide if you want to have page F_01 and N_01 or F_02 and N_02.
    For this reason call function  "OPEN_FORM"  without the name of the form (SAPscript) because in
    call function START_FORM you can export the page.
    data:   GV_STARTPAGE type TDPAGE.
    if vbdkr-vkorg = '1000'.
      GV_STARTPAGE = 'F_01'.
    endif.
    if vbdkr-vkorg = '2000'.
      GV_STARTPAGE = 'F_02'.
    endif.
    call function START_FORM
      FORM = name of form
      LANGUAGE = nast-spras
      STARTPAGE = GV_STARTPAGE
      and so on
      call function WRITE_FORM
      call function WRITE_FORM
      call function WRITE_FORM
    call function END_FORM.
    call fuction CLOSE_FORM.
    **************************************************************************************** 2st option
    Short description:
    Normal SAPscript only FIRST and NEXT, both with same tray.
    ABAP: Do not print, only get OTF-data.
    Change the tray in OTF-data.
    Print OTF-data.
    I have done this before and I know it works. But I think the 1st option is better.
    You can change the field for the "Recource name" from TRY01 to TRY02 in the print program but only with a trick.
    Do not print out in a normal way (Open_form; write_form; close_form).
    Solution:
    In function OPEN_FORM     set field    OPTIONS-TDGETOTF to 'X'.
    This means: The function CLOSE_FORM will not print into spool and maybe from spool to the printer but the print data will only be stored into a table.
    In SAPscript you have 2 Pages. FIRST and NEXT; both with Recource name = 'TRY01'.
    At the end nn CLOSE_FORM you can receive the table OTFDATA.
    data: GS_OTFDATA type ITCOO,
            GT_OTFDATA type standard table of ITCOO.
    call function CLOSE_FORM
      tables OTFDATA = GT_OTFDATA.
    * Up to now no data have been sent to spool.
    * If you have a look now into table GT_OTFDATA (field TDPRINTPAR) you will
    * find in the first lines  "TRY01"
    * You can change this
    If vbdkr-vkorg = '2000'.
      loop at GT_OTFDATA into GS_OTFDATA.
    *   Find the pattern "TRY01" in GS_OTFDATA-TDPRINTPAR
    *   with commands FIND or SEARCH or something like that.
    *   Change the pattern "TRY01" in GS_OTFDATA-TDPRINTPAR to "TRY02"
    *   and take over this change to table GT_OTFDATA with command "MODIFY".
    *   Please notice: In table GT_OTFDATA the pattern "TRY01" can occure more than 1 time.
        modify GT_OTFDATA from GS_OTFDATA.
      endloop.
    endif.
    * Now print the OTF-Data
    call function PRINT_OTF
    * the paramters are   PRINTOPTIONS (same as in OPEN_FORM)
    *                   and tables OTF = GT_OTFDATA.
    Ok, I know the problem and the thread are very old but maybe someone wants to have a more detailed solution.
    Keywords in English: SAP ABAP SAPscript  Resource Name ITCTG-TDPAPERRES   from program dynamically dynamic dynamically
    TRAY  TRY01 TRY02 TRY03
    Keywords in German: SAP ABAP SAPscript  Resourcenname   ITCTG-TDPAPERRES vom Programm aus dynamisch TRAY  TRY01 TRY02 TRY03 Druckerschacht Schachtsteuerung Druckerschachtsteuerung verschiedenes Papier
    best regards
    Norbert Zanders

  • Dynamic Tray Selection in Smartforms

    Hi all,
    I am looking for a solution, to set the tray in a Smartform dynamically.
    It is not sufficient to set the Tray statically on the "Output Options" tab -> Ressource Name.
    Can anybody help me?!?
    Thanks and best regards,
    SteCee

    Normally, tray selection is done using GET_PRINT_PARAMETER FM.
    Refer to these threads, may be helpful -
    Print to different output tray in SAPscript/Print Workbench
    Automatic tray selection for printing
    Regards,
    Amit

  • Smart form dynamic tray selection on printing

    Hi Experts,
    I have a requirement in smart form that need to output the a particular invoice to a particular tray a printer. For e.g. tray 2.
    I have added TRY02 to the resource name of the pages in the smartform, but still the invoice is being printed to the default tray of the printer.
    I have done a test to that printer by printing the SAPCRIPT-TRAYTEST from SO10, and the output is being printed correctly i.e. to the different trays. So I guess the printer has been configured correctly.
    Is there any additional configurations that need to be done for smart forms for the tray selection works correctly? And, is it correct the way I implemented the functionality in the smart form?
    Can someone help please?
    Thanks in advance
    Regards,
    Zaheed

    Hi Experts,
    I have a requirement in smart form that need to output the a particular invoice to a particular tray a printer. For e.g. tray 2.
    I have added TRY02 to the resource name of the pages in the smartform, but still the invoice is being printed to the default tray of the printer.
    I have done a test to that printer by printing the SAPCRIPT-TRAYTEST from SO10, and the output is being printed correctly i.e. to the different trays. So I guess the printer has been configured correctly.
    Is there any additional configurations that need to be done for smart forms for the tray selection works correctly? And, is it correct the way I implemented the functionality in the smart form?
    Can someone help please?
    Thanks in advance
    Regards,
    Zaheed

  • Linksys WRT-1900AC and Dynamic Frequency Selection(DFS)

    Hello All
    Does anybody know if the Linksys Router WRT-1900AC will support Dynamic Frequency Selection(DFS) by a newer Firmwareupdate?
    I don't understand why this feature has not been added yet
    Second why does i have to set the 5GHZ WLAN to mixed to use AC. for me it is better when there is a Mode AC only.
    thanks for your help

    http://en.wikipedia.org/wiki/Channel_allocation_schemes
    Your best bet would be to phone contact your regional Linksys support office and ask them about this. Ask them if this model doesn't support it, which one does, if any. Let us know how it goes please.

  • Dynamic Tray Selection

    Hi All,
    When the print out is issued from the SMARTFORM, it should automatically determine the tray for the paper (based on a pre-defined logic):
    The trays can be:
    Tray 1
    Tray 2
    Manual Feed
    I tried sending Dynamic Value in RESOURCE NAME field of Smartform Page. The Value i tried in TRY1, TRY2. But printer is not selecting according to the value passed at runtime in field RESOURCE NAME. Could someone please let me know about the exact name to be specified in RESOURCE NAME as the field is 20 characters long.
    If GET_PRINT_PARAMETERS is to be used, please let me know where should i pass the internal table which i get from GET_PRINT_PARAMETERS FM.
    Thanks,
    Best regards,
    Prashant

    Hai prashant,
    Do you want to define the tray statically?.
    Then you can mention the tray at the page level.
    Select the page and select 'output options' tab.
    There you can mention the tray name with the resource field.
    if you want to select the tray dynamically then ,refer the OSS note 367128 and apply the OSS note which is applicable for release 4.6 C.
    Implement the program correction. Afterwards, you can also enter a field (for example, ) in field 'Resource'. This field must be defined in a global manner (the type must be RSPORESNAM). You must set the value of this field before you call up the page. That is, you must either supply the value on the first page via the interface or you must set it during the initialization. If you call a page via an explicit page break, you must have set the value before the page break.
    I hope this should resolve your issue.
    You can even try using cal functions.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    GET_PRINT_PARAMETERS
    Regards,
    Srikanth.
    Please reward points If it is helpful

  • Discriminator and dynamic table selection

    Is there a way (in DSP 3.0) to use a discriminator to dynamically determine a related table to join in a select or update? On the java client I have a base class with extended class that I would like to model in related tables.
    Thanks,
    Jeff
    Edited by jhoffmanme at 02/08/2008 4:09 AM

    Ok - so you want something like
    <CASE>
    <BASE_CASE>
    <BASE_CASE>
    <LAB_CASE>
    </LAB_CASE>
    <CASE>
    <CASE>
    <BASE_CASE>
    <BASE_CASE>
    <CS_CASE>
    </CS_CASE>
    <CASE>
    So you will need to define a CASE schema element that contains a BASE_CASE, and optionally a LAB_CASE, CS_CASE etc. element.
    your queries will look like :
    function getLABCases()
    for $base_case in BASE_CASES()
    return
    <CASE>
    {$base_case}
    {for $lab_case in LAB_CASES()
                where $lab_case/ID eq $case/ID
                return
                  $lab_case
    </CASE>
    function getCSCases()
    for $base_case in BASE_CASES()
    return
    <CASE>
    {$base_case}
    {for $cs_case in CS_CASES()
                where $cs_case/ID eq $case/ID
                return
                  $cs_case
    </CASE>
    getAllCases()
    ( getLABCases(),
    getCSCases() )
    Use the nested for's as I have shown above rather than...
    for $base_case in BASE_CASES()
    for $lab-case in LAB_CASES()
    where $lab_case/ID eq $base_case/ID
    as the second way forces LAB_CASE table to be read even when it is not required in the output.
    For updates, you will need visit the update template documentation to see how you tell DSP that a CASE with a LAB_CASE came from the LAB_CASES table.

  • Multimapping and dynamic folder selection for files

    Hi SDNers,
    I have a requirement where I need to split the message in multiple messages, I am using 1:N Multimapping for this.
    Also I need to use dynamic configuration to route the separated files to multiple folders based on place field in the message.
    When I am using Dynamic configuration the splitted files are all getting created in one directory instead of multiple directories.
    The requirement is that if place field has value india then the file having value as INDIA should be placed in folder INDIA, if place is UK then that file should be placed in folder UK
    Can anyone please help me on how to achieve this?
    Regards,
    Gautam Purohit

    As far as I know this is not possible, since bulk message will be delivered to Adapter Frame Work (AFW). AFW delegates each message from bulk message.
    Try using Variable substitution, but I am not sure if it works.
    May be you need a BPM to achieve this. But this will cause performance.
    Regards,
    Praveen Gujjeti.
    Edited by: Praveen Gujjeti on Apr 6, 2010 8:11 PM

  • Does the Officejet 8600 Pro Premium N911n printer perform auto tray selection?

    I have an Officejet 8600 Pro Pemium N911n printer,  CN577A with two trays. My Operating Sysem is Win8,64bit,there are no error messages, no system changes.
    The HP Officejet Pro 8600 e-All-in One series User Guide states that By default, the printer draws media from Tray1.If Tray1 is empty, the printer draws media from Tray2(if it is installed and loaded with media. I have Tray lock disabled ,Tay1 the default Tray and Automatic Tray Selection enabled.Prior to making these selections,I contacted HP support via email to report that this option was not working. I received a response that there is no method that will automatically select a tray when one tray is empty. The User 's manual states otherwise..This option might not work but it is part of this series of printers. I have both trays loaded and I will determine if it works after Tray1 is empty. Does anyone have one of these printers and the auto Tray function works? Thanks.
    This question was solved.
    View Solution.

    Hello wardell1,
    Please take a look at this document and let me know if the troubleshooting steps help resolve your issue.
    Good luck!
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Can we change tray selection dynamically?

    Hello experts,
    is it possible to change the tray selection dynamically? That is to say, via the driver program.
    For example the default tray on the SAPscript  form is TRY02. So if there are less than 20 lines on a form, it'll use TRY02 containing paper with pre-printed text. However, if there are more lines, then, I would like it to use TRY03 containing blank paper, for the rest of the information.
    Is this possible via programming or any other way for that matter?
    Your help is greatly appreciated.
    Edited by: Goharjou ardavan on Oct 29, 2008 11:07 AM

    Hi,
    Tray Options are available in the Output Device. You can't control it from the SAP Script. In Output device Tray's will be defined, But there is no option to shift the Tray based on the lines.
    But If you guys can define two output device, one with tray TRY02 and other device with tray TRY03. Then in the program based on the how many lines, Pass the Respective Output device to the Spool structures in the program.

  • Tray selection with LOCL in sapscript

    I want to print the document from Tray 2 always and so I set the resource name in the sapscript to TRY02. When I put the printer name in, it works fine and prints from tray 2. But when I put LOCL as the output device, it always prints from the default tray. Does anyone have a solution to this?

    I think this is because of your local printer configuration
    Please find the documentation related to this-> this documentation i found in start> printer and faxes>select your default printer> right click> properties> help> index --> find tab > type tray> Selecting paper by type or source
    If your application supports printing by paper type or source, make the selections from your application. Application settings override printer driver settings.
    You can configure the printer to select paper by Type (such as Plain or Letterhead) or Source (such as Tray 1 or Tray 2). If you frequently use several different kinds of paper, once trays are set up correctly from the printer control panel, you do not have to check which paper is loaded in each tray before you print.
    Your paper trays must be configured from the printer control panel before you can print by type. To configure your paper trays, see the printer user guide.

  • Tray selection for sapscript

    I am working on tray selection for an invoice sapscript. It should print in Tray 2 and so I have set Resource Name in Sapscript form to TRY02.
    It works in one client and not in another client. Does anyone have an idea why this could be?

    Please check thru transaction code SPAD
    In SPAD > select the printer>. On the output devicescreen,--> menu selection Goto --> Device Type. This will allow youenter specific PCL code for all Print Controls.
    SE71 -> on page layout, --> give a tray name (TRY01) in the resource name to all pages in the sapscript.
    But you should know the printer PCL codes (basis can help you on this)

  • Selecting both static and dynamic values in a report.

    Hello,
    I am using the following LOV for a select list in a form based on another post (Re: Static and Dynamic LOV ordering
    It is presenting five static values along with a dynamic LOV.
    select d, r
    from (select n, d, r
    from (select 1 as n, 'NAME_A' d, 1 r
    from dual
    union all
    select 1 as n, 'NAME_B' d, 2 r
    from dual
    union all
    select 1 as n, 'NAME_C' d, 3 r
    from dual
    union all
    select 1 as n, 'NAME_D' d, 4 r
    from dual
    union all
    select 1 as n, 'NAME_E' d, 5 r
    from dual
    union all
    select 2 as n,
    (LNAME || ', ' || FNAME || ' (' ||
    to_char(DOB, 'MM/DD/YYYY') || ')') display_value,
    ID return_value
    from my_name_table)
    ORDER BY n, r asc)
    The static display and return values do not exist in my_name_table, but the static return values are recorded in my_main_table when the user submits the form.
    The tables look like this:
    my_main_table:
    record_id
    name_id
    my_name_table:
    name_id
    fname
    lname
    How can I present the display values associated with the static return values recorded in my_main_table along with the dynamic display values in a report? I am currently presenting the dynamic portion in a report using the following select statment:
    select
    (my_name_table.LNAME||', '||my_name_talbe.FNAME) AS Name
    from my_name_table
    WHERE my_main_table.NAME_ID = my_name_table.NAME_ID
    I have the additional problem that the static return values are not in my_name_table so the join in the last statement will not find the static values in my_name_table.
    Edited by: mterlesky on Feb 24, 2009 9:51 AM

    1. You will need to add an outer join to return all the values in the Main table.
    2. Then decode the values for the static LOV.
    Something like (this is not tested, but should give you the idea)
    select
    decode(my_main_table.NAME_ID,1,'NAME_A',2,'NAME_B',3,'NAME_C',4,'NAME_D',5,'NAME_B',(my_name_table.LNAME||', '||my_name_talbe.FNAME)) AS Name
    from my_name_table
    WHERE my_main_table.NAME_ID = my_name_table.NAME_ID(+)
    This will all break if any of your static LOV ID values clash with your dynamic LOV ID values.
    I am now going to give you a long lecture about hard coding values ..... ;)
    Related info: http://simonhunt.blogspot.com/2009/02/how-to-cope-with-list-of-values-lovs.html
    I hope that helps
    Shunt

  • Policy-based Tunnel Selection and PBTS with Dynamic Tunnel Selection option

    Unfortunately I can't test this feature on GSR 12k platform.
    RP/0/0/CPU0:ios(config)#show config failed
    !! SEMANTIC ERRORS: This configuration was rejected by
    !! the system due to semantic errors. The individual
    !! errors with each failed configuration command can be
    !! found below.
    interface tunnel-te1
    policy-class 1
    !!% The requested operation is not supported: Feature not supported on this platform
    end
    What is the difference between Dynamic Tunnel Selection and ordinary PBTS? It would be nice to see some real-world example.

    PBTS with DTS is supported only on the Cisco XR 12000 Series Router... you should rather test it on 12K platform.

  • Getting content and address of select-options (created dynamically)

    Hi guys,
    Suppose I have a dynamically created select-options in a program
    SELECT-OPTIONS it_ranges FOR ...
    Let's say I can determine its name ( IT_RANGES ) only during program execution.
    Now I know I can use field symbols to get its content like below:
    FIELD-SYMBOLS: <fs>.
    "here I will have content of the table in <FS>
    ASSIGN ('IT_RANGES[]') TO <fs>.
    ...but I would like to know how can I get the content of this select-options table through date reference
    TYPES: BEGIN OF t_ranges,
            sign TYPE c,
            option(2) TYPE c,
            low TYPE i,
            high TYPE i,
           END OF t_ranges.
    "let say tt_ranges is of the same type like IT_RANGES
    TYPES: tt_ranges TYPE TABLE OF t_ranges.
    DATA: ref TYPE REF TO data.
    CREATE DATA ref TYPE tt_ranges.
    The above will only create typed reference to table but I want it to point to my table IT_RANGES. The statement below don't work here.
    GET REFERENCE OF ('IT_RANGES[]') INTO ref.
    Is there any other way I can get (using data reference)?
    1) address of this select-options table
    2) content of this select-options table
    Thanks for help in advance
    M.
    Edited by: Marcin Pciak on Nov 28, 2008 11:33 AM

    Statement CREATE DATA would only make sense when you are trying to create the dynamic select options. You can use the addition TYPE HANDLE in order to create the Range Table. Check method implementation CREATE_RANGE_TABLE in class CL_WDR_SELECT_OPTIONS.
    Once the Select-option is created, you need to use the GET REFERENCE to get the data reference of the Select-options. We can't specify the dynamic reference with brackets in the GET REFERENCE statement. So, you need to use the field-symbols to do the dynamics.
    DATA: ref TYPE REF TO data.
    DATA: ref_fs TYPE REF TO data.
    FIELD-SYMBOLS: <fs>.
    DATA: w_range TYPE i.
    SELECT-OPTIONS it_rang FOR w_range.
    START-OF-SELECTION.
      GET REFERENCE OF it_rang[] INTO ref.
      ASSIGN ('IT_RANG[]') TO <fs>.
      GET REFERENCE OF <fs> INTO ref_fs.
      write: 'done'.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Inter-company Billing Payment Idoc posting

    Hi Friends, We have got the regular inter-company billing scenario, After creating the inter-company billing document IV we post the payment Idoc through the output processing.           Here IV document will be created by the user from the deliverin

  • Report on button click

    Hi experts, i hope you all are doing fine.I need your help ....i generated a report in rtf format using iText and stored in a file name like 'xyz.rtf'.Now i want to open this file on button click in jsp. Pls. suggest me something.... Thanks a lot...a

  • Code Signing in CloudBuild

    Is it possible to run a post build action in the VS Online cloud that will sign my dlls? What is the best practice here and where would I put the certificate in this case?

  • Adding objects to subviews

    I know how to create a subview from a selected collection of objects in my main relational diagram, but once I have created a subview, I cannot figure out how to add any more tables to it from main. I just have to start over and generate a new subvie

  • DPS6: hiding attributes for entries not matching a specific objectclass

    I'd like to be able to hide some attributes, but only for entries not matching a given objectclass. DPS 6 allows data hiding rules to apply to a specific subset of entries, but the subset can not be defined thanks to a negative filter such like (!(ob