Need help in framing ABAP code

Hi,
Can someone help me frame code for the below logic
In start routine, if records that have a common record for PO 0OI_EBELN in ITROMML ODS and 0AC_DOC_NO on ITROFIL ODS , then the entire PO record details will be deleted from ITROMML ODS . Therefore  0AC_DOC_NO details from ITROFIL ODS will be filled in ITROCMH ODS and ITROCMD ODS.
Logic is like : Using the Material Document Number ITRMATDOC, line item ITRMTDCLI and fiscal year 0FISCYEAR as key - open POs (0OI_EBELN) from ITROMML ODS are checked with invoices 0AC_DOC_NO in ITROFIL ODS and if the respective keys match, then the entire record is deleted from ITROMML ODS and only invoiced records are brought into the second level ODS ITROCMH and ITROCMD
Here,
ITROMML and ITROFIL are first level ODS
ITROCMH and ITROCMD are second level ODS
I need to write the start routine in between these two levels in BI.7

any suggestions please?

Similar Messages

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help in writing ABAP Code

    Hi All,
    I have a scenario to write a code for below requirement to fetch a latest sales document based on Last Date of Change and Last Time Change and I have written below code in the transfer rule..
    SORT datapak BY Sales Doc
      Last Date of Change Last Time Change descending.
    DELETE ADJACENT DUPLICATES FROM DATAPAK
    COMPARING Sales Doc
    The above code works as per below details
    Data is coming from source in FULL mode
    Data in Source: Input
    Sales Doc       Last Date of Change    Last Time Change    Order Reason
    201                01/03/2014                   04:10:00                        A
    201                 01/03/2014                   05:12:00                        B
    Output: Data in DSO(after moving from transfer rule)
    201                  01/03/2014                  05:12:00                        B             ------------------This is correct(record based on latest date of modification and time)
    Data in source
    Sales Doc       Last Date of Change    Last Time Change    Order Reason
    201                01/03/2014                   04:10:00                        A
    201                 02/04/2014                   05:12:00                        B
    Data in output
    201                01/03/2014                   04:10:00                        A 
    201                 02/04/2014                  05:12:00                        B  -------------------------In this case code is not working when Last date of Modification is different, the DSO fetches both the records while it should fetch only record with latest Date of Modification and Time....
    Could you pls advice if the code is correct or any changes to be made to the code..

    Hi Antony,
    Here the problem is of SORT statement when the Time has been introduced as the sorting factor.
    Please apply below additional code and it will do the job for you.
    *Additional Code
    DATA: ls_datapak LIKE LINE OF datapak.
    DATA: ls_datapak1 LIKE LINE OF datapak.
    * First sort the datapack with only last change date
    SORT datapak BY vbeln aedat DESCENDING.
    * remove all the old dates first and keep only the latest change date in DATAPAK
    READ TABLE datapak INTO ls_datapak1 INDEX 1.
    LOOP AT datapak INTO ls_vbak.
      IF ls_datapak-aedat LT ls_datapak1-aedat.
        DELETE datapak INDEX sy-tabix.
      ENDIF.
    ENDLOOP.
    * below is your code
    SORT datapak BY vbeln aedat lastchangetime DESCENDING.
    DELETE ADJACENT DUPLICATES FROM datapak COMPARING vbeln.
    Please let me know if you face any issue with this code.
    Thanks
    Amit

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • I need help getting new authorization codes for digital copies

    I need help getting new authorization codes for digital copies of movies. Can someone help me out?

    There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed

  • Require  help in my ABAP code

    Hi All,
    My design wont allow Delta loads because the transformation source is an InfoSet.  To limit the data in these loads, I require a  filter in the DTPs on fiscal year/period then only load I can load the current month and 2 prior months.  Now we are updating manually for the DTPs.   To eliminate this monthly task a dynamic filter (routine) needs should be used rather than a static filter.
    So I have written as follows  But in the debugger mode am able to see the -3months to the current date but records are not filtered. Any help please
    *&  Include           RSBC_SEL_ROUTINE_TPL -
    program conversion_routine.---
    Type pools used by conversion program---
    type-pools: rsarc, rsarr, rssm.---
    tables: rssdlrange.---
    Global code used by conversion rules---
    $$ begin of global - insert your declaration only below this line  ----
    TABLES: ...---
    DATA:   ...------
    $$ end of global - insert your declaration only before this line   ----
        Fieldname       = F139---
        data type       = NUMC---
        length          = 000007---
    form compute_F139---
      tables l_t_range structure rssdlrange---
      changing p_subrc like sy-subrc.---
          Insert source code to current selection field---
    $$ begin of routine - insert your code only below this line        ----
      data: l_idx like sy-tabix.---
      read table l_t_range with key---
           fieldname = '/bic/0FISCPER' .---
      l_idx = sy-tabix.---
      DATA: w_date TYPE SY-DATUM,---
          w_date1 type sy-datum,---
          lv_idate(8) type n,---
          lv_odate(8) type n,---
          lv_date1(7) type n,---
          lv_date2(8) type n.---
      CONCATENATE SY-DATUM0(4) SY-DATUM4(2) sy-datum+6(2) into W_DATE.---
      CALL FUNCTION 'SEPA_MANDATE_ADD_MONTH_TO_DATE'---
        EXPORTING---
          MONTHS  = '-3'---
          OLDDATE = W_DATE---
        IMPORTING---
          NEWDATE = W_DATE1.---
      Concatenate W_DATE0(4) W_DATE4(2) W_DATE+6(2) into lv_Idate.---
      Concatenate W_DATE10(4) W_DATE14(2) W_DATE1+6(2) into lv_odate.---
      Concatenate '0' W_DATE4(2) '.' W_DATE0(4) into lv_date2.---
       Concatenate '0' W_DATE14(2)  W_DATE10(4) into lv_date1.---
    CALL FUNCTION 'UMC_CALDAY_TO_FISCPER'---
       EXPORTING---
        I_PERIV    = 'K1'---
        I_CALDAY   = lv_Idate---
       IMPORTING---
         OUTPUT = lv_date1.---
    CALL FUNCTION 'UMC_CALDAY_TO_FISCPER'---
       EXPORTING---
        I_PERIV    = 'K1'---
        I_CALDAY   = lv_odate---
       IMPORTING---
         OUTPUT = lv_date2.---
    *l_t_range-iobjnm = '0FISCPER'.---
    l_t_range-fieldname = '/bic/0FISCPER'.---
    l_t_range-sign = 'I'.---
    l_t_range-option = 'GE'.---
    l_t_range-low = lv_date1.---
    *l_t_range-high = lv_date2.---
      if l_idx <> 0.---
        modify l_t_range index l_idx.---
      else.---
        append l_t_range.---
      endif.---
      p_subrc = 0.---
    $$ end of routine - insert your code only before this line         ----
    endform.---
    -Ashwin
    Edited by: ashwin kumar on Jun 16, 2010 10:04 AM

    1. In the future, please use a meaningful subject line, like "loop not performing last iteration." Just saying "Help in my java code" is useless. We know you need help with your Java code, else you wouldn't be posting here.
    2. Repost your code without those annoying superfluous asterisks, and with proper indentation in the section that they are currently polluting. It's too hard to read as-is.

  • Need help to master ABAP

    I need help to master ABAP.
    Please email me....if u can help me : [email protected]
    I am looking for help with IDOC, ALE, RFC and BAPI.
    Please send me mail. We can talk more.

    Jeff,  please ask specific questions here.  The answer will come.  Try to not ask for material to be sent directly to you.  This is not in the community spirit as it will only benefit you.  Also you might want to try the search functionality on this site.  There is plenty of info out there.
    Regards,
    RIch HEilman

  • Need help to redeem contact code for OS X 7

    Need help to redeem contact code for OS X 7

    Hello NOREDEEM,
    Thanks for using Apple Support Communities.
    If you have the purchase code for OS X 10.7 Lion, then you can follow the directions below to redeem it on your Mac.
    Mac App Store: Redeem gift cards and download codes
    Take care,
    Alex H.

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • Please help me with ABAP code

    Hi Gurus,
    Please help me with the code.
    Algorithm: This is for master data extraction. I need to append some records to I_T_DATA before the loop on I_T_DATA begins.
    ZTAB is a custom defined table with key KEY. STAB is standard table with key KEY.
    1. Create an internal table I_T_STAB similar to STAB.
    2. Loop at I_T_DATA
        Read record from ZTAB where KEY = I_T_DATA-KEY and { field1 <> I_T_DATA-field1 or field2 <> I_T_DATA-field2 <> field3 <> I_T_DATA-field3}
    If success
         Delete record from I_T_DATA.
    Else
         Continue loop.
    Copy all records of STAB to I_T_STAB.
    3. Delete records in I_T_STAB where I_T_STAB-KEY = ZTAB-KEY.
    Now
    4. Delete all records in I_T_DATA where I_T_DATA-KEY = I_T_STAB-KEY.
    Now,
    5. Append all the remaining records from step 3 in I_T_STAB to I_T_DATA.
    Please help me with the code upto this part.
    Now the actual code in exit starts.
    Loop at I_T_DATA
    Thanks,
    Regards,
    aarthi
    [email protected]

    You might get a quick answer if you were to post in the ABAP forum. 
    Moderator, please move to ABAP forum.  Thanks.
    Regards,
    Rich Heilman

  • Need help in hr abap

    hi friends,
    I need to learn hr abap.I need help from u ...if anyone have hr abap documents or books please give me..or suggest me some basic hr abap book names
    Thank u.
    Pinky.

    sample programs
    REPORT ZPETROL_EXCLUDE .
    TABLES SSCRFIELDS.
    SELECTION-SCREEN BEGIN OF SCREEN 100.
    SELECTION-SCREEN SKIP 9.
    PARAMETERS NUMBER(200) TYPE C.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN:
    BEGIN OF LINE,
    PUSHBUTTON 2(10) TEXT-001 USER-COMMAND PROC,
    END OF LINE.
    SELECTION-SCREEN END OF SCREEN 100.
    CALL SCREEN 100.
    AT SELECTION-SCREEN.
    CASE SSCRFIELDS.
    WHEN 'PROC'.
    SET PARAMETER ID: 'NUM' FIELD NUMBER.
    CALL TRANSACTION 'ZP_PALLOWANCE'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    SECOND PRG
    REPORT ZPR_PETROL_ALLOWANCE NO STANDARD PAGE
    HEADING .
    *-- Infotypes
    INFOTYPES : 0000, "Actions
    0002, "Personal Data
    0008. "Basic pay details
    *-- Tables
    TABLES : PERNR, "Standard Selections for HR Master Data Reporting
    PC207, "Payroll Results: Results Table
    PCL1, "HR Cluster 1
    PCL2, "HR Cluster 2
    T510, "Pay scales
    T549A, "Payroll areas
    T549Q, "Payroll Periods
    PA0002. "Personal details
    *-- Internal Tables
    *-- Internal Table Declaration For Holding The Data
    DATA: BEGIN OF INT_PETROL OCCURS 0,
    PERNR LIKE PA0008-PERNR, "Personnel Number
    TRFST LIKE PA0008-TRFST, "Pay Scale Level
    NAME(40), "Name of Employee
    PALLOWANCE TYPE P DECIMALS 2, "Petrol Allowance Amount
    END OF INT_PETROL.
    DATA: BEGIN OF PA0015_DATA OCCURS 0,
    PERNR LIKE PA0015-PERNR,
    BETRG LIKE PA0015-BETRG,
    END OF PA0015_DATA.
    DATA:BEGIN OF INT_PETROL2 OCCURS 0,
    PERNR LIKE PA0008-PERNR, "Personnel Number
    VORNA LIKE PA0002-VORNA, "First Name
    NACHN LIKE PA0002-NACHN, "Last Name
    TRFST LIKE PA0008-TRFST, "Pay Scale Level
    NAME(40), "Name of Employee
    PALLOWANCE TYPE P DECIMALS 2, "Petrol Allowance Amount
    END OF INT_PETROL2.
    DATA : TITLE TYPE LVC_TITLE.
    DATA: BEGIN OF PER_NO OCCURS 0,
    PERNR LIKE PA0008-PERNR,
    TRFST LIKE PA0008-TRFST,
    END OF PER_NO.
    DATA: BEGIN OF MSG OCCURS 0,
    MSG1(100) TYPE C,
    END OF MSG.
    DATA: FLAG TYPE I VALUE '0',
    DIS_FLAG TYPE I VALUE '0'.
    DATA: INT_PETROL3 LIKE STANDARD TABLE OF INT_PETROL2 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: INT_PETROL1 LIKE STANDARD TABLE OF INT_PETROL INITIAL SIZE 0 WITH
    HEADER LINE.
    DATA: WA_PET_ALLOWANCE TYPE ZBPETROL_ALL. "WORKAREA FOR INSERTING
    VALUES.
    *DATA: P_LGART1 LIKE T512T-LGART VALUE '0010'. "CHANGE WAGE TYPE HERE
    DATA: P_LGART1 LIKE T512T-LGART VALUE '0077'. "CHANGE WAGE TYPE HERE
    DATA: BEGIN OF INT_0015 OCCURS 0,
    PERNR(038),
    BEGDA(010),
    BETRG(018),
    END OF INT_0015.
    *-- Internal Table To Store Error Records.
    DATA: E_INT_0015 LIKE INT_0015 OCCURS 0 WITH HEADER LINE.
    *-- Batch Input Data of Single Transaction
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *-- Internal Table For Export and Import Payroll Results
    DATA: INT_RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE,
    LGTXT LIKE T512T-LGTXT.
    DATA: BEGIN OF EMP_NO OCCURS 0,
    PERNR(4) TYPE C,
    END OF EMP_NO.
    DATA: BEGIN OF EMP_NO1 OCCURS 0,
    PERNR TYPE I,
    END OF EMP_NO1.
    DATA EMPNO LIKE STANDARD TABLE OF EMP_NO INITIAL SIZE 0.
    DATA EMPNO1 LIKE STANDARD TABLE OF EMP_NO1 INITIAL SIZE 0 WITH HEADER
    LINE.
    DATA LEN1 TYPE I.
    DATA: ERR LIKE MESSAGE.
    DATA TEMP_NUM(200) TYPE C.
    *-- Includes
    *-- International Include
    INCLUDE RPC2CD09. "Cluster CD data definition
    INCLUDE RPC2CA00. "Cluster CA Data-Definition
    INCLUDE RPPPXD00. "Data Definition buffer PCL1/PCL2 Buffer INCLUDE RPPPXD10.
    "Common part buffer PCL1/PCL2 INCLUDE RPPPXM00. "Buffer Handling routine
    *-- Country Specific Include
    INCLUDE PC2RXIN0. "Cluster IN data definition
    INCLUDE RPC2RX09.
    *-- ALV Declaration
    TYPE-POOLS : SLIS.
    DATA: INT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
    INT_EVENTS TYPE SLIS_T_EVENT,
    INT_LAYOUT TYPE SLIS_LAYOUT_ALV,
    WS_EVENTS TYPE SLIS_ALV_EVENT,
    WS_REPID LIKE SY-REPID.
    *-- Initialization
    INITIALIZATION.
    WS_REPID = SY-REPID.
    *-- At Selection-Screen
    START-OF-SELECTION.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) TEXT-002.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: P_RATE TYPE P DECIMALS 2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-003.
    SELECTION-SCREEN BEGIN OF BLOCK B3.
    PARAMETERS: P_UPLOAD AS CHECKBOX,
    P_FG RADIOBUTTON GROUP G1,
    P_BG RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B4.
    PARAMETERS: P_DI AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B4.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN.
    *-- Wate Type Text
    SELECT SINGLE LGTXT INTO LGTXT FROM T512T WHERE SPRSL = 'E' AND
    MOLGA = '40' AND LGART = P_LGART1 .
    *-- Data Retrieval From Logical Database PNP
    GET PERNR.
    PROVIDE PERNR FROM P0000 VORNA NACHN FROM P0002 BETWEEN PN-BEGDA AND
    PN-ENDDA.
    INT_PETROL1-PERNR = P0000-PERNR.
    CONCATENATE P0002-VORNA P0002-NACHN INTO INT_PETROL1-NAME SEPARATED
    BY SPACE.
    ENDPROVIDE.
    *-- Clear Data
    CLEAR: RGDIR, INT_RGDIR.
    REFRESH: RGDIR, INT_RGDIR.
    *-- Read All The Payroll Runs For An Employee
    CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
    CHECK RP-IMP-CD-SUBRC EQ 0.
    *-- Clear Data
    REFRESH: RT.
    Read IN Cluster.
    LOOP AT RGDIR WHERE FPBEG >= PN-BEGDA AND FPEND <= PN-ENDDA.
    MOVE-CORRESPONDING RGDIR TO INT_RGDIR.
    APPEND INT_RGDIR.
    CLEAR INT_RGDIR.
    ENDLOOP.
    Read the last record.
    SORT INT_RGDIR BY SEQNR DESCENDING.
    READ TABLE INT_RGDIR INDEX 1.
    RX-KEY-SEQNO = INT_RGDIR-SEQNR.
    RX-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-IN.
    CHECK RP-IMP-IN-SUBRC EQ 0.
    READ TABLE RT WITH KEY LGART = P_LGART1.
    IF SY-SUBRC = 0.
    INT_PETROL1-PALLOWANCE = RT-BETRG.
    ENDIF.
    APPEND INT_PETROL1.
    CLEAR INT_PETROL1.
    SELECT TRFST PERNR
    INTO CORRESPONDING FIELDS OF TABLE PER_NO
    FROM PA0008
    WHERE TRFST LIKE 'L%'
    AND BET01 > 0.
    SORT PER_NO.
    DELETE ADJACENT DUPLICATES FROM PER_NO.
    *-- END-OF-SELECTION.
    END-OF-SELECTION.
    LOOP AT INT_PETROL1.
    READ TABLE PER_NO WITH KEY PERNR = INT_PETROL1-PERNR.
    IF SY-SUBRC = 0.
    INT_PETROL-TRFST = PER_NO-TRFST.
    MODIFY INT_PETROL1 FROM INT_PETROL TRANSPORTING TRFST.
    ENDIF.
    ENDLOOP.
    SORT INT_PETROL1.
    DELETE ADJACENT DUPLICATES FROM INT_PETROL1.
    CONCATENATE 'From' ' : ' PN-BEGDA6(2) '.' PN-BEGDA4(2) '.' PN-
    BEGDA+0(4)
    ' To' ' : ' PN-ENDDA6(2) '.' PN-ENDDA4(2) '.' PN-ENDDA+0(4)
    INTO TITLE.
    IF P_DI = 'X'. "TO DISPLAY PETROL ALLOWANCE ONLY
    IF PNPTIMRA = 'X'. "CHECK OTHER PERIOD CHECKED
    DIS_FLAG = 1.
    ENDIF.
    IF PNPTIMR9 = 'X'. "CHECK TO SEE CURRENT PERIOD SELECTED
    CASES - NO RATE GIVEN, RATE GIVEN
    CURRENT PERIOD UPLOADED BUT PAYROLL NOT WRITTEN SO NO RESULT FROM LDB
    SELECT RATE INTO P_RATE FROM ZBPETROL_ALL WHERE BEGDA = PN- BEGDA AND ENDDA = PN-ENDDA.
    ENDSELECT.
    IF SY-DBCNT = 0.
    MESSAGE I455(0) WITH 'NO PETROL RATE EXSISTS'.
    ELSE.
    FLAG = 1.
    ENDIF. "OF SY-DBCNT
    IF P_RATE > 0 AND FLAG = 1. " PETROL RATE EXSISTS.
    SELECT PERNR SUM( BETRG ) INTO TABLE PA0015_DATA
    FROM PA0015
    WHERE BEGDA BETWEEN PN-BEGDA AND PN-ENDDA
    GROUP BY PERNR.
    SELECT APERNR ATRFST BVORNA BNACHN
    INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
    FROM PA0008 AS A
    INNER JOIN PA0002 AS B ON BPERNR = APERNR
    WHERE A~TRFST LIKE 'L%'
    AND A~BET01 > 0.
    SORT INT_PETROL3.
    DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
    REFRESH INT_PETROL1.
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    employee name
    CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
    INT_PETROL2-NAME SEPARATED BY SPACE.
    MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
    ENDLOOP.
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    one
    table to another table
    READ TABLE PA0015_DATA WITH KEY PERNR = INT_PETROL2-PERNR.
    IF SY-SUBRC = 0.
    INT_PETROL-PERNR = INT_PETROL2-PERNR.
    INT_PETROL-TRFST = INT_PETROL2-TRFST.
    INT_PETROL-NAME = INT_PETROL2-NAME.
    INT_PETROL-PALLOWANCE = PA0015_DATA-BETRG.
    APPEND INT_PETROL TO INT_PETROL1.
    ENDIF.
    ENDLOOP.
    DIS_FLAG = 1.
    ENDIF. "P_RATE > 0 AND FLAG = 1.
    IF P_RATE > 0 AND FLAG = 0. "CURRENT PERIOD AND DATA NOT UPLOADED
    SELECT APERNR ATRFST BVORNA BNACHN
    INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
    FROM PA0008 AS A
    INNER JOIN PA0002 AS B ON BPERNR = APERNR
    WHERE A~TRFST LIKE 'L%'
    AND A~BET01 > 0.
    SORT INT_PETROL3.
    DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
    REFRESH INT_PETROL1.
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    employee name
    CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
    INT_PETROL2-NAME SEPARATED BY SPACE.
    MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
    ENDLOOP.
    PERFORM GET_VALUE. "TO CONVERT THE FIRST SCREEN PERNR INTO
    NUMBER FORMATE
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    one
    table to another table
    READ TABLE EMPNO1 WITH KEY PERNR = INT_PETROL2-PERNR.
    IF SY-SUBRC <> 0.
    INT_PETROL-PERNR = INT_PETROL2-PERNR.
    INT_PETROL-TRFST = INT_PETROL2-TRFST.
    INT_PETROL-NAME = INT_PETROL2-NAME.
    APPEND INT_PETROL TO INT_PETROL1.
    ENDIF.
    ENDLOOP.
    PERFORM CAL_ALLOWANCE.
    ENDIF. " OF P_RATE > 0
    DIS_FLAG = 1.
    ENDIF. " OF CURRENT PERIOD CHECK.
    ENDIF. " OF CHECK DISPLAY.
    *----BDC
    IF P_UPLOAD = 'X'.
    IF PNPTIMRA = 'X'. "CHECK OTHER PERIOD CHECKED
    MESSAGE I455(0) WITH 'Petrol Allowance cannot be uploaded'.
    LEAVE SCREEN.
    ENDIF.
    IF P_RATE > 0.
    IF P_RATE > 0 OR P_RATE = 0.
    IF PNPTIMR9 = 'X'. "CHECK TO SEE CURRENT PERIOD SELECTED
    WA_PET_ALLOWANCE-BEGDA = PN-BEGDA.
    WA_PET_ALLOWANCE-ENDDA = PN-ENDDA.
    WA_PET_ALLOWANCE-RATE = P_RATE.
    WA_PET_ALLOWANCE-CURR = 'INR'.
    INSERT INTO ZBPETROL_ALL VALUES WA_PET_ALLOWANCE.
    SELECT A~PERNR A~TRFST B~VORNA B~NACHN
    INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
    FROM PA0008 AS A
    INNER JOIN PA0002 AS B ON B~PERNR = A~PERNR
    WHERE A~TRFST IN ('L1' , 'L2' , 'L3')
    AND A~BET01 > 0.
    SORT INT_PETROL3.
    DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
    REFRESH INT_PETROL1.
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    employee name
    CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
    INT_PETROL2-NAME SEPARATED BY SPACE.
    MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
    ENDLOOP.
    PERFORM GET_VALUE. "TO CONVERT THE FIRST SCREEN PERNR INTO
    NUMBER FORMATE
    LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
    one
    table to another table
    READ TABLE EMPNO1 WITH KEY PERNR = INT_PETROL2-PERNR.
    IF SY-SUBRC <> 0.
    INT_PETROL-PERNR = INT_PETROL2-PERNR.
    INT_PETROL-TRFST = INT_PETROL2-TRFST.
    INT_PETROL-NAME = INT_PETROL2-NAME.
    APPEND INT_PETROL TO INT_PETROL1.
    ENDIF.
    ENDLOOP.
    PERFORM CAL_ALLOWANCE.
    DIS_FLAG = 1.
    SORT INT_PETROL1.
    LOOP AT INT_PETROL1.
    MOVE: INT_PETROL1-PERNR TO INT_0015-PERNR,
    INT_PETROL1-PALLOWANCE TO INT_0015-BETRG.
    CONCATENATE PN-ENDDA6(2) PN-ENDDA4(2) PN-ENDDA+0(4) INTO
    INT_0015-BEGDA SEPARATED BY '.'.
    APPEND INT_0015.
    CLEAR INT_0015.
    ENDLOOP.
    LOOP AT INT_0015.
    PERFORM F_BDCDATA.
    IF P_FG = 'X'.
    CALL TRANSACTION 'PA30' USING BDCDATA MODE 'A' UPDATE 'S'.
    ELSE.
    CALL TRANSACTION 'PA30' USING BDCDATA MODE 'N' UPDATE 'S'.
    ENDIF.
    *-- Handling Error records.
    IF SY-SUBRC <> 0.
    *-- Handling Error Messages
    PERFORM ERROR_MSG.
    MOVE-CORRESPONDING INT_0015 TO E_INT_0015.
    APPEND E_INT_0015.
    CLEAR E_INT_0015.
    ENDIF.
    REFRESH BDCDATA.
    ENDLOOP.
    *-- Downloading Error Records.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\Errors.Txt'
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = E_INT_0015.
    *-- Downloading Error Messages.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\Err_Msg.Txt'
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = MSG.
    ENDIF. " FOR CURRENT PERIOD
    ENDIF.
    ELSE.
    MESSAGE I455(0) WITH 'Enter Petrol Rate'.
    LEAVE TO SCREEN 0.
    ENDIF. " FOR PETROL RATE
    ENDIF. " FOR UPLOAD
    IF DIS_FLAG = 1.
    INT_LAYOUT-SUBTOTALS_TEXT = TEXT-004.
    INT_LAYOUT-TOTALS_TEXT = TEXT-004.
    INT_LAYOUT-ZEBRA = 'X'.
    PERFORM FILL_FIELDCAT.
    PERFORM GET_EVENTS_ALV.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = WS_REPID
    IS_LAYOUT = INT_LAYOUT
    IT_FIELDCAT = INT_FIELDCAT[]
    I_DEFAULT = 'X'
    I_SAVE = 'X'
    IT_EVENTS = INT_EVENTS
    TABLES
    T_OUTTAB = INT_PETROL1
    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.
    ENDIF.
    *& Form GET_VALUE
    text
    FORM GET_VALUE.
    GET PARAMETER ID: 'NUM' FIELD TEMP_NUM.
    IF TEMP_NUM <> ''.
    LEN1 = STRLEN( TEMP_NUM ).
    PERFORM GET_PERNR.
    APPEND TEMP_NUM TO EMPNO.
    LOOP AT EMPNO INTO EMP_NO.
    CALL FUNCTION 'CHECK_AND_CONVERT_NUMERICS'
    EXPORTING
    DFELD = ' '
    DMZEI = ','
    DTYPE = 'STRING'
    DYPNO = ' '
    EFELD = EMP_NO-PERNR
    FNAME = ' '
    PROGR = ' '
    IMP_DECIMALS = '0'
    IMPORTING
    ERROR =
    IFELD = EMP_NO1-PERNR
    MESSG = ERR
    MSGLN =
    IF ( ERR-MSGID = '' ).
    APPEND EMP_NO1 TO EMPNO1.
    CLEAR EMP_NO1-PERNR.
    ELSE.
    MESSAGE I455(0) WITH 'Could not convert employee number'.
    LEAVE TO SCREEN 0.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDFORM. "GET_VALUE
    *& Form GET_PERNR
    text
    FORM GET_PERNR.
    SPLIT TEMP_NUM AT ',' INTO EMP_NO TEMP_NUM.
    APPEND EMP_NO TO EMPNO.
    CLEAR EMP_NO.
    SEARCH TEMP_NUM FOR ','.
    IF SY-SUBRC = 0.
    PERFORM GET_PERNR.
    ENDIF.
    ENDFORM. "GET_PERNR
    *& Form ERROR_MSG
    text
    --> p1 text
    <-- p2 text
    FORM ERROR_MSG.
    IF SY-SUBRC <> 0.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    LANG = SY-LANGU
    IMPORTING
    MSG = MSG-MSG1.
    APPEND MSG.
    CLEAR MSG.
    ENDIF.
    ENDFORM. "ERROR_MSG
    *& Form F_BDCDATA
    text
    FORM F_BDCDATA.
    PERFORM BDC_DYNPRO USING 'SAPMP50A' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=INS'.
    PERFORM BDC_FIELD USING 'RP50G-PERNR'
    INT_0015-PERNR.
    PERFORM BDC_FIELD USING 'RP50G-TIMR6'
    'X'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'RP50G-CHOIC'.
    PERFORM BDC_FIELD USING 'RP50G-CHOIC'
    '0015'.
    PERFORM BDC_DYNPRO USING 'MP001500' '2000'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'Q0015-BETRG'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '/00'.
    PERFORM BDC_FIELD USING 'P0015-LGART'
    '0077'. "CHANGE WAGE TYPE HERE
    ALSO
    PERFORM BDC_FIELD USING 'Q0015-BETRG'
    INT_0015-BETRG.
    PERFORM BDC_FIELD USING 'P0015-WAERS'
    'INR'.
    PERFORM BDC_FIELD USING 'P0015-BEGDA'
    INT_0015-BEGDA.
    PERFORM BDC_DYNPRO USING 'MP001500' '2000'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'P0015-LGART'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=UPD'.
    PERFORM BDC_FIELD USING 'P0015-LGART'
    '0077'. "CHANGE WAGE TYPE HERE
    ALSO
    PERFORM BDC_FIELD USING 'Q0015-BETRG'
    INT_0015-BETRG.
    PERFORM BDC_FIELD USING 'P0015-WAERS'
    'INR'.
    PERFORM BDC_FIELD USING 'P0015-BEGDA'
    INT_0015-BEGDA.
    ENDFORM. "F_BDCDATA
    *& Form BDC_DYNPRO
    text
    -->P_0732 text
    -->P_0733 text
    FORM BDC_DYNPRO USING VALUE(P_0732) TYPE C
    VALUE(P_0733) TYPE C.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = P_0732.
    BDCDATA-DYNPRO = P_0733.
    BDCDATA-DYNBEGIN = 'X'.
    APPEND BDCDATA.
    ENDFORM. " BDC_DYNPRO
    *& Form BDC_FIELD
    text
    -->P_0755 text
    -->P_0756 text
    FORM BDC_FIELD USING VALUE(P_0755) TYPE C
    VALUE(P_0756) TYPE C.
    CLEAR BDCDATA.
    BDCDATA-FNAM = P_0755.
    BDCDATA-FVAL = P_0756.
    APPEND BDCDATA.
    ENDFORM. " BDC_FIELD
    *& Form CAL_ALLOWANCE
    text
    FORM CAL_ALLOWANCE.
    LOOP AT INT_PETROL1 INTO INT_PETROL.
    IF INT_PETROL-TRFST = 'L1'.
    INT_PETROL-PALLOWANCE = P_RATE * 100. "CHANGE TO SELECT WHEN
    DISPLAY
    ELSEIF INT_PETROL-TRFST = 'L2'.
    INT_PETROL-PALLOWANCE = P_RATE * 150.
    ELSEIF INT_PETROL-TRFST = 'L3'.
    INT_PETROL-PALLOWANCE = P_RATE * 150.
    ELSEIF INT_PETROL-TRFST = 'L4'.
    INT_PETROL-PALLOWANCE = P_RATE * 200.
    ELSEIF INT_PETROL-TRFST = 'L5'.
    INT_PETROL-PALLOWANCE = P_RATE * 250.
    ENDIF.
    MODIFY INT_PETROL1 FROM INT_PETROL TRANSPORTING PALLOWANCE.
    ENDLOOP.
    ENDFORM. "CAL_ALLOWANCE
    *& Form FILL_FIELDCAT
    text
    --> p1 text
    <-- p2 text
    FORM FILL_FIELDCAT.
    INT_FIELDCAT-COL_POS = 1.
    INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
    INT_FIELDCAT-FIELDNAME = 'PERNR'.
    INT_FIELDCAT-SELTEXT_L = TEXT-005.
    INT_FIELDCAT-OUTPUTLEN = 10.
    INT_FIELDCAT-KEY = 'X'.
    APPEND INT_FIELDCAT.
    CLEAR INT_FIELDCAT.
    INT_FIELDCAT-COL_POS = 2.
    INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
    INT_FIELDCAT-FIELDNAME = 'NAME'.
    INT_FIELDCAT-SELTEXT_L = TEXT-006.
    INT_FIELDCAT-OUTPUTLEN = 25.
    INT_FIELDCAT-KEY = 'X'.
    APPEND INT_FIELDCAT.
    CLEAR INT_FIELDCAT.
    INT_FIELDCAT-COL_POS = 3.
    INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
    INT_FIELDCAT-FIELDNAME = 'TRFST'.
    INT_FIELDCAT-SELTEXT_L = TEXT-007.
    INT_FIELDCAT-OUTPUTLEN = 5.
    INT_FIELDCAT-KEY = 'X'.
    APPEND INT_FIELDCAT.
    CLEAR INT_FIELDCAT.
    INT_FIELDCAT-COL_POS = 4.
    INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
    INT_FIELDCAT-FIELDNAME = 'PALLOWANCE'.
    INT_FIELDCAT-SELTEXT_L = TEXT-008.
    INT_FIELDCAT-OUTPUTLEN = 16.
    INT_FIELDCAT-KEY = 'X'.
    APPEND INT_FIELDCAT.
    CLEAR INT_FIELDCAT.
    ENDFORM. " FILL_FIELDCAT
    *& Form GET_EVENTS_ALV
    text
    --> p1 text
    <-- p2 text
    FORM GET_EVENTS_ALV.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 1
    IMPORTING
    ET_EVENTS = INT_EVENTS[]
    EXCEPTIONS
    LIST_TYPE_WRONG = 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.
    READ TABLE INT_EVENTS INTO WS_EVENTS WITH KEY NAME =
    SLIS_EV_TOP_OF_PAGE.
    IF SY-SUBRC = 0.
    WS_EVENTS-FORM = 'TOP'.
    MODIFY INT_EVENTS FROM WS_EVENTS INDEX SY-TABIX.
    ENDIF.
    ENDFORM. " GET_EVENTS_ALV
    *& Form TOP-OF-PAGE
    text
    FORM TOP.
    *-- ALV Declarations
    DATA: WS_HEADER TYPE SLIS_T_LISTHEADER,
    WA_HEADER TYPE SLIS_LISTHEADER.
    *-- Title
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = TEXT-009.
    APPEND WA_HEADER TO WS_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = TITLE.
    APPEND WA_HEADER TO WS_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = ' '.
    APPEND WA_HEADER TO WS_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = ' '.
    APPEND WA_HEADER TO WS_HEADER.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = WS_HEADER
    I_LOGO = 'LOGO'.
    ENDFORM. "TOP-OF-PAGE
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    Check these links -
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/8a/6a46347969e94be10000009b38f83b/frameset.htm
    Re: INFOTYPE
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://www.sap-img.com/sap-hr.htm
    HR abap
    Go through the SAp doc for HR programming and start doing.
    Refer this link
    http://www.sapdevelopment.co.uk/fmodules/fmshr.htm
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    BDC - hr maintain text
    Please refer to the following sample program for accessing PCH LDB.
    For concept to start with refer url:
    http://www.sap-press.de/download/dateien/860/sappress_mysap_hr_technical_principles2.pdf

  • Pulling the condition records - help in the ABAP code -urgent!!!!!

    hi folks,
    I need some urgent help here..
    I have discussed this portion before in the forum  but there are some changes and I need some help here.
    The code goes like this....
    select knumv kschl kbetr kwert
      from konv into table cdata
         for all entries in bodyitab21
        where konv~knumv = bodyitab21-knumv
                     and konv~kwert > 0.
    I am successfully pulling the data into cdata here..
    I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.
    <b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data  and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.
    This process has to be done for every condition type.</b>Given this scenario how can i do it?
        loop at cdata  into wac.
        case wac-kschl.
             when 'ZRAT' OR 'ZAGR'  OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'
    OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'
    OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.
    <b>***** the first set of these condition types have just values</b>     if wac-kbetr = ' ' AND wac-kwert = ' '.
                   continue.
                 else.
                  p = wac-kbetr.
                  i = p.
                  c = i.
                  MOVE c to w_accitab-zrate.
                     MOVE wac-kbetr to w_accitab-zrate.
                  MOVE wac-kwert to w_accitab-zsubtotal.
                endif.
        when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'
         OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'
    OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR
    'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'
    OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'
    OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR
    'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'
    OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR
    'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'
    OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR
    'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR
    'ZPA$' OR 'ZPA%'.
    the second set of these condition types have just values that has to be converted into %.
               if wac-kbetr = ' ' AND wac-kwert = ' '.
                clear w_accitab-zrate.
                continue.
              else.
                p = wac-kbetr.
                p = p / 10.
                if p < 1.
                  rate+0(1) = '-'.
                endif.
                if i = 0.
                  clear w_accitab-zrate.
                 else.
                i = p.
                c = i.
                shift c right deleting trailing '-'.
                concatenate rate c '%' into rate.
                condense rate no-gaps.
                     MOVE wac-kbetr to w_accitab-zrate.
                MOVE rate to w_accitab-zrate.
                clear rate.
                MOVE wac-kwert to w_accitab-zsubtotal.
              endif.
            endif.
    Thanks alot in advance.
    Santhosh

    Maybe this will help you,  otherwise I'm missing something.
    [code]
    data: begin of wac,
          kschl type t685t-kschl,
          vtext type t685t-vtext,
          end of wac.
    case wac-kschl.
    when 'ZRAT' or 'ZAGR' or 'ZRCR' or 'Y098' or 'Y007' or 'ZREW' or 'Y106'
    or 'ZTSR' or 'Y127' or 'Y125' or 'Y126' or 'Y124' or 'Y157' or 'Y092' or
      'Y085' or 'Y090' or 'ZMZD' or 'Y215' or 'Y214' or 'Y111' or 'ZC$D' or
         'ZAUD' or 'ZTHX' or 'ZCOL' or 'ZCFE' or 'ZSPA' or 'ZBOX' or 'ZCOR'
    or 'Y130' or 'ZBOR' or 'Y108' or 'ZFPP' or 'Y204' or 'Y200' or 'Y202' or
      'Y201' or 'Y203' or 'Y002' or 'ZSCR' or 'Y128' or 'Y100' or 'ZABS' or
         'ZSMG' or 'ZFRE' or 'ZREC' or 'ZCOM' or 'ZPMG' or 'BEMG' or 'ZDTI'
            or'ZBET'.
    Some code
      when 'ZSED' or 'ZRFQ' or 'ZIMP' or 'ZERR'
    or 'ZECD' or 'ZAC1' or 'ZAC%' or 'ZAC2' or 'ZSED' or 'ZRFQ' or 'ZIMP' or
      'ZERR' or 'ZECD' or 'ZQUD' or 'ZEMP' or 'Y101' or 'Y012' or 'ZCHU' or
      'Y054' or 'Y065' or 'Y066' or 'Y067' or 'Y068' or 'Y069' or 'Y096'
      or 'Y103' or 'Y010' or 'Y070' or 'Y071' or
      'Y072' or 'Y073' or 'Y074' or 'Y075' or 'Y076'
      or 'Y077' or 'Y078' or 'Y079' or 'Y156' or 'Y148'
      or 'Y102' or 'Y205' or 'Y206' or 'Y207' or 'Y208' or
      'Y209' or 'Y213' or 'Y210' or 'Y211' or 'Y212' or 'Z%DS'
      or 'Z%DO' or 'Y113' or 'Y151' or 'Y152' or 'Y153' or
      'Y154' or 'Y155' or 'Y147' or'Z%PB' or 'Y142' or 'Y131'
      or 'Y141' or 'Y149' or 'ZDEO' or 'Z%DR' or 'Y115' or
      'Y116' or 'Y095' or 'Y084' or 'ZSA$' or 'ZSA%' or
      'ZPA$' or 'ZPA%'.
    Some code
    endcase.
    select single vtext into wac-vtext from t685t
                  where spras = sy-langu
                    and kschl = wac-kschl.
    write:/ wac-kschl, wac-vtext.
    [/code]
    Regards,
    Rich Heilman

  • Need help fine tuning my code

    This program im making is eventualy going to end up as an attack calculator; the thing is i need help finetuning my program so that a) when it is run it will start at the very top of the window ancestory. b) the 2 windows are locked onto the same ancestory (ancestory is the position of the window relitive to the others: ie the window that is on top of another is higher on the ancestory). this code runs and should easily cut and paste.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AttackCalculator implements ActionListener{
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         "Use the legend below for the correct government number. ",
          "Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, ",
          "Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, ",
          "Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 ",
           public static void createAndShowGUI(){
           String[] labels = {
          "Enter how many troops you have: ", "Enter how many tanks you have: ",
          "Enter how many jets you have: ", "Enter how many ships you have: ",
          "Enter your government type (1-12 refer above): ","Enter your health(%)",
          "Enter your stage number (1-4): ", "Enter how many troops your enemy has: ",
          "Enter how many tanks your enemy has: ", "Enter how many jets your enemy has: ",
          "Enter how many ships your enemy has: ", "Enter your enemy's government type (1-12 refer above): ",
          "Enter your enemy's stage number (1-4): ", "Enter your enemy health: "};
            int numPairs = labels.length;
           JTextField[] textField = {
           new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 )};
            //Create and populate the panel.
            JPanel p = new JPanel(new SpringLayout());
            for (int i = 0; i < numPairs; i++) {
                JLabel l = new JLabel(labels, JLabel.TRAILING);
    p.add(l);
    l.setLabelFor(textField[i]);
    p.add(textField[i]);
    JLabel l = new JLabel("Your union has 2+ members", JLabel.TRAILING);
    p.add(l);
    JCheckBox checkBox = new JCheckBox("", false);
    l.setLabelFor( checkBox );
    p.add(checkBox );
    JLabel la = new JLabel("Enemy's union 2+ members", JLabel.TRAILING);
    p.add(la);
    JCheckBox jcheckBox = new JCheckBox("", false);
    la.setLabelFor( jcheckBox );
    p.add(jcheckBox);
    JButton calculate = new JButton("Calculate");
    p.add(calculate);
    //Lay out the panel.
    SpringUtilities.makeCompactGrid(p,
    16, 2, //rows, cols
    6, 6, //initX, initY
    6, 6); //xPad, yPad
    JFrame contentPane = new JFrame();
    contentPane.setSize(420, 105);
    JLabel title1 = new JLabel("Use the legend below for the correct government number. \n");
    JLabel title2 = new JLabel("Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, \n");
    JLabel title3 = new JLabel("Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, \n");
    JLabel title4 = new JLabel("Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 " );
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title1,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title1,
    5,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title2,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title2,
    20,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title3,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title3,
    35,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title4,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title4,
    50,
    SpringLayout.NORTH, contentPane);
    //Create and set up the window.
    JFrame frame1 = new JFrame("Endless Revolution Attack Calculator");
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Set up the content pane.
    p.setOpaque(true); //content panes must be opaque
    frame1.setContentPane(p);
    //Display the window.
    frame1.pack();
    frame1.setLocationRelativeTo( null );
    frame1.setVisible(true);
    contentPane.setLocationRelativeTo( null );
    contentPane.setVisible(true);
    public void actionPerformed( ActionEvent evt){
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    here is the second class needed to run
    import javax.swing.*;
    import javax.swing.SpringLayout;
    import java.awt.*;
    * A 1.4 file that provides utility methods for
    * creating form- or grid-style layouts with SpringLayout.
    * These utilities are used by several programs, such as
    * SpringBox and SpringCompactGrid.
    public class SpringUtilities {
         * A debugging utility that prints to stdout the component's
         * minimum, preferred, and maximum sizes.
        public static void printSizes(Component c) {
            System.out.println("minimumSize = " + c.getMinimumSize());
            System.out.println("preferredSize = " + c.getPreferredSize());
            System.out.println("maximumSize = " + c.getMaximumSize());
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component is as big as the maximum
         * preferred width and height of the components.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeGrid(Container parent,
                                    int rows, int cols,
                                    int initialX, int initialY,
                                    int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeGrid must use SpringLayout.");
                return;
            Spring xPadSpring = Spring.constant(xPad);
            Spring yPadSpring = Spring.constant(yPad);
            Spring initialXSpring = Spring.constant(initialX);
            Spring initialYSpring = Spring.constant(initialY);
            int max = rows * cols;
            //Calculate Springs that are the max of the width/height so that all
            //cells have the same size.
            Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            for (int i = 1; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
                maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
            //Apply the new width/height Spring. This forces all the
            //components to have the same size.
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                cons.setWidth(maxWidthSpring);
                cons.setHeight(maxHeightSpring);
            //Then adjust the x/y constraints of all the cells so that they
            //are aligned in a grid.
            SpringLayout.Constraints lastCons = null;
            SpringLayout.Constraints lastRowCons = null;
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                     parent.getComponent(i));
                if (i % cols == 0) { //start of new row
                    lastRowCons = lastCons;
                    cons.setX(initialXSpring);
                } else { //x position depends on previous component
                    cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
                                         xPadSpring));
                if (i / cols == 0) { //first row
                    cons.setY(initialYSpring);
                } else { //y position depends on previous row
                    cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
                                         yPadSpring));
                lastCons = cons;
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH,
                                Spring.sum(
                                    Spring.constant(yPad),
                                    lastCons.getConstraint(SpringLayout.SOUTH)));
            pCons.setConstraint(SpringLayout.EAST,
                                Spring.sum(
                                    Spring.constant(xPad),
                                    lastCons.getConstraint(SpringLayout.EAST)));
        /* Used by makeCompactGrid. */
        private static SpringLayout.Constraints getConstraintsForCell(
                                                    int row, int col,
                                                    Container parent,
                                                    int cols) {
            SpringLayout layout = (SpringLayout) parent.getLayout();
            Component c = parent.getComponent(row * cols + col);
            return layout.getConstraints(c);
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component in a column is as wide as the maximum
         * preferred width of the components in that column;
         * height is similarly determined for each row.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeCompactGrid(Container parent,
                                           int rows, int cols,
                                           int initialX, int initialY,
                                           int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
                return;
            //Align all cells in each column and make them the same width.
            Spring x = Spring.constant(initialX);
            for (int c = 0; c < cols; c++) {
                Spring width = Spring.constant(0);
                for (int r = 0; r < rows; r++) {
                    width = Spring.max(width,
                                       getConstraintsForCell(r, c, parent, cols).
                                           getWidth());
                for (int r = 0; r < rows; r++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setX(x);
                    constraints.setWidth(width);
                x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
            //Align all cells in each row and make them the same height.
            Spring y = Spring.constant(initialY);
            for (int r = 0; r < rows; r++) {
                Spring height = Spring.constant(0);
                for (int c = 0; c < cols; c++) {
                    height = Spring.max(height,
                                        getConstraintsForCell(r, c, parent, cols).
                                            getHeight());
                for (int c = 0; c < cols; c++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setY(y);
                    constraints.setHeight(height);
                y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH, y);
            pCons.setConstraint(SpringLayout.EAST, x);
    }I know this is a lot but when I have tried to put out the portion where I belived the problem to be, didnt work, people couldent help, so here it is all of it.

    it wouldn't run for me, until I changed these lines
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    to these
    contentPane.getContentPane().add( title1 );
    contentPane.getContentPane().add( title2 );
    contentPane.getContentPane().add( title3 );
    contentPane.getContentPane().add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.getContentPane().setLayout(layout);
    then it worked OK, smaller frame on top (the one with the info), larger frame behind.
    both above all other windows
    made it into a .jar file (in case IDE influenced above) and ran the same way

  • Help with basic ABAP code (merge internal tables, sort of...)

    Hello,
    Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
    Should be some easy points for an experienced ABAPer!
    I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
    How will I code the following?:
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    Then I want to read I_B and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
    Then I want to read I_C and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
    Let me know if I can provide anymore information.
    Thanks in advance for you help!
    Adriaan
    Message was edited by: Adriaan
    Message was edited by: Adriaan

    Hi Adriaan ,
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    <b>i_master[] = i_a[] .</b>
    loop at i_b .
    read table i_master with key myfiled < i_b-myfield .
    if sy-subrc = 0 .
    append i_master from i_b .
    endif.
    endloop.
    loop at i_c .
    read table i_master with key myfiled < i_c-myfield .
    if sy-subrc = 0 .
    append i_master from i_c .
    endif.
    endloop.
    Let me know if this helped .
    Regards,
    Varun .
    Message was edited by: varun sonu

  • Need help with pie chart code

    I am new to Java and am having problems and I am in need of some help. I have written the code for my Mortgage Calculator but do not know how to get my chart to work. I found an example of the chart code in my text book but I am not sure if I wrote it wrong. When I run the MortCalc code it compiles but the Pie Chart code won't. I tried to run the chart code by itself but it prints out another calculator. My question is 1.) Is my chart code written wrong? and 2.) How do i enter it into my MortCalc code so that I get my chart?
    **Below I have included the assignment(so you know what I am doing exactly) and below that the pie chart code just in case you have questions. Thanks for any advice you can give.
    **If you need the rest of the code I can post it too. It was too long to post with the pie chart code.
    Assignment:
    Write the program in Java(w/ a GUI) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage adn the user's selection from a menu of availible mortgage loans:
    --7 yrs @ 5.35%
    --15 yrs @ 5.5%
    --30 yrs @ 5.75%
    Use an array for the mortgage data for the different loans. Read the interst rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Add graphics in the form of a chart.Allow the user to loop back and enter a new amount and make a new selection of quit. Please insert comments in the program to document the program.
    CODE:
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    //Class to hold a value for a slice
    public class PieValue {
    double value;
    Color color;
    public PieValue(double value, Color color) {
    this.value = value;
    this.color = color;
    // slices is an array of values that represent the size of each slice.
    public void drawPie(Graphics2D g, Rectangle area, PieValue[] slices) {
    // Get total value of all slices
    double total = 0.0D;
    for (int i=0; i<slices.length; i++) {
    total += slices.value;
    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i++) {
    // Compute the start and stop angles
    startAngle = (int)(curValue * 360 / total);
    int arcAngle = (int)(slices[i].value * 360 / total);
    // Ensure that rounding errors do not leave a gap between the first and last slice
    if (i == slices.length-1) {
    arcAngle = 360 - startAngle;
    // Set the color and draw a filled arc
    g.setColor(slices[i].color);
    g.fillArc(area.x, area.y, area.width, area.height, startAngle, arcAngle);
    curValue += slices[i].value;

    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i+) {
    // Compute the start and stop angles
    startAngle = (int)(curValue 360 / total);
    int arcAngle = (int)(slices.value * 360 / total);Look here and i think you will find some syntax errors.
    Count the brackets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Fail to render (export, share) in PE7

    I am running Premiere Elements 7 on a Windows Vista PC. When attempting to share (export) a finished project (e.g., using flash and quicktime formats), it either crashes upon hitting "save" or goes through the rendering process only to crash seconds

  • Reasons for Hard Drive failure (bad blocks)

    I've had my MacPro looked at by an Authorised Apple Service Provider because it's been crashing and the screen is corrupting. They have told me that they have scanned the hard drive and it's showing some bad blocks. They have said in this scenario I

  • Cole-Parme​r DAQ with ABB Aquamaster​-S Flow Meter

    I have a Cole-Parmer 18200-00 DAQ that I'm using to measure the flow rate using an ABB Aquamaster S. The flow meter sends out a pulse that is equivalent to the flow rate in the system. I'm having some trouble writing a program that would give me an a

  • ActionScript 2.0 to be able to embed URL into SWF file?

    Hello, It seems that the web based newspaper who is going to publish my ad banner doesn't have flash player 10 (or 9). My ad banner was made in Flash CS4 / ActionScript 3.0. Instead I now have to change the code in my invisible button to ActionScript

  • RE : Visitation order

    Hi, The default tab-order is left-to-right and top-to-bottom. You can override the tab order by setting NextTabField attribute of the field widget(s). In TOOL, you can simply inspect the <FieldWidget>.NextTabField to find out which field is visited a