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

Similar Messages

  • 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 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 HR-ABAP programming stuff

    Hi Alls
    I have been assigned to work in HR-ABAP.I have gud exp in normal ABAP but i am totally new for hr-abap.Could please help to me as u guys are helping to others.
    What are teh basic things i need to know , so  i can start working..
    Please send me HR-ABAP related programming stuff on given id.
    My mail id is [email protected]
    Ur help would highly be appreciate.
    Regards
    Vinod Tiwari

    hi,
    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
    I am sending to ur maild id also.
    if helpful reward points

  • Need help in writing ABAP for and Object

    Hi ,
    I am an ABAPer and I need a help related to BW.
    As per the Client Requirement ,I need to write ABAP for object  ZC_MRPAMC.
    what he expects is :
    0MRP_CONTROL is an attribute of 0MAT_PLANT. There can be only one 0MRP_CONTROL per  0MAT_PLANT.
    Assign the attribute value of 0MRP_CONTROL to ZC_MRPAMC per 0MAT_PLANT.
    How to assign value of 0MRP_CONTROL to ZC_MRPAMC per 0MAT_PLANT.
    Kindly  give me the steps.
    Thanks.
    Anu.

    Hi,
    U can use FM RSAU_READ_MASTER_DATA.
    Give as input the info object(I_IOBJNM=0MAT_PLANT) and attribute name(I_ATTRNM=0MRP_CONTROL).
    Output u will get the value of that attribute which u want(E_ATTRVAL=ZC_MRPAMC).
    Hope it helps
    Regards,
    Rathy

  • Need Help : Native SQL ABAP dump "DBIF_DSQL2_SQL_ERROR" on procedure "APS_ORDER_CHANGE".

    Hi All,
    We are facing an issue and want to check if you have seen it in past and can help us in resolving it. Any input will be greatly appreciated.
    Issue:
    While executing product heuristic on few product/location combinations in product view, we encounter native SQL ABAP dump “DBIF_DSQL2_SQL_ERROR” on
    procedure “APS_ORDER_CHANGE”.
    We were debugging for one particular product/location combination, this combination has 2 planned orders, and the Internal order number of these planned orders are
    given as input to this procedure “APS_ORDER_CHANGE”. These 2 internal order numbers are the only inputs given to this procedure.
    When we try to delete those planned orders we again encounter same ABAP dump. There are many product/location having the same issue.
    We also checked variable duration maintained on the PPM of this product/location, and was fine.
    For more deatils : Please check the attached document of downloaded ABAP Dump.
    Thanks and Regards,
    Pritesh Jain

    Hi Pritesh.
    What liveCache version/build/patch are you on? What is the database error text shown in this dump?
    If it is exactly the one below
    Database error text........: "POS(1) Work rolled back: tExcept 30730 in
    APS_ORDER_CHAN"
    You can try running report SLCA_EMERGENCY_SWITCH, then turning off the option "Verify that all input table records have been read" and saving the results. If that solves the issue, you can use this as a workaround until the next time you upgrade your liveCache build.
    To get a clear root cause, you may need to create an OSS incident under BC-DB-LCA component providing a reproducible example.
    Regards,
    Tiago

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

  • Need  help in  sapcertification abap/4

    hi,
        suggest me  in preparing  sap certificatin in abap.
    provide me links and material were i can get  good stuff in prepareing sap exam.iwant to write my exam in october where sap is conduting exam in bangalore india.
       is this two months enough to write a certification exam
    in abap. if so give some suggestions .i will be very thankfull to u.
    byeee

    Hi,
    To begin ABAP,
    ABAP in 21 days
    http://cma.zdnet.com/book/abap/ch03/ch03.htm
    To learn the following concepts:
    ALV
    http://www.geocities.com/mpioud/Abap_programs.html
    OLE
    http://www.sapgenie.com/abap/ole.htm
    For FAQ
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.sapgenie.com/faq/abap.htm
    Smartforms
    http://www.sap-basis-abap.com/sapsf001.htm
    Workflow
    http://www.sap-img.com/workflow/sap-workflow.htm
    very useful link for all
    http://www.sapgenie.com/abap/index.htm
    http://www.sap-img.com/abap.htm
    http://www.sapdevelopment.co.uk/tips/tipshome.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://www.henrikfrank.dk/abapuk.html
    http://sappoint.com/abap/
    For certification details,check this.
    http://www.alluwanted.com/certif.htm

  • Need Help on HR ABAP

    Hi
    can any body help me on HR ABAP especiallin payroll and time management do favour me any material and specs regarding this to my email id [email protected]
    thanks in advance
    regards
    sreenu

    Hi,
    Check these links.
    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
    These are the FAQ's that might helps you
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm

  • Need help with transforming abap to xml doc!!

    Abap To XML
    Posted: Aug 18, 2005 11:31 AM        Reply      E-mail this post 
    I was able to transfer xml data from abap internal tables to a string.
    Here is the content of the string:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">
    <asx:values>
    <DATA>
    <item>
    <UOM1 />
    <UOM2>L</UOM2>
    <GL_PR_SEG />
    <RECORDMODE>A</RECORDMODE>
    </item>
    </DATA>
    </asx:values>
    </asx:abap>
    Now my goal is to strip out a couple of tags out of that string directly using xslt.
    Do you know of any way i could take out the <asx:abap> and <asx:values> tags using an xslt program. I'd like to be able to strip them out directly from the string itself.

    Hi there,
    Unfortunately this is a bit outside the scope of what ExportPDF is designed for.  You may be able to convert your document to a Word file and, as long as you didn't write over any of the printed text on the document, make your edits there to remove your writing  That said, it sounds like your best bet would be to scan the document to an image format, then use a photo-editing application, such as Photoshop Elements to touch up and remove your hand-written notes.
    Please let us know if you have any questions.
    -David

  • 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 in creating webas abap system

    hi
    new to create jco and techinical system need help
    experts  i have few faqs on creating techinical system plz help me
    i have 4.7ee r/3  and portal 2004s  sp9
    wer can i find these values plz give me navigation
    SID ==  ?
    MESG SEVER PORT ===?
    to add application server
    application host name ==?
    application instance number ==?
    client number ==?
    logical client name ==?
    it is asking to select a software component wat we have to select to finish
    wen i gave some dummy values
    i get an error
    CIM_ERR_ALREADY_EXISTS: Instance already exists: SAP_BCApplicationServer.CreationClassName="SAP_BCApplicationServer",Name="C11.Number.00.HostName.rama"
    is it necessary to have WAS in r/3 to connect to portal plz explain

    i want to use jco
    but for that we need to create a techinical system
    i followed these steps for techinical system
    1 Step
    selected web as abap
    2nd step
    sid = PRD
    installation number== INITIAL
    database host name== super
    3rd step
    message server name = 3600+instance
    i took system number from sap gui(21)
    so i gave 3600+21=3621
    central application sever
    instance number ==21
    next pressed button -->add new logon group
    entered longon group == entered value
    which i found in t-code -smlg
    4th Step
    Add application server
    host == gave r/3 ip 198.168.0.2
    instance==21
    client number = 800
    logical client = left it empty
    5 th step
    selected one componenet and finished
    after this i created the jco
    1st Step general data
    name =test1
    client=800
    2nd step  j2ee cluster
    checked the box
    use local j2ee engine
    3rd step
    selected dictionary meta data
    4 th
    selected the techinical system
    5th
    user name -->sapuser
    pasww-->india
    pressed finish
    now i found the jco in green color
    but i pinged it 
    i got mesg
    ping failed

  • Need help in ABAP.

    HI gurus,
    I AM KISHORE i am SD consultant.here my client is asking to create some programmes. i need help in simple programmes so that as per that i can change the fiels as per my requirement.
          i am in real big problem now .i know these are very simple programmes but i don't know ABC of programming.
    can some one help me in this regard.  this ABAP help is needed for me only for some time.
    the requirement:  
    create program which will produce list with:
       Materia number; Material description ; Valuation class, Standard price with curency and unit.
    Select conditions:
       Material number,
       Plant,
       Material type                                as mandatory
       Material Group                              as mandatory,
       LP/KD/MIP  (LABOR)                    as mandatory,
       Replenishment strategy (TEMPB)   as mandatory,
       Valuation class,
       Flag for deletion-Client Level  with initial value <> ‘X’  (only materials without flag for deletion)
    Simple List is enough
    reagrds
    kishore

    Hi
    Eventhough i cant fullfill your complete requirement. I'm giving u a report performed by me in which most of the fields are covered ask any of abaper to make modifications in this report and change it to accordingly ur requirement. I think it will solve 80% of ur work
    * tables
    TABLES: ekko,ekbe,ekpo,ekkn,konh,konv,esll,ekbz,rseg,lfa1,j_1ipart1,
    j_1igrxref.
    TYPE-POOLS: slis.
    *data definituon
    DATA:
          wa_ekko LIKE ekko,
          wa_ekbe LIKE ekbe,
          wa_ekkn LIKE ekkn,
          wa_konp LIKE konp,
          wa_ekpo LIKE ekpo,
          wa_rbkp LIKE rbkp,
          wa_j_1ipart1 LIKE j_1ipart1,
          wa_j_1igrxref LIKE j_1igrxref,
          wa_rseg LIKE rseg OCCURS 0 WITH HEADER LINE.
    DATA: ws_vakey LIKE konh-vakey,
          ws_kbetr LIKE konp-kbetr,
          ws_kbetr1 LIKE konp-kbetr,
          ws_kbetr2 LIKE konp-kbetr,
          ws_ecs LIKE j_1igrxref-ecs,
          ws_ebelp LIKE ekbz-ebelp,
          ws_ebeln LIKE ekko-ebeln,
          ws_belnr LIKE ekbe-belnr,
          ws_beznk LIKE  rbkp-beznk,
          ws_wrbtr_f LIKE ekbz-wrbtr,
          ws_rmwwr LIKE rbkp-rmwwr,
          ws_rbkp_benz.
    *internal tables
    DATA: BEGIN OF int_outtab OCCURS 0,
          lifnr      LIKE ekko-lifnr,               " vend no
          name1      LIKE lfa1-name1,               " vend name
          werks      LIKE ekpo-werks,               "  plant
          ebeln      LIKE ekko-ebeln,               " po no
          knumv      LIKE ekko-knumv,
          ebelp      LIKE ekbe-ebelp,
          matnr      LIKE ekpo-matnr,               " mat no
          txz01      LIKE ekpo-txz01,               " mat desceiption
          kostl      LIKE ekkn-kostl,               " cost center
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,          " WBS element
          netwr      LIKE ekpo-netwr,
          " basic value           (po)
          kbetr      LIKE konp-kbetr,
          " excise value          (po)
          kwert_i    LIKE konv-kwert,
          " insurance value       (po)
          kwert_f    LIKE konv-kwert,
          " frieght value         (po)
          kwert_t    LIKE konv-kwert,
          " vat/tax value         (po)
          kwert_o    LIKE konv-kwert,
          " others                (po)
          kwert_total LIKE konv-kwert,
          " total                 (po)
          ecs        LIKE j_1igrxref-ecs,
          " excise                (ap)
          wmwst1     LIKE   rbkp-wmwst1,
          " tax amount            (ap)
          wrbtr_f       TYPE ekbz-wrbtr,
          " freight               (ap)
          wrbtr       TYPE ekbz-wrbtr,
          beznk      LIKE    rbkp-beznk,
          " Unplanned cost        (ap)
          refwr_g    TYPE  ekbe-refwr,
          " gross                 (ap)
          rmwwr   LIKE  rbkp-rmwwr,
          "  Actual Invoice Total (ap)
          buzei      LIKE ekbz-buzei,               "item for material doc
          gjahr      LIKE ekbe-gjahr,
          tax        LIKE ekbe-wrbtr,                " tax (ap)
          actual_total LIKE ekbe-wrbtr,
    *      belnr      LIKE rseg-belnr,
           belnr     LIKE ekbe-belnr,
          vakey      LIKE konh-vakey,
          cpudt      LIKE ekbe-cpudt,
          budat      LIKE ekbz-budat,
          belnr_ekbz LIKE ekbz-belnr,              "to get excise value
    *      aedat     LIKE ekpo-aedat,
          bedat   LIKE ekko-bedat,
          waers     LIKE lfm1-waers,               " currency
          END OF int_outtab.
    DATA:   int_konv LIKE konv OCCURS 0 WITH HEADER LINE,
    *        int_ekbe LIKE ekbe OCCURS 0 WITH HEADER LINE,
            int_ekbz LIKE ekbz OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF int_konh OCCURS 0,
          knumh LIKE konh-knumh,
          kschl LIKE konh-kschl,
          vakey LIKE konh-vakey,
          END OF int_konh.
    DATA: BEGIN OF int_konp OCCURS 0,
          knumh LIKE konp-knumh,
          kschl LIKE konp-kschl,
          kbetr LIKE konp-kbetr,
          END OF int_konp.
    DATA: BEGIN OF int_ekkn OCCURS 0,
          ebeln      LIKE ekkn-ebeln,
          ebelp      LIKE ekkn-ebelp,
          kostl      LIKE ekkn-kostl,
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,
          END OF int_ekkn.
    DATA: BEGIN OF int_outtab1 OCCURS 0,
          exbed      LIKE j_1igrxref-exbed,
          ecs        LIKE j_1igrxref-ecs,
          END OF int_outtab1.
    DATA: BEGIN OF int_ekbe OCCURS 0,
          ebelp LIKE ekbe-ebelp,
          refwr LIKE ekbe-refwr,
          wrbtr LIKE ekbe-wrbtr,
          shkzg LIKE ekbe-shkzg,
          END OF int_ekbe.
    DATA: BEGIN OF int_total OCCURS 0,
          ebeln LIKE ekko-ebeln,
          ebelp LIKE ekbe-ebelp,
          actual_total LIKE ekbe-wrbtr,
          END OF int_total.
    DATA: BEGIN OF int_excise OCCURS 0,
          ebeln      LIKE ekko-ebeln,
          kbetr      LIKE konp-kbetr,
          END OF int_excise.
    DATA: BEGIN OF int_rseg OCCURS 0,
          ebeln LIKE rseg-ebeln,
          ebelp LIKE rseg-ebelp,
          lfbnr LIKE rseg-lfbnr,
          matnr LIKE rseg-matnr,
          lfgja LIKE rseg-lfgja,
          belnr LIKE rseg-belnr,
          ecs LIKE j_1igrxref-ecs,
          beznk      LIKE    rbkp-beznk,
          wrbtr_f    LIKE  ekbz-wrbtr,
          rmwwr LIKE rbkp-rmwwr,
          END OF int_rseg.
    DATA: BEGIN OF int_rbkp OCCURS 0,
          belnr LIKE  rbkp-belnr,
          beznk      LIKE    rbkp-beznk,
          rmwwr      LIKE    rbkp-rmwwr,
          tcode  LIKE rbkp-tcode,
          END OF int_rbkp.
    ****ALV list definintion
    DATA: ws_cat TYPE slis_t_fieldcat_alv ,
          int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_custom_container TYPE REF TO cl_gui_custom_container.
    *selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(23) text-002.
    SELECT-OPTIONS: s_lifnr FOR ekko-lifnr obligatory.
    *PARAMETERS:p_lifnr LIKE ekko-lifnr  .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 25(17) text-006.
    *PARAMETERS:p_ebeln LIKE ekko-ebeln obligatory.
    SELECT-OPTIONS:s_ebeln FOR ekko-ebeln .
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-003.
    *PARAMETERS:p_ekorg LIKE ekko-ekorg.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(20) text-004.
    *PARAMETERS:p_werks LIKE ekpo-werks obligatory.
    *SELECT-OPTIONS: S_werks FOR ekpo-werks obligatory.
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-005.
    *SELECT-OPTIONS:s_bedat FOR ekko-bedat.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM field_catalog.
      PERFORM display_data.
    END-OF-SELECTION.
    *&      Form  get_data
    *       text
    FORM get_data.
    * start of Vender details
    ***vender no, vender name, po no,service/mat no, service/mat description
      SELECT  ekko~lifnr ekko~ebeln ekko~knumv ekko~bedat
              ekpo~werks ekpo~matnr ekpo~txz01 ekpo~werks
              ekpo~netwr
    *          ekpo~aedat
              ekbe~ebelp  ekbe~belnr
              lfa1~name1
      INTO    CORRESPONDING   FIELDS OF  TABLE int_outtab
      FROM ( ( ( ekko
               JOIN ekbe ON  ekbe~ebeln = ekko~ebeln AND
                             ekbe~vgabe = '2'       )
               JOIN ekpo ON ekpo~ebeln = ekko~ebeln   AND
                            ekpo~ebelp = ekbe~ebelp )
               JOIN lfa1 ON lfa1~lifnr = ekko~lifnr )
      WHERE
    *  ekko~lifnr  =  P_lifnr  AND
    *         ekko~ebeln IN  S_ebeln  AND
    **         ekpo~werks IN  S_werks AND
             ekbe~vgabe = '2'.
    ***WBS/Cost center
      SELECT  ebeln ebelp kostl ps_psp_pnr  FROM ekkn INTO int_ekkn
      FOR ALL ENTRIES IN int_outtab
      WHERE ebeln = int_outtab-ebeln AND
            ebelp = int_outtab-ebelp.
        APPEND int_ekkn.
      ENDSELECT.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_ekkn WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            IF  int_ekkn-kostl <> ' '.
              MOVE int_ekkn-kostl TO int_outtab-kostl.
            ELSE.
              MOVE int_ekkn-ps_psp_pnr TO int_outtab-kostl.
              " int_outtab-ps_psp_pnr.
            ENDIF.
          ENDLOOP.
          MODIFY int_outtab.
        ENDON.
      ENDLOOP.
    *end of Vender details*****
    *******Start of calculation of PO
    *****Excise calculation of po
      LOOP AT int_outtab.
        CONCATENATE int_outtab-werks int_outtab-lifnr int_outtab-matnr INTO
        ws_vakey.
        MOVE ws_vakey TO int_outtab-vakey.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        ON CHANGE OF int_outtab-ebelp.
          SELECT knumh kschl vakey FROM konh INTO int_konh
    *        FOR ALL ENTRIES IN int_outtab
            WHERE vakey = int_outtab-vakey AND
                  datab <= int_outtab-bedat AND
                  datbi > int_outtab-bedat AND
                 ( kschl = 'JMOP' OR kschl = 'JEC1' ).
            SELECT knumh kschl kbetr FROM konp INTO int_konp
            WHERE  knumh = int_konh-knumh .
              IF  int_konp-kschl = 'JMOP'.
                ws_kbetr = int_konp-kbetr / 1000 * int_outtab-netwr.
                ws_kbetr1 = ws_kbetr.
              ENDIF.
              IF int_konp-kschl = 'JEC1'.
                ws_kbetr2 = int_konp-kbetr / 1000 * ws_kbetr1.
              ENDIF.
              ws_kbetr = ws_kbetr + ws_kbetr2.
            ENDSELECT.
          ENDSELECT.
        ENDON.
    *    ENDON.
        MOVE ws_kbetr TO int_outtab-kbetr.
        MODIFY int_outtab.
        CLEAR: ws_kbetr, ws_kbetr1, ws_kbetr2.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        int_excise-kbetr =  int_outtab-kbetr.
        int_excise-ebeln =  int_outtab-ebeln.
        APPEND int_excise.
    *    ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_excise WHERE ebeln = int_outtab-ebeln.
            ws_kbetr = ws_kbetr + int_excise-kbetr.
          ENDLOOP.
        ENDON.
        int_outtab-kbetr = ws_kbetr.
        MODIFY int_outtab.
        CLEAR ws_kbetr.
      ENDLOOP.
    ***** Insurance, Freight,Vat/ST, Other, Total***********
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          CLEAR int_konv.
          SELECT * FROM konv INTO CORRESPONDING FIELDS OF int_konv
          WHERE knumv = int_outtab-knumv AND
                kposn = int_outtab-ebelp AND
              ( ( kschl <> 'RA00' )
                 AND ( kschl <> 'RA01' ) AND ( kschl <>  'RB00' )
                 AND ( kschl <> 'PBXX' ) AND ( kschl <>  'PB00' )
                 AND ( kschl <> 'RC00' ) AND ( kschl <>  'RL01' )
                 AND ( kschl <> 'ZC00' ) AND ( kschl <>  'ZA00' )
                 AND ( kschl <> 'ZA01' ) AND ( kschl <>  'HB01' )
                 AND ( kschl <> 'ZBED' ) AND ( kschl <>  'ZAED' )
                 AND ( kschl <> 'ZSED' ) AND ( kschl <>  'ZAE1' )
                 AND ( kschl <> 'ZSE1' ) AND ( kschl <>  'ZCEX' )
                 AND ( kschl <> 'ZPRO' ) AND ( kschl <>  'ZTRD' )
                 AND ( kschl <> 'ZPK4' ) AND ( kschl <>  'ZSTX' )
                 AND ( kschl <> 'ZASS' ) AND ( kschl <>  'ZJCD' )
                 AND ( kschl <>  'HB00') ).
            APPEND int_konv.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-knumv.
          LOOP AT int_konv WHERE kposn = int_outtab-ebelp AND
                                 knumv = int_outtab-knumv.
    *                             lifnr = int_outtab-lifnr.
    ***** tax
            IF  ( ( int_konv-kschl = 'NAVS' ) OR ( int_konv-kschl = 'NAVM' )
              int_outtab-kwert_t = int_outtab-kwert_t + int_konv-kwert.
            ELSE.
    *****freight
              IF ( ( int_konv-kschl = 'FRA1' ) OR ( int_konv-kschl = 'FRB1'
                                              OR  ( int_konv-kschl = 'FRC1'
                int_outtab-kwert_f = int_outtab-kwert_f + int_konv-kwert.
              ELSE.
    *****insurance
                IF ( ( int_konv-kschl = 'ZGIN' )  OR ( int_konv-kschl =
                'ZIN2' ) ).
                  int_outtab-kwert_i =  int_outtab-kwert_i + int_konv-kwert.
                ELSE.
    ****others
                  IF NOT (    ( int_konv-kschl = 'NAVS' ) OR (
                  int_konv-kschl = 'NAVM' )
                           OR ( int_konv-kschl = 'FRA1' ) OR (
                           int_konv-kschl = 'FRB1' )
                           OR ( int_konv-kschl = 'FRC1' ) OR (
                           int_konv-kschl = 'ZGIN' )
                           OR ( int_konv-kschl = 'ZIN2' ) OR (
                           int_konv-kschl = 'RA00' )
                           OR ( int_konv-kschl = 'RA01' ) OR (
                           int_konv-kschl = 'RB00' )
                           OR ( int_konv-kschl = 'PBXX' ) OR (
                           int_konv-kschl = 'PB00' )
                           OR ( int_konv-kschl = 'RC00' ) OR (
                           int_konv-kschl = 'RL01' ) ).
                    int_outtab-kwert_o =   int_outtab-kwert_o  +
                    int_konv-kwert.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDLOOP.
    ****total
          int_outtab-kwert_total =  int_outtab-kwert_t
                                    + int_outtab-kwert_f
                                    + int_outtab-kwert_i
                                    + int_outtab-kwert_o
                                  + int_outtab-netwr.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
    ******End of calculation of PO
    *start of calculation for actual payment
    *****Excise
    sort int_outtab by ebelp ebeln.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          SELECT * FROM rseg INTO CORRESPONDING FIELDS OF int_rseg
    *          FOR ALL ENTRIES IN int_outtab
                 WHERE ebeln = int_outtab-ebeln AND
                       ebelp = int_outtab-ebelp.
            APPEND int_rseg.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      sort int_rseg by ebelp lfbnr matnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_outtab-ebelp OR int_rseg-lfbnr OR int_rseg-matnr OR
        int_rseg-lfgja.
          SELECT * FROM j_1ipart1 INTO wa_j_1ipart1
          WHERE mblnr = int_rseg-lfbnr AND
                mjahr = int_rseg-lfgja AND
                matnr = int_rseg-matnr.
            ON CHANGE OF wa_j_1ipart1-mblnr OR wa_j_1ipart1-zeile.
              SELECT * FROM j_1igrxref INTO wa_j_1igrxref
               WHERE mblnr = wa_j_1ipart1-mblnr AND
                     zeile = wa_j_1ipart1-zeile.
                IF sy-subrc EQ 0.
                  ws_ecs = ws_ecs + wa_j_1igrxref-exbed + wa_j_1igrxref-ecs.
                ENDIF.
              ENDSELECT.
            ENDON.
          ENDSELECT.
        ENDON.
        MOVE ws_ecs TO int_rseg-ecs.
        MODIFY int_rseg TRANSPORTING ecs.
        CLEAR: ws_ecs.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln.
            ws_ecs = ws_ecs + int_rseg-ecs.
          ENDLOOP.
        ENDON.
        MOVE ws_ecs TO int_outtab-ecs.
        MODIFY int_outtab TRANSPORTING ecs.
        CLEAR ws_ecs.
      ENDLOOP.
    ******unplanned costs and actual_invoice_total
      SORT int_rseg BY belnr.
      LOOP AT int_rseg .
        ON CHANGE OF int_rseg-belnr.
          SELECT  belnr beznk rmwwr tcode FROM rbkp INTO int_rbkp
          WHERE   belnr  = int_rseg-belnr .
            APPEND int_rbkp.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      SORT int_rseg BY belnr.
      SORT int_rbkp BY belnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_rseg-ebeln OR int_rseg-belnr.
          LOOP AT int_rbkp WHERE belnr = int_rseg-belnr.
            IF int_rbkp-tcode = 'MR8M'.
              int_rbkp-rmwwr = int_rbkp-rmwwr * ( - 1 ).
              int_rbkp-beznk = int_rbkp-beznk * ( - 1 ).
            ENDIF.
            ws_beznk =  ws_beznk + int_rbkp-beznk.
            ws_rmwwr =  ws_rmwwr + int_rbkp-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_rseg-beznk.
        MOVE ws_rmwwr TO int_rseg-rmwwr.
        MODIFY int_rseg.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_rseg-ebeln.
            ws_beznk =  ws_beznk + int_rseg-beznk.
            ws_rmwwr =  ws_rmwwr + int_rseg-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_outtab-beznk.
        MOVE ws_rmwwr TO int_outtab-rmwwr.
        MODIFY int_outtab.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
    *freight of actual payment
      sort int_rseg by belnr ebelp.
      LOOP AT int_rseg.
        ON CHANGE OF  int_rseg-belnr or int_rseg-ebelp..
          SELECT * FROM ekbz INTO CORRESPONDING FIELDS OF int_ekbz
          WHERE ebeln = int_rseg-ebeln AND
                belnr = int_rseg-belnr AND
                ebelp = int_rseg-ebelp AND
                vgabe = '2' .
            IF int_ekbz-shkzg = 'H'.
              int_ekbz-wrbtr = int_ekbz-wrbtr  * ( - 1 ).
            ENDIF.
            int_rseg-wrbtr_f = int_rseg-wrbtr_f + int_ekbz-wrbtr.
          ENDSELECT.
        ENDON.
        MODIFY int_rseg.
        CLEAR int_rseg-wrbtr_f.
      ENDLOOP.
      sort int_rseg by ebelp.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            ws_wrbtr_f = ws_wrbtr_f + int_rseg-wrbtr_f.
          ENDLOOP.
        ENDON.
        MOVE ws_wrbtr_f TO int_outtab-wrbtr_f.
        MODIFY int_outtab TRANSPORTING wrbtr_f.
        CLEAR ws_wrbtr_f.
      ENDLOOP.
    **tax and gross amt of actual payment
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
        " or int_outtab-belnr.
          SELECT ebelp refwr wrbtr shkzg FROM ekbe INTO int_ekbe
          WHERE ebelp = int_outtab-ebelp AND
                ebeln = int_outtab-ebeln AND
                vgabe = '2' .
            IF int_ekbe-shkzg = 'H'.
              int_ekbe-refwr  = int_ekbe-refwr * ( - 1 ).
              int_ekbe-wrbtr  = int_ekbe-wrbtr * ( - 1 ).
            ENDIF.
            int_outtab-refwr_g = int_outtab-refwr_g +  int_ekbe-refwr.
            int_outtab-tax =  int_outtab-tax + ( int_ekbe-wrbtr -
            int_ekbe-refwr ).
          ENDSELECT.
        ENDON.
        MODIFY int_outtab.
        CLEAR int_outtab-refwr_g.
        CLEAR int_outtab-tax.
      ENDLOOP.
    ****total
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp  OR int_outtab-ebeln.
          int_outtab-actual_total =  int_outtab-actual_total
                                     + int_outtab-ecs
                                     + int_outtab-wrbtr_f
                                     + int_outtab-tax
                                     + int_outtab-beznk
                                     + int_outtab-refwr_g.
          int_total-actual_total =  int_outtab-actual_total.
          int_total-ebelp        = int_outtab-ebelp.
          int_total-ebeln        = int_outtab-ebeln.
          APPEND int_total.
        ENDON.
      ENDLOOP.
    *end of calculation for actaul payment
    *************Modification in internal table*****
      LOOP AT int_outtab.
        IF int_outtab-ebelp = ws_ebelp AND
           int_outtab-ebeln = ws_ebeln.
          int_outtab-netwr = 0.
          MODIFY int_outtab.
        ENDIF.
        ws_ebelp = int_outtab-ebelp.
        ws_ebeln = int_outtab-ebeln.
      ENDLOOP.
      LOOP AT int_outtab.
        IF int_outtab-netwr IS INITIAL.
          DELETE int_outtab INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_total WHERE ebeln = int_outtab-ebeln.
            int_outtab-actual_total =  int_outtab-actual_total
                                       + int_total-actual_total.
          ENDLOOP.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
        SELECT SINGLE * FROM lfm1 INTO CORRESPONDING FIELDS OF int_outtab
        WHERE lifnr = int_outtab-lifnr.
        MODIFY int_outtab.
      ENDLOOP.
    ********** end of modification*********
    ENDFORM.                    "get_data
    *&      Form  field_catalog
    *       text
    FORM field_catalog.
    ***vender no
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'LIFNR'.
      int_cat-reptext_ddic  = 'Vender No'.
      APPEND int_cat TO ws_cat.
    *vender name
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NAME1'.
      int_cat-reptext_ddic  = 'Vender Name'.
      APPEND int_cat TO ws_cat.
    ** PO No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'EBELN'.
      int_cat-reptext_ddic  = 'PO No'.
      APPEND int_cat TO ws_cat.
    ** Mat No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'Mat No'.
      APPEND int_cat TO ws_cat.
    ** Matdescription
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'TXZ01'.
      int_cat-reptext_ddic  = 'Mat description'.
      APPEND int_cat TO ws_cat.
    **WBS/Cost center
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KOSTL'.
      int_cat-reptext_ddic  = 'WBS/Cost center'.
      APPEND int_cat TO ws_cat.
    **Currency
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WAERS'.
      int_cat-reptext_ddic  = 'Currency'.
      APPEND int_cat TO ws_cat.
    **Basic
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NETWR'.
      int_cat-reptext_ddic  = 'Basic'.
      APPEND int_cat TO ws_cat.
    **Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KBETR'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    **Insurance
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_I'.
      int_cat-reptext_ddic  = 'Insurance'.
      APPEND int_cat TO ws_cat.
    **Frieght
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_F'.
      int_cat-reptext_ddic  = 'Frieght'.
      APPEND int_cat TO ws_cat.
    **VAT/ST
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_T'.
      int_cat-reptext_ddic  = 'VAT/ST'.
      APPEND int_cat TO ws_cat.
    **Other
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_O'.
      int_cat-reptext_ddic  = 'Others'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    ***Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ECS'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    *****Freight
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WRBTR_F'.
      int_cat-reptext_ddic  = 'Freight'.
      APPEND int_cat TO ws_cat.
    *****Tax
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     =  'TAX'.
      int_cat-reptext_ddic  =  'Tax'.
      APPEND int_cat TO ws_cat.
    ***Unplanned Del Cost
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'BEZNK'.
      int_cat-reptext_ddic  = 'Unplanned Del Cost'.
      APPEND int_cat TO ws_cat.
    ****Gross
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'REFWR_G'.
      int_cat-reptext_ddic  = 'Gross'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ACTUAL_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    **Actual Invoice Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'RMWWR'.
      int_cat-reptext_ddic  = 'Actual Invoice Total'.
      APPEND int_cat TO ws_cat.
    ENDFORM.                    "field_catalog
    *&      Form  display_data
    *       text
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'Z_MM_TEST1'
          it_fieldcat        = ws_cat[]
        TABLES
          t_outtab           = int_outtab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    Reward for all helpfull answers
    Regards
    Pavan

  • Need help in optimizing the ABAP code

    Hi,
    Can anyone help me in optimizing the code. Here the select statement has select within the loop. Need help in optimization.
    WHEN '0CO_PC_PCP_03'.
    LOOP AT C_T_DATA INTO TBL_KKBW_ITEM.
          W_TABIX = SY-TABIX.
          IF TBL_KKBW_ITEM-CURRENCY_TYPE EQ '20'.
    SELECT SINGLE KALNR KALKA KADKY TVERS KADAT KOKRS INTO (W_KALNR, W_KALKA, W_KADKY, W_TVERS,  
                    TBL_KKBW_ITEM-COSTING_DATE,
                    TBL_KKBW_ITEM-CONTROLLING_AREA)           
                    FROM KEKO                                  
                       WHERE KLVAR EQ TBL_KKBW_ITEM-COSTING_VARIANT                              
                        AND  KADKY EQ TBL_KKBW_ITEM-COSTING_DATE
                        AND  TVERS EQ TBL_KKBW_ITEM-COSTING_VERSION                           
                        AND  MATNR EQ TBL_KKBW_ITEM-HEADER_MATERIAL                             
                        AND  WERKS EQ TBL_KKBW_ITEM-HEADER_PLANT.
               IF SY-SUBRC EQ 0.                                
              SELECT SINGLE KOSTL INTO TBL_KKBW_ITEM-COST_CENTER
                              FROM CKIS WHERE KOSTL NE SPACE   
                                         AND  KALNR EQ W_KALNR 
                                         AND  KALKA EQ W_KALKA 
                                         AND  KADKY EQ W_KADKY 
                                         AND  TVERS EQ W_TVERS.
              IF SY-SUBRC NE 0.                                
                CLEAR TBL_KKBW_ITEM-COST_CENTER.               
              ENDIF.                                           
            ENDIF.                                             
            MODIFY C_T_DATA FROM TBL_KKBW_ITEM INDEX W_TABIX.
          ELSE.
            DELETE C_T_DATA INDEX W_TABIX.
          ENDIF.
        ENDLOOP.
    Thanks,
    Rani.

    hi
    plz use the below code :
    WHEN '0CO_PC_PCP_03'.
    SELECT  KALNR KALKA KADKY TVERS KADAT KOKRS INTO it_keko "declare internal table with the mentioned fields
    " also select the fields to be used in where condition
    FROM KEKO
    for all entries in c_t_data
    WHERE KLVAR EQ c_t_data-COSTING_VARIANT
    AND KADKY EQ c_t_data-COSTING_DATE
    AND TVERS EQ c_t_data-COSTING_VERSION
    AND MATNR EQ c_t_data-HEADER_MATERIAL
    AND WERKS EQ c_t_data-HEADER_PLANT.
    "sort the tables on the fields used in where.
    IF SY-SUBRC EQ 0.
    SELECT  KOSTL "and other fields to be used in where
    INTO it _ckis
    FROM CKIS
    for all entries in c_t_data
    WHERE KOSTL NE SPACE "use c_t_data
    AND KALNR EQ W_KALNR
    AND KALKA EQ W_KALKA
    AND KADKY EQ W_KADKY
    AND TVERS EQ W_TVERS.
    IF SY-SUBRC NE 0.
    CLEAR TBL_KKBW_ITEM-COST_CENTER.
    ENDIF.
    it_data[] = c_t_data. "declare it_data same as the extract structure
    delete it_data where CURRENCY_TYPE  NE '20'.
    LOOP AT it_data assigning <fs_data>. "use field symbols
    read from it_keko into wa_keko
    where
    KLVAR EQ <fs_data>-COSTING_VARIANT
    AND KADKY EQ <fs_data>-COSTING_DATE
    AND TVERS EQ <fs_data>-COSTING_VERSION
    AND MATNR EQ <fs_data>-HEADER_MATERIAL
    AND WERKS EQ<fs_data>-HEADER_PLANT
    binary search.
    if sy_subrc = 0.
    similarly read from the second itab
    ENDIF.
    ENDLOOP.
    c_t_data[] = it_data[].
    Pls let me know in case of any issues
    Regards,
    Aparna
    Edited by: Aparna KS on Jun 13, 2010 11:01 PM

  • Need help in bex query designer

    hi experts ,
    Actually we had a ODS where the KPI's values  for all weeks are present and also the module.
    in the query designer we need to show the targets for respective KPI's modulewise.
    the requirement is
    module-selections
    week no-selection
    targetweek1week2---week3
    KPI1--10090---90--
    90
    KPI2--95-7885-----90
    based on the module selection the targets values should change and also there should not be any restriction on weeks.
    and also exceptions needs to be done for color coding.
    we actually implemented cell defination for getting the above requirement , but here the problem is that we need to fix the  targets and there is arestriction on the weeks . but the requirement should be dynamic i.e, the targets should be configurable and the weeks should not be restricted.
    in the backend ODS all weeks data is present. we just need an idea how to fix these targets and also color coding for the respective KPI's without using cell defination.
    Kindly throw some pointers how to acheive this..
    thanks in advance,
    Madhu

    Hi Madhuri,
      Ur requirement can be done by using a customer exit variable,keeping any sap stand. time characteristics value.
    If u want to define the any selection dynamically,make a new selection with the text variable and call the customer exit variable into it and assaign the corresponding KPI into it and there by u can define the offset value as well.
      for writting the customer exit,u need to contact ur ABAP'er and say the requirement.
    Hope this helps!!

Maybe you are looking for

  • Unable to open RFC connection - Err message

    I all I am trying to install SAP ERP 2004 SR1 on Microsoft Windows Server 2003, SQL Server 2000. I have successfully installed the Central Instance but when I try to install the Database instance after the database loading the following error is give

  • Report output from memory to internal table (corresponding fields)

    How can we pick any standard report output such as RM07DOCS on to memory and from memory to an internal table.Here by internal table ,i do not mean of type c containing complete report but data should go from output to corresponding fields of interna

  • Invalid language characters

    HI, We got this error while executing DTP. Data record 2378 ('0000102749 '): Version '珠海市鹰飞商贸有限公 ' is not valid      We had nearly 101 error datarecords of this kind. So its getting difficult to look into the language and add the characters to RSKC .

  • Calculation of goods issue date in sales order with routes

    Hello Gurus, This is my first post on SCN, I'm excited to share a new little problem I have. I have configured my routes determination as per our requirements.  For example, I have one route configured in 0VTC such that the transit duration is 1 hour

  • Email Attachment Download

    Whenever I try to download an attachment to an email the download process freezes up.  This has also happened when I tried to download a video from a respected site.  It ran for 30 minutes and froze at time remaining 1 sec.  Any help in understanding