How can I find the currently logined domain name on Windows??

Dear,
I've a program that query some user account information from A.D.
But I don't want to hard code anything.
I've read some previous post about using LDAP, and using DNS queries to found all LDAP server of A.D.
But how can I get the A.D. domain name in Java?
for example
ldcp://_ldap._tcp.xxxx.yyyy
I want to get "xxxx.yyyy" from the logined user account. It is possible in Java.

You coud use the NTSystem class to derive the NetBIOS domain name, however without doing some gymnastics it isn't easy to derive the fully qualified domain name. import java.io.*;
import com.sun.security.auth.module.NTSystem;
class NTDomain {
     public static void main(String[] args) {
          NTSystem system = new NTSystem();
          String domain = system.getDomain();
          System.out.println("Domain: " + domain);
}The only other alternatives could be to check the domain suffix of the user principal that was authenticated via Kerberos ....
lc = new LoginContext(searchkrb5.class.getName(),new SampleCallbackHandler());
     lc.login();
     catch (LoginException le) {
          System.out.println("Logon failed: " + le);
          System.exit(-1);
     System.out.println("Authenticated via GSS-API");
        System.out.println("User: " + lc.getSubject().getPrincipals().toString); however I think that you still have to specifify the Kerberos realm in the apps configuration file.
Another alternative could be to make assumptions about the machines hostname, however one day an assumption will always be proven wrong, (eg. The machine's DNS domain name does not need to match the Active Directory domain).
Unless there is a Java API to read the Windows registry or extract Kerberos ticket information from the WIndows Kerberos ticket cache, you may be kind of stuck.

Similar Messages

  • How can i find the available JDBC driver name?

    hi,
    can anyone tell me how can i find the JDBC driver name in XI

    Hi
    The available JDBC drivers can be viewed in the file found in the following path in ur XI  server
    :\usr\sap\XR3\DVEBMGS00\j2ee\cluster\server0\bin\ext\
    regards
    krishna

  • How can I see the current script file name in Vision Builder

    I would like to not have to remember which script file I have open. Is that displayed somewhere?

    Brian,
    I have been looking over Vision Builder 6.1, and from what I can tell, the name of the file that you are working on is not displayed on the screen, and there does not appear to be a way to get it to display there.
    This seems like a very worthwhile feature to add, and I definitely agree that it would be useful. You may want to consider filing a Product Suggestion by using the Product Suggestion Center (PSC) that is linked below:
    Product Suggestion Center
    The PSC links directly into our R&D group's suggestion database, and any suggestions entered would be reviewed by the R&D team.
    Regards,
    Jed R.
    Applications Engineer
    National Instruments

  • How do I find out user and domain names in WL7.0 security

    Hi,
    I'm moving to WL7.0 security and now weblogic.security.acl.Security.getCurrentUser()
    that worked in CompatibilityMode throws NullPointerException. What is the alternative
    to deprecated weblogic.security.acl.Security in the new Weblogic security framework?
    Also, how can I find the current domain name?
    Thanks,
    Michael.

    "Michael Bogomolov" <[email protected]> wrote in message
    news:3ec515ae$[email protected]..
    >
    Hi,
    I'm moving to WL7.0 security and nowweblogic.security.acl.Security.getCurrentUser()
    that worked in CompatibilityMode throws NullPointerException. What is thealternative
    to deprecated weblogic.security.acl.Security in the new Weblogic securityframework?
    >
    See getCurrentSubject in
    http://e-docs.bea.com/wls/docs81/javadocs/weblogic/security/Security.html
    getCurrentUser only works in compatibilty mode

  • How can I find the center of the current view

    How can I find the center of the current view

    Oracle permitted renaming the snapshot in the earlier versions of 8i. However, it does not permit renaming the materialized view in 9i or 10g.
    SQL> rename mymatview to mymatview2;
    rename mymatview to mymatview2
    ERROR at line 1:
    ORA-32318: cannot rename a materialized view
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options
    SQL> rename mymatview to mymatview2;
    rename mymatview to mymatview2
    ERROR at line 1:
    ORA-32318: cannot rename a materialized view
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Production

  • I want to update iCloud account with new apple id but don't know password for old apple id.  Plus can no longer receive email at old apple id.  How can I delete the current iCloud account on my iPhone if the previously stated conditions exist?

    I want to update iCloud account with new apple id but don't know password for old apple id.  Plus can no longer receive email at old apple id.  How can I delete the current iCloud account on my iPhone if the previously stated conditions exist?

    If the old ID is yours, and if it is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • How can i find the option to delete a recent print job from the "View Job History

    1. Photosmart 5510 e-ALL-IN-ONE SERIES
    2. Window 7 64 bit
    How can i find the option to delete a recent print job from the "View Job History

    Hello alfmswongg,
    Currently there is no option to delete print jobs from the "View Job History" section of ePrintCenter.  
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How can I find the index from a specific container?

    How can I find the index from a specific container?
    For example, if I'm traversing through textframes like so (an example, not tested):
    var doc = app.activeDocument;
    var story = doc.pages[0].textFrames[0].parentStory;
    for (var i=0, l=story.textContainers.length; i<l; i++) {
         var textFrame = story.textContainers[i];
         if (textFrame.constructor.name == "TextFrame") {
              var lastPara = textFrame.paragraphs.lastItem();        //How can I find the index of this in relation to the story?
    How can I find the index of "lastPara" in relation to the story rather than the current container?
    I tried:
    var newPara = story.paragraphs[lastPara.index];
    but this results in an invalid object. . .
    alert(newPara.isValid);      //returns false

    The .index property is the character offset. So lastPara will begin at story.characters[lastPara.index].

  • If I've lost or had my iPod nano 3rd gen stolen, how can i find the serial numbers? Nothing in iTunes but i am sure i linked them before...

    if I've lost or had my iPod nano 3rd gen stolen, how can i find the serial numbers? Nothing in iTunes but i am sure i linked them before...
    They are not listed as devices on the itunes store account...

    Hi BradSLane,
    Thanks for using Apple Support Communities.  This article has one method to find your serial number:
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    If you have lost or found an Apple product, please contact your local law enforcement agency to report it. Although Apple does not have a process to track or flag lost or stolen product, you can use My Support Profile to find a list of serial numbers that have been purchased or registered with your Apple ID.
    Go to My Support Profile*.
    Sign in with your Apple ID.
    View your purchases in "My Products".
    * Currently available only in certain languages.
    Note: If you need help remembering your Apple ID(s), go here.
    Take care,
    - Ari

  • How can I CACULATE the current X,Y coordinate?

    Hi Veterans,
    When I was using method Graphics.drawString(String str, int x, int y) to display the string on the specified (x, y), how can I calculate the current x at the end of the string when i finished, given the font size is available
    any help is appreciated!

    Well Im sure if you searched the sun sight you could find a getX() method....but this works too
    public void paint() {
    Graphics2D g2D = (Graphics)g
    int x=5;
    int y=7;
    g2D.drawString("Hello",x,y);
    System.out.println(x +" is the x position");
    System.out.println(y + " is the y position");
    This is direct code for the paint() method of an applet paintComponent() if your in a JFrame

  • How can I check  the current cost and budget in SAP?

    Dear experts,
         How can I check  the current cost and budget in SAP for the PR approval?
    Table:COEP, COBK, COSS COSP can not find below information:Tender_budget,Working_budget,reconciliation,Additional,Adjustment,variation
    Best regards,
    Merry

    Dear expert,
         I need below information:Project_id,Cost_code,Nature_code,Section_code,Work_type,Work_code,Cost_type,Suffix,item_desc,Tender_budget,Working_budget,reconciliation,Additional,Adjustment,variation
    Can you tell me which table and filed can find them?
    Many thanks.
    best regards,
    Merry

  • How can I find the reason for frequent system crashes?

    Hi all,
    since a couple if weeks my iMac (late 2009) has a system crash at least once per day; I don't know the reason or what software causes that. How can I find the source of this crashes?
    Thanks and regards
    Chris

    Thanks for your answer.
    Here the result:
    EtreCheck version: 1.9.15 (52)
    Report generated 27. September 2014 11:26:51 GMT+8
    Hardware Information: ?
      iMac (21.5-inch, Late 2009) (Verified)
      iMac - model: iMac10,1
      1 3.06 GHz Intel Core 2 Duo CPU: 2 cores
      8 GB RAM
    Video Information: ?
      ATI Radeon HD 4670 - VRAM: 256 MB
      iMac 1920 x 1080
    System Software: ?
      OS X 10.9.5 (13F34) - Uptime: 0 days 3:9:21
    Disk Information: ?
      ST31000528AS disk0 : (1 TB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted>: 209,7 MB
      Macintosh HD (disk0s2) / [Startup]: 999,35 GB (636,04 GB free)
      Recovery HD (disk0s3) <not mounted>: 650 MB
      OPTIARC DVD RW AD-5680H 
    USB Information: ?
      StoreJet Transcend StoreJet Transcend 2 TB
      S.M.A.R.T. Status: Verified
      EFI (disk1s1) <not mounted>: 209,7 MB
      Transcend (disk1s2) /Volumes/Transcend: 2 TB (1,53 TB free)
      Apple Inc. Built-in iSight
      Apple Internal Memory Card Reader
      Apple, Inc. Keyboard Hub
      Apple Inc. iPhone
      Apple Inc. Apple Keyboard
      Apple Computer, Inc. IR Receiver
      Apple Inc. BRCM2046 Hub
      Apple Inc. Bluetooth USB Host Controller
    Gatekeeper: ?
      Mac App Store and identified developers
    Kernel Extensions: ?
      [loaded] com.Cycling74.driver.Soundflower (1.5.2) Support
      [loaded] com.avast.AvastFileShield (2.1.0 - SDK 10.9) Support
      [loaded] com.avast.PacketForwarder (1.4 - SDK 10.9) Support
      [not loaded] com.paceap.kext.pacesupport.leopard (5.9 - SDK 10.4) Support
      [not loaded] com.paceap.kext.pacesupport.master (5.9 - SDK 10.6) Support
      [not loaded] com.paceap.kext.pacesupport.panther (5.9 - SDK 10.3) Support
      [loaded] com.paceap.kext.pacesupport.snowleopard (5.9 - SDK 10.6) Support
      [not loaded] com.paceap.kext.pacesupport.tiger (5.9 - SDK 10.4) Support
      [loaded] foo.tap (1.0) Support
      [loaded] foo.tun (1.0) Support
    Startup Items: ?
      KP_IPFW: Path: /System/Library/StartupItems/KP_IPFW
      Sudochmod: Path: /Library/StartupItems/Sudochmod
    Launch Daemons: ?
      [loaded] com.adobe.fpsaud.plist Support
      [loaded] com.avast.init.plist Support
      [loaded] com.avast.uninstall.plist Support
      [loaded] com.avast.update.plist Support
      [loaded] com.google.keystone.daemon.plist Support
      [running] com.machangout.glims.loader.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [loaded] com.oracle.java.Helper-Tool.plist Support
      [loaded] com.oracle.java.JavaUpdateHelper.plist Support
      [loaded] org.tcpdump.chmod_bpf.plist Support
      [loaded] PACESupport.plist Support
      [running] vyprvpnservice.plist Support
    Launch Agents: ?
      [loaded] com.avast.userinit.plist Support
      [loaded] com.google.keystone.agent.plist Support
      [loaded] com.hp.messagecenter.launcher.plist Support
      [running] com.machangout.glims.agent.plist Support
      [loaded] com.oracle.java.Java-Updater.plist Support
    User Launch Agents: ?
      [loaded] com.adobe.ARM.[...].plist Support
      [failed] com.akamai.single-user-client.plist Support
      [loaded] com.avast.home.userinit.plist Support
      [running] com.google.Chrome.framework.plist Support
      [loaded] com.macpaw.CleanMyMac.helperTool.plist Support
      [loaded] com.macpaw.CleanMyMac.trashSizeWatcher.plist Support
      [loaded] com.macpaw.CleanMyMac.volumeWatcher.plist Support
      [not loaded] Verbindungsassistent
    User Login Items: ?
      Show Desktop
      Skype
      Air Media Server
      TuneupMyMac
      VyprVPN
    Internet Plug-ins: ?
      NPClientBinding: Version: 1.0.0.5 - SDK 10.6
      Google Earth Web Plug-in: Version: 6.0 Support
      Default Browser: Version: 537 - SDK 10.9
      Flip4Mac WMV Plugin: Version: 2.3.8.1 Support
      NPCleanHistory: Version: 1.0 - SDK 10.6
      AdobePDFViewerNPAPI: Version: 10.1.12 Support
      FlashPlayer-10.6: Version: 15.0.0.152 - SDK 10.6 Support
      AmazonMP3DownloaderPlugin101749: Version: Unknown
      NPSafeInput: Version: 1.0 - SDK 10.6
      Flash Player: Version: 15.0.0.152 - SDK 10.6 Support
      iPhotoPhotocast: Version: 7.0
      NPSafeSubmit: Version: 1.0 - SDK 10.6
      QuickTime Plugin: Version: 7.7.3
      AdobePDFViewer: Version: 10.1.12 Support
      GarminGpsControl: Version: 4.0.2.6 Beta - SDK 10.6 Support
      SharePointBrowserPlugin: Version: 14.4.4 - SDK 10.6 Support
      Silverlight: Version: 5.1.20913.0 - SDK 10.6 Support
      JavaAppletPlugin: Version: Java 7 Update 67 Check version
    Safari Extensions: ?
      AdBlock
      wrc (Disabled)
      Download Shuttle
    Audio Plug-ins: ?
      BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
      AirPlay: Version: 2.0 - SDK 10.9
      AppleAVBAudio: Version: 203.2 - SDK 10.9
      iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins: ?
      Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    User Internet Plug-ins ?
      Picasa: Version: 1.0 Support
      WebEx64: Version: 1.0 - SDK 10.5 Support
    3rd Party Preference Panes: ?
      Flash Player  Support
      Flip4Mac WMV  Support
      Java  Support
      MacFUSE (Tuxera)  Support
    Time Machine: ?
      Skip System Files: NO
      Mobile backups: OFF
      Auto backup: YES
      Volumes being backed up:
      Macintosh HD: Disk size: 930.71 GB Disk used: 338.35 GB
      Destinations:
      Transcend [Local] (Last used)
      Total size: 2 TB
      Total number of backups: 23
      Oldest backup: 2014-09-12 08:28:44 +0000
      Last backup: 2014-09-27 03:10:24 +0000
      Size of backup disk: Adequate
      Backup size 2 TB > (Disk used 338.35 GB X 3)
      Time Machine details may not be accurate.
      All volumes being backed up may not be listed.
    Top Processes by CPU: ?
          2% WindowServer
          0% Microsoft Word
          0% VyprVPN
          0% Skype
          0% hidd
    Top Processes by Memory: ?
      377 MB iTunes
      369 MB Safari
      254 MB mds_stores
      180 MB com.apple.IconServicesAgent
      131 MB com.avast.daemon
    Virtual Memory Information: ?
      2.37 GB Free RAM
      3.25 GB Active RAM
      1.60 GB Inactive RAM
      793 MB Wired RAM
      1.52 GB Page-ins
      0 B Page-outs

  • How can I find the Thread ID

    Hi
    I read the following sentences in FAQ:
    {forum:id=123} - Displays link to forum 123
    {thread:id=12345} - Displays link to thread 12345
    {message:id=1234567} - Displays link to message 1234567
    {user:id=1234} - Displays link to user 1234 (numeric ID)But I don' know where I can find the forum:id, thread:id and message:id
    Thank for your help
    hqt200475

    bigdelboy wrote:
    trent wrote:
    bigdelboy wrote:
    As far as I am aware the threadID and the messageID never appear in the same URL.At this top of this thread, there is a link for 'Last Post'
    This points to: Re: How can I find the Thread ID containing both thread and message id's
    In your example, the 'Whoever' bit is just plain text. i.e. no hyperlink (for me).
    I think you are talking about the links on the list of threads, whereas Aketi is referring to the link in the actual thread (at the top of the page).I feel a litlte outgunned {noformat};){noformat} ..... however I currently stand by my postulation their is no URL hyperlink where both the threadID (2234623 for this thread) and messageID (eg 9651344 for this post) are present in the same URL. URLs with the messageID obviously link to the thread on the basis the message is a child of the thread, but the threadID is not explicily present in this case.
    Rgds - bigdelboy
    http://en.wikipedia.org/wiki/A_Funny_Thing_Happened_on_the_Way_to_the_Forum ( {forum:id=29} )
    http://forums.oracle.com/forums/help.jspa
    Waht a plonker bigdelboy is!
    I think you are talking about the links on the list of threads, whereas Aketi is referring to the link in the actual thread (at the top of the page).I agree entirely. Apolgies to all. You are SO right.
    Permlink           Replies:  12  -   Pages:   1   -   Last Post:   Jun 10, 2011 8:23 AM  Last Post By: bigdelboy          Threads:  [ Previous |  Next   ]
    Re: How can I find the Thread ID

  • HT201299 How can I find my current OS number? (10.5, 10.6)

    How can I find my current OS number? (10.5, 10.6)

    This is the iPhone forum, not the Mac forum.  You should post questions about your Mac in the Mac forum.
    However, to answer your question this time, click on the black Apple logo in the top left corner of your Mac screen, then click on 'About this Mac'.  You'll see your OS version there.

  • How can i find the printing program?

    hi
    i have sap script how can i find the printing program ?
    ami

    ami bardogo wrote:
    hi
    what is the different between the commands 'break' and 'break-point'
    thanks,
    ami
      h2 Breakpoints  h2
    Apart from being able to execute an ABAP program in the Debugger, you can also start the Debugger call by the choosing a breakpoint. This is achieved by setting one or more of these breakpoints in the program. A breakpoint is a signal at a particular point in the program that tells the ABAP runtime processor to interrupt processing and start the Debugger. The Debugger is activated when the program reaches this point.
    There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For more information, refer to the chapter Watchpoints.
    Breakpoint Variants
    The Debugger contains different breakpoint variants:
    Static
    A user-specific breakpoint is inserted in the source code as an ABAP statement using the keyword BREAK-POINT. A non user-specific breakpoint is set in the ABAP Editor using the BREAK user name statement.
    Directly set
    dynamic breakpoints
    Can be set in the ABAP Editor or the Debugger by double-clicking a line, for example. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
    Breakpoints
    at statements
    The Debugger stops the program immediately before the specified statement is executed.
    Breakpoints
    at subroutines
    The Debugger stops the program immediately before the specified subroutine is called.
    Breakpoints at function modules
    The Debugger stops the program immediately before the specified function module is called.
    Breakpoints at methods
    The Debugger stops the program immediately before the specified method is called.
    Breakpoints at exceptions and system exceptions
    The Debugger stops the program immediately after a system exception, that is, after a runtime error has been intercepted.
    Static Breakpoints
    Static breakpoints are always user-independent if there is no specification of a user name. Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP program, the system always interrupts the program at that point for that user or only for the user name. This procedure is only useful in the development phase of an application when program execution is always to be interrupted at the same place. For more information, refer to the chapter Static Breakpoints.
    In HTTP sessions, a static breakpoint is skipped if you did not set additional dynamic HTTP breakpoints in the editor of a BSP page. Instead, a corresponding system log entry is written, which can be checked using transaction SM21.
    Dynamic Breakpoints
    Dynamic breakpoints are user-specific. Therefore, you should use them if you only want the program to be interrupted when you run it yourself, not when it is being executed by other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
    Dynamic breakpoints are more flexible than static breakpoints because you can deactivate or delete them at runtime. They have the following advantages:
    ·        You do not have to change the program code.
    ·        You can set them even when the program is locked by another programmer.
    ·        You can define a counter that only activates the breakpoint after it has been reached.
    Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the source code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger. For more information, refer to the chapter Dynamic Breakpoints.
    In HTTP sessions, the system stops both at static and dynamic breakpoints if a dynamic breakpoint was set in the editor of a BSP page before program execution.
    Lifetime and Transfer of Breakpoints
    A static breakpoint remains intact as long as the BREAK-POINT or BREAK-POINT name statement is not removed from the source code. Without saving, dynamic breakpoints only remain intact in the relevant internal session. However, they remain in effect during the entire user session if they are saved by choosing the menu path Breakpoints ® Save in the ABAP Debugger. For more details on the subject of user sessions and modes, refer to Modularization Techniques in the ABAP keyword documentation.
    If you call an HTTP session during a user session, only the HTTP breakpoints are loaded when the HTTP session is started. You activate HTTP debugging in the ABAP Editor by choosing Utilities ® Settings ® HTTP Debugging. Depending on the setting, the system then displays either the HTTP or standard breakpoints in the Editor.
    If you call an update session during a user session, breakpoints that were defined beforehand in the calling processing unit are copied to the new update session, where they can be displayed under Breakpoints. If, in the ABAP Debugger, you check Update Debugging  under Settings and then, for example, call the update module func using CALL FUNCTION func IN UPDATE TASK, a new window is opened in which you can debug this function module in the update session. All the breakpoints that were set in the calling processing unit can also be processed here.
    For further information on special breakpoints, refer to:
    Breakpoints at Statements
    Breakpoints at Subroutines
    Breakpoints at Function Module Calls
    Breakpoints at Methods
    Breakpoints at System Exceptions
    h2 page  break h2
    WINDOW TYPES
    When defining a layout set window, you must select a window type for the window. You can choose between three types:
    • Constant windows (CONST)
    • Variable windows (VAR)
    • Main windows (MAIN)
    CONSTANT WINDOW
    A window of type CONST has the same contents and size on all layout set pages, on which a corresponding page window is defined. This allows the processing of the window contents to be optimized internally.
    Page windows whose allocated window is of type CONST must have the same size throughout the layout set. If a window of type CONST is full, all remaining text the application program wants to output in this window, is lost. Constant windows do not trigger a page break. In other words: all text exceeding the window size is simply truncated.
    VARIABLE WINDOW
    The contents of variable windows is processed again for each page, on which the window appears. The system outputs only as much text as fits into the window. Text exceeding the window size is truncated; the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different layout set pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike. The only difference is that constant windows have the same size throughout the layout set.
    MAIN WINDOW
    Each layout set must have one window of type MAIN. Such a window is called the main window of the layout set. For SAPscript layout sets, the main window has a central meaning:
    • It controls the page break.
    • It contains the text body that may cover several pages.
    • It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the layout set. The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page. This page must not call itself as subsequent page (recursive call), since this would produce an endless loop. In such a case, SAPscript terminates the output after three subsequent pages.
    HOW THE COMPOSER WORKS
    The composer or layout set processor is the central formatting module for the print output. It prepares the texts for the different output devices by using the allocated styles or layout sets.
    Processing a layout set happens in a certain order. You must know some facts concerning the different window types, the setting of subsequent pages, or the dynamic control from within the print program.
    Page control in layout sets
    Define subsequent page statically
    Define subsequent page dynamically
    Format a layout set page
    PAGE CONTROL IN LAYOUT SETS
    SAPscript automatically triggers a page break as soon as the main window of one page is full. To be able to execute the page break, the system must know on which subsequent page to continue outputting the text. You can specify the subsequent page either statically when defining the layout set, or you can set the subsequent page dynamically during layout set output.
    If the subsequent page is not specified, SAPscript automatically terminates printing, thereby ignoring any other output statements of the application program.
    DEFINE SUBSEQUENT PAGE STATICALLY
    You define the subsequent page statically with the layout set maintenance transaction. First, specify the start page in the layout set header. The system automatically calls this page whenever the layout set is started. With this page, or, more correctly, with the page window of this page, the text output starts. For each page, specify the subsequent page in the page definition. After a page break, the system continues text output on the subsequent page defined for the last page. By specifying start page and subsequent pages, you can define a page sequence.
    DEFINE SUBSEQUENT PAGE DYNAMICALLY
    The page sequence set in the layout set definition can be changed by the application program dynamically at runtime. If you want the layout set to start with a page other than the one defined in the layout set header, specify the desired start page using the parameter STARTPAGE when you call the function module START_FORM. However, this new start page is valid only for the current call of the function module.
    If you want to break to a subsequent page other than the one specified in the page definition, use the control statement NEW-PAGE to set the name of the new page.
    NEW-PAGE .
    NEW-PAGE ends the output on the current page. The new subsequent page is only valid for the current call of the control statement. You can either include the control statement explicitly into the text of a text element or pass it to the layout set output using the function module CONTROL_FORM.
    FORMAT LAYOUT SET PAGE
    The process of formatting the output is controlled by the text contents in the BODY area of the main window. If the main window is completely filled, or if the control statement NEW-PAGE appears in the main window, the system executes a page break. Only at this point in time the system formats the contents of the windows of the other types and replaces the variables with the current values.
    For each other window, the system first outputs the default text element, if it exists. Then it processes and formats the list of the active text elements of this window, which you set using the function module WRITE_FORM with the parameter FUNCTION (SET, APPEND, DELETE). Any text that does not fit into the page window is truncated.
    As a consequence to this processing order of the composer, the reservation of space for the TOP and BOTTOM areas must be made beforehand. If the BODY area of the main window already contains text, a new text output to the TOP area does not appear on the current page but on the subsequent page in the TOP area. The same applies for the BOTTOM area. If the BODY area is filled to such an extend that the new BOTTOM text no longer fits into the current main window, this text appears on the subsequent page in the BOTTOM area.
    A frequent error in application programs is that for the subsequent page (for example, NEXT) of a layout set no main window is defined. If the formatted text of the previous page did not fit into the corresponding main window , the composer searches the subsequent pages for a main window to output the text remainder. However, if the subsequent page of NEXT is NEXT again, the composer encounters an endless loop.
    To be able to create correct page breaks in longer text, you should define a main window on each layout set page.
    LAYOUT SET CONTROL
    To output SAPscript layout sets, in the print program you must always start the output with OPEN_FORM and end it with CLOSE_FORM. The function module OPEN_FORM initializes the SAPscript composer and opens the specified layout set for subsequent output. The system combines all output for this layout set up to the CLOSE_FORM to one print request. If CLOSE_FORM is missing, nothing will be printed.
    To output data in a layout set, you must use the SAPscript function modules WRITE_FORM, WRITE_FORM_LINES, and CONTROL_FORM. You can use these function modules any number of times in any order between opening and closing a layout set.
    You cannot use the ABAP/4 statement WRITE to write output to a SAPscript layout set.
    Several print requests
    Start a layout set again
    Switch layout sets
    Find layout sets
    SEVERAL PRINT REQUESTS
    Within one transaction, you can open and close several layout sets using OPEN_FORM and CLOSE_FORM, however not simultaneously. You can use parameters in the OPEN_FORM to control whether the output is stored in the same print request. But also the SAP spool decides, depending on several plausibility checks, whether new output is appended to an existing print request or whether to create a new print request anyway.
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'CLOSE_FORM'
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'CLOSE_FORM'
    You cannot combine ABAP/4 list output and SAPscript output in one print request.
    START A LAYOUT SET AGAIN
    Usually a print program does not print only one urging letter or one account statement, but several layout sets for different customers. To have the output for each customer begin with the start page of the layout set, you must start the current layout set again and again.
    To start a layout set again, you must first end the current layout set and then open the layout set again. Within one print request, first call the function module END_FORM. It executes the final processing for the current layout set. Then start the layout set again using START_FORM. Output then begins again on the start page of the desired layout set.
    CALL FUNCTION 'OPEN_FORM'
    CALL FUNCTION 'START_FORM'
    CALL FUNCTION 'END_FORM'
    CALL FUNCTION 'START_FORM'
    CALL FUNCTION 'END_FORM'
    CALL FUNCTION CLOSE_FORM
    If you use START_FORM and END_FORM, you must not specify a layout set for OPEN_FORM. However, in this case you can use the SAPscript output functions only after opening a layout set with START_FORM.

Maybe you are looking for