Help needed for Restricting roles by maintaining values at Profit center

Hi,
My client uses the restriction at Company Code and Cost Center but we were using a * for full authorization to maintain the Profit Center. Now the situation has arisen where we need to maintain a particular Role at Profit Center level. We are creating a new role and maintaining the value of it. But there are a few other Roles where the Profit Center was not maintained and a * (which is already there) will give access to the Profit Center which is actually meant for the new Role.
The Profit Center has values of around 2500 which is going to be difficult to be maintained. Is there any other method where in we can restrict the Roles at Profit Center level by giving some ranges and if it is please let me know the format?
Regards
Shakeel

Hi
There are two methods that you can maintain:
1. Using the Company Code
2. Using the Company Code simultaneously with Profit Center
The approach that we are following is like that: We have created a excel file which contains the segegrated list of Profit Centers according to Company Code.
Now if you provide the range of Company code ( that can be achieved in authorization fields) the profit center related will automaically be associated by giving *.
We can give the range of profit center at two levels....one at the Organizational Level which would give acess to all the authorization objects present in the Role.
Other is give the range at the Authorization Object Level...that would give access to that particular Authorization Object or the Tcodes related to that.
Check out this thread also
How to assign profit center or cost center authorizations ?

Similar Messages

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with re

    Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with reddish cast and loss of detail
    System: Windows 7
    Adobe CS5
    Printer: Epson Stylus Photo 1400
    Paper: Inkjet matte presentation paper with slight luster
    Installed latest patch for Adobe CS5
    Epson driver up to date
    After reading solutions online and trying them for my settings for 2 days I am still unable to print what I am seeing on my screen in Adobe CS5. I calibrated my monitor, but am not sure once calibration is saved if I somehow use this setting in Photoshop’s color management.
    The files I am printing are photographs of dogs with lots of detail  I digitally painted with my Wacom tablet in Photoshop CS5 and then printed with Epson Stylus 1400 on inkjet paper 20lb with slight luster.
    My Printed images lose a lot of the detail & come out way to dark with a reddish cast and loss of detail when I used these settings in the printing window:
    Color Handling: Photoshop manages color, Color management -ICM, OFF no color adjustment.
    When I change to these settings in printer window: Color Handling:  Printer manages color.  Color management- Color Controls, 1.8 Gamma and choose Epson Standard it prints lighter, but with reddish cast and very little detail and this is the best setting I have used so far.
    Based on what I have read on line, I think the issue is mainly to do with what controls are set in the Photoshop Color Settings window and the Epson Printer preferences. I have screen images attached of these windows and would appreciate knowing what you recommend I enter for each choice.
    Also I am confused as to what ICM color management system to use with this printer and CS5:
    What is the best ICM to use with PS CS5 & the Epson 1400 printer? Should I use the same ICM for both?
    Do I embed the ICM I choose into the new files I create? 
    Do I view all files in the CS5 workspace in this default ICM?
    Do I set my monitor setting to the same ICM?
    If new file opens in CS5 workspace and it has a different embedded profile than my workspace, do I convert it?
    Do I set my printer, Monitor and PS CS5 color settings to the same ICM?
    Is using the same ICM for all devices what is called a consistent workflow?
    I appreciate any and all advice that can be sent my way on this complicated issue. Thank you in advance for your time and kind help.

    It may be possible to figure out by watching a Dr.Brown video on the subject of color printing. Adobe tv
    I hope this may help...............

  • File missing (file\BCD error code 0Xc0000034 help need for work!

    file missing (file\BCD  error code 0Xc0000034 help need for work!    what can i do?
    have an p 2000 notebook pc

     Hi bobkunkle, welcome to the HP Forums. I understand you cannot boot passed the error you are receiving.
    What is the model or product number of your notebook? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Help need for force to signout All session ! how...

    hi
         help need for force to  signout All session !  how ??
    Solved!
    Go to Solution.

    Hi and welcome to the Skype Community,
    To force a signout of all instances your Skype is signed into please change your password: https://support.skype.com/en/faq/FA95/how-do-i-change-my-password
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Restriction of Users to access other Profit Center Data

    Hi All,
    We have a Ztable to maintian User Id and Profit Center ranges (from to).
    This well help us to enter an user id and a Profit Center range in the Ztable.
    Later this particular User will be having access to only these (mentioned in the Ztable) Profit Centers while doing any Transaction.
    But how exactly this User will get such restriction..????
    I believe something has to be done apart from entering such details in the Ztable.
    What exactly should be done, so that the User will have access to particular set of Profit Centers...??????
    Kindly guide me in this regard.....
    Regards
    Pavan

    Hi,
    Contact your basis consultant.....he may be able to help you with the authorisations.
    Aravind
    Assign points if helpful

  • Help needed for ALV report

    Hi,
    i need to add coloums for the existing report which picks from G/L account.
    in this report I need to add some more columns from COSP-KSTAR, which shows the cost element details from G/L account.
    I need to restrict that cost element number according to the company code.
    Plz see this and let me know the things.
    1. I need to add FISCAL YEAR(COEP-GJAHR) in selection screen.
    2. I need to add column: Employee Cost (CSKS-KOSTL)
    3. add a column Staff Welfare (COSP-KSTAR) this is to restrict for the cost element 3000200 from G/L account
    4. add a column Recruitment restrict for the cost element(COSP-KSTAR) 3100040 from G/L account
    5. add a column Travels (suppressing some cost elements(COSP-KSTAR) and putting into Travels)
    6. add a column Subcontracts restrict for the cost element (COSP-KSTAR)3100360 from G/L account
    7. add a column Communication suppressing some cost elements and putting into Communication)
    8. add a column Rent restrict for the cost element (COSP-KSTAR)3100055 from G/L account
    9. add a column Back end Cost restrict for the cost element (COSP-KSTAR)3100065 from G/L account
    i can hardcode these cost elements.
    i did according to some of our sdn friends guidence but it is going to dump.
    hear i am sending the code what i changed.
    it is giving the error with the select.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    plz try to help me out in this issue.
    hear i am sending the complete code what i worte.
    *& Report  ZPROJECT_PROFIT2
    REPORT  ZPROJECT_PROFIT2.
    *********************MAIN DOCUMENTATION BLOCK*************************
    Project Code           :
    Program Name           :Zproject_profit1.
    Purpose of program     :This report will give the gross margin for a project as
    *a whole based on some selected input criteria.
    Author of program      :JAYA KRISHNA .B.
    INPUT/OUTPUT FILE      :nil
    TYPE-POOLS : SLIS."For ALV display.
    TABLES : COEP,  "CO Object: Line Items  (by period).
             AUFK,   "Order master data.
             csks,    "Cost center master data
             cosp.    "CO Objects
    *&  Include           ZSTRUCTURE
    types:    BEGIN OF TY_COEP ,            "structure of table COEP.
              BUKRS LIKE COEP-BUKRS,
              KOKRS LIKE COEP-KOKRS,
              OBJNR LIKE COEP-OBJNR,
               gjahr like coep-gjahr,
              kstar like coep-kstar,
              OBJNR_N1 LIKE COEP-OBJNR_N1,
              PERIO LIKE COEP-PERIO,
              BEKNZ LIKE COEP-BEKNZ,
              WKGBTR LIKE COEP-WKGBTR,
              WOGBTR LIKE COEP-WOGBTR,
              BELNR LIKE COEP-BELNR,
              END OF TY_COEP,
             BEGIN OF TY_AUFK ,             "structure of table AUFK.
             BUKRS LIKE AUFK-BUKRS,
             KOKRS LIKE AUFK-KOKRS,
             OBJNR LIKE AUFK-OBJNR,
             KTEXT LIKE AUFK-KTEXT,
             ANFAUFNR LIKE AUFK-ANFAUFNR,
             AUFEX LIKE AUFK-AUFEX,
             USER2 LIKE AUFK-USER2,
             USER0 LIKE AUFK-USER0,
             USER1 LIKE AUFK-USER1,
             USER3 LIKE AUFK-USER3,
             USER6 LIKE AUFK-USER6,
             USER7 LIKE AUFK-USER7,
             USER8 LIKE AUFK-USER8,
             ABKRS(10) TYPE C,
             USER9 LIKE AUFK-USER9,
             AUFNR LIKE AUFK-AUFNR,
           END OF TY_AUFK,
           begin of ty_csks,
           kokrs like csks-kokrs,
            kostl like csks-kostl,
            bukrs like csks-bukrs,
            objnr like csks-objnr,
                 end of ty_csks.
    DATA :   BEGIN OF IT_COSP occurs 100,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           END OF IT_COSP.
    DATA : IT_COEP TYPE TABLE OF TY_COEP,     " Declaraton of tables COEP and AUFK.
           IT_AUFK TYPE TABLE OF TY_AUFK,
           IT_CSKS TYPE TABLE OF TY_CSKS.
          IT_COSP TYPE TABLE OF TY_COSP.
    DATA : WA_COEP LIKE LINE OF IT_COEP,      " Declaration of work areas for tables COEP and AUFK.
           WA_AUFK LIKE LINE OF IT_AUFK,
           WA_CSKS LIKE LINE OF IT_CSKS.
          WA_COSP LIKE LINE OF IT_COSP.
    DATA : BEGIN OF IT_DISPLAY OCCURS 0,      " Declaration of display table.
            OBJNR_N1 LIKE COEP-OBJNR_N1,
            OBJNR_N12 LIKE COEP-OBJNR_N1,
            KTEXT1 LIKE AUFK-KTEXT,
            WKGBTR LIKE COEP-WKGBTR,
            WOGBTR LIKE COEP-WOGBTR,
            WKGBTR1  LIKE COEP-WTGBTR,
            WOGBTR1 LIKE COEP-WOGBTR,
            ADDK LIKE COEP-WOGBTR,
            ADDO LIKE COEP-WOGBTR,
            ADDK1 LIKE COEP-WOGBTR,
            ADDO1 LIKE COEP-WOGBTR,
            PROFIT1 LIKE COEP-WOGBTR,
            PROFIT2 LIKE COEP-WOGBTR,
            BEKNZ LIKE COEP-BEKNZ,
            BUKRS LIKE AUFK-BUKRS,
            anfaufnr LIKE AUFK-anfaufnr,
            aufex like aufk-aufex,
            OBJNR LIKE AUFK-OBJNR,
            USER2 LIKE AUFK-USER2,
            USER0 LIKE AUFK-USER0,
            USER1 LIKE AUFK-USER1,
            USER3 LIKE AUFK-USER3,
            USER6 LIKE AUFK-USER6,
            USER7 LIKE AUFK-USER7,
            USER8 LIKE AUFK-USER8,
            ABKRS LIKE AUFK-ABKRS,
            USER9 LIKE AUFK-USER9,
            PERIO LIKE COEP-PERIO,
            AUFNR LIKE AUFK-AUFNR,
            STR(5) TYPE C,
            WORK(10) TYPE C,
           END OF IT_DISPLAY,
      : BEGIN OF IT_DISPLAY1 OCCURS 0,      " Declaration of second display table.
         OBJNR_N1 LIKE COEP-OBJNR_N1,
         OBJNR_N12 LIKE COEP-OBJNR_N1,
         KTEXT1 LIKE AUFK-KTEXT,
         WKGBTR LIKE COEP-WKGBTR,
         WOGBTR LIKE COEP-WOGBTR,
         WKGBTR1  LIKE COEP-WTGBTR,
         WOGBTR1 LIKE COEP-WOGBTR,
         ADDK LIKE COEP-WOGBTR,
         ADDO LIKE COEP-WOGBTR,
         ADDK1 LIKE COEP-WOGBTR,
         ADDO1 LIKE COEP-WOGBTR,
         PROFIT1 LIKE COEP-WOGBTR,
         PROFIT2 LIKE COEP-WOGBTR,
         BEKNZ LIKE COEP-BEKNZ,
         BUKRS LIKE AUFK-BUKRS,
         anfaufnr like aufk-anfaufnr,
         aufex like aufk-aufex,
         OBJNR LIKE AUFK-OBJNR,
         USER2 LIKE AUFK-USER2,
         USER0 LIKE AUFK-USER0,
         USER1 LIKE AUFK-USER1,
         USER3 LIKE AUFK-USER3,
         USER6 LIKE AUFK-USER6,
         USER7 LIKE AUFK-USER7,
         USER8 LIKE AUFK-USER8,
         ABKRS LIKE AUFK-ABKRS,
         USER9 LIKE AUFK-USER9,
         PERIO LIKE COEP-PERIO,
         AUFNR LIKE AUFK-AUFNR,
         STR(5) TYPE C,
         WORK(10) TYPE C,
        END OF IT_DISPLAY1.
    data : it_field type slis_fieldcat_alv,        " Declaration of ALV variables
           it_field_t type slis_t_fieldcat_alv,
            xlayout    TYPE slis_layout_alv.
    data : it_event type slis_t_event,
          wa_event like line of it_event.
    DATA : WA_TOP TYPE SLIS_LISTHEADER,
           IT_TOP TYPE SLIS_T_LISTHEADER.
    data:w_lines type i,
          w_occurs type i,
          STR(5) TYPE C,
          WORK(10) TYPE C.
          constants : c_selection type char20 value 'Selection based on'. " Declaration of a constant.
    selection-screen BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS S_BUKRS FOR AUFK-BUKRS OBLIGATORY.
    SELECT-OPTIONS S_OBJNR FOR AUFK-AUFNR.
    SELECT-OPTIONS S_ANF FOR AUFK-ANFAUFNR.
    SELECT-OPTIONS S_AUFEX FOR AUFK-AUFEX.
    SELECT-OPTIONS S_USER2 FOR AUFK-USER2.
    SELECT-OPTIONS S_USER0 FOR AUFK-USER0.
    SELECT-OPTIONS S_USER1 FOR AUFK-USER1.
    SELECT-OPTIONS S_USER3 FOR AUFK-USER3.
    SELECT-OPTIONS S_USER6 FOR AUFK-USER6.
    SELECT-OPTIONS S_ABKRS FOR AUFK-ABKRS.
    SELECT-options s_gjahr for coep-gjahr obligatory.
    SELECT-OPTIONS S_PERIO FOR COEP-PERIO OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLK .
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : ONSITE RADIOBUTTON GROUP RADI.
    PARAMETERS : OFFSHORE RADIOBUTTON GROUP RADI.
    PARAMETERS : BOTH RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN END OF BLOCK BLK1 .
    start-of-selection.
    *ZAUFK
                                  " Selection of records from aufk to internal table.
    IF ONSITE EQ 'X' .
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN s_anf AND
    aufex in s_aufex and
    aufnr IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 EQ 'X' .
    ENDIF.
    IF OFFSHORE EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufnR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 <> 'X'.
    ENDIF.
    IF BOTH EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufNR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS.
    ENDIF.
    *&  Include           ZCOEP
                                  " Selection of records from coep to internal table.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    *&  Include           ZPROFIT_CALC
                                 " Calculations for income and Profit of the employee.
    if not it_coep[] is initial.
        select objnr gjahr wrttp versn kstar from cosp into TABLE It_cosp for
    all entries in it_coep where objnr = IT_COEP-objnr .
    endif.
      LOOP AT IT_coep INTO WA_coep.
        read table IT_aufk into WA_aufk with key OBJNR = wa_coep-OBJNR.
    case it_cosp-kstar.
    when '3000200'.
    it_cosp-kstar = cosp-kstar.
    when '3100040'.
    it_cosp-kstar = cosp-kstar.
    when '3100360'.
    it_cosp-kstar = cosp-kstar.
    when '3100055'.
    it_cosp-kstar = cosp-kstar.
    when '3100065'.
    it_cosp-kstar = cosp-kstar.
    when '3100115'.
    it_cosp-kstar = cosp-kstar.
    when '3100120'.
    it_cosp-kstar = cosp-kstar.
    when '3100130'.
    it_cosp-kstar = cosp-kstar.
    when '3100135'.
    it_cosp-kstar = cosp-kstar.
    when '3100140'.
    it_cosp-kstar = cosp-kstar.
    when '3100145'.
    it_cosp-kstar = cosp-kstar.
    when '3100150'.
    it_cosp-kstar = cosp-kstar.
    when '3100155'.
    it_cosp-kstar = cosp-kstar.
    when '3100160'.
    it_cosp-kstar = cosp-kstar.
    when '3100165'.
    it_cosp-kstar = cosp-kstar.
    when '3100170'.
    it_cosp-kstar = cosp-kstar.
    endcase.
        IT_DISPLAY-BUKRS = WA_AUFK-BUKRS.
        IT_DISPLAY-anfaufnr = WA_AUFK-anfaufnr.
        it_display-aufex  = wa_aufk-aufex.
        IT_DISPLAY-OBJNR = WA_AUFK-OBJNR.
        IT_DISPLAY-USER2 = WA_AUFK-USER2.
        IT_DISPLAY-USER0 = WA_AUFK-USER0.
        IT_DISPLAY-USER1 = WA_AUFK-USER1.
        IT_DISPLAY-USER3 = WA_AUFK-USER3.
        IT_DISPLAY-USER6 = WA_AUFK-USER6.
        IT_DISPLAY-USER7 = WA_AUFK-USER7.
        IT_DISPLAY-USER8 = WA_AUFK-USER8.
        IT_DISPLAY-ABKRS = WA_AUFK-ABKRS.
        IT_DISPLAY-USER9 = WA_AUFK-USER9.
        IT_DISPLAY-KTEXT1 =  WA_AUFK-KTEXT.
        if WA_AUFK-abkrs = 01.
          IT_DISPLAY-STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          IT_DISPLAY-STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          IT_DISPLAY-WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          IT_DISPLAY-WORK = 'OFFSHORE'.
        ENDIF.
        it_display-ABKRS = it_display-user7.
        IF wa_coep-BEKNZ = 'S'.
          IT_DISPLAY-WKGBTR = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR.
          IT_DISPLAY-ADDO = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR.
          IT_DISPLAY-ADDK1 = 0.
          IT_DISPLAY-ADDO1 = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        IF WA_COEP-BEKNZ = 'H'.
          IT_DISPLAY-WKGBTR1 = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR1 = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK1 = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR1.
          IT_DISPLAY-ADDO1 = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR1.
          IT_DISPLAY-ADDK = 0.
          IT_DISPLAY-ADDO = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        collect it_display into it_display1.
        clear it_display.
      ENDLOOP.
                        "calc
    *&  Include           ZPROFIT_DISPLAY
      LOOP AT IT_DISPLAY1.                                         "it_display.
        read table IT_COEP into WA_COEP with key OBJNR =
        IT_DISPLAY-OBJNR.
        read table IT_AUFK into WA_AUFK with key aufnr = IT_DISPLAY-aufnr.
        if WA_AUFK-abkrs = 01.
          STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          WORK = 'OFFSHORE'.
        ENDIF.
      endloop.
      clear it_field.
      it_field-col_pos = 1.
      it_field-fieldname = 'AUFNR'.
      it_field-seltext_l = 'project id.'.
      it_field-outputlen = 15.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 2.
      it_field-fieldname = 'KTEXT1'.
      it_field-seltext_l = 'Project Name'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 3.
      it_field-fieldname = 'USER7'.
      it_field-seltext_l = 'Start Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 4.
      it_field-fieldname = 'USER8'.
      it_field-seltext_l = 'End Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 5.
      it_field-fieldname = 'USER2'.
      it_field-seltext_l = 'Location'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 6.
      it_field-fieldname = 'USER0'.
      it_field-seltext_l = 'Vertical'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 7.
      it_field-fieldname = 'USER1'.
      it_field-seltext_l = 'Sub_vertical'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 8.
      it_field-fieldname = 'USER3'.
      it_field-seltext_l = 'Technology'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 9.
      it_field-fieldname = 'USER6'.
      it_field-seltext_l = 'Department'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 10.
      it_field-fieldname = 'WORK'.
      it_field-seltext_l = 'Onsite/Offshore'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 11.
      it_field-fieldname = 'STR'.
      it_field-seltext_l = 'T&M/FP'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 12.
      it_field-fieldname = 'KOSTL'.
      it_field-seltext_l = 'EMP COST'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 13.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'STAFF WELFARE'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 14.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RECRUITMENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 15.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'TRAVELS'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 16.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'SUBCONTRACT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 17.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'COMMUNICATION'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 18.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 19.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'BACKEND COST (PROJECT EXP)'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 20.
      it_field-fieldname = 'ADDO'.
      it_field-seltext_l = 'Direct costs'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 21.
      it_field-fieldname = 'ADDO1'.
      it_field-seltext_l = 'Income'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 22.
      it_field-fieldname = 'PROFIT2'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 23.
      it_field-fieldname = 'ADDK'.
      it_field-seltext_l = 'Direct costs(Grp cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 24.
      it_field-fieldname = 'ADDK1'.
      it_field-seltext_l = 'Income(Grp Cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 25.
      it_field-fieldname = 'PROFIT1'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      xlayout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = 'ZPROJECT_PROFIT1'
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE_PROFIT'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         IS_LAYOUT                         = xlayout
         IT_FIELDCAT                       =  it_field_t
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
       TABLES
          T_OUTTAB                          = IT_DISPLAY1
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      clear it_field_t.
      "it_display.
    FORM USER_COMMAND using r_ucomm like sy-ucomm rs type slis_selfield.
      include zinteractive_profit."Secondary list for calling KO03.
    ENDFORM.                    "USER_COMMAND.
    Thanks & Regards,
    Lakshmi..

    Hi,
    i did according to ur suggession.
    now it is going dump.
    and it is telling like this.
    2629               i_event_name      = 'SUBTOTAL_TEXT'
    2630               is_subtottxt_info = ls_subtot_info
    2631               ip_subtot_line    = lr_data
    2632             changing
    2633               c_subtottxt       = l_subtottxt.
    2634           ls_lvc_data-value = l_subtottxt.
    2635
    2636           append ls_lvc_data to ct_lvc_data.
    2637         endif.
    2638
    2639 ************************************
    2640 * Column per Fieldcat Entry
    2641 ************************************
    2642         clear ls_lvc_data-style.
    2643         loop at it_fcat_local assigning <ls_fcat>
    2644                 where tech ne 'X' and no_out ne 'X'.
    2645           if l_invisible eq 'X'.
    2646             clear l_invisible.
    2647             if <ls_fcat>-do_sum is initial.
    2648               continue.
    2649             else.
    2650               clear ls_lvc_data-col_pos.
    2651             endif.
    2652           endif.
    2653
    2654           add 1 to ls_lvc_data-col_pos.
    2655
    2656           assign component <ls_fcat>-fieldname
    2657                            of structure <ls_data> to <l_field_val
    2658           if sy-subrc ne 0.
    >>>>>             message x000(0k).
    2660           endif.
    2661
    2662 *... work on average
    2663           if <ls_fcat>-do_sum eq 'C'.
    2664             clear l_entries.
    2665
    2666             assign space to <l_unit>.
    2667             if not <ls_fcat>-cfieldname is initial.
    2668               assign component <ls_fcat>-cfieldname
    2669                      of structure <ls_data> to <l_unit>.
    2670             endif.
    2671             if not <ls_fcat>-qfieldname is initial.
    2672               assign component <ls_fcat>-qfieldname
    2673                      of structure <ls_data> to <l_unit>.
    2674             endif.
    2675
    2676             l_from = ls_grpl-index_from.
    2677             l_to   = ls_grpl-index_to.
    2678             if ls_grpl-index_from is initial and
    plz any of u help me to come out with solution.
    Thanks & Regards,
    Lakshmi..

  • SAP PS Module Report, Help needed for the Right Logic.

    Hi,
             I have to develop a  PS module Report . This spec of this  report is when you enter , project # , month , date , proj type it should  display all the projects  and only the billing levels  with  different  fiels  like ITD cost, ITD sales, ytd cost,  sales,  awards  etc etc.
    Right now  Iam getting the O/P : in the  following manner, There are many fields  I am just showing the desired ones which have to be changed.
    Proj,           Title,         award,    ITDsales,         ITD cost ,    ytd sales,   ytd costs,
    14148,       New prj       123        --                   ---                    -
    14148-B01,  bill1          -
                234           -
                       456                -
    14148-B02,  bill2          -
                789          -
                       123                -
    14148.001    wbs1        -
             123                     -
                     456
    14148.001    wbs2        -
              567                    -
                     890
    But   for me  the desired output must be only for  project  and the billing levels. It shouldn’t be for WBS elements  xxxx.001  and xxxx.002.
    Desired  output:
    Proj,           Title,         award,    ITDsales,   ITD cost ,       ytd sales,      ytd costs,
    14148,       New prj       123        --               690                 -
                   1346
    14148-B01,  bill1          -
             234                -
                       456             -
    14148-B02,  bill2          -
             789                -
                      123              -
    The ITD costs  and YTD costs must be added   123 + 567 = 690 and
                                                                                 456+890 = 1346.
    And these values must come   on the project level.
    P.S:  I can restrict the values  for wbs elements  , means I can filter them at PRPS table  by giving prps-stufe LE ‘2’.  Then I wont get the wbs level, But I want the values of these to be added up and then show it on the project level.
    Please  go through  this code and let me  know where exactly I need to put the right logic  to work in the desired manner.
    Thanks   in advance
    Dan
    Code Below************************
    [code]TABLES: PROJ,                "Project Definition
            PRPS,                "WBS Elements
            prhi,
            CEPC,                " Profit Center w/ Group Head info
            BPGE,                "Plans (12, 13, etc.)
            COSP,                "Primary   Cost Element (Bill Sales, DPC)
            COSS,                "Secondary Cost Element (Shrd Sls,Sal,etc)
            COSB,                "Results Analysis Cost Elements (Unbil Sls)
            COOI,                "Commitments management: Line items
            JEST,                "Project Status
            TCJ04,               "Person Responsible for Project
            zpclasses,           "Project classes.
    New Added
            CRCO,            " Assignment of Work Center to Cost Center
            CRHD.            " Work Center Header
    Record Layout of extracted data
    TYPES: BEGIN OF EXDEF,       "Data definition of extract data
           X_BU(2)     TYPE C,   "Business Unit
           X_CNTR(10)  TYPE C,   " Profit Center
           X_PROJ(24)  TYPE C,   "Project def (Prj)
           X_CREP(30)  TYPE C,   "Contract Rep.
           X_BDREP(25) TYPE C,   "BD Rep. name
           X_GRPH(15)  TYPE C,   "Tech Rep employee name
           X_ACTREP(15)  TYPE C,  "Acct Rep employee name
           X_PMGR(15)  TYPE C,   "PM employee name
           X_TTLE(35)  TYPE C,   "Title
           X_CLNT(20)  TYPE C,   "Client
           X_POCN(20)  TYPE C,   "Prime Contract Number
           X_TYPE(13)  TYPE C,   "Order Type Sarnoff
           X_OPEN(10)  TYPE C,   "Open Date
           X_CLOSE(10) TYPE C,   "Close Date
           X_CGT(4)    TYPE C,   "CO, GV, TC
           X_DISTR(2)  TYPE C,   "Distribution Channel
           X_CONTR(6)  TYPE C,   "Percentage contribution
           X_AWRD(14)  TYPE C,   "Award        (Plan 11)
           X_P12R(14)  TYPE C,   "Auth Revenue (Plan 12 @ Rev)
           X_P12C(14)  TYPE C,   "Auth Cost    (Plan 12 @ Cost)
           X_P13R(14)  TYPE C,   "Auth Revenue (Plan 13 @ Rev)
           X_P13C(14)  TYPE C,   "Auth Cost    (Plan 13 @ Cost)
           X_ITDS(14)  TYPE C,   "ITD Sales
           X_ITDC(14)  TYPE C,   "ITD Costs
           X_YTDS(14)  TYPE C,   "YTD Sales
           X_YTDC(14)  TYPE C,   "YTD Costs
           X_MTHS(14)  TYPE C,   "Current Month Sales
           X_MTHC(14)  TYPE C,   "Current Month Costs
           X_ITDB(14)  TYPE C,   "ITD Billed Sales
           X_YTDB(14)  TYPE C,   "YTD Billed Sales
           X_MTHB(14)  TYPE C,   "Current Month Billed Sales
           X_COMM(14)  TYPE C,   "Commitments
           X_STAT(6)   TYPE C,   "Active or Inactive (REL, TECO, or CLSD)
           X_ZPROJCLASS(12),
           X_MTHIC(14) TYPE C,   "Current Month Incremental Costs
           X_YTDIC(14) TYPE C,   "YTD Incremental Costs
           X_ITDIC(14) TYPE C,   "ITD Incremental Costs
           X_ZSCURVE(10) TYPE C, "S-CURVE  Status
    New Added
           X_CM_COST(20) TYPE C,
           X_AM_COST(20) TYPE C,
           X_TL_COST(20) TYPE C,
           X_KP_COST(20) TYPE C,
           X_PM_COST(20) TYPE C,
    END OF EXDEF.
    Data declarations
    FIELD-SYMBOLS <MNT> .
    DATA: ETAB  TYPE  EXDEF   OCCURS 100  WITH  HEADER LINE.
    DATA:  X1_PM_COST(20) TYPE C,
           X1_TL_COST(20) TYPE C,
           X1_AM_COST(20) TYPE C,
           X1_CM_COST(20) TYPE C,
           X1_KP_COST(20) TYPE C.
    DATA: KOKRS_FIXED      LIKE PROJ-VKOKR VALUE 'DSRC',  "Controlling Area
          TOTAL_AWARD      LIKE BPGE-WTGES,
          TOTAL_AUTHR12    LIKE BPGE-WTGES,
          TOTAL_AUTHC12    LIKE BPGE-WTGES,
          TOTAL_AUTHR13    LIKE BPGE-WTGES,
          TOTAL_AUTHC13    LIKE BPGE-WTGES,
          TOTAL_ITDSALES   LIKE BPGE-WTGES,
          TOTAL_ITDCOSTS   LIKE BPGE-WTGES,
          TOTAL_ITDICOSTS  LIKE BPGE-WTGES,
          TOTAL_YTDSALES   LIKE BPGE-WTGES,
          TOTAL_YTDCOSTS   LIKE BPGE-WTGES,
          TOTAL_YTDICOSTS  LIKE BPGE-WTGES,
          TOTAL_MTHSALES   LIKE BPGE-WTGES,
          TOTAL_MTHCOSTS   LIKE BPGE-WTGES,
          TOTAL_MTHICOSTS  LIKE BPGE-WTGES,
          TOTAL_ITDBILLED  LIKE BPGE-WTGES,
          TOTAL_YTDBILLED  LIKE BPGE-WTGES,
          TOTAL_MTHBILLED  LIKE BPGE-WTGES,
          TOTAL_COMMITMENT LIKE COOI-WTGBTR,
          HOLD_PRART       LIKE PRPS-PRART,
          COUNT_PROJECTS   TYPE I,
          MNT_INDX(20)     TYPE C,
          HLD_INDX(3)      TYPE N,
          YYYY_MM(10)      TYPE C,
          TEMP-DATE(8)     TYPE C.
    Selection Screen
    SELECTION-SCREEN SKIP 3.
    SELECTION-SCREEN BEGIN OF BLOCK XEXTRPM WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETERS MONTH(2)  TYPE  N   OBLIGATORY.
    PARAMETERS YEAR(4)   TYPE  N   OBLIGATORY.
    SELECT-OPTIONS: EXTRPRJ  FOR PROJ-PSPID.     " Range of Projects
    SELECT-OPTIONS: EXTRTYP  FOR PRPS-PRART.  "Project Types (CO,GV,etc.*)
    SELECT-OPTIONS: EXTRPCTR FOR PROJ-PRCTR.     " Range of Profit centers
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: OPT1 RADIOBUTTON GROUP OPTN,
                OPT2 RADIOBUTTON GROUP OPTN DEFAULT 'X'.
    select-options : s_pc for proj-zprojclass.   "project class
    SELECTION-SCREEN END OF BLOCK XEXTRPM.
    Select Tables
    START-OF-SELECTION.
    write: / 'Sales data (Unshared) extracted on: ', sy-datum.
    uline.
      CLEAR:  COUNT_PROJECTS,
              TOTAL_AWARD,
              TOTAL_AUTHR12,
              TOTAL_AUTHC12,
              TOTAL_AUTHR13,
              TOTAL_AUTHC13,
              TOTAL_ITDSALES,
              TOTAL_ITDCOSTS,
              TOTAL_YTDSALES,
              TOTAL_YTDCOSTS,
              TOTAL_MTHSALES,
              TOTAL_MTHCOSTS,
              TOTAL_ITDBILLED,
              TOTAL_YTDBILLED,
              TOTAL_MTHBILLED,
              TOTAL_COMMITMENT,
              ETAB.
    PROJ Table                                          Project Definition
      SELECT  * FROM PROJ                   "Project Definition
           WHERE PSPID IN EXTRPRJ AND      " Range of Project Numbers
              PRCTR IN EXTRPCTR and        " Range of Profit center
                zprojclass in s_pc.     "project class
    SELECT * FROM PRPS WHERE           "WBS Elements
                  PRART IN EXTRTYP         " Range of Proj.Types (CO,GV,TC..
                 and PSPHI = PROJ-PSPNR.
        HOLD_PRART   = '  '.               "clears project type
        CLEAR ETAB.
        ETAB-X_PROJ  = PRPS-POSID.
        ETAB-X_BU    = PRPS-PRCTR(2).      "Business Unit
        ETAB-X_PMGR = PROJ-VERNA.          "Project Manager
        IF PRPS-PRCTR(2) = '01'.
         ETAB-X_CNTR  = PRPS-PRCTR.         " Profit Center
         CONCATENATE SPACE PRPS-PRCTR INTO ETAB-X_CNTR SEPARATED BY SPACE.
        ELSE.
          ETAB-X_CNTR  = PRPS-PRCTR.         " Profit Center
        ENDIF.
         ETAB-X_TTLE  = PRPS-POST1.         "Title
        CLEAR  TEMP-DATE.
        TEMP-DATE    = PROJ-PLFAZ.         "Project planned start date
        CONCATENATE  TEMP-DATE4(2)  '/' TEMP-DATE6(2) '/'
                     TEMP-DATE+0(4)  INTO  ETAB-X_OPEN.
        TEMP-DATE    = PROJ-PLSEZ.         "Project planned finish date
        CONCATENATE  TEMP-DATE4(2)  '/' TEMP-DATE6(2) '/'
                     TEMP-DATE+0(4)  INTO  ETAB-X_CLOSE.
    Tech Lead
    will comment below
        SELECT SINGLE VERNA FROM TCJ04     "Tech Lead name from TCJ04
               INTO  (ETAB-X_GRPH) WHERE  VERNR = PROJ-ZGRPHD.
    End Of Tech Lead
    Account Manager
        SELECT SINGLE VERNA FROM TCJ04  "Acct Manager from TCJ04
               INTO  (ETAB-X_BDREP) WHERE  VERNR = PROJ-ZBUSDEV.
    ******End Of Account Manager
    Key Personnel
        SELECT SINGLE VERNA FROM TCJ04     "Account Rep name from TCJ04
               INTO  (ETAB-X_ACTREP) WHERE  VERNR = PROJ-ZRESPDIR.
    ********End of Key Personnel
    **Contract Manager
        SELECT SINGLE VERNA FROM TCJ04     "Contract Rep name from TCJ04
               INTO  (ETAB-X_CREP) WHERE  VERNR = PROJ-ZCNTREP.
    End of Contract Manager
    PRPS Table                            WBS's attached to the Project
       SELECT * FROM PRPS WHERE           "WBS Elements
                 PRART IN EXTRTYP         "Range of Proj.Types (CO,GV,TC..
                 AND PSPHI = PROJ-PSPNR.
                order by posid stufe.    "Sort by WBS & Level (needed?)
    get info from level 1 of the WBS
         IF PRPS-STUFE EQ 1.              "top-level WBS element
            HOLD_PRART  = PRPS-PRART.      "save project type for later
            ETAB-X_STAT = '????'.          "set ? as the default status
    get Status for level 1
            SELECT * FROM JEST             "use JEST to determine Status
               WHERE OBJNR =  PRPS-OBJNR
                 AND INACT EQ SPACE.       "space denotes an active status
               CASE JEST-STAT.             "find the system status (Ixxx)
                    WHEN 'I0001'.
                         ETAB-X_STAT = 'CRTD'.    "Created
                    WHEN 'I0002'.
                         ETAB-X_STAT = 'REL'.     "Released
                    WHEN 'I0045'.
                         ETAB-X_STAT = 'TECO'.    "Technically Complete
                    WHEN 'I0046'.
                         ETAB-X_STAT = 'CLSD'.    "Closed
               ENDCASE.
            ENDSELECT.
    Select only active projects (ie; those not with TECO or CLSD)
            IF  OPT2 EQ 'X'
               AND  ( ETAB-X_STAT EQ  'TECO'
                  OR  ETAB-X_STAT EQ  'CLSD' ).
                   EXIT.
            ENDIF.
    *comment Contract Rep and Proj man because we get them from PROJ now
           etab-x_crep   = prps-zzcont.     "Contract Rep.
           etab-x_pmgr   = prps-verna.      "Program Manager Name
            ETAB-X_CLNT   = PRPS-ZZMANDT.    "Client Name
            ETAB-X_CGT    = PRPS-PRART.      "CO, GV, TC, etc
            ETAB-X_DISTR  = PRPS-ZZVTWEG.    "Distrib Channel (ie; GP, etc.)
            ETAB-X_CONTR  = PRPS-USR04.      "Contribution %
            ETAB-X_POCN   = PRPS-ZZPOCN.     "Contract Number
            ETAB-X_TYPE   = PRPS-ZZORDT.     "Order Type Sarnoff
    Award and Authorization (Revenue & Cost)
            SELECT * FROM BPGE
               WHERE OBJNR   = PRPS-OBJNR
                 AND LEDNR   = '0001'        "Budget / Planning Ledger
                 AND TRGKZ   = 'N'           "Object indicator
                 AND WRTTP   = '01'          "Value Type
                 AND ( VERSN = '011'         "011 = Award
                    OR VERSN = '012'         "012 = Billing Authorization
                    OR VERSN = '013' ).      "013 = RA Authorization
                                             "010 = Funding Authorization
    Award                                                        Plan 11
              IF BPGE-VERSN = '011'.         "Plan 11 = Award
                CASE BPGE-VORGA.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_AWRD = ETAB-X_AWRD + BPGE-WTGES.
                ENDCASE.
              ENDIF.
        IF prps-stufe eq '2'.
    Authorization (Revenue & Cost plan 12)                       Plan 12
              IF BPGE-VERSN = '012'.         "Plan 12 = RA Authorization
                CASE BPGE-VORGA.
                  WHEN 'KSTR'.               "KSTR = Revenue level
                    ETAB-X_P12R = ETAB-X_P12R - BPGE-WTGES.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_P12C = ETAB-X_P12C + BPGE-WTGES.
                ENDCASE.
              ENDIF.
    Authorization (Revenue & Cost plan 13)                       Plan 13
              IF BPGE-VERSN = '013'.         "Plan 13 = RA Authorization
                CASE BPGE-VORGA.
                  WHEN 'KSTR'.               "KSTR = Revenue level
                    ETAB-X_P13R = ETAB-X_P13R - BPGE-WTGES.
                  WHEN 'KSTP'.               "KSTP = Cost level
                    ETAB-X_P13C = ETAB-X_P13C + BPGE-WTGES.
                ENDCASE.
              ENDIF.
        endif.
            ENDSELECT.                     "BPGE
      ENDIF.      "end of if prps-stufe eq 1. top-level WBS element
    COSP Table (External Postings)                     Awards
    COSP Table (External Postings)                     Billed Sales
    COSP Table (External Postings)                     DPC's & Legacy Load
            SELECT * FROM COSP
               WHERE OBJNR = PRPS-OBJNR    AND
                     GJAHR LE YEAR
             AND (
                 ( kstar = '0000400999'   and        "old CE for Award $
                   ( KSTAR BETWEEN '0000400990' AND '0000400999' AND
                     VERSN = '011'              AND    "11 = Award
                     WRTTP = '01' )                    "01 = Planned
              OR ( ( KSTAR BETWEEN '0000400001' AND '0000400989' OR
                     KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                     WRTTP = '04' )                    "04 = Actuals
              OR ( ( KSTAR BETWEEN '0000998001' AND '0000998010' OR
                     KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
                     WRTTP = '04' )                    "04 = Actuals
    *------- Awards
           if cosp-kstar = '0000400999' and          "old 400999 = Awards
             IF COSP-KSTAR BETWEEN '0000400990' AND '0000400999' AND
                COSP-VERSN = '011'              AND    "11 = Award
                COSP-WRTTP = '01'.                     "01 = Planned
               IF YEAR       = COSP-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSP-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_AWRD = ETAB-X_AWRD + <MNT>.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSP-GJAHR.
                   ETAB-X_AWRD = ETAB-X_AWRD +
                                 COSP-WKG001 + COSP-WKG002 +
                                 COSP-WKG003 + COSP-WKG004 +
                                 COSP-WKG005 + COSP-WKG006 +
                                 COSP-WKG007 + COSP-WKG008 +
                                 COSP-WKG009 + COSP-WKG010 +
                                 COSP-WKG011 + COSP-WKG012 +
                                 COSP-WKG013 + COSP-WKG014 +
                                 COSP-WKG015 + COSP-WKG016.
               ELSE.
                 EXIT.
               ENDIF.
             ENDIF.
    *------- Billed Sales
             IF ( COSP-KSTAR BETWEEN '0000400001' AND '0000400989' OR
                  COSP-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                  COSP-WRTTP = '04'.
                                     "0000999001 = ITD Sales
                                     "0000999003 = ITD Billed Revenue
                IF YEAR = COSP-GJAHR.
                  DO.
                   IF SY-INDEX LE MONTH.
                      MOVE SY-INDEX TO HLD_INDX.
                      MNT_INDX =  'COSP-WKGXXX'.
                      REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                      ASSIGN  (MNT_INDX) TO <MNT>.
                      ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
                      ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
                      IF SY-INDEX = MONTH.
                         ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
                      ENDIF.
                   ELSE.
                      EXIT.
                   ENDIF.
                  ENDDO.
                ELSEIF YEAR > COSP-GJAHR.
                  ETAB-X_ITDB = ETAB-X_ITDB -
                             COSP-WKG001 - COSP-WKG002 -
                             COSP-WKG003 - COSP-WKG004 -
                             COSP-WKG005 - COSP-WKG006 -
                             COSP-WKG007 - COSP-WKG008 -
                             COSP-WKG009 - COSP-WKG010 -
                             COSP-WKG011 - COSP-WKG012 -
                             COSP-WKG013 - COSP-WKG014 -
                             COSP-WKG015 - COSP-WKG016.
                ELSE.
                  EXIT.
                ENDIF.
             ENDIF.
    *------- DPC's & Legacy Load
             IF ( COSP-KSTAR BETWEEN '0000998001' AND '0000998010' OR
                  COSP-KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
                  COSP-WRTTP = '04'.
               IF YEAR = COSP-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSP-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDC  = ETAB-X_ITDC  + <MNT>.
                        ETAB-X_YTDC  = ETAB-X_YTDC  + <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHC  = ETAB-X_MTHC  + <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSP-GJAHR.
                   ETAB-X_ITDC = ETAB-X_ITDC +
                                 COSP-WKG001 + COSP-WKG002 +
                                 COSP-WKG003 + COSP-WKG004 +
                                 COSP-WKG005 + COSP-WKG006 +
                                 COSP-WKG007 + COSP-WKG008 +
                                 COSP-WKG009 + COSP-WKG010 +
                                 COSP-WKG011 + COSP-WKG012 +
                                 COSP-WKG013 + COSP-WKG014 +
                                 COSP-WKG015 + COSP-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
           ENDSELECT.
    COOI Table (Commitments)              commitments for the WBS elements
           SELECT  * FROM COOI
             WHERE OBJNR =  PRPS-OBJNR.
               ETAB-X_COMM = ETAB-X_COMM + COOI-WTGBTR.
           ENDSELECT.
    COSS Table (External Postings)                    G&A on Commitments
    COSS Table (External Postings)                    Shared Billed Sales
    COSS Table (External Postings)                    Shared DPC's
    COSS Table (External Postings)                    Salary,ESE,OH, & G&A
           SELECT  *   FROM  COSS
             WHERE
              ( OBJNR =  PRPS-OBJNR AND
                WRTTP =  '22' )                         "G&A on Commitments
                    OR
              ( OBJNR =  PRPS-OBJNR AND
                GJAHR LE YEAR       AND
                WRTTP = '04'        AND                 "04 = Actuals
                   (                                   "Shared Billed Sales
                     (   KSTAR BETWEEN '0000400001' AND '0000400989' OR
                         KSTAR BETWEEN '0000999001' AND '0000999003' )
                     OR                                "Shared DPC's
                     (   KSTAR BETWEEN '0000600001' AND '0000601999' )
                     OR                                "Salary,ESE,OH, & G&A
                     ( ( KSTAR BETWEEN '0000001000' AND '0000001999'  OR
                         KSTAR BETWEEN '0000002100' AND '0000002199'  OR
                         KSTAR BETWEEN '0000002500' AND '0000002599'  OR
                         KSTAR BETWEEN '0000002800' AND '0000002899' ) )
                  and  parob not like 'PR%' ) "commented out on 4/19/2000
    *------- G&A on Commitments    (NOTE: data is always as of the RUN date)
             IF  COSS-WRTTP = '22'.
                   ETAB-X_COMM = ETAB-X_COMM +
                                 COSS-WKG001 + COSS-WKG002 +
                                 COSS-WKG003 + COSS-WKG004 +
                                 COSS-WKG005 + COSS-WKG006 +
                                 COSS-WKG007 + COSS-WKG008 +
                                 COSS-WKG009 + COSS-WKG010 +
                                 COSS-WKG011 + COSS-WKG012 +
                                 COSS-WKG013 + COSS-WKG014 +
                                 COSS-WKG015 + COSS-WKG016.
             ENDIF.
    *------- Shared Billed Sales
             IF ( COSS-KSTAR BETWEEN '0000400001' AND '0000400989' OR
                  COSS-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
                  COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSS-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
                        ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                 ETAB-X_ITDB = ETAB-X_ITDB -
                               COSS-WKG001 - COSS-WKG002 -
                               COSS-WKG003 - COSS-WKG004 -
                               COSS-WKG005 - COSS-WKG006 -
                               COSS-WKG007 - COSS-WKG008 -
                               COSS-WKG009 - COSS-WKG010 -
                               COSS-WKG011 - COSS-WKG012 -
                               COSS-WKG013 - COSS-WKG014 -
                               COSS-WKG015 - COSS-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
    *------- Shared DPC's
             IF COSS-KSTAR BETWEEN '0000600001' AND '0000601999' AND
                COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSS-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDC  = ETAB-X_ITDC  + <MNT>.
                        ETAB-X_YTDC  = ETAB-X_YTDC  + <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHC  = ETAB-X_MTHC  + <MNT>.
                       ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                   ETAB-X_ITDC = ETAB-X_ITDC +
                                 COSS-WKG001 + COSS-WKG002 +
                                 COSS-WKG003 + COSS-WKG004 +
                                 COSS-WKG005 + COSS-WKG006 +
                                 COSS-WKG007 + COSS-WKG008 +
                                 COSS-WKG009 + COSS-WKG010 +
                                 COSS-WKG011 + COSS-WKG012 +
                                 COSS-WKG013 + COSS-WKG014 +
                                 COSS-WKG015 + COSS-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
             ENDIF.
    *------- Salary,ESE,OH,& G&A
             IF ( COSS-KSTAR BETWEEN '0000001000' AND '0000001999'  OR
                  COSS-KSTAR BETWEEN '0000002100' AND '0000002199'  OR
                  COSS-KSTAR BETWEEN '0000002500' AND '0000002599'  OR
                  COSS-KSTAR BETWEEN '0000002800' AND '0000002899' ) AND
                  COSS-WRTTP = '04'.
               IF YEAR = COSS-GJAHR.
                 DO.
                   IF SY-INDEX LE MONTH.
                      MOVE SY-INDEX TO HLD_INDX.
                      MNT_INDX =  'COSS-WKGXXX'.
                      REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                      ASSIGN  (MNT_INDX) TO <MNT>.
                      ETAB-X_ITDC = ETAB-X_ITDC + <MNT>.
                      ETAB-X_YTDC = ETAB-X_YTDC + <MNT>.
                      IF SY-INDEX = MONTH.
                          ETAB-X_MTHC = ETAB-X_MTHC + <MNT>.
                      ENDIF.
                   ELSE.
                      EXIT.
                   ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSS-GJAHR.
                 ETAB-X_ITDC = ETAB-X_ITDC +
                               COSS-WKG001 + COSS-WKG002 +
                               COSS-WKG003 + COSS-WKG004 +
                               COSS-WKG005 + COSS-WKG006 +
                               COSS-WKG007 + COSS-WKG008 +
                               COSS-WKG009 + COSS-WKG010 +
                               COSS-WKG011 + COSS-WKG012 +
                               COSS-WKG013 + COSS-WKG014 +
                               COSS-WKG015 + COSS-WKG016.
               ELSE.
                 EXIT.
                ENDIF.
             ENDIF.
            ENDSELECT.
    COSB Table (Results from running RA)                    Unbilled Sales
            SELECT * FROM COSB
               WHERE OBJNR = PRPS-OBJNR
                 AND KSTAR BETWEEN '0000003004' AND '0000003005'
                                   "0000003004 = Unbilled Revenue
                                   "0000003005 = Unearned Revenue
                 AND GJAHR LE YEAR
                 AND WRTTP = '32'.                    "32 = Results Analysis
               IF YEAR = COSB-GJAHR.
                 DO.
                     IF SY-INDEX LE MONTH.
                        MOVE SY-INDEX TO HLD_INDX.
                        MNT_INDX =  'COSB-WKGXXX'.
                        REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
                        ASSIGN  (MNT_INDX) TO <MNT>.
                        ETAB-X_ITDS = ETAB-X_ITDS - <MNT>.
                        ETAB-X_YTDS = ETAB-X_YTDS - <MNT>.
                        IF SY-INDEX = MONTH.
                           ETAB-X_MTHS = ETAB-X_MTHS - <MNT>.
                        ENDIF.
                     ELSE.
                        EXIT.
                     ENDIF.
                 ENDDO.
               ELSEIF YEAR > COSB-GJAHR.
                 ETAB-X_ITDS = ETAB-X_ITDS -
                               COSB-WKG001 - COSB-WKG002 -
                               COSB-WKG003 - COSB-WKG004 -
                               COSB-WKG005 - COSB-WKG006 -
                               COSB-WKG007 - COSB-WKG008 -
                               COSB-WKG009 - COSB-WKG010 -
                               COSB-WKG011 - COSB-WKG012 -
                               COSB-WKG013 - COSB-WKG014 -
                               COSB-WKG015 - COSB-WKG016.
               ELSE.
                  EXIT.
               ENDIF.
            ENDSELECT.
      ENDSELECT.               "End of WBS records (from PRPS) for project
    Get Total Sales by adding Billed Sales to Unbilled Sales.
       ETAB-X_ITDS  =  ETAB-X_ITDS  +  ETAB-X_ITDB.
       ETAB-X_YTDS  =  ETAB-X_YTDS  +  ETAB-X_YTDB.
       ETAB-X_MTHS  =  ETAB-X_MTHS  +  ETAB-X_MTHB.
       IF  HOLD_PRART IN EXTRTYP.   "Matches the user requested project type
         IF  OPT1 EQ 'X' OR         "All projects
           ( OPT2 EQ 'X' AND        "Only active projects
             ETAB-X_STAT NE  'TECO' AND
             ETAB-X_STAT NE  'CLSD' ).
               TOTAL_AWARD      = TOTAL_AWARD      + ETAB-X_AWRD.
               TOTAL_AUTHR12    =   TOTAL_AUTHR12    + ETAB-X_P12R .
              TOTAL_AUTHC12    = TOTAL_AUTHC12    + ETAB-X_P12C.
               TOTAL_AUTHR13    = TOTAL_AUTHR13    + ETAB-X_P13R.
               TOTAL_AUTHC13    = TOTAL_AUTHC13    + ETAB-X_P13C.
               TOTAL_ITDSALES   = TOTAL_ITDSALES   + ETAB-X_ITDS.
               TOTAL_ITDCOSTS   = TOTAL_ITDCOSTS   + ETAB-X_ITDC.
               TOTAL_YTDSALES   = TOTAL_YTDSALES   + ETAB-X_YTDS.
               TOTAL_YTDCOSTS   = TOTAL_YTDCOSTS   + ETAB-X_YTDC.
               TOTAL_MTHSALES   = TOTAL_MTHSALES   + ETAB-X_MTHS.
               TOTAL_MTHCOSTS   = TOTAL_MTHCOSTS   + ETAB-X_MTHC.
               TOTAL_ITDBILLED  = TOTAL_ITDBILLED  + ETAB-X_ITDB.
               TOTAL_YTDBILLED  = TOTAL_YTDBILLED  + ETAB-X_YTDB.
               TOTAL_MTHBILLED  = TOTAL_MTHBILLED  + ETAB-X_MTHB.
               TOTAL_COMMITMENT = TOTAL_COMMITMENT + ETAB-X_COMM.
               PERFORM SHIFT_SIGN.
               APPEND  ETAB.              "Write data to internal table
               CLEAR   ETAB.
               COUNT_PROJECTS = COUNT_PROJECTS + 1. "Count # of Projects
         ENDIF.
       ENDIF.
       ENDSELECT.
    ENDSELECT.                          "End of Projects from PROJ table
      PERFORM GRAND_TOTALS.
      SORT  ETAB  BY  X_BU X_PROJ.
      ETAB-X_BU    = 'BU'.
      ETAB-X_CNTR  = 'PrftCntr'.
      ETAB-X_PROJ  = 'Proj'.
      ETAB-X_CREP  = 'Contract Mgr'.
      ETAB-X_BDREP = 'Account Mgr'.
      ETAB-X_GRPH  = 'Technical Lead'.
      ETAB-X_ACTREP = 'Key Person1'.
      ETAB-X_PMGR  = 'Program Mgr'.
      ETAB-X_TTLE  = 'Title'.
      ETAB-X_CLNT  = 'Client'.
      ETAB-X_POCN  = 'Contract #'.
      ETAB-X_TYPE  = 'Type'.
      ETAB-X_OPEN  = 'Open'.
      ETAB-X_CLOSE = 'Close'.
      ETAB-X_CGT   = 'CGT'.
      ETAB-X_DISTR = 'DC'.
      ETAB-X_CONTR = 'Contr%'.
      ETAB-X_AWRD  = 'Award'.
      ETAB-X_P12R  = 'Auth12 Sales'.
      ETAB-X_P12C  = 'Auth12 Cost'.
      ETAB-X_P13R  = 'Auth13 Sales'.
      ETAB-X_P13C  = 'Auth13 Cost'.
      ETAB-X_ITDS  = 'ITD Sales'.
      ETAB-X_ITDC  = 'ITD Costs'.
      ETAB-X_YTDS  = 'YTD Sales'.
      ETAB-X_YTDC  = 'YTD Costs'.
      ETAB-X_MTHS  = 'Mth Sales'.
      ETAB-X_MTHC  = 'Mth Costs'.
      ETAB-X_ITDB  = 'ITD Billed'.
      ETAB-X_YTDB  = 'YTD Billed'.
      ETAB-X_MTHB  = 'Mth Billed'.
      ETAB-X_COMM  = 'Commitments'.
      ETAB-X_STAT  = 'Status'.
      INSERT ETAB  INDEX 1.    "Write a report header line to internal table
      CLEAR  ETAB.
    CALL FUNCTION 'Z_RH_START_EXCEL_DATA_OLE'
        EXPORTING
           data_name = 'C:\WINNT\Profiles\cbraswell\Desktop\TestTemp.xlt'
             DATA_NAME          = 'ZSales.XLS'
             DATA_PATH_FLAG     = 'W'
             DATA_TYPE          = 'DAT'
             DATA_BIN_FILE_SIZE = 'ZSales'
             CHART_TITLE        = 'ZSales'
             CHART_TYPE         = 2
             CATEGORY_TITLE     = 'ZSales'
             VALUE_TITLE        = 'ZSales'
             DATA_XTOP_COR      = 0
             DATA_YTOP_COR      = 0
             DATA_XBOT_COR      = 0
             DATA_YBOT_COR      = 0
             CATEGORY_XTOP_COR  = 0
             CATEGORY_YTOP_COR  = 0
             CATEGORY_XBOT_COR  = 0
             CATEGORY_YBOT_COR  = 0
         TABLES
              DATA_TAB           =    ETAB
         EXCEPTIONS
              NO_BATCH           = 1
              DOWNLOAD_ERROR     = 2
              INVALID_TYPE       = 3
              INTERNAL_ERROR     = 4
              NO_OLE_SUPPORT     = 5
              OLE_FILE_ERROR     = 6
              OLE_ERROR          = 7
              NO_DATA            = 8
              COORDINATE_ERROR   = 9
              OTHERS             = 10.
    Negative # sign in the front of number for downloading to Excel
    FORM  SHIFT_SIGN.
      IF ETAB-X_AWRD CA '-'.    SHIFT ETAB-X_AWRD RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P12R CA '-'.    SHIFT ETAB-X_P12R RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P12C CA '-'.    SHIFT ETAB-X_P12C RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P13R CA '-'.    SHIFT ETAB-X_P13R RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_P13C CA '-'.    SHIFT ETAB-X_P13C RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_ITDS CA '-'.    SHIFT ETAB-X_ITDS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_ITDIC CA '-'.   SHIFT ETAB-X_ITDIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_ITDC CA '-'.    SHIFT ETAB-X_ITDC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDS CA '-'.    SHIFT ETAB-X_YTDS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDC CA '-'.    SHIFT ETAB-X_YTDC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDIC CA '-'.   SHIFT ETAB-X_YTDIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_MTHS CA '-'.    SHIFT ETAB-X_MTHS RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHC CA '-'.    SHIFT ETAB-X_MTHC RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHIC CA '-'.   SHIFT ETAB-X_MTHIC RIGHT CIRCULAR.    ENDIF.
      IF ETAB-X_ITDB CA '-'.    SHIFT ETAB-X_ITDB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_YTDB CA '-'.    SHIFT ETAB-X_YTDB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_MTHB CA '-'.    SHIFT ETAB-X_MTHB RIGHT CIRCULAR.     ENDIF.
      IF ETAB-X_COMM CA '-'.    SHIFT ETAB-X_COMM RIGHT CIRCULAR.     ENDIF.
    ENDFORM.
    FORM  GRAND_TOTALS.
    SKIP 1.    .
    WRITE: / '----
    WRITE: / 'System ID                  = ', SY-SYSID,
           / 'Client                     = ', SY-MANDT,
           / 'User                       = ', SY-UNAME,
           / 'Date of data extract       = ', SY-DATUM ,
           / 'Number of Projects          =           ',   COUNT_PROJECTS,
           / 'total Award      (Plan 11)  = ', TOTAL_AWARD,
           / 'total Auth Sales

    Hi all,
        Iam really waiting for someone to see and  get the logic right  for this code.Iam completely stuck up.  i need ur help
    Thanks

  • Help needed for creating 1 invoice for 2 different material types.

    Dear, Gurus
    I really need help here I have spent 3 days cracking my head trying to solve the problem. Problem is client was creating invoice with reference to order and while invoice was being made it would cause an invoice split. The materials involved are Trading Good and Service Material. They would like only 1 invoice. Note nothing was different except material group and item cat. of the material. payment terms billing dates partners everything is same.
    Current item config for Trading Good material is ZMPI-project item cat.
    Copying requirements   023  Item ord.ref. w/o AZ        Billing quantity     A
    Data VBRK/VBRP         000                                           Pos./neg. quantity   +
                                                                                    Pricing type         K
                                                                                    PricingExchRate type
                                                                                    Price source
    Current item config for service Material is TAD-Service
    Copying requirements   002  Item/order-related          Billing quantity     A
    Data VBRK/VBRP         001  Inv.split (sample)            Pos./neg. quantity   +
                                                                                    Pricing type         G
                                                                                    PricingExchRate type
                                                                                    Price source
    I was told to change Data VBRK/VBRP to 003 One Invoice which I did in both of these item cat. and yes they worked perfectly but at time of creating the invoice for service material the qty that showed was 11. Note: In sales order it is 1 qty. So I went back into the config of item cat TAD and changed copying requirement to 023 instead of 002 but nothing changed. Seems a qty of 10 is referencing something else which I have no idea what or where it is picking this up from. Just to see or test things I went into the sales order and tried changing the service material qty then a weird popup appears and says service order 12344456 has been blocked. (Seriously I have no idea why this would happen or should be existing at all.) Even if for some reason it is being referenced the service order that is existing is qty 1.
    I really really do need help and if someone can help me that would be god sent.
    Regards, Ali

    You did not mention what value is maintained in the field billing quantity in the copy control->Item settings. Check for the service item, what value is assigned. Put value A and re-test.
    Note that whenever you change any settings in configuration side, you need to create a new documents to test the results of the settings. You should not use the existing documents.
    When you say the document is blocked, then check the status of the sales order to find the reason for blocking (like credit block, approval etc)..
    Regards,

  • Query help needed for querybuilder to use with lcm cli

    Hi,
    I had set up several queries to run with the lcm cli in order to back up personal folders, inboxes, etc. to lcmbiar files to use as backups.  I have seen a few posts that are similar, but I have a specific question/concern.
    I just recently had to reference one of these back ups only to find it was incomplete.  Does the query used by the lcm cli also only pull the first 1000 rows? Is there a way to change this limit somwhere?
    Also, since when importing this lcmbiar file for something 'generic' like 'all personal folders', pulls in WAY too much stuff, is there a better way to limit this? I am open to suggestions, but it would almost be better if I could create individual lcmbiar output files on a per user basis.  This way, when/if I need to restore someone's personal folder contents, for example, I could find them by username and import just that lcmbiar file, as opposed to all 3000 of our users.  I am not quite sure how to accomplish this...
    Currently, with my limited windows scripting knowledge, I have set up a bat script to run each morning, that creates a 'runtime' properties file from a template, such that the lcmbiar file gets named uniquely for that day and its content.  Then I call the lcm_cli using the proper command.  The query within the properties file is currently very straightforward - select * from CI_INFOOBJECTS WHERE SI_ANCESTOR = 18.
    To do what I want to do...
    1) I'd first need a current list of usernames in a text file, that could be read (?) in and parsed to single out each user (remember we are talking about 3000) - not sure the best way to get this.
    2) Then instead of just updating the the lcmbiar file name with a unique name as I do currently, I would also update the query (which would be different altogether):  SELECT * from CI_INFOOBJECTS where SI_OWNER = '<username>' AND SI_ANCESTOR = 18.
    In theory, that would grab everything owned by that user in their personal folder - right? and write it to its own lcmbiar file to a location I specify.
    I just think chunking something like this is more effective and BO has no built in back up capability that already does this.  We are on BO 4.0 SP7 right now, move to 4.1 SP4 over the summer.
    Any thoughts on this would be much appreciated.
    thanks,
    Missy

    Just wanted to pass along that SAP Support pointed me to KBA 1969259 which had some good example queries in it (they were helping me with a concern I had over the lcmbiar file output, not with query design).  I was able to tweak one of the sample queries in this KBA to give me more of what I was after...
    SELECT TOP 10000 static, relationships, SI_PARENT_FOLDER_CUID, SI_OWNER, SI_PATH FROM CI_INFOOBJECTS,CI_APPOBJECTS,CI_SYSTEMOBJECTS WHERE (DESCENDENTS ("si_name='Folder Hierarchy'","si_name='<username>'"))
    This exports inboxes, personal folders, categories, and roles, which is more than I was after, but still necessary to back up.. so in a way, it is actually better because I have one lcmbiar file per user - contains all their 'personal' objects.
    So between narrowing down my set of users to only those who actually have saved things to their personal folder and now having a query that actually returns what I expect it to return, along with the help below for a job to clean up these excessive amounts of promotion jobs I am now creating... I am all set!
    Hopefully this can help someone else too!
    Thanks,
    missy

  • XMLAGG structure, performance help needed for odd nesting in schema

    Hello,
    I have to produce XML to look like:
    <?xml version='1.0'?>
      <enterprise>
        <membership>
          <sourcedid>
            <id>PHYS_101_001_FA2007</id>
          </sourcedid>
        <!-- NOTE: absence of "members" level tag for XMLAGG! -->
        <member>
          <sourcedid>
            <id>D2LU0001</id>
          </sourcedid>
          <role roletype="Sample Role">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourcedid>
            <id>D2LU0002</id>
          </sourcedid>
          <role roletype="Sample Role">
            <status>1</status>
          </role>
        </member>
      </membership>
    </enterprise>This would be straightforward if the schema allowed for a "<members>" tag under which to nest the <member> tags. But, it does not allow for that tag or any other than those listed above.
    I have a query which does produce that output (except for the roletype attribute), but its performance is horrible; it takes about 40 minutes to return data:
    SELECT
         XMLROOT(
             XMLELEMENT("enterprise",
               XMLAGG(
                 XMLELEMENT("membership",
                   XMLFOREST( XMLELEMENT("id",cx.mapped_course_id) as "sourcedid"
                   (SELECT XMLAGG(
                     XMLELEMENT("member",
                       XMLFOREST(XMLELEMENT("id",spriden_id) AS "sourcedid",
                                 XMLELEMENT("status",'1') AS "role"
                      FROM enrollments_fall_sfrstca efs
                         , spriden sp
                         , gzv_tuid t
                     WHERE sp.spriden_change_ind IS NULL
                       AND sp.spriden_pidm       = t.pidm
                       AND t.tuid                = efs.user_name
                       AND efs.mapped_course_id  = cx.mapped_course_id
                       AND efs.term              = cx.semester
                , VERSION '1.0', STANDALONE NO VALUE)
      FROM courses_xt cx
    WHERE cx.semester = :term_code
    ;Similar queries are producing courses and users XML fine with no performance issues, but these are driven off either the courses view or the enrollments view, but not both.
    Is there some other way I can produce the nesting I need for the vendor's schema?
    The source views are basically as follows (showing relevant columns only):
    courses_xt:
    MAPPED_COURSE_ID       SEMEST
    AVFT209-13307-201210   201210
    AVFT210-13308-201210   201210enrollments_fall_sfrstca:
    MAPPED_COURSE_ID       USER_NAME
    AVFT209-13307-201210    FULLERC8
    AVFT209-13307-201210    SHUPEK
    AVFT209-13307-201210    NOMAN
    AVFT210-13308-201210    SHUPEK
    AVFT210-13308-201210    PELLONMWhen I have the query without the XML (with the subquery as a column of the outer query), this returns the correct data quickly (a couple of minutes).
    I have tried various permutations of XMLFOREST, XMLELEMENT, XMLAGG but either I get syntax errors, or the data is wrong (e.g. repeated '<membership>' for each '<member>', or I have to create an invalid tag '<members>' to be filtered later).
    Please advise!
    Thanks,
    Anita Lees

    Hi Anita,
    Have you tried with a GROUP BY and no subquery?
    Here's an example using SCOTT schema.
    I've used the same tag names and structure so that you can see the analogy :
    SELECT XMLElement("enterprise",
             XMLAgg(
               XMLElement("membership",
                 XMLElement("sourceid", xmlelement("id", d.deptno))
               , XMLAgg(
                   XMLElement("member",
                     XMLElement("sourceid",
                       XMLElement("id", e.empno)
                   , XMLElement("role",
                       XMLAttributes(e.job as "roletype")
                     , XMLElement("status", '1')
    FROM scott.dept d
         LEFT OUTER JOIN scott.emp e ON e.deptno = d.deptno
    WHERE d.deptno IN (10,20)
    GROUP BY d.deptno
    ;which gives :
    <enterprise>
      <membership>
        <sourceid>
          <id>10</id>
        </sourceid>
        <member>
          <sourceid>
            <id>7782</id>
          </sourceid>
          <role roletype="MANAGER">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7934</id>
          </sourceid>
          <role roletype="CLERK">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7839</id>
          </sourceid>
          <role roletype="PRESIDENT">
            <status>1</status>
          </role>
        </member>
      </membership>
      <membership>
        <sourceid>
          <id>20</id>
        </sourceid>
        <member>
          <sourceid>
            <id>7369</id>
          </sourceid>
          <role roletype="CLERK">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7902</id>
          </sourceid>
          <role roletype="ANALYST">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7566</id>
          </sourceid>
          <role roletype="MANAGER">
            <status>1</status>
          </role>
        </member>
      </membership>
    </enterprise>

  • Help needed on how to assign string value to variables in process designer

    Hi,
    I am using LC Workbench 8.0.1 version, I have a business requirement where in my form I have a dropdown box which contains two options i.e,
    1. Accept
    2. Decline
    If the user selects Accept, I have to route the form to user some "x" or if the user selects Decline then the form should be routed to some user "y" .
    To implement this I need to capture the user selected value which is a String.
    can someone explain me how to reslove this..?
    thanks and regards,
    sudheer

    I'm assuming you're using a xfaForm variable that points to an XDP in the repository to render your document.
    In that case, you set the Form Data Mapping to point to that xfaForm variable in the User step.
    When the user submits the form the xfaForm variable contains the data for the form in an XML format. You can have multiple routes that come out of your user step that will check a certain value in the xfaForm variable.
    The xml data for you form will be located under the /process_data/xfaForm/data/datasets/data node.
    You can use an xPath similar to /process_data/xfaForm/object/data/xdp/datasets/data/myNode/MyField
    you can also use the // notation to do a full search within the data node if you're not sure of the structure:
    /process_data/xfaForm/object/data/xdp/datasets/data//MyFieldValue
    I hope this helps.
    Jasmin

  • Help needed for IPC

    Hi,
      I need to implement the custom scale value formula u201C900u201D which is assigned to condition type ZABC. This is based on the ECC formula u201CFRM_STAFFELBAS_900u201D in include u201CRV62A900u201D. The form is:
    Form FRM_STAFFELBAS_900.
       xkwert = komp-netpr.
    Endform.
    I got to know that these changes need to be made in PricingUserExits.java file. Where can I find this file.
    I am not using a local IPC server and currently have acess to R/3 system only.
    What are the steps needed to implement this?

    Hi Deepika,
    I just saw your post, not sure your problem is solved or not but still want to add something.
    If you are on CRM5.0 or above than you wont be making changes to PricingUserExits.java file instead you need to write a
    new custom user exit.
    I wrote 900 as bas value formula to compute the subtotals.My code was like this.
    * Created on Apr 4, 2009
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package com.yourcompany.pricing.bas;
    import java.math.BigDecimal;
    import com.sap.spe.base.logging.UserexitLogger;
    import com.sap.spe.pricing.customizing.PricingCustomizingConstants;
    import com.sap.spe.pricing.transactiondata.userexit.BaseFormulaAdapter;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit;
    * @author arshi
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class ZConditionBase900 extends BaseFormulaAdapter{
         /* (non-Javadoc)
          * @see com.sap.spe.pricing.transactiondata.userexit.BaseFormulaAdapter#overwriteConditionBase(com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit, com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit)
         UserexitLogger log = new UserexitLogger(ZConditionBase900.class);
         public BigDecimal overwriteConditionBase(
              IPricingItemUserExit prItem,
              IPricingConditionUserExit prCondition) {
             log.writeLogDebug("SUBTOTAL_1 "+prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_1).getValue());
              log.writeLogDebug("SUBTOTAL_5 "+prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_5).getValue());
              log.writeLogDebug("TOTAL "+(prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_1).getValue()).add(prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_5).getValue()));
              return (prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_1).getValue()).add(prItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_5).getValue());
    May be it can help you.
    Regards,
    Arshi

  • Help needed for using BASIC authentication through JDBCRealm

    Help needed.
    Hello,
    I am doing a degree project, so far it works fine in my local machine, I need to try it on my virtual hosting (as it is a live server).
    My project requires JDBCRealm, that is BASIC authentication loading access data from mysql database. Normally this setup can be done in Server.xml file, because my Tomcat hosting is a virtual one, I only have permission to access the web.xml file.
    My question is: is it possible to get it done in an alternative way? In web.xml? Some properties file maybe?
    Thank you very much.

    You can set this up for your context using META-INF/context.xml instead of working with server.xml.
    Make a directory called META-INF under your webapp ( it'll be at the same level as WEB-INF ). Under this, add a context.xml with all your context specific configuration including the realm. A sample is below
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/myApp" reloadable="true">
        <Realm
            className="org.apache.catalina.realm.JDBCRealm"            
            driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"         
            connectionURL="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=myDB;SelectMethod=Cursor;"
            connectionName="username" connectionPassword="password"
            digest="MD5" userTable="users" userNameCol="userid" userCredCol="userpassword"
            userRoleTable="user_roles" roleNameCol="rolename"
        />
    </Context>Hope this helps.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Help Needed for T42 Start-up Problem

    Urgent help need!!!
    I have a ThinkPad T42 with Windows XP installed.  It works perfectly for a while without ever have any problem or error message.  Then suddenly it won’t work anymore.  The symptom is following:
    After power on the laptop the Microsoft window would show up and it prompt me for window logon password.  After I type in the password it then shows “window is loading your personal setting”.  After a long while nothing would show up on the screen other than the background of the normal screen.  There is no window bar at the bottom or any icon on the screen.  If I start in safe mode then everything would show up.  I don’t know what is going on.
    This happened two months ago and I ended up restoring a backup image to get it work again.  It happens again today with the same symptom.  I am really tired of having to restore image backup every 2 months. 
    I would really appreciate it if any of your experts can offer me some insight into this problem.  I am desperate in need of help.
    Thanks very much!

    wangy26, welcome to the forum,
    Have a look at this thread to see if my post there helps. The problem seems to mostly occur at the start of a month, why I don't know. Unfortunately the member didin't report back whether or not this was a viable solution for them.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

Maybe you are looking for

  • Unable to open/run any application in Hyperion 11.1.2 Workspace

    Hi all, I get the below error message when try to open any application in workspace.I'm using Hyperion system 11.1.2 .Please help me out to sort out this error message.I dont find any clue on why this occurring and how can it be rectified. +"There wa

  • Relation between Maintenance Order No. and Operation Number

    Hi all, I have to make a module pool in which i want to display the following field Order No.                                                Operation no. | Operation Description | Now my problem is that i m not getting the tables from which i have t

  • Web Dynpro and CAF (BOs, Application Services, returning Complex Types)

    Hi All, I am trying to develop an application using Web Dynpro and CAF for days now and did not get it running.. I need some help here. What I am trying to do / have done is the following: - Design a Business Object (BO) in CAF - Implement an Applica

  • Filtering Problem

    Hi. I have developed a screen and in the screen i have used the <h:SelectOneMenu> component. I am getting values from the database and populating the values in the dropdown. I have to provide a feature for that component such that if i type 0 all val

  • Feature available in slideshow? (Request)

    I sometimes make a long selection of photos to create a slideshow but find some duplicates which I would like to remove (and are not consecutive) as I PLAY the slideshow. I am thinking, pressing the "D" or "R" key could make it for me. Is there a fea