Typical problem in SCRIPTS

Hello Experts,
I am working on SAP script where i have to display the records in a page from a internal table.
begin of xtab occurs 0,
vbeln like vbak-vbeln,
matnr like mara-matnr,
maktx like makt-maktx,
erdat like vbak-erdat,
date_var(1),       "indicates date change with 'x'
status(1),         "indicates vbeln change with 'x'
end of xtab.
now my requirement to display to have the script is
1) when ever the date_var is 'X' a new page should trigger.
2) when ever status = 'X' there should be
a line after the display of records indicating the change of vbeln saying
"there are xxx number of materials for vbeln"
THE PROBLEM:-
    suppose if a page can hold 20 records. and if I have 23 records.  the 3 records are dispalying in next page, with "there are xxx number of materials for vbeln"
which is fine.
     But if when there is change of date at 24th record, where a new page should trigger- this
     is not happening and further more records from 24 index are attaching after the
     "there are 23 number of materials for vbeln are used".
    My exceptation over this display should is - it should display 20 records in frist page
    and move to next page to display 3 records along with "there are 23 number of materials for
    vbeln are used"  ( As the page could hold only 20 records). and THEN AFTER THIS AS THERE IS
    CHANGE IN DATE IT SHOULD TRIGGER A NEW PAGE to display from 24th record.
  Please Help me in giving the code for this.
Thanks
Mary

Hi Mary,
I suppose you can modify the printing program.
Try to work with an internal table like:
<i>erdat like vbak-erdat,
vbeln like vbak-vbeln,
matnr like mara-matnr,
maktx like makt-maktx,</i>
So the code could be something as:
<i>SORT XTAB BY ERDAT VBELN
LOOP AT XTAB
AT NEW ERDAT
  if sy-tabix > 1.
    NEW-PAGE (function).
  endif.
ENDAT
AT END OF VBELN.
  WRITE_FORM (function)
  Element = text containing numbers of materials
ENDAT
ENDLOOP</i>

Similar Messages

  • Problem in script format

    hi,
    i am having problem in script , the problem is
    s.no|    descriptio                           |   UOM                      |          Qty                   |             Rate           |          AMT            |
    01     aaaaaaaaaaaaaaaaaaaaa       11.01                             17.28                     170000000               2400000
    this is fine but when the 1st column is shot other also get affected.
    s.no|    descriptio                           |   UOM                      |          Qty                   |             Rate           |          AMT            |
    01     aa       11.01                             17.28                     170000000               2400000
    and i cannot draw vertical line here .what is the solution for this.
    Edited by: jaihind on Mar 6, 2010 12:21 PM
    hi,
    problem is if the description field is long then other coloum are comming fine but if description caloumn is small then other also get affected and its comes towards left .
    Edited by: jaihind on Mar 6, 2010 12:22 PM

    Hi
    For this u can resolve by using the Formatting characters ......
    This is your layout ..
    s.no| descriptio | UOM | Qty | Rate | AMT |
    01 aaaaaaaaaaaaaaaaaaaaa 11.01 17.28 170000000 2400000
    Assume that   your field names like  
    s.no      |  description  |    UOM      |    Qty      |      Rate      |         AMT       |
    &sno&      &desc&         &UOM&       &Qty&         &rate&         &AMT&
    asseme that  length of these fields(in characters) as per your requirement will be ...
    s.no      |  description  |    UOM      |    Qty      |      Rate      |         AMT       |
    8                  15                  5                8                 10                  15
    For these use formatting characters    like   ...
                  s.no      |  description      |    UOM      |    Qty      |      Rate      |         AMT       |
    1stLine  &sno& ,,  &desc+0(15)&,,  &UOM&       &Qty&        &rate&         &AMT&
    2ndline                 &desc+15(15)&     
    &desc+0(15)&  -  it will print  first 15 characters from 0th position
    &desc+15(15)&- From 15th position it will print 15 characters ..
    Hope you resolve your issue
    Let me know if Any concerns,.......

  • Typical Problem !! File Download UI related

    Dear All,
    I'm stuck in a typical problem. I upload files thru the File Upload UI and generate uique IDs against every upload document.
    For displaying the documents, the user goes thru a web page that has URL to a WDA application.
    This WDA application has the unique Number as application paramater.
    The problem : If the default view of the WDA has a button and on click the uploaded file opens properly. But if I write the same code in WDINIT , the code gets executed but doesn't open the uploaded file. Reason??? I fail to understand !!!
    Any help would be highly appreciated.
    Regds,
    Srini

    Are you using the attach file to response API?  Basically in the WDDOINIT, the page is being built for the first time. Therefore the framework on the client side isn't rendered yet to be able to download a file.  If you want a file download to trigger "automatically" upon a page load; consider using a timedTrigger UI element set to 1 second and then download the content upon the event of the timedTrigger.
    Is this WDA only being used to download the files via a Link?  If so consider if you really need WDA for this.  That's a heavy weight framework if you are only wanting to push the download of a file. A stateless BSP or even a ICF handler class might be much better options.

  • A typical problem

    hi,
    I m in the middle of a typical problem.
    I have this table abc with columns
    ( x varchar2(10),
    y varchar2(10),
    z varchar2(10)
    the contents of which look like this
    table : abc
    x y z
    5 .5*x .1+x
    10 .75*x
    columns y and z r storing the formula.
    now my problem is
    I have another table
    PQR (x number(5,2), y number(5,2), z number(5,2))
    I want the result of this table to look like this
    table : PQR
    x y z
    5 2.5 .5
    10 7.5
    i. e the formula should get executed and the result to be placed
    in the corresponding columns of PQR.
    I just hope someone comes up with the following result. I would
    be very thankfull to the person.

    Hi...
    You might try something like this...
    DECLARE
      vabc_x abc.x%TYPE ;
      vabc_y abc.y%TYPE ;
      vabc_z abc.z%TYPE ;
      vpqr_x pqr.x%TYPE ;
      vpqr_y pqr.y%TYPE ;
      vpqr_z pqr.z%TYPE ;
    BEGIN
      SELECT x, y, z
        INTO vabc_x, vabc_y, vabc_z
        FROM abc ;
      SELECT TO_CHAR(x), TO_CHAR(y), TO_CHAR(z)
        INTO vpqr_x, vpqr_y, vpqr_z
        FROM pqr ;
      EXECUTE IMMEDIATE
      'SELECT ('||REPLACE(vabc_x,vpqr_x)||') FROM DUAL'
      INTO vpqr_x ;
      EXECUTE IMMEDIATE
      'SELECT ('||REPLACE(vabc_y,vpqr_y)||') FROM DUAL'
      INTO vpqr_y ;
      EXECUTE IMEDIATE
      'SELECT ('||REPLACE(vabc_z,vpqr_z)||') FROM DUAL'
      INTO vpqr_z ;
      UPDATE pqr SET x = vpqr_x, y = vpqr_y, z = vpqr_z ;
    END ;.
    Hope this helps. Good Luck.

  • Priniting problem in script

    Hi friends,
    i am facing a problem in script. i have developed the form
    and it is working fine .in print preview every thing seems to be ok.
    when we try to take a print the right side characters are cutting down by 2
    characters every time.
    i have moved the content to left but the result is the same.
    can any one tell me how to solve the issue.
    Regards,
    Srinivas

    Hi,
    Try to check the lenght of the field/var that you are printing.
    change the alignment doesnt solve the problem.
    Check in your code what is the lenght and if is the same in your form.
    Sample:
    &j_1bprnfli-cfop(4C)&
    prints only 4 digits of the variable j_1bprnfli-cfop.
    Regards.
    Rodrigo Paisante

  • Problem in script printing

    Hi Guru's
    I have a problem in script printing.
    The quantity and netprice are printing incorrectly. i.e., quantity should print as 1.000 where as it is printing as 1,000 and net price is printing as 5,30 instead of 5.30.
    I have checked in the owndata settings it is like 1,234,56.00.
    I would like to know whether any settings will be there or i need to do any modificatione
    Waiting for you reply.

    Hi!
    Here you can find the SAPScript formatting options.
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/803411454211d189710000e8322d00/content.htm
    If it is not good for you, you might code it in your printer program and put it into a character variable.
    Regards
    Tamá

  • Typical problem in java program ?

    Typical problem in java program ?
    I have three java files , i am pasting them here. Please show me the errors. Compilation error in Cat.java
    File 1 : Dog.java
    public class Dog extends Animal {
    public String noise() { return "back"; }
    File 2 : Cat.java
    public class Cat extends Animal {
    public String noise() {
    return "meow";
    File 3:AnimalTest.java
    public class AnimalTest {
    public static void main(String[] args)
    Animal animal = new Dog();
    //Cat cat = (Cat)animal;
    Cat cat = new Cat();
    System.out.println(cat.noise()...
    Output :
    D:\>javac AnimalTest.java
    .\Cat.java:4: illegal start of expression
    ^
    .\Cat.java:5: ';' expected
    ^
    .\Cat.java:5: '}' expected
    ^
    3 errors
    Please help me. Not a homework.
    Message was edited by:
    Taton

    D:\>javac AnimalTest.java
    .\Cat.java:4: illegal start of expression
    ^You really need to start to understand what you are doing. Look at the error, it even points to what the error is. Look at where this bracket appears in your code and think to yourself "Should that be there or should it be something else" Once you fix that, the other errors will probably disappear.
    Stoopid lag.
    Message was edited by:
    flounder

  • Typical Problem

    Hi,
    I am facing a typical problem.
    When I am doing the usage decision of the quality lot, the batch to batch transfer is getting trigerred automatically,
    for ex: 1st inspection lot   ABCD    batch 150000  UD done
    2nd inspection lot   ABCD    batch 150001, Once the  UD is done, movement type 321 the material gets transferred automatically in the batch generated for 1st inspection kot i.e., 150000.
    In short for all the inspection lot for ABCD, when ever I do the UD and save, there is batch to batch transfer is getting trigerred automatically in background.
    Kindly help.
    Regards,
    Narendra

    Dear,
    Is this problem with all materail?
    How the system is creating same lot number with different batches could you please explain the process?
    At the time of giving Usage Decision in QA32, you will get a button for "Create Batch" besides Batch and Plant field. Just click on this Icon, user need not to enter the Batch No manually.
    Deactivate the batch creation for movement type 321 in Batch management.
    Go to SPRO > Logistics - General > Batch Management > Creation of New Batches > Define Batch Creation for Goods Movements > Here for movement type "321", keep "D" (Manual without check) under "New Batch" column.
    Regards,
    R.Brahmankar

  • HI i have macbook pro with OSX 10.8. I am facing typical problem with Wi- Fi , in school wi-fi it does'nt connects to http sites and connects only https  but in home wi-fi it connects to all all http and https sites. How fix this problem as I am new this

    HI i have macbook pro with OSX 10.8. I am facing typical problem with Wi- Fi , in school wi-fi it does'nt connects to http sites and connects only https as no security/proxy settings done but in home wi-fi it connects to all  http and https sites. How to fix this problem as I am new this operating system. Please any one help me in this as I have installed Delicious Library which is not working in school becoz it searches amzon http site.

    I would imagine that at school, you're required to connect through an HTTP proxy.
    From the menu bar, select
     ▹ System Preferences ▹ Network
    If the preference pane is locked, click the lock icon in the lower left corner and enter your password to unlock it. Then click the Advanced button and select the Proxies tab. Enter the proxy settings given to you by the network administrator. Click OK and then Apply.
    You may wish to create separate network locations for home and school. See the built-in help for instructions.

  • Lately and i dont know why i see a pop up about a problem with script. can some1 help me?

    there is a pop up about a problem with script. it ask me end and contuniue the script. i didnt have that problem before. plz help me it gets really irritating. it asks a lot

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • A typical problem : urgent

    hi,
    I m in the middle of a typical problem.
    I have this table abc with columns
    ( x varchar2(10),
    y varchar2(10),
    z varchar2(10)
    the contents of which look like this
    table : abc
    x y z
    5 .5*x .1+x
    10 .75*x
    columns y and z r storing the formula.
    now my problem is
    I have another table
    PQR (x number(5,2), y number(5,2), z number(5,2))
    I want the result of this table to look like this
    table : PQR
    x y z
    5 2.5 .5
    10 7.5
    i. e the formula should get executed and the result to be placed
    in the corresponding columns of PQR.
    I just hope someone comes up with the following result. I would
    be very thankfull to the person.

    If the formula is always in the fashion u mentioned in the table
    ABC i.e, a number multiplied with x then do this way.
    store the value of the number only in the y column and z column,
    i.e, if .5*x is the formula then store .5 only in column y.
    and if .1*x is the formula then store .1 only in column z.
    then use a procedure to update PQR table.
    the procedure can be in this way.....
    Use a cursor with a select statement to retrive the values of
    table ABC.
    and store these values in local variable.
    say LVX,LVY,LVZ
    declare another 2 local variables- LVQ,LVR
    and say LVQ=LVY*LVX
    and LVR=LVZ*LVX
    and insert into table PQR (x,y,z)
         values (LVX,LVQ,LVR);
    Hope this helps u.
    If u could get a solution for invoking MSWORD or Powerpoint,
    please let me know.

  • Having multiple problems with script - NTFS Permissions and AD Groups

    Hi, all!  I'm having multiple problems with my first script I've written with Powershell.  The script below does the following:
    1. Prompts the user for a corporate division under which a shared folder will be created, and adjusts variables accordingly.
    2. Prompts if the folder will be a global folder or an office/location-specific folder, and makes appropriate adjustments to variables.
    3.  If a global folder, prompts for the name.  If an office/location-specific folder, prompts for each component of the street address, city and state and an optional modifier.  I've prompted for this information in this way because the information
    is used differently later on in the script.
    4.  Verifies the entered information and requests confirmation to proceed.
    5.  Creates the folder.
    6.  Creates an AD OU and/or security group(s).
    7.  Applies appropriate security groups to the new folder and removes undesired permissions.
    Import-Module ActiveDirectory
    $Division = ""
    $DivAbbr = ""
    $OU = ""
    $OUDrive = "AD:\"
    $FolderName = ""
    $OUName = ""
    $GroupName = ""
    $OURoot = "ou=DFS Restructure Testing OU,ou=Pennsylvania Camp Hill 4410 Industrial Park Rd,ou=Locations,ou=Camp Hill,dc=jacobsonco,DC=com"
    $FSRoot = "E:\"
    $FolderPath = ""
    $DefaultFolders = "Archive","Customer Service","Equipment","Inbounds","Management","Outbounds","Processes","Projects","Quality","Reports","Returns","Safety","Schedules","Time Keeping","Training"
    [bool]$Location = 0
    do {
    $userInput = Read-Host "Enter CLS Division: (W)arehousing, (S)taffing, or (P)ackaging"
    Switch ($userInput)
    W {$Division = "Warehousing"; $DivAbbr = "WHSE"; $OU = "ou=Warehousing,"; break}
    S {"Staffing is not yet implemented."; break}
    P {"Packaging is not yet implemented."; break}
    default {"Invalid choice. Please re-enter."; break}
    while ($DivAbbr -eq "")
    write-host ""
    write-host ($Division + " was selected.")
    $FolderPath = $Division + "\"
    write-host ""
    $choice = ""
    do {
    $choice = Read-Host "Will this be a (G)lobal folder or (L)ocation folder?"
    Switch ($choice)
    G {$Location = $false; break}
    L {$Location = $true; $FolderPath = $FolderPath + "Locations\"; $OU = "ou=Locations," + $OU; break}
    default {"Invalid choice. Please re-enter."; $choice = ""; break}
    while ($choice -eq "")
    write-host ""
    write-host ("Location is set to: " + $Location)
    write-host ""
    if ($Location -eq $false) {
    $FolderName = Read-Host "Please enter folder name:"
    $GroupName = $DivAbbr + " " + $FolderName
    } else {
    $input = Read-Host "Please enter two-letter state abbreviation:"
    $FolderName = $FolderName + $input + " "
    $input = Read-Host "Please enter city:"
    $FolderName = $FolderName + $input + " "
    $input = Read-Host "Please enter street address number only:"
    $FolderName = $FolderName + $input
    $GroupName = $DivAbbr + " " + $FolderName
    $FolderName = $FolderName + " "
    $input = Read-Host "Please enter street name:"
    $FolderName = $FolderName + $input
    $input = Read-Host "Please enter any optional information to appear in folder name:"
    if ($input -ne "") {
    $FolderName = $FolderName + " " + $input
    $OUName = $FolderName
    write-host
    write-host "Path for folder: "$FSRoot$FolderPath$FolderName
    write-host "AD Path: "$OUDrive$OU$OURoot
    write-host "New OU Name: "$OUName
    write-host -NoNewLine "New Security Group names: "$GroupName
    if ($Location -eq $true) { write-host " and "$GroupName" MGMT" }
    write-host
    $input = Read-Host "Please confirm creation of new site/folder: (Y/N) "
    if ($input -ne "Y") { Exit }
    write-host
    write-host -NoNewLine "Folder exists: "; Test-Path ($FSRoot + $FolderPath + $FolderName)
    if (Test-Path ($FSRoot + $FolderPath + $FolderName)) {
    Write-Host "Folder already exists! Skipping folder creation..."
    } else {
    write-host "Folder does not exist. Creating..."
    new-item -path ($FSRoot + $FolderPath) -name $FolderName -itemtype directory
    Set-Location ($FSRoot + $FolderPath + $FolderName)
    if ($Location -eq $true) {
    $tempOUName = "ou=" + $OUName + ","
    write-host
    write-host $OUDrive$tempOUName$OU$OURoot
    write-host
    write-host -NoNewLine "OU exists: "; Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)
    if (Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)) {
    Write-Host "OU already exists! Skipping OU creation..."
    } else {
    write-host "OU does not exist. Creating..."
    New-ADOrganizationalUnit -Name $OUName -Path ($OU + $OURoot) -ProtectedFromAccidentalDeletion $false
    $GroupNameMGMT = $GroupName + " MGMT"
    if (!(Test-Path ($OUDrive + "CN=" + $GroupName + "," + $tempOUName + $OU + $OURoot))) { write-host "Normal user group does not exist. Creating..."; New-ADGroup -Name $GroupName -GroupCategory Security -GroupScope Global -Path ("OU=" + $OUName + "," + $OU + $OURoot)}
    if (!(Test-Path ($OUDrive + "CN=" + $GroupNameMGMT + "," + $tempOUName + $OU + $OURoot))) { write-host "Management user group does not exist. Creating..."; New-ADGroup -Name $GroupNameMGMT -GroupCategory Security -GroupScope Global -Path ("OU=" + $OUName + "," + $OU + $OURoot)}
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    $FolderACL.SetAccessRuleProtection($True,$True)
    # $FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
    $BIUsers = New-Object System.Security.Principal.NTAccount("BUILTIN\Users")
    $BIUsersSID = $BIUsers.Translate([System.Security.Principal.SecurityIdentifier])
    write-host $BIUsersSID.Value
    # out-string -inputObject $BIUsers
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($BIUsersSID.Value,"ReadAndExecute,AppendData,CreateFiles,Synchronize","ContainerInherit, ObjectInherit", "None", "Allow")
    $FolderACL.RemoveAccessRuleAll($Ar)
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    get-acl ($FSRoot + $FolderPath + $FolderName) | fl
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    $ADGroupName = "JACOBSON\" + $GroupName
    $objUser = New-Object System.Security.Principal.NTAccount($ADGroupName)
    $objUser.Translate([System.Security.Principal.SecurityIdentifier]).Value
    write-host $ADGroupName
    write-host $objUser.Value
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName,"ReadAndExecute","ContainerInherit, ObjectInherit", "None", "Allow")
    Out-String -InputObject $ar
    $FolderACL.AddAccessRule($Ar)
    $ADGroupName = "JACOBSON\" + $GroupNameMGMT
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName, "Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
    Out-String -InputObject $ar
    $FolderACL.AddAccessRule($Ar)
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    } else {
    $tempOUName = "cn=" + $GroupName + ","
    write-host
    write-host $OUDrive$tempOUName$OU$OURoot
    write-host
    write-host -NoNewLine "Group exists: "; Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)
    if (Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)) {
    Write-Host "Security group already exists! Skipping new security group creation..."
    } else {
    write-host "Security group does not exist. Creating..."
    New-ADGroup -Name $GroupName -GroupCategory Security -GroupScope Global -Path ($OU + $OURoot)
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    $ADGroupName = "JACOBSON\" + $GroupName
    $FolderACL.SetAccessRuleProtection($True,$True)
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName,"Modify","ContainerInherit, ObjectInherit", "None", "Allow")
    $FolderACL.AddAccessRule($Ar)
    $FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    My problems right now are in the assignment/removal of security groups on the newly-created folder, and the problems are two-fold.  Yes, I am running this script as an Administrator.
    First, I am unable to remove the BUILTIN\Users group from the folder when this is an office/location-specific folder.  I've tried to remove the group in several different ways, and none are having any effect.  Oddly, if I type in the lines directly
    into Powershell, they work as expected.  I've tried the following methods:
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    $FolderACL.SetAccessRuleProtection($True,$True)
    $FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    $FolderACL.SetAccessRuleProtection($True,$True)
    $BIUsers = New-Object System.Security.Principal.NTAccount("BUILTIN\Users")
    $BIUsersSID = $BIUsers.Translate([System.Security.Principal.SecurityIdentifier])
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($BIUsersSID.Value,"ReadAndExecute,AppendData,CreateFiles,Synchronize","ContainerInherit, ObjectInherit", "None", "Allow")
    $FolderACL.RemoveAccessRuleAll($Ar)
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    In the first case, the script goes through and has no apparent effect because afterwards, I do a get-acl and the BUILTIN\Users group is still there, although when looking through the GUI, inheritance appears to have been broken from the parent folder.
    In the second case, I get the following error message:
    Exception calling "RemoveAccessRuleAll" with "1" argument(s): "Some or all identity references could not be translated."
    At C:\Users\tesdallb\Documents\FileServerBuild.ps1:110 char:5
    +     $FolderACL.RemoveAccessRuleAll($Ar)
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IdentityNotMappedException
    This seems strange that the local server is unable to translate the SID of a BUILTIN account.  I've also tried explicitly putting in the BUILTIN\Users SID in place of the variable in the New-Object line, but that gives me the same error.  I've
    also tried the solutions given in this thread:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ad59dc58-1360-4652-ae09-2cd4273cbd4f/remove-acl-issue?forum=winserverpowershell and at this URL:
    http://technet.microsoft.com/en-us/library/ff730951.aspx but these solutions also failed to have any effect.
    My second problem is when I try to apply the newly-created security groups, I also will get the "Some or all identity references could not be translated."  I thought I had found a workaround to the problem by adding the -PassThru option to
    the New-ADGroup commands, because it would output the SID of the group after creation, however a few lines later, the server is unable to translate the account to apply the security groups to the folder.
    My first Powershell script has been working well up to this point and now I seem to have hit a showstopper.  Any help is appreciated.
    Thanks!

    I was hoping to stay with strictly Powershell, but unless I can find a Powershell solution, I may resort to ICACLS.
    As for the problems with my groups not being translatable right after creating them, I think I have solved this problem by using the -Server parameter on all my New-ADGroup commands and this example code seems to have gotten around the translation problem,
    again utilizing the -Server parameter on the Get-ADGroup command:
    get-acl ($FSRoot + $FolderPath + $FolderName) | fl
    $FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
    # Add the new normal users group to the folder with Read and Execute permissions
    $GroupSID = Get-ADGroup -Identity $GroupName -Server chadc01.jacobsonco.com | Select-Object -ExpandProperty SID
    $SIDIdentity = New-Object System.Security.Principal.SecurityIdentifier($GroupSID)
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($SIDIdentity,"ReadAndExecute","ContainerInherit, ObjectInherit", "None", "Allow")
    $FolderACL.AddAccessRule($Ar)
    # Add the management users group to the folder with Modify permissions
    $GroupMGMTSID = Get-ADGroup -Identity $GroupNameMGMT -Server chadc01.jacobsonco.com | Select-Object -ExpandProperty SID
    $SIDIdentity = New-Object System.Security.Principal.SecurityIdentifier($GroupMGMTSID)
    $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($SIDIdentity, "Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
    $FolderACL.AddAccessRule($Ar)
    Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
    Going this route seems to ensure that the Domain Controller I'm creating my groups on is the same one that I'm querying for the group's SID to use in the FileSystemAccessRule.  It's been working fairly consistently.
    Still having issues with the translation of the BUILTIN\Users group, though. 

  • Page problem in script

    Hi,
    I have one more problem. Actually my script having only one page output. But in second page also logo is printing.
    I don't want second page. In first page I have only two windows main & logo.
    Could you please suggest me how to do it.

    Hi!
    You have to set up 2 pages in SE71, FIRST, and NEXT.
    FIRST has to contain the LOGO and MAIN windows.
    NEXT has to contain only the MAIN window.
    At the FIRST page you have to set the next page as NEXT page.
    At the NEXT page you have to set the next page as NEXT page (same as FIRST).
    This makes your NEXT sides not to print the logo and handles accidentally data overflow to your second page.
    Check out if there is an explicit /: NEW-PAGE in your sapscript, this causes problems also.
    Regards
    Tamás
    Message was edited by:
            Tamás Nyisztor

  • Problem in script output sending mail

    hi ,
    I have a problem sending a mail with script output as attachment . I have searched in the forum for the answers but none is solved my question.
    I am sending the data to the otf and it is getting the otfdata. but it is not showing  the data on the script when it is sent as an attachment to the email , but it is showing only script with null values filled.( means i am getting the mail with attachment but in that attachment there is no data filled in the script send).
    the code is like this ..
    here i am filling the otfdata and i am exporting the otfdata
    CALL FUNCTION 'ZMM_ARRANG_ENTRY_ABR_NATRAB'
        EXPORTING
          i_nast       = nast
          i_fonam      = tnapr-fonam
          i_xscreen    = pi_xscreen
          i_arc_params = arc_params
          i_toa_dara   = toa_dara
        IMPORTING
          e_retcode    = px_retcode
        EXCEPTIONS
          OTHERS       = 1.
      IF ( sy-subrc <> 0 ).                "Fehler
        MOVE sy-subrc TO px_retcode.
        IF ( pi_xscreen = 'X' ).           "Ausgabe auf Bildschirm
          MESSAGE ID     sy-msgid
                  TYPE   sy-msgty
                  NUMBER sy-msgno
                  WITH   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.
    *---Import OTFDATA from the memory
        IMPORT  it_otfdata FROM MEMORY ID 'OTF'.
      ENDIF.
      wa_maildata-obj_name = 'EMAIL'.
      wa_maildata-obj_descr = 'Settlement Details'.
    *-----mail contents
      it_mailtext-line = 'Sub-sequent settlement Details'.
      APPEND it_mailtext.
      DESCRIBE TABLE it_mailtext LINES v_lines.
      READ TABLE it_mailtext INDEX v_lines.
      wa_maildata-doc_size = ( v_lines - 1 ) * 255 + STRLEN( it_mailtext ).
    *Creation of the entry for the compressed document
      CLEAR it_mailpack-transf_bin.
      it_mailpack-head_start = 1.
      it_mailpack-head_num   = 0.
      it_mailpack-body_start = 1.
      it_mailpack-body_num   = v_lines.
      it_mailpack-doc_type   = 'RAW'.
      APPEND it_mailpack.
    *-----Get OTF data
      LOOP AT it_otfdata.
        it_mailcont-line = it_otfdata.
        APPEND it_mailcont.
      ENDLOOP.
    *---Move  OTF data into binary table
      LOOP AT it_mailcont.
        MOVE-CORRESPONDING it_mailcont TO it_mailbin.
        APPEND it_mailbin.
      ENDLOOP.
    *---Get no of lines in Binary data table
      DESCRIBE TABLE it_mailbin LINES v_lines.
    *---Fill name of the header of email
      it_mailhead = 'Subsequent Settlement Details.OTF'.
      APPEND it_mailhead.
    *---Creation of the entry for the compressed attachment
      it_mailpack-transf_bin   = 'X'.
      it_mailpack-head_start   = 1.
      it_mailpack-head_num     = 1.
      it_mailpack-body_start   = 1.
      it_mailpack-body_num     = v_lines.
      it_mailpack-doc_type     = 'OTF'.
      it_mailpack-obj_name     = 'EMAIL'.
      it_mailpack-obj_descr    = 'Settlement Details'.
      it_mailpack-doc_size     = v_lines * 255.
      APPEND it_mailpack.
    *----Get email address from the address number of vendor
      CALL FUNCTION 'ADDR_GET_REMOTE'
        EXPORTING
          addrnumber = l_adrnum
        TABLES
          adsmtp     = it_adsmtp.
    *----Get mail address
      READ TABLE it_adsmtp WITH KEY remark = 'AP_SUB_SETT'.
      IF sy-subrc = 0.
        it_mailrec-receiver   = it_adsmtp-smtp_addr.
        it_mailrec-rec_type   = 'U'.
        it_mailrec-com_type   = 'EXT'.
        APPEND it_mailrec.
    *---Send email with PDF attachment
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data = wa_maildata
            put_in_outbox = 'X'
            COMMIT_WORK   = 'X'
          TABLES
            packing_list  = it_mailpack
            object_header = it_mailhead
            contents_bin  = it_mailbin
            contents_txt  = it_mailtext
            receivers     = it_mailrec.
      ELSE.
        MESSAGE 'No email id Exist for the vendor' TYPE 'E'.
      ENDIF.
    please suggest me with your valuable answers .
    Regards,
    Venkat Appikonda.

    Hi venkat
    Just check if this helps you.
    The following part of the code does exactly that.
    Selecting details from the spool request table.
      SELECT * FROM tsp01 INTO TABLE tb_spool
               WHERE rqowner = sy-uname.
      IF sy-subrc EQ 0.
        SORT tb_spool DESCENDING BY rqcretime.
        CLEAR : tb_spool.
        READ TABLE tb_spool INDEX 1.
    convert spool into PDF format.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid = tb_spool-rqident
             TABLES
                  PDF         = tb_lines.
      ENDIF.
    After this, on execution we get the below mentioned message.
    This indicates that a PDF of the SAP Script has been created which is in the format u201C132-long stringsu201D.
    In order to send the mail across, the mailing format of the PDF supports u201C255-long stringsu201D. So, the present u201C132-long stringsu201D needs to be converted into u201C255-long stringsu201D. This along with the mail code is mentioned below.
      DATA: lv_receiver(50) TYPE c.
      REFRESH: tb_obj_txt,
               tb_obj_bin,
               tb_obj_head,
               tb_paklist,
               tb_receiver.
      CLEAR: tb_obj_txt,
             tb_obj_bin,
             tb_paklist,
             tb_obj_head,
             tb_receiver.
      CLEAR: tb_adrc.
    IF NOT tb_adrc[] IS INITIAL.
    Reading the address table with the key as address number.
        READ TABLE tb_adrc WITH KEY addrnumber = tb_kna2-adrnr.
        IF sy-subrc EQ 0.
    Vendor Email ID.
          SELECT SINGLE smtp_addr
             FROM adr6
             INTO wf_mailaddr
             WHERE addrnumber = tb_adrc-addrnumber.
          IF sy-subrc EQ 0.
    Moving the mail address to the receiver itab
            MOVE wf_mailaddr TO tb_receiver-receiver.
            tb_receiver-rec_type = text-011.
            APPEND tb_receiver.
          ELSE.
            CONCATENATE text-004 tb_kna2-kunnr text-005 INTO lv_receiver
                                       SEPARATED BY space.
    If pa_call is initial, the receiver ID is printed; else an INVALID E-mail ID    message gets flashed.
            IF pa_call IS INITIAL.
              WRITE :/ lv_receiver.
            ENDIF.
            CLEAR: itab.
            itab-kunnr = tb_kna2-kunnr.
            itab-message = lv_receiver.
            APPEND itab.
            EXIT.   u201CNo mailing for invalid Email id
          ENDIF.
        ENDIF.
      ENDIF.
      wf_name = sy-uname.
      wf_year = tb_main-bldat(4).
      wf_mon = tb_main-bldat+4(2).
    *This FM gives the name of the months. 
    CALL FUNCTION 'MONTH_NAMES_GET'
           EXPORTING
                language    = sy-langu
           TABLES
                month_names = tb_months.
      IF sy-subrc EQ 0.
        READ TABLE tb_months WITH KEY mnr = wf_mon.
        IF sy-subrc EQ 0.
          wf_name = tb_months-ktx.
        ENDIF.
      ENDIF.
      CLEAR: tb_contp.
    IF NOT tb_contp[] IS INITIAL.
    *Reading the contp itab as per the customer entered on the selection screen.
        READ TABLE tb_contp WITH KEY bukrs = pa_bukrs
                                     kunnr =  tb_kna2-kunnr.
        IF sy-subrc EQ 0.
        CONCATENATE text-006 text-008 tb_contp-contp text-008 tb_kna2-kunnr
                              text-008 wf_name text-008 wf_year INTO wf_sub.
        ENDIF.
      ELSE.
        CONCATENATE text-006 text-008 tb_kna2-kunnr text-008 wf_name
                                        text-008 wf_year INTO wf_sub.
      ENDIF.
    Subject and Description
      CLEAR wa_docdata.
      wa_docdata-obj_name  = text-007.
      wa_docdata-obj_descr = wf_sub.
      wa_docdata-obj_langu = sy-langu.
    Write main body
      tb_obj_txt = text-009.
      APPEND tb_obj_txt.
      CLEAR tb_obj_txt.
      CLEAR  tb_paklist.
      tb_paklist-head_start = 1.
      tb_paklist-head_num   = 3.
      tb_paklist-body_start = 1.
      tb_paklist-body_num   = 60.
      tb_paklist-doc_type   = text-012.
      APPEND tb_paklist.
      CLEAR  tb_paklist.
    create PDF file
    Transfer the 132-long strings to 255-long strings
      LOOP AT tb_lines.
        TRANSLATE tb_lines USING ' ~'.
        CONCATENATE wf_buffer tb_lines INTO wf_buffer.
      ENDLOOP.
      TRANSLATE wf_buffer USING '~ '.
      DO.
        tb_obj_bin = wf_buffer.
        APPEND tb_obj_bin.
        SHIFT wf_buffer LEFT BY 255 PLACES.
        IF wf_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
      DESCRIBE TABLE tb_obj_bin LINES lv_lines.
      READ TABLE tb_obj_bin INDEX lv_lines.
      lv_size = ( lv_lines - 1 ) * 255 + STRLEN( tb_obj_bin ).
    Create attachment notification
      tb_paklist-transf_bin = co_x.
      tb_paklist-head_start = 1.
      tb_paklist-head_num   = 0.
      tb_paklist-body_start = 1.
      tb_paklist-body_num   = lv_lines.
      tb_paklist-doc_type   = text-013.
      tb_paklist-obj_descr  = text-010.
      tb_paklist-obj_name   = text-010.
      tb_paklist-doc_size   = lv_size.
      APPEND tb_paklist.
    *mail the PDF to the receiver.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = wa_docdata
                sender_address             = wf_name
                sender_address_type        = text-014
           TABLES
                packing_list               = tb_paklist
                object_header              = tb_obj_head
                contents_bin               = tb_obj_bin
                contents_txt               = tb_obj_txt
                receivers                  = tb_receiver
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
      IF sy-subrc <> 0.
        CONCATENATE text-003 tb_kna2-kunnr text-005 INTO lv_receiver
                                SEPARATED BY space.
        CLEAR: itab.
        itab-kunnr = tb_kna2-kunnr.
        itab-message = lv_receiver.
        APPEND itab.
        IF pa_call IS INITIAL.
          WRITE :/ lv_receiver.
        ENDIF.
      ELSE.
        CONCATENATE text-002 tb_kna2-kunnr text-005 INTO lv_receiver
                                SEPARATED BY space.
        CLEAR: itab.
        itab-kunnr = tb_kna2-kunnr.
        itab-message = lv_receiver.
        APPEND itab.
        IF pa_call IS INITIAL.
          WRITE :/ lv_receiver.
        ENDIF.
      ENDIF.
    Hope this helps.
    Harsh

  • Problem with scripts

    Certain sites, most recently The Daily Show, will not load for me. I get a box that says:
    "Warning: unresponsive script
    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    Script: resource://gre/modules/ConsoleAPIStorage.jsm:157
    [Continue] [Stop script]"
    Whether I click to continue or stop the script, nothing happens except that the box goes away and then comes up again. If I try to close the tab, it just hangs and then finally shows the box again.
    Finally, Firefox just gets completely hung up, and I have to close it out with the task manager.
    Meanwhile, everything runs fine in Internet Explorer.
    Can anyone please help me solve this problem?
    Thanks,
    Ellen

    Is DOM storage enabled?
    You can check the value of the dom.storage.enabled pref on the about:config page.
    *http://kb.mozillazine.org/about:config
    You can also try to delete the webappsstore.sqlite file in the Firefox Profile Folder to remove all data (cookies) stored in DOM storage.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    You can try to reset Firefox and create a new profile.
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems

Maybe you are looking for

  • GetURL open in new TAB

    Im making a flash banner that opens link in a new Window. getURL("bla bla", "_blank"); In explorer everything works fine but in Firefox its not working, it blocks popups. Is there a way that i can open link without using external javascript?! Or open

  • Query in Smartforms!!!!

    Hi all,           Can anyone please tell me how to get the URL of a Smart Form. Kindly reply immediately as this is bit urgent. Regards, Vijay

  • Billing Block Removal

    hi friends when i am trying to create credit memo the following error came: the document is blocked for billing how to remove the block for this document, the block was set at sales document level regards srini 1379

  • Dynamic Actions - Use of PSPAR versus InfoType number

    Can someone explain when creating Dynamic Actions when PSPAR should be used instead of InfoType numbers (ie... PSPAR-MASSN vs. P0000-MASSN).

  • Dictophone problems (does not play recorded audio)

    Hi, everyone. I have a very big problem with my Ipod 4g touch. I've made several audio notes by standart dictophone. But two of them are not playing. Also the're not displaying in iTunes. I don't want to loose these notes, because they're very import