Total Problem in scripts

Hi,
I'm facing one big issue in scripts.ie: in printing totals.
  for totals i write a subroutine in scripts.
  it's working fine.it's displaying totals well.here my problem is first i see the print preview.at that time total is correct.but when i came back and see the print preview again it displaying wrong.ie if first time the total is 'A'.Then second time it displaying like (A+A).
  other problem is when i see the print preview and displays it and go back and took the print at that time also it displaying (A+A).
My code is like :
*&      Form  GET_EXTPR_TOT
    this routine will get the LINE ITEM EXTENDED PRICE TOTALS When
    there is no PROMO CODE.
form get_extpr_tot tables it_input structure itcsy it_output structure itcsy.
  data: v_vbeln2(10) type n.
  clear it_input.
  clear v_vbeln2.
  read table it_input index 1.
  move it_input-value to v_vbeln2.
  read table it_input index 2.
  move it_input-value to v_extpr_tot.
  v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.
  read table it_output index 1.
  write v_extpr_tot1 to it_output-value left-justified.
  modify it_output index 1.
  clear it_output.
endform.                    "GET_EXTPR_TOT
Please Send ur valuable answers.
Thanks,
Srinivas.

Hi Srinivas,
In your script you can define the total variable in one of the header related elements that will be called. for exaple you can define it in the element
/E HEADER_TARGET_VALUE
/: DEFINE &V_EXTPR_TOT1& = ' '
and change your code in ITEM_LINE_PRICE_QUANTITY element as follows
/E ITEM_LINE_PRICE_QUANTITY
/* Begin of modification (RICEF/Issue Number:F-SD-04) by sbhavanam
/: PERFORM GET_EXTPR_TOT IN PROGRAM ZSP_SD_ORDCM.
/: USING &VBDKA-VBELN&
/: USING &V_PRICE&
/: CHANGING &V_EXTPR_TOT1&
/: ENDPERFORM
your abap should look like this.
FORM get_extpr_tot TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.
DATA: v_vbeln2(10) TYPE n
* CLEAR it_input.
CLEAR v_vbeln2.
CLEAR v_extpr_tot.
READ TABLE it_input INDEX 1.
MOVE it_input-value TO v_vbeln2.
READ TABLE it_input INDEX 2.
MOVE it_input-value TO v_extpr_tot.
read table it_input index 3.
move it_input-value to v_extpr_tot1.
v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.
* v_extpr_tot_tst = v_extpr_tot_
READ TABLE it_output INDEX 1.
WRITE v_extpr_tot1 TO it_output-value LEFT-JUSTIFIED.
MODIFY it_output INDEX 1.
CLEAR it_output.
ENDFORM. "GET_EXTPR_TOT
that should solve your issues.
-Kalyan

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,.......

  • Grand Total problem

    I have grand total problem. This is my pivot table.
    A B A/B
    1 10 0,1
    2 4 0,5
    8 3 2,67
    {color:#ff0000}11 17 _3,27_ GRAND TOTAL{color} (0,1+0,5+2,67)
    A - AVG type
    B - SUM type
    How to make obi calculate grand total like this:
    A B A/B
    1 10 0,1
    2 4 0,5
    8 3 2,67
    {color:#0000ff}11 17 _0,647_ GRAND TOTAL{color} (11/17)
    Is that posssible?
    Would it help to add *<ReportAggregateEnabled>true</ReportAggregateEnabled>*
    in instanceconfig.xml?
    Edited by: Micek on 2009.02.09 12:53

    Conceptually Report Aggregate Enabled should work. Look into this blog article which refers same.
    http://oraclebi.soundvoid.net/2008/10/grand-totals-with-calculated-columns-2/

  • 'Some of the items in the iTunes library were not copied to the iPod because they cannot be found....94 total problems' ??

    "Some of the items in the iTunes library were not copied to the iPod because they cannot be found....94 total problems"
    I keep getting this everytime I plug in my iPod ....I really dont want to lose NINETY FOUR songs, as these are the most played ones! I don't know why it's doing this and its freakin annoying!
    Can anybody PLEASE help me?????

    Thanks for the answer, but this is not a nano, it's a 5th gen 60GB wth video.
    http://support.apple.com/kb/ht1353
    Disk use is already enabled and I manually manage my music.

  • 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á

  • Calculate sub totals in SAP Script

    Hi Friends, In Sapscript,  I want to print as follows. Please help.
    Empno       Name       Dept.        Salary
    A1             AAAA       DP01       1000.00
    A2             BBBB       DP01       1500.00
                                          2500.00
    A3         CCCC    DP02    2000.00
    A4         DDDD    DP02    2200.00
                                           4200.00

    Hi
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
                                        outt_cond structure itcsy. data : value type kbert.
    statics   value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    PLZ REWARD POINTS

  • This is regarding totals and sub totals in sap-scripts

    Hi to all...............
    1...How to print totals and subtotals in sap-scripts? where we have to code the logic.what sort of logic is needed to print the same?
    regards,
    swaminath.

    Hi
    HI,
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
    outt_cond structure itcsy. data : value type kbert.
    statics value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    To know more, have a look at this thread ..
    Re: SAP Script: Display Total calculated  on page 2 in page 1
    <b>Reward if usefull</b>

  • 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

  • Total display in script

    I am displaying line items in the script.
    I have total 20 line items and in each page i am displaying 5 line items with page wise totals . I am displaying 20 line items in 4 pages each page below i am displaying 5 line items amount totals , in the last page i want to display 4 pages totals . I have done calculations for getting totals but when displaying i am getting problem.
       First page
    line item 1     10,000
    line item 2     20,000
    line item 3     30,000
    line item 4     15,000
    line item 5     25,000
    first page total called as ubertag : 90,000
    Second page
         top first page total as ubertag : 90,000
        line item 1     12,000
        line item 2     18,000
        line item 3     25,000
        line item 4     15,000
        ine item 5     25,000
    second page total called as ubertag: 95,000
    3rd page
      top of second page  ubertag 95,000
        line item 1     11,000
        line item 2     19,000
        line item 3     35,000
        line item 4     10,000
        line item 5     25,000
    3rd page total called as ubertag : 1,05,000
    4th page    
      top of page ubertag : 1,05,000
        line item 1     5,000
        line item 2     8,000
        line item 3     4,000
        line item 4     1,000
        ine item 5     2,000
    all pages total called as gesamtsaldo : 3,10,000
    I have 15 lines text at the last of the page i want to display it with out splitting.
    can u please suggest me how can i display above format. Now i am getting page wise totals and final totals but displaying at last i want to call it as gesamtsaldo ( 4 pages total) 
    1. how i display page wise totals
    2. how i display 4 pages at last page
    i am using following statement for every page total.
    IF NEXTPAGE > 0
       UBERTAG : &WRBTR&
    ENDIF.
    please guide me.

    Hi Srisai,
      Try using protect and end protect to get the sum and total on the same page. Try using bottom and end bottom for your totals on the last page.
    For your final total validate it like,
    If &nextpage& = 0.
    Print your final total.
    endif.
    Regards,
    Amuktha.

  • Abt clear value problem in scripts

    Hi,
    Im working on scripts.in scripts im calculating totals by using subroutine.but im facing problem.
    my problem is first time i calculated it's working fine.
    when i go back and enter other order number it's taking previous order number and present total and it displays these totals.
    i clear the it_out in se38 and the varible which holds the total.
    but it's not working.
    please help me in this.
    Thanks & Regards,
    Srinivas

    Hi this is my abap code.
    FORM get_extpr_tot TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.
    REFRESH : it_output.
    CLEAR v_extpr_tot.
      DATA: v_vbeln2(10) TYPE n.
      REFRESH it_input.
      Clear v_vbeln2.
    clear v_extpr_tot1.
      READ TABLE it_input INDEX 1.
      MOVE it_input-value TO v_vbeln2.
      READ TABLE it_input INDEX 2.
      MOVE it_input-value TO v_extpr_tot.
      v_extpr_tot1 = v_extpr_tot1 + v_extpr_tot.
      READ TABLE it_output INDEX 1.
      WRITE v_extpr_tot1 TO it_output-value LEFT-JUSTIFIED.
      MODIFY it_output INDEX 1.
       Clear it_output.
      clear v_extpr_tot1.
    REFRESH it_output.
    ENDFORM.                    "GET_EXTPR_TOT
    and my se71 code is
    PERFORM GET_EXTPR_TOT IN PROGRAM ZSP_SD_ORDCM.
    USING &VBDKA-VBELN&
    USING &V_PRICE&
    CHANGING &V_EXTPR_TOT1&
    ENDPERFORM
    please help me

  • Oracle11r2/Solaris10 Problem startup script "insufficient privileges"

    Hi,
    I have a problem with my startup script. i think that is the permissions but i dont know.
    When i run the script as oracle user, the script runs ok. But when i reboot the system the log showme error with "insufficient privileges".
    This is my script.
    +# more dbora+
    +#!/usr/bin/bash -x+
    +#/bin/sh -x+
    +#+
    +# Change the value of ORACLE_HOME to specify the correct Oracle home+
    +# directory for your installation.+
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    +#+
    +# Change the value of ORACLE to the login name of the+
    +# oracle owner at your site.+
    +#+
    ORACLE=oracle
    +PATH=${PATH}:$ORACLE_HOME/bin+
    HOST=`hostname`
    PLATFORM=`uname`
    ORACLE_SID="orcl"
    export ORACLE_HOME PATH ORACLE_SID
    case $1 in
    +'start')+
    sleep 3
    +# rsh $HOST -l $ORACLE -n "$ORACLE_HOME/bin/dbstart $ORACLE_HOME &"+
    +# su - oracle -c "$ORACLE_HOME/bin/dbstart"+
    +# $ORACLE_HOME/bin/dbstart "+
    +$ORACLE_HOME/bin/dbstart $ORACLE_HOME &+
    +$ORACLE_HOME/bin/lsnrctl start &+
    +$ORACLE_HOME/bin/emctl start dbconsole &+
    +;;+
    +'stop')+
    +$ORACLE_HOME/bin/dbshut $ORACLE_HOME &+
    +$ORACLE_HOME/bin/lsnrctl stop &+
    +$ORACLE_HOME/bin/emctl stop dbconsole &+
    +;;+
    +*)+
    +echo "usage: $0 start"+
    +exit+
    +;;+
    +esac+
    +exit+
    +#+
    +# ll /etc/init.d/dbora+
    +-rwxr-x--- 1 root dba 1185 Apr 20 10:33 /etc/init.d/dbora+
    +#+
    +# ll /etc/rc3.d/+
    +total 42+
    +...+
    +...+
    +lrwxrwxrwx 1 root root 17 Apr 20 10:30 K01dbora -> /etc/init.d/dbora+
    +lrwxrwxrwx 1 root root 17 Apr 19 17:04 S99dbora -> /etc/init.d/dbora+
    +#+
    +# more /var/opt/oracle/oratab+
    +orcl:/u01/app/oracle/product/11.2.0/db_1:Y+
    +other:/u01/app/oracle/product/11.2.0/db_1:Y+
    +#+
    +# more /etc/group+
    +...+
    +...+
    +oinstall::100:oracle+
    +dba::101:oracle+
    +#+
    I try with su - oracle -c "command" in the script but doesnt work (the oracle doesnt startup and startup log dont show nothing).
    I dont know whats the problem. I will thank you for your help.
    Thanks.
    ========
    startup log from the init.d:
    ++ export ORACLE_SID+
    ++ PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin:/u01/app/oracle/product/11.2.0/db_1/bin+
    ++ export PATH+
    ++ LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:+
    ++ export LD_LIBRARY_PATH+
    ++ PFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora+
    ++ SPFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora+
    ++ SPFILE1=/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora+
    ++ echo ''+
    ++ echo '/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"'+
    +/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"+
    ++ date+
    +Tue Apr 20 10:34:25 CDT 2010+
    ++ echo ''+
    ++ checkversionmismatch+
    ++ '[' 11 ']'+
    +++ sqlplus -V+
    +++ grep 'Release '+
    +++ cut '-d ' -f3+
    +++ cut -d. -f1+
    ++ VER10INST=11+
    ++ '[' 11 -lt 11 ']'+
    ++ VERSION=undef+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/sqldba ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/svrmgrl ']'+
    ++ SQLDBA='sqlplus /nolog'+
    ++ STATUS=1+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.dbf ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.ora ']'+
    +++ ps -ef+
    +++ grep -w ora_pmon_orcl+
    +++ grep -v grep+
    ++ pmon=+
    ++ '[' '' '!=' '' ']'+
    ++ '[' 1 -eq -1 ']'+
    ++ '[' 1 -eq 1 ']'+
    ++ '[' -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora ']'+
    ++ case $VERSION in+
    ++ sqlplus /nolog+
    +SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 20 10:34:26 2010+
    +Copyright (c) 1982, 2009, Oracle. All rights reserved.+
    +SQL> + export ORACLE_SID+
    ++ PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin:/u01/app/oracle/product/11.2.0/db_1/bin+
    ++ export PATH+
    ++ LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:+
    ++ export LD_LIBRARY_PATH+
    ++ PFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora+
    ++ SPFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora+
    ++ SPFILE1=/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora+
    ++ echo ''+
    ++ echo '/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"'+
    +/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"+
    ++ date+
    +Tue Apr 20 10:34:27 CDT 2010+
    ++ echo ''+
    ++ checkversionmismatch+
    ++ '[' 11 ']'+
    +++ sqlplus -V+
    +++ grep 'Release '+
    +++ cut '-d ' -f3+
    +++ cut -d. -f1+
    ++ VER10INST=11+
    ++ '[' 11 -lt 11 ']'+
    ++ VERSION=undef+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/sqldba ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/svrmgrl ']'+
    ++ SQLDBA='sqlplus /nolog'+
    ++ STATUS=1+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.dbf ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.ora ']'+
    +++ ps -ef+
    +++ grep -w ora_pmon_orcl+
    +++ grep -v grep+
    ++ pmon=+
    ++ '[' '' '!=' '' ']'+
    ++ '[' 1 -eq -1 ']'+
    ++ '[' 1 -eq 1 ']'+
    ++ '[' -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora ']'+
    ++ case $VERSION in+
    ++ sqlplus /nolog+
    +SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 20 10:34:27 2010+
    +Copyright (c) 1982, 2009, Oracle. All rights reserved.+
    +SQL> ERROR:+
    +ORA-01031: insufficient privileges+
    +SQL> ORA-01031: insufficient privileges+
    +SQL> + '[' 0 -eq 0 ']'+
    ++ echo ''+
    ++ echo '/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Database instance "orcl" warm started.'+
    +/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Database instance "orcl" warm started.+
    =============
    if i run the script as oracle user this is the log:
    ++ export ORACLE_SID+
    ++ PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin:/opt/csw/bin:/usr/openwin/bin:/u01/app/oracle/product/11.2.0/db_1/bin+
    ++ export PATH+
    ++ LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:+
    ++ export LD_LIBRARY_PATH+
    ++ PFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora+
    ++ SPFILE=/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora+
    ++ SPFILE1=/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora+
    ++ echo ''+
    ++ echo '/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"'+
    +/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Starting up database "orcl"+
    ++ date+
    +Tue Apr 20 10:39:17 CDT 2010+
    ++ echo ''+
    ++ checkversionmismatch+
    ++ '[' ']'+
    ++ VERSION=undef+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/sqldba ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/bin/svrmgrl ']'+
    ++ SQLDBA='sqlplus /nolog'+
    ++ STATUS=1+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.dbf ']'+
    ++ '[' -f /u01/app/oracle/product/11.2.0/db_1/dbs/sgadeforcl.ora ']'+
    +++ ps -ef+
    +++ grep -w ora_pmon_orcl+
    +++ grep -v grep+
    ++ pmon=+
    ++ '[' '' '!=' '' ']'+
    ++ '[' 1 -eq -1 ']'+
    ++ '[' 1 -eq 1 ']'+
    ++ '[' -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora -o -e /u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora ']'+
    ++ case $VERSION in+
    ++ sqlplus /nolog+
    +SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 20 10:39:17 2010+
    +Copyright (c) 1982, 2009, Oracle. All rights reserved.+
    +SQL> Connected to an idle instance.+
    +SQL> ORACLE instance started.+
    +Total System Global Area 3374866432 bytes+
    +Fixed Size 2152768 bytes+
    +Variable Size 1845495488 bytes+
    +Database Buffers 1493172224 bytes+
    +Redo Buffers 34045952 bytes+
    +Database mounted.+
    +Database opened.+
    +SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production+
    +With the Partitioning, OLAP, Data Mining and Real Application Testing options+
    ++ '[' 0 -eq 0 ']'+
    ++ echo ''+
    ++ echo '/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Database instance "orcl" warm started.'+
    +/u01/app/oracle/product/11.2.0/db_1/bin/dbstart: Database instance "orcl" warm started.+

    Hi,
    thanks for your reply.
    I found the problem.
    In my script, i change this:
    # su - oracle -c "$ORACLE_HOME/bin/dbstart"
    by this and its work (without "-")
    # su oracle -c "$ORACLE_HOME/bin/dbstart"
    Thanks...

  • Calculation of total in sap script

    Hi All,
    Please help me out for this requirement.
    I have an amount field reguh-rbetr. I need to show the sum of this field as TOTAL.
    How can we do it? Please let me know. Is there any function in the script itself or do we need to calculate it in the program? Pl gimme example code.
    Regards,
    Priya

    Hi
    see the sample codes of the Subroutines and do accordingly
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    /: PERFORM
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    Example:
    In script form
    /: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'
    /: USING &EKKO-EKORG&
    /: USING &EKPO-WERKS&
    /: USING &EKKO-EKGRP&
    /: USING &EKKO-BSTYP&
    /: CHANGING &COMPNAME&
    /: CHANGING &SENDADR&
    /: CHANGING &INVCADR&
    /: CHANGING &COMPADR&
    /: CHANGING &COVERLTR&
    /: CHANGING &SHIPADR&
    /: CHANGING &REMINDER&
    /: CHANGING &REJECTION&
    /: CHANGING &POSTADR&
    /: CHANGING &LOGO&
    /: ENDPERFORM
    In program
    FORM Read_texts - To extract the standard texts from the table *
    FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA : L_EKORG TYPE EKORG,
    L_WERKS TYPE WERKS_D,
    L_BSTYP TYPE BSTYP,
    L_EKGRP TYPE BKGRP.
    READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .
    CHECK SY-SUBRC = 0.
    L_EKORG = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .
    CHECK SY-SUBRC = 0.
    L_WERKS = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .
    CHECK SY-SUBRC = 0.
    L_EKGRP = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .
    CHECK SY-SUBRC = 0.
    L_BSTYP = IN_PAR-VALUE.
    CLEAR Z08M1_ORG_TEXTS.
    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
    AND WERKS = L_WERKS
    AND EKGRP = L_EKGRP
    AND BSTYP = L_BSTYP.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
    AND WERKS = L_WERKS
    AND EKGRP = L_EKGRP
    AND BSTYP = SPACE.
    ENDIF.
    READ TABLE OUT_PAR WITH KEY 'COMPNAME'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'SENDADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'INVCADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'COMPADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'COVERLTR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'SHIPADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'REMINDER'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'REJECTION'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'POSTADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'LOGO'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    REPORT ZMPO1 .
    form get_freight tables in_par structure itcsy out_par structure itcsy.
    tables: ekko,konv,t685t.
    data: begin of itab occurs 0,
             ebeln like ekko-ebeln,
             knumv like ekko-knumv,
           end of itab.
    data: begin of itab1 occurs 0,
             knumv like konv-knumv,
             kposn like konv-kposn,
             kschl like konv-kschl,
             kbetr like konv-kbetr,
             waers like konv-waers,
             kwert like konv-kwert,
           end of itab1.
    data: begin of iout occurs 0,
             kschl like konv-kschl,
             vtext like t685t-vtext,
             kbetr like konv-kbetr,
             kwert like konv-kwert,
           end of iout.
    data v_po like ekko-ebeln.
    read table in_par with key 'EKKO-EBELN'.
    if sy-subrc = 0.
       v_po = in_par-value.
       select
         ebeln
         knumv
      from ekko
      into table itab
      where ebeln = v_po.
      if sy-subrc = 0.
        loop at itab.
          select
            knumv
            kposn
            kschl
            kbetr
            waers
            kwert
          into table itab1
          from konv
          where knumv = itab-knumv and
                kappl = 'M'.
        endloop.
        loop at itab1.
          if itab1-kposn <> 0.
            select single * from t685t
                              where kschl = itab1-kschl
                                and kappl = 'M'
                                and spras = 'EN'.
            iout-vtext = t685t-vtext.
            iout-kschl = itab1-kschl.
            iout-kbetr = itab1-kbetr.
            iout-kwert = itab1-kwert.
            append iout.
            clear iout.
          endif.
        endloop.
        sort itab1 by kposn.
        loop at iout.
          sort iout by kschl.
          if ( iout-kschl eq 'GSDC' OR
               iout-kschl eq 'GSFR' OR
               iout-kschl eq 'GSIR' ).
            at end of kschl.
              read table iout index sy-tabix.
              sum.
             write:/ iout-kschl,iout-vtext,iout-kwert.
          out_par-name = 'A1'.
          out_par-value = iout-vtext.
          append out_par.
          out_par-name = 'A2'.
          out_par-value = iout-kwert.
          append out_par.
              endat.
            endif.
          endloop.
        endif.
      endif.
    endform.
    IN THE FORM I AM WRITING THIS CODE.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:ENDPERFORM
    &A1&
    &A2&
    This Code is to be written in the PO form under ADDRESS window.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:DEFINE &A3& = ' '
    /:DEFINE &A4& = ' '
    /:DEFINE &A5& = ' '
    /:DEFINE &A6& = ' '
    /:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:CHANGING &A3&
    /:CHANGING &A4&
    /:CHANGING &A5&
    /:CHANGING &A6&
    /:ENDPERFORM
    &A1&
    &A2&
    &A3&
    &A4&
    &A5&
    &A6&
    Regards
    Anji

  • 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. 

  • How to print the Totals in SAP Scripts..?

    Hi,
    I have an SAP Script layout. Currently I am displaying the Line items in the layout. The new requirement has come up to display the TOTAL of the amount value in the layout at the end of the line items. Can someone tell me how to display the Sum of the Amount value at the end of the Line items in an SAP Script.
    The Print program for this layout is standard program. Can this be handled within the layout..? Someone please provide me some sample code if available.
    Thanks in advance.
    Best regards,
    Paddu.

    Hi,
    Thank you for your reply.
    My Standard print program doesn't provide the total value.  Could you please tell me where exactly we need to write the logic in the Layout. I mean, do we need to write under separate element..? and in the External subroutine, how would be the logic. It would be greatful if you provide some sample code.
    Thanks & Regards,
    Paddu.

Maybe you are looking for

  • Mini Display to VGA, screen doesn't fit.  How do I fix?

    When I use my Mini DisplayPort to VGA adapter, the resolution gets too big for my screen (mbpro 15") and the same thing appears on the projector I use. I'm not sure if I should change my screen resolution while I use the projector or what? Also, the

  • How to create separate articles out of one InDesign document?

    I have a pre-created InDesign 5 document that is about 50 pages. There are different articles within these pages, and there are different sections created for the page numbers. When I add to the folio, it appears to be adding the entire document as o

  • Mail spam filters and phishing

    Yesterday's UK Sunday Times gave an email address to which sufferers were advised to forward bank phishing emails - it is, presumably, a bank sponsored site which allows them to try and trace and/or stem this ever increasing tide of spam. Most of the

  • Export styles to an external style sheet

    I'm a student taking Dreamweaver 8 and the only software available was CS3. So, I'm using CS3 and following the tutorial and it says to add some page-level styles. Then, the next step is to export those styles to an external stylesheet. The steps say

  • LSMW Batch input  session issue

    We have LSMW project for changing material BOM, object 0030, method 0002 and program RCSBI020 type B. I am passing header and items file. All the steps works until session creation. At session creation step it is just displaying the list of material