HR ABAP /RETRIVING NO OF FAMILY DEPENDANTS
Hello ,
i m facing a problem in getting a logic.
I Hav to design a report in this way.
<b>pernr | last,first | department | no of dependants like this.................. </b>
| name | | |
I hav to retrive data from p0021 to get the no of dependants for an employee.
so i m getting confused how to write the logic so that i hav to check the dependant type and that to subtyp and add them up to get the total no of dependants for an employee.
can anyone guide me regarding that.
regards,
sahakla
Hi Rajest ,just copy this code and check -
REPORT ZPPL_PREVEMPLOYERS message-id rp
line-size 250
line-count 65.
tables: pernr.
infotypes: 0021.
*eject
*& Constants *
constants: c_1(1) type c value '1' .
data: begin of t_output occurs 0,
num_dep(2) type n,
pernr like pernr-pernr.
data: end of t_output.
data: count type i.
*eject
*& Initialization *
Initialization.
Initialize Selection-Screen values
perform init_selction_screen.
Start-of-selection.
get pernr.
clear t_output.
Read Infotype 0021
rp-provide-from-last p0021 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
Gather all the required information related to the emp
describe table p0021 lines count.
move: pernr-pernr to t_output-pernr,
count to t_output-num_dep.
append t_output.
Clear count.
*eject
*& End-of Selection *
end-of-selection.
perform print_report.
*eject
*& Form print_report
*Description:
FORM print_report .
Print the report
loop at t_output.
skip 1.
write: 2 t_output-pernr,
15 t_output-num_dep.
endloop.
ENDFORM. " print_report
Similar Messages
-
Abap-hr : error in retrieving employee's family dependent details
Hi all,
while retreiving family dependent details of employee of subtype de01 its throwing up a dump
<REMOVED BY MODERATOR>
*& Report ZABAP_HR *
REPORT ZABAP_HR .
TABLES : PERNR.
INFOTYPES : 0000, 0001, 0002, 0006, 0105, 0021.
* STRUCTURES
TYPES : BEGIN OF TY_EMP,
PERNR(20) TYPE C, "PERSONNEL NO
NACHN TYPE NACHN, "FIRST NAME
VORNA TYPE VORNA, "LAST NAME
* ANSSA TYPE ANSSA, "ADDRESS TYPE
STRAS TYPE STRAS, "STREET
PSTLZ TYPE PSTLZ, "POSTAL CODE
ORT01 TYPE ORT01, "CITY
LAND1 TYPE LAND1, "COUNTRY
STRAS1 TYPE STRAS, "STREET
PSTLZ1 TYPE PSTLZ, "POSTAL CODE
ORT011 TYPE ORT01, "CITY
LAND11 TYPE LAND1, "COUNTRY
PLANS TYPE PLANS, "POSITION
EMAILID TYPE COMM_ID_LONG, "EMAIL ID
FAMSA TYPE FAMSA, "DEPENDENT TYPE
FAVOR TYPE FAVOR, "FIRST NAME
FANAM TYPE PAD_NACHN, "LAST NAME
FAMSA1 TYPE FAMSA, "DEPENDENT TYPE
FAVOR1 TYPE FAVOR, "FIRST NAME
FANAM1 TYPE PAD_NACHN, "LAST NAME
FAMSA2 TYPE FAMSA, "DEPENDENT TYPE
FAVOR2 TYPE FAVOR, "FIRST NAME
FANAM2 TYPE PAD_NACHN, "LAST NAME
FAMSA3 TYPE FAMSA, "DEPENDENT TYPE
FAVOR3 TYPE FAVOR, "FIRST NAME
FANAM3 TYPE PAD_NACHN, "LAST NAME
FAMSA4 TYPE FAMSA, "DEPENDENT TYPE
FAVOR4 TYPE FAVOR, "FIRST NAME
FANAM4 TYPE PAD_NACHN, "LAST NAME
FAMSA5 TYPE FAMSA, "DEPENDENT TYPE
FAVOR5 TYPE FAVOR, "FIRST NAME
FANAM5 TYPE PAD_NACHN, "LAST NAME
FAMSA6 TYPE FAMSA, "DEPENDENT TYPE
FAVOR6 TYPE FAVOR, "FIRST NAME
FANAM6 TYPE PAD_NACHN, "LAST NAME
FAMSA7 TYPE FAMSA, "DEPENDENT TYPE
FAVOR7 TYPE FAVOR, "FIRST NAME
FANAM7 TYPE PAD_NACHN, "LAST NAME
FAMSA8 TYPE FAMSA, "DEPENDENT TYPE
FAVOR8 TYPE FAVOR, "FIRST NAME
FANAM8 TYPE PAD_NACHN, "LAST NAME
FAMSA9 TYPE FAMSA, "DEPENDENT TYPE
FAVOR9 TYPE FAVOR, "FIRST NAME
FANAM9 TYPE PAD_NACHN, "LAST NAME
FAMSA10 TYPE FAMSA, "DEPENDENT TYPE
FAVOR10 TYPE FAVOR, "FIRST NAME
FANAM10 TYPE PAD_NACHN, "LAST NAME
FAMSA11 TYPE FAMSA, "DEPENDENT TYPE
FAVOR11 TYPE FAVOR, "FIRST NAME
FANAM11 TYPE PAD_NACHN, "LAST NAME
FAMSA12 TYPE FAMSA, "DEPENDENT TYPE
FAVOR12 TYPE FAVOR, "FIRST NAME
FANAM12 TYPE PAD_NACHN, "LAST NAME
FAMSA13 TYPE FAMSA, "DEPENDENT TYPE
FAVOR13 TYPE FAVOR, "FIRST NAME
FANAM13 TYPE PAD_NACHN, "LAST NAME
FAMSA14 TYPE FAMSA, "DEPENDENT TYPE
FAVOR14 TYPE FAVOR, "FIRST NAME
FANAM14 TYPE PAD_NACHN, "LAST NAME
END OF TY_EMP.
* INTERNAL TABLES
DATA : IT_EMP TYPE STANDARD TABLE OF TY_EMP.
* WORK AREAS
DATA : WA_EMP TYPE TY_EMP.
DATA : N TYPE I.
* START-OF-SELECTION
START-OF-SELECTION.
GET PERNR.
* SUBROUTINE TO FETCH DATA FROM INFOTYPES
PERFORM FETCH_DATA_INFTY.
END-OF-SELECTION.
* SUBROUTINE TO DISPLAY DATA
PERFORM DISPLAY_DATA.
*& Form FETCH_DATA_INFTY
* text
* --> p1 text
* <-- p2 text
*PERSONAL DETAILS
RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-PERNR = P0002-PERNR.
WA_EMP-NACHN = P0002-NACHN.
WA_EMP-VORNA = P0002-VORNA.
ENDIF.
*ORGANIZATIONAL DETAILS
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-PLANS = P0001-PLANS.
ENDIF.
*PERMANENT ADDRESS DETAILS
RP_PROVIDE_FROM_LAST P0006 0001 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-STRAS = P0006-STRAS.
WA_EMP-PSTLZ = P0006-PSTLZ.
WA_EMP-ORT01 = P0006-ORT01.
WA_EMP-LAND1 = P0006-LAND1.
ENDIF.
*TEMPORARY ADDRESS DETAILS
RP_PROVIDE_FROM_LAST P0006 0002 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-STRAS1 = P0006-STRAS.
WA_EMP-PSTLZ1 = P0006-PSTLZ.
WA_EMP-ORT011 = P0006-ORT01.
WA_EMP-LAND11 = P0006-LAND1.
ENDIF.
*COMMUNICATION DETAILS
RP_PROVIDE_FROM_LAST P0105 0010 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-EMAILID = P0105-USRID_LONG.
ENDIF.
*DEPENDANT DETAILS
FORM FETCH_DATA_INFTY .
DATA : ITAB1 TYPE P0021-FAMSA VALUE 'DE01'.
DATA : ITAB TYPE I.
MOVE ITAB1 TO ITAB.
RP_PROVIDE_FROM_LAST P0021 0001 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA = P0021-FAMSA.
WA_EMP-FAVOR = P0021-FAVOR.
WA_EMP-FANAM = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0002 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA1 = P0021-FAMSA.
WA_EMP-FAVOR1 = P0021-FAVOR.
WA_EMP-FANAM1 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0003 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA2 = P0021-FAMSA.
WA_EMP-FAVOR2 = P0021-FAVOR.
WA_EMP-FANAM2 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0004 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA3 = P0021-FAMSA.
WA_EMP-FAVOR3 = P0021-FAVOR.
WA_EMP-FANAM3 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0005 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA4 = P0021-FAMSA.
WA_EMP-FAVOR4 = P0021-FAVOR.
WA_EMP-FANAM4 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0006 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA5 = P0021-FAMSA.
WA_EMP-FAVOR5 = P0021-FAVOR.
WA_EMP-FANAM5 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0007 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA6 = P0021-FAMSA.
WA_EMP-FAVOR6 = P0021-FAVOR.
WA_EMP-FANAM6 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0008 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA7 = P0021-FAMSA.
WA_EMP-FAVOR7 = P0021-FAVOR.
WA_EMP-FANAM7 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0009 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA8 = P0021-FAMSA.
WA_EMP-FAVOR8 = P0021-FAVOR.
WA_EMP-FANAM8 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0010 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA9 = P0021-FAMSA.
WA_EMP-FAVOR9 = P0021-FAVOR.
WA_EMP-FANAM9 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0011 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA10 = P0021-FAMSA.
WA_EMP-FAVOR10 = P0021-FAVOR.
WA_EMP-FANAM10 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0012 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA11 = P0021-FAMSA.
WA_EMP-FAVOR11 = P0021-FAVOR.
WA_EMP-FANAM11 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0013 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA12 = P0021-FAMSA.
WA_EMP-FAVOR12 = P0021-FAVOR.
WA_EMP-FANAM12 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0014 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA13 = P0021-FAMSA.
WA_EMP-FAVOR13 = P0021-FAVOR.
WA_EMP-FANAM13 = P0021-FANAM.
ENDIF.
*DATA : DE01 LIKE P0021-FAMSA.
*DATA : ITAB TYPE I.
*DATA : DE01(4) TYPE C.
RP_PROVIDE_FROM_LAST P0021 ITAB PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA14 = P0021-FAMSA.
WA_EMP-FAVOR14 = P0021-FAVOR.
WA_EMP-FANAM14 = P0021-FANAM.
ENDIF.
APPEND WA_EMP TO IT_EMP.
CLEAR WA_EMP.
ENDFORM. " FETCH_DATA_INFTY
*& Form DISPLAY_DATA
* text
* --> p1 text
* <-- p2 text
FORM DISPLAY_DATA .
LOOP AT IT_EMP INTO WA_EMP.
AT FIRST.
WRITE : /02 'PERSONNELNO',
15 'FIRSTNAME',
25 'LASTNAME',
35 'POSITION',
45 'PERMANENT ADDRESS : ',
65 'STREET',
80 'POSTALCODE',
93 'CITY',
100 'COUNTRY',
110 'EMAILID',
130 'DEP TYPE : ',
147 'DEP FIRSTNAME',
160 'DEP LASTNAME'.
ULINE.
ENDAT.
WRITE : /02 WA_EMP-PERNR,
15 WA_EMP-NACHN,
25 WA_EMP-VORNA,
35 WA_EMP-PLANS,
65 WA_EMP-STRAS,
80 WA_EMP-PSTLZ,
90 WA_EMP-ORT01,
100 WA_EMP-LAND1,
110 WA_EMP-EMAILID,
137 WA_EMP-FAMSA,
147 WA_EMP-FAVOR,
160 WA_EMP-FANAM.
WRITE : /137 WA_EMP-FAMSA1,
147 WA_EMP-FAVOR1,
160 WA_EMP-FANAM1.
WRITE : /137 WA_EMP-FAMSA2,
147 WA_EMP-FAVOR2,
160 WA_EMP-FANAM2.
WRITE : /137 WA_EMP-FAMSA3,
147 WA_EMP-FAVOR3,
160 WA_EMP-FANAM3.
WRITE : /137 WA_EMP-FAMSA4,
147 WA_EMP-FAVOR4,
160 WA_EMP-FANAM4.
WRITE : /137 WA_EMP-FAMSA5,
147 WA_EMP-FAVOR5,
160 WA_EMP-FANAM5.
WRITE : /137 WA_EMP-FAMSA6,
147 WA_EMP-FAVOR6,
160 WA_EMP-FANAM6.
WRITE : /137 WA_EMP-FAMSA7,
147 WA_EMP-FAVOR7,
160 WA_EMP-FANAM7.
WRITE : /137 WA_EMP-FAMSA8,
147 WA_EMP-FAVOR8,
160 WA_EMP-FANAM8.
WRITE : /137 WA_EMP-FAMSA9,
147 WA_EMP-FAVOR9,
160 WA_EMP-FANAM9.
WRITE : /137 WA_EMP-FAMSA10,
147 WA_EMP-FAVOR10,
160 WA_EMP-FANAM10.
WRITE : /137 WA_EMP-FAMSA11,
147 WA_EMP-FAVOR11,
160 WA_EMP-FANAM11.
WRITE : /137 WA_EMP-FAMSA12,
147 WA_EMP-FAVOR12,
160 WA_EMP-FANAM12.
WRITE : /137 WA_EMP-FAMSA13,
147 WA_EMP-FAVOR13,
160 WA_EMP-FANAM13.
WRITE : /137 WA_EMP-FAMSA14,
147 WA_EMP-FAVOR14,
160 WA_EMP-FANAM14.
ULINE.
AT FIRST.
WRITE : /45 'TEMPORARY ADDRESS : ',
65 'STREET',
87 'POSTALCODE',
100 'CITY',
120 'COUNTRY'.
ULINE.
ENDAT.
WRITE : /65 WA_EMP-STRAS1,
87 WA_EMP-PSTLZ1,
100 WA_EMP-ORT011,
120 WA_EMP-LAND11.
ENDLOOP.
ENDFORM. " DISPLAY_DATA
Thanks & Regards
Jerry
Code Formatted by: Alvaro Tejada Galindo on Jun 5, 2008 11:36 AMHi Ira , thanks for your help.......... I checked it but still getting the same error as unable to interpret de04 as number....see the below code..........this I am executing for all active employees.....
regards
John
*& Report ZABAP_HR *
REPORT ZABAP_HR .
TABLES : PERNR.
INFOTYPES : 0000, 0001, 0002, 0006, 0105, 0021.
STRUCTURES
TYPES : BEGIN OF TY_EMP,
PERNR(20) TYPE C, "PERSONNEL NO
NACHN TYPE NACHN, "FIRST NAME
VORNA TYPE VORNA, "LAST NAME
ANSSA TYPE ANSSA, "ADDRESS TYPE
STRAS TYPE STRAS, "STREET
PSTLZ TYPE PSTLZ, "POSTAL CODE
ORT01 TYPE ORT01, "CITY
LAND1 TYPE LAND1, "COUNTRY
STRAS1 TYPE STRAS, "STREET
PSTLZ1 TYPE PSTLZ, "POSTAL CODE
ORT011 TYPE ORT01, "CITY
LAND11 TYPE LAND1, "COUNTRY
PLANS TYPE PLANS, "POSITION
EMAILID TYPE COMM_ID_LONG, "EMAIL ID
FAMSA TYPE FAMSA, "DEPENDENT TYPE
FAVOR TYPE FAVOR, "FIRST NAME
FANAM TYPE PAD_NACHN, "LAST NAME
FAMSA1 TYPE FAMSA, "DEPENDENT TYPE
FAVOR1 TYPE FAVOR, "FIRST NAME
FANAM1 TYPE PAD_NACHN, "LAST NAME
FAMSA2 TYPE FAMSA, "DEPENDENT TYPE
FAVOR2 TYPE FAVOR, "FIRST NAME
FANAM2 TYPE PAD_NACHN, "LAST NAME
FAMSA3 TYPE FAMSA, "DEPENDENT TYPE
FAVOR3 TYPE FAVOR, "FIRST NAME
FANAM3 TYPE PAD_NACHN, "LAST NAME
FAMSA4 TYPE FAMSA, "DEPENDENT TYPE
FAVOR4 TYPE FAVOR, "FIRST NAME
FANAM4 TYPE PAD_NACHN, "LAST NAME
FAMSA5 TYPE FAMSA, "DEPENDENT TYPE
FAVOR5 TYPE FAVOR, "FIRST NAME
FANAM5 TYPE PAD_NACHN, "LAST NAME
FAMSA6 TYPE FAMSA, "DEPENDENT TYPE
FAVOR6 TYPE FAVOR, "FIRST NAME
FANAM6 TYPE PAD_NACHN, "LAST NAME
FAMSA7 TYPE FAMSA, "DEPENDENT TYPE
FAVOR7 TYPE FAVOR, "FIRST NAME
FANAM7 TYPE PAD_NACHN, "LAST NAME
FAMSA8 TYPE FAMSA, "DEPENDENT TYPE
FAVOR8 TYPE FAVOR, "FIRST NAME
FANAM8 TYPE PAD_NACHN, "LAST NAME
FAMSA9 TYPE FAMSA, "DEPENDENT TYPE
FAVOR9 TYPE FAVOR, "FIRST NAME
FANAM9 TYPE PAD_NACHN, "LAST NAME
FAMSA10 TYPE FAMSA, "DEPENDENT TYPE
FAVOR10 TYPE FAVOR, "FIRST NAME
FANAM10 TYPE PAD_NACHN, "LAST NAME
FAMSA11 TYPE FAMSA, "DEPENDENT TYPE
FAVOR11 TYPE FAVOR, "FIRST NAME
FANAM11 TYPE PAD_NACHN, "LAST NAME
FAMSA12 TYPE FAMSA, "DEPENDENT TYPE
FAVOR12 TYPE FAVOR, "FIRST NAME
FANAM12 TYPE PAD_NACHN, "LAST NAME
FAMSA13 TYPE FAMSA, "DEPENDENT TYPE
FAVOR13 TYPE FAVOR, "FIRST NAME
FANAM13 TYPE PAD_NACHN, "LAST NAME
FAMSA14 TYPE FAMSA, "DEPENDENT TYPE
FAVOR14 TYPE FAVOR, "FIRST NAME
FANAM14 TYPE PAD_NACHN, "LAST NAME
END OF TY_EMP.
INTERNAL TABLES
DATA : IT_EMP TYPE STANDARD TABLE OF TY_EMP.
WORK AREAS
DATA : WA_EMP TYPE TY_EMP.
DATA : N TYPE I.
START-OF-SELECTION
START-OF-SELECTION.
GET PERNR.
SUBROUTINE TO FETCH DATA FROM INFOTYPES
PERFORM FETCH_DATA_INFTY.
END-OF-SELECTION.
SUBROUTINE TO DISPLAY DATA
PERFORM DISPLAY_DATA.
*& Form FETCH_DATA_INFTY
text
--> p1 text
<-- p2 text
FORM FETCH_DATA_INFTY .
*PERSONAL DETAILS
RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-PERNR = P0002-PERNR.
WA_EMP-VORNA = P0002-VORNA.
WA_EMP-NACHN = P0002-NACHN.
ENDIF.
*ORGANIZATIONAL DETAILS
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-PLANS = P0001-PLANS.
ENDIF.
*PERMANENT ADDRESS DETAILS
RP_PROVIDE_FROM_LAST P0006 0001 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-STRAS = P0006-STRAS.
WA_EMP-PSTLZ = P0006-PSTLZ.
WA_EMP-ORT01 = P0006-ORT01.
WA_EMP-LAND1 = P0006-LAND1.
ENDIF.
*TEMPORARY ADDRESS DETAILS
RP_PROVIDE_FROM_LAST P0006 0002 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-STRAS1 = P0006-STRAS.
WA_EMP-PSTLZ1 = P0006-PSTLZ.
WA_EMP-ORT011 = P0006-ORT01.
WA_EMP-LAND11 = P0006-LAND1.
ENDIF.
*COMMUNICATION DETAILS
RP_PROVIDE_FROM_LAST P0105 0010 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-EMAILID = P0105-USRID_LONG.
ENDIF.
*DEPENDANT DETAILS
DATA : ITAB1 TYPE P0021-FAMSA VALUE 'DE01'.
DATA : ITAB(4) TYPE C .
MOVE ITAB1 TO ITAB.
RP_PROVIDE_FROM_LAST P0021 0001 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA = P0021-FAMSA.
WA_EMP-FAVOR = P0021-FAVOR.
WA_EMP-FANAM = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0002 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA1 = P0021-FAMSA.
WA_EMP-FAVOR1 = P0021-FAVOR.
WA_EMP-FANAM1 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0003 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA2 = P0021-FAMSA.
WA_EMP-FAVOR2 = P0021-FAVOR.
WA_EMP-FANAM2 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0004 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA3 = P0021-FAMSA.
WA_EMP-FAVOR3 = P0021-FAVOR.
WA_EMP-FANAM3 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0005 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA4 = P0021-FAMSA.
WA_EMP-FAVOR4 = P0021-FAVOR.
WA_EMP-FANAM4 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0006 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA5 = P0021-FAMSA.
WA_EMP-FAVOR5 = P0021-FAVOR.
WA_EMP-FANAM5 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0007 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA6 = P0021-FAMSA.
WA_EMP-FAVOR6 = P0021-FAVOR.
WA_EMP-FANAM6 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0008 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA7 = P0021-FAMSA.
WA_EMP-FAVOR7 = P0021-FAVOR.
WA_EMP-FANAM7 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0009 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA8 = P0021-FAMSA.
WA_EMP-FAVOR8 = P0021-FAVOR.
WA_EMP-FANAM8 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0010 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA9 = P0021-FAMSA.
WA_EMP-FAVOR9 = P0021-FAVOR.
WA_EMP-FANAM9 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0011 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA10 = P0021-FAMSA.
WA_EMP-FAVOR10 = P0021-FAVOR.
WA_EMP-FANAM10 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0012 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA11 = P0021-FAMSA.
WA_EMP-FAVOR11 = P0021-FAVOR.
WA_EMP-FANAM11 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0013 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA12 = P0021-FAMSA.
WA_EMP-FAVOR12 = P0021-FAVOR.
WA_EMP-FANAM12 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 0014 PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA13 = P0021-FAMSA.
WA_EMP-FAVOR13 = P0021-FAVOR.
WA_EMP-FANAM13 = P0021-FANAM.
ENDIF.
RP_PROVIDE_FROM_LAST P0021 ITAB PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WA_EMP-FAMSA14 = P0021-FAMSA.
WA_EMP-FAVOR14 = P0021-FAVOR.
WA_EMP-FANAM14 = P0021-FANAM.
ENDIF.
APPEND WA_EMP TO IT_EMP.
CLEAR WA_EMP.
ENDFORM. " FETCH_DATA_INFTY
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM DISPLAY_DATA .
LOOP AT IT_EMP INTO WA_EMP.
AT FIRST.
WRITE : /02 'PERSONNELNO',
15 'FIRSTNAME',
25 'LASTNAME',
35 'POSITION',
45 'PERMANENT ADDRESS : ',
65 'STREET',
80 'POSTALCODE',
93 'CITY',
100 'COUNTRY',
110 'EMAILID',
130 'DEP TYPE : ',
147 'DEP FIRSTNAME',
160 'DEP LASTNAME'.
ULINE.
ENDAT.
WRITE : /02 WA_EMP-PERNR,
15 WA_EMP-NACHN,
25 WA_EMP-VORNA,
35 WA_EMP-PLANS,
65 WA_EMP-STRAS,
80 WA_EMP-PSTLZ,
90 WA_EMP-ORT01,
100 WA_EMP-LAND1,
110 WA_EMP-EMAILID,
137 WA_EMP-FAMSA,
147 WA_EMP-FAVOR,
160 WA_EMP-FANAM.
WRITE : /137 WA_EMP-FAMSA1,
147 WA_EMP-FAVOR1,
160 WA_EMP-FANAM1.
WRITE : /137 WA_EMP-FAMSA2,
147 WA_EMP-FAVOR2,
160 WA_EMP-FANAM2.
WRITE : /137 WA_EMP-FAMSA3,
147 WA_EMP-FAVOR3,
160 WA_EMP-FANAM3.
WRITE : /137 WA_EMP-FAMSA4,
147 WA_EMP-FAVOR4,
160 WA_EMP-FANAM4.
WRITE : /137 WA_EMP-FAMSA5,
147 WA_EMP-FAVOR5,
160 WA_EMP-FANAM5.
WRITE : /137 WA_EMP-FAMSA6,
147 WA_EMP-FAVOR6,
160 WA_EMP-FANAM6.
WRITE : /137 WA_EMP-FAMSA7,
147 WA_EMP-FAVOR7,
160 WA_EMP-FANAM7.
WRITE : /137 WA_EMP-FAMSA8,
147 WA_EMP-FAVOR8,
160 WA_EMP-FANAM8.
WRITE : /137 WA_EMP-FAMSA9,
147 WA_EMP-FAVOR9,
160 WA_EMP-FANAM9.
WRITE : /137 WA_EMP-FAMSA10,
147 WA_EMP-FAVOR10,
160 WA_EMP-FANAM10.
WRITE : /137 WA_EMP-FAMSA11,
147 WA_EMP-FAVOR11,
160 WA_EMP-FANAM11.
WRITE : /137 WA_EMP-FAMSA12,
147 WA_EMP-FAVOR12,
160 WA_EMP-FANAM12.
WRITE : /137 WA_EMP-FAMSA13,
147 WA_EMP-FAVOR13,
160 WA_EMP-FANAM13.
WRITE : /137 WA_EMP-FAMSA14,
147 WA_EMP-FAVOR14,
160 WA_EMP-FANAM14.
ULINE.
AT FIRST.
WRITE : /45 'TEMPORARY ADDRESS : ',
65 'STREET',
87 'POSTALCODE',
100 'CITY',
120 'COUNTRY'.
ULINE.
ENDAT.
WRITE : /65 WA_EMP-STRAS1,
87 WA_EMP-PSTLZ1,
100 WA_EMP-ORT011,
120 WA_EMP-LAND11.
ENDLOOP.
ENDFORM. " DISPLAY_DATA -
Note 1054952 - Singapore Family Dependant scenario: Deletion is not working
Hi,
As per SAP 1054952, Solution below describes about Correction in FPM configuration.
Please confirm if i have to check, the correction in FPM configuration will i require Self-Service Administration (SSA) Business Package deployed on portal or there is some other procedure as well?
Heading 1: h2.*Solution:
Dispatch event associated with 'Delete' was not correct. Correction is done in FPM configuration of singapore Family Dependants scenario.*
Thanks,
SJThanks Suresh,
Yes, I agree the Note has specification about SP 10,
Currently Portal is at SP 14 and the issue is still appearing.
A OSS have been raised and as per OSS updated, we have been recommended to check if the changes have been taken place?
Currently we donu2019t have SSA deployed on Portal, before asking Basis team to deploy SSA BP, I want to confirm if I will need SSA BP to check the changed mentioned in SAP Note 1054952 or it can be check by some other mean?
Regards,
SJ -
Hi,
1. May I know if there is a country specific (Singapore) ESS for Update Family/Dependent (ITS version) ?
2. If there is, how do I call it, i.e what is the corresponding transaction (I intend to call via https://its../scripts/wgate/<transaction code>/!) ?
3. How to control which field to hide/display on ESS ? Is it via the view V_T588M_ESS ? I am not sure the function group/workarea to input.
Many thanks in advance.
Regards
Kir ChernHi Kir,
1. For Singapore it's 25.
2. Transaction for FAmily/dependant persons is <b>PZ12 </b>.
3. The function group for the abve is <b>EHR6</b>
This contains 2 function modules, one for List and one for detailed display.
After making necessary modifications you have to assign
the fn module in the View <b>T77WWW_SC</b>.
PZ12 2 25 HR_ESS_FAMMEMBERSGDETAIL_25 X
PZ12 2 25 HR_ESS_FAMMEMBERDETAIL_25 X
Hope it helps.
Rgds,
Jayvee. -
Implementing DAO Pattern in ABAP
This discussion implement DAO pattern asked the question of how to develop a DAO pattern in ABAP but i'd like to go a little deeper.
The only answer given suggested the following design pattern:
I don't have an coded example here, but isn't it sufficient for this pattern to build an interface with some get- and set-methods? This interface can be implemented by several classes with different data retrieval logic. Then a static factory-method could do the job to decide during runtime which actual class is instantiated, returning the interface.
Can anyone give an abstract description of this implementation relative to an SAP module (How would one approach this implementation in MM, PM, FICO, HR)
Can anyone see any issues in this design?
Can anyone provide an alternate design?
Are we missing any steps?
Together we can build a solid abap DAO everyone can use.I started to read about DAO pattern some days ago and found this great blog post:
ABAP Unit Tests without database dependency - DAO concept
I am starting to implement unit test in my developments and DAO pattern seems to be a clever choice.
Regards,
Felipe -
Webdynpro ABAP or Webdynpro Java?
Hello experts.
I want to learn to develop WebDynpro's
Do you which of the two tools do you recommend? webdynpro java or webdynpro abap.
GreetingsHi Lupe ,
Although both technologies have same functionalities but even then they are not identical.
Following are some of the differences:
Language :- First difference is the programming language used as the names Webdynpro ABAP and Webdynpro JAVA reflect. In ABAP Webdynpro, along with ABAP coding, RFCu2019s are also supported via Service call. Unlike Webdynpro ABAP, we cannot do ABAP coding in Webdynpro JAVA. Instead RFCu2019s and Web services are created and used in it to serve this purpose. In addition to Web services and adaptive RFC, Java Beans is another model supported by Webdynpro JAVA.
Design Time Environment :- Webdynpro ABAP requires ABAP Workbench (SE80) while SAP Netweaver Developer Studio is necessary for designing Webdynpro JAVA applications. So, additional installation is required. This studio reduces the development effort and utilizes some visual tools for creating components which can be reused.
Storage :- Applications developed using Webdynpro ABAP are stored centrally in ABAP server whereas in case of Webdynpro JAVA, the code remains on the client machine that is developed using a tool called Netweaver Developer studio. So, due to the powerful version control system of Webdynpro ABAP, the load removes from the development machine which is not possible in case of Webdynpro JAVA.
Skills Required :- For Webdynpro ABAP, a developer should have knowledge of ABAP programming, Development tools, Database concepts, ABAP Objects. However, Webdynpro JAVA requires skill set comprising java programming, java development tools and object-oriented concept.
Performance:- Large scale applications that involve large number of web users canu2019t work well on ABAP server. So, for robust and scalable applications, Webdynpro JAVA is preferred because of powerful J2EE server as proved by Sun Microsystems. However, small-scale or applications involving small or medium users can go well with Webdynpro ABAP. Thus, performance varies depending on the number of web users and one can choose ABAP or JAVA accordingly.
So the decession is that its totaly based on your available skillsets and your scenario to be implemented.
Thanks & Regards,
Monishankar C -
CRM ABAP development and interaction with SAP R/3
Hi Experts,
I am an ABAPer and have close to 3 years of development experience in ABAP, now i was trying to understand how exactly a CRM system is intergrated with SAP R/3 . Below are few of the basic question i have
1. How does R/3 interact with CRM, searching in the forum i just got to know its through RFC . Can anyone give me specific technical details like how R/3 and CRM interact in a real time scenario .
2. Ca any one also give me an real time development example that was done in CRM to interact with SAP R/3 and explain me the basic steps involved in it, this might give me clear picture of how developments happen in CRM and also how CRM and SAP interacts with each other .
Your quick response would be greatly appreciated .
Regard's
Sudheer Vwith repect to programming , it is similar to R/3 ABAP devlopment . It all depends on scenarios:
1) For eaxmple we use BADI's to put some extra validations / additional data when you are creation order
2) unlike R/3 where we use SAP GUI trnsactions for creating orders, in CRM we have IC web client techonolgy where we can create orders through web.This is based on BSP technology. In order to add additinal fields on the screen for we use easy enhancment workbench tool(EEWB).this is something new in CRM when compared to R/3. -
Workflow - Family dependents, personal data
Hi All,
We are implementing ESS/MSS on ERP 6.0 and EP 7.0 with EhP4 and ESS 603 patch for India country grouping.
We have a requirement of encorporating z-workflow template to the standard ESS application whenever employee add/change/delete family dependents using family dependent application and personal data as well using Personal data application.
Once we have done with the z-workflow template creation, where we need to attach the events of the z-workflow to standard ESS application ? Can we attach these events to the standard RFC's used for updating family dependents and personal data ?
NWDI is required to accomplish this task ? Kindly suggest the best practises.
Regards,
Anil kumar.>
Anil Kumar Venkatappa wrote:
> So, based on this standard BOR (Family) which has various events for insert, delete and change operations we need to trigger the corresponding workflow. Henceforth, records can be updated for respective employee after the approval process.
What approval process? Maybe you should outline your required process once more.
>
Anil Kumar Venkatappa wrote:
> My question would be...the same events (CREATED, CHANGED, DELETED) are being called in front end WD Java using the RFC (HR_EVENT_RULES_PA0021) ?
Yes. Just try it. Execute the service and check transaction SWEL to see the called Events.
>
Anil Kumar Venkatappa wrote:
> Moreover, we not touching frontend source code using NWDI due to timelines and other restrictions. Is it really required to modify the code to achive above operations ?
No Java Code needs to be touched
>
Anil Kumar Venkatappa wrote:
> And how about locking the infotype records during the approval stage ? Please share your experiences. Once again thanks for your time.
So your requirenment is, that employees when editing their family data, they should just write locked infotype records? And your post-processing workflow is about unlocking the locked records once its approved?
Please take a look at BAdI HRPAD00INFTYUI. This BAdI is called during the Input and Output Conversion. The Infotypes you can edit from the ESS Services are so called "Decoupled Infotpes". Which means the Business Logik is decoupled from the UI. With so called "Converting Classes" the mapping between UI and Backend data is done each time you call such an application. So what you have to do here is, once the INPUT_CONVERSION is processed, you have to set the LOCKED-Value of the current processed infotype record.
I hope this helps,
regards,
Markus -
Employee has a family tie to another employee
Is it possible to record in SAP HR where an employee has a family tie to another employee? Corporate policy at my company is that there should be no direct line relationships, so a wife cannot report into her husband. Whilst at the point of recruitment we would most certainly ensure that this did not happen, years down the line as people move in the organisation, where the connection is less obvious it may be forgotten. This could be the case for example with sisters u2013 different surnames, cousins etc.
I'm thinking that I can create some additional fields on IT21 to indicate if the related person is an employee and perhaps include their PERNR, manager's name and org unit.
has anyone else had this requirement and if so, what was your solution?
Thanks TanyaHi
Certainly have not come across this requirement before, but have come across several funny ones, so this doesn't appear to be very strange.
I guess the only way is what you have already identified. Use IT0021 to store all family/dependent info details, and if any of them work in the same company, either use an existing field or enhance it with a new field to store the personnel number of the relative.
Depending on how you do the recruitment in the system, either have some reports run everytime you process someone through it, or some online checks using user eixts etc.
Hope this helps. -
Hi Experts..
I would like to know how to create a databases in SQL and have access from ABAP.. to Modify, Consult and do the basic operations like insert information, drop and modify in the respective tables.
I'm ussing MiniSap Minigui 6.2 on Windows XP and the BCUSER
Thank you very much for your help
REGARDSHI Araceli,
Database Access using Advanced Business Application Programming (ABAP)
Basics :
Accessing the Database in the R/3 System is performed through the interface provided by the SAP System, which in the SAP System is referred to as the Database Interface. A user can access the database from his/her program through Open SQL and Native SQL depending upon the circumstances.
About SQL
The Structured Query Language (SQL) is a largely standardized language, which is used for accessing relational databases. It can be divided as follows:
Data Manipulation Language (DML)
These statements are for reading and changing data in database tables.
Data Definition Language (DDL)
These statements are for creating and administering database tables.
Data Control Language (DCL)
These statements are used for authorization and consistency checks.
So each database has a programming interface. This programming interface allows the user to access the database tables by using SQL statements. But, these SQL statements in the programming interfaces are not fully standardized. So, you must refer to the documentation of that system for a list of the SQL statements available and also their correct syntax in order to access a specific database system.
Interface thru data base
Each work process on an application server must have a database interface if you want to make the R/3 system independent of the database system, and also to use it correctly despite the differences in the SQL syntax between various databases. By means of this interface only, the R/3 system can communicate with the database. All of the database requests from the R/3 system are converted into the correct Standard SQL statements for the database system by the database interface. In order to perform this function, it has to use a database-specific component, which shields the differences between database systems from the rest of the database interface. You have to choose the appropriate layer when installing the R/3 system. A user can access a database from a program through Open SQL and Native SQL.
Open SQL
Open SQL are statements that make up a subset of Standard SQL which is fully integrated in ABAP. Open SQL consists of Data Manipulation Language (DML) which is a part of Standard SQL.
One of the ways to access the database from a program is Open SQL. These Open SQL statements are nothing but a subset of Standard SQL, which is fully integrated in ABAP. Irrespective of which database system the R/3 installation is using, they allow you to access data. When I said that, Open SQL consists of the Data Manipulation Language (DML). I meant that it allows you to read (i.e. to SELECT) and change (For example to INSERT, UPDATE, DELETE) data.
Moreover, Open SQL also goes beyond Standard SQL. This is to provide statements that can simplify or speed up database access in conjunction with other ABAP constructions. Apart from that, it also gives you the freedom to buffer certain tables on the application server, thereby enabling you to save excessive database access. In this case, the database interface is responsible for comparing the buffer with the database. As far as buffer storage is concerned, they may be stored in two parts: the working memory of the current work process, and the shared memory for all work processes on an application server. The data in the various buffers is synchronized at set intervals by buffer management where an R/3 system is distributed across more than one application server. It should be noted that data in the buffer is not always up to date when you are buffering the database. That is why you should only use the buffer for data which does not change often. You can specify whether a table can be buffered in its definition in the ABAP Dictionary.
Open SQL consists of a set of ABAP statements. These statements perform operations on the central database in the R/3 system. The results of the operations and any error messages which come out of it are independent of the current database system. Thus, uniform syntax and semantics for all of the database systems supported by SAP is provided by Open SQL. Regardless of the current database system, the ABAP programs, which use Open SQL statements only, will work in any R/3 system. Moreover, Open SQL statements work only with database tables that have been created in the ABAP Dictionary.
You have the freedom to combine columns belonging to different database tables to a database view (or view for short) in the ABAP Dictionary. Views are also handled in exactly the same way as database tables in Open SQL statements.
Some Open SQL keywords are as follows:
SELECT - It reads data from database tables.
INSERT - It adds rows to database tables.
UPDATE - It changes the contents of rows of database tables.
MODIFY - It inserts rows into database tables or changes the content of existing rows.
DELETE - It deletes rows from database tables.
OPEN CURSOR, FETCH, CLOSE CURSOR - It reads rows of database tables using the cursor.
Return Codes
The following two system fields are filled with return codes by all Open SQL statements:
SY-SUBRC: The system field SY -SUBRC contains the value 0 after every Open SQL statement if the operation was successful. When a value is other than 0, then it is unsuccessful.
SY-DBCNT: The system field SY-DBCNT contains the number of database lines processed after an open SQL statement.
Native SQL
The other possible way to access the database from a program is Native SQL. It is only loosely integrated into ABAP. It allows access to all of the functions contained in the programming interface of the respective database system. Native SQL statements are not checked and converted as compared to Open SQL statements. Unlike Open SQL, these are sent directly to the database system. The function of the database-dependent layer remains minimal when you use Native SQL. The Programs which use Native SQL are written specifically for a database system. You should avoid using Native SQL wherever possible when writing R/3 applications. However, you can use it in some parts of the R/3 Basis System, for instance, for creating or changing table definitions in the ABAP Dictionary.
Regardless of the database platform that your R/3 system is using, Open SQL allows you to access database tables, which are declared in the ABAP Dictionary. Native SQL allows you to use database specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary. Aside from that, you can also integrate data that is not part of the R/3 system.
As a rule, an ABAP program that contains database-specific SQL statements will not run under different database systems. You have to use Open SQL statements only, if your program is used on more than one database platform.
You must proceed with the EXEC SQL statement, and follow the ENDEXEC statement to use a: Native SQL statement. For example
Listing 1
EXEC SQL [PERFORMING
ENDEXEC.There is no period after Native SQL statements. Also, using quotation marks (") or an asterisk (*) at the beginning of a native SQL statement's line does not introduce a comment as it would in normal ABAP syntax. You need to know if the table and field names are case-sensitive in your chosen database.
The data is transported between the database table and the ABAP program using host variables in Native SQL statements. These are preceded in a Native SQL statement by a colon ( and are declared in the ABAP program. The elementary structures can be used as host variables. The structures of an INTO clause are treated exceptionally, as though all of their fields are listed individually. If the selection in a Native SQL SELECT statement is a table, then you can pass it to ABAP line by line using the PERFORMING addition. For each line read, the program calls a subroutine
. Further, you can process the data within the subroutine.
After the ENDEXEC statement, SY-DBCNT contains the number of lines processed as it does in Open SQL. In almost all cases, SY-SUBRC contains the value a after the ENDEXEC statement. Cursor operations form an exception: after FETCH, SY-SUBRC is 4 if no more records could be read. This is also applied when you read a result set using EXEC SQL PERFORMING.
Native SQL Scope
Native SQL is very important as it allows you to execute nearly all available statements through the SQL programming interface (usually known as SQL Call Interface or similar) for directly executing SQL program code (using EXEC IMMEDIATE or a similar command). The statements that are not supported are listed in the following section:
· Native SQL and the Database Interface,
· Native SQL and Transactions
· Native SQL and the Database Interface
Native SQL statements bypass the R/3 database interface. With the database buffer on the application server, there is no table logging, and no synchronization. Therefore, you should use Open SQL to change database tables declare in the ABAP dictionary wherever possible. Since the columns contain extra database specific length information for the column tables declared in the ABAP dictionary, containing long columns with the type LCHAR or LRAW should only be addressed using Open SQL. Native SQL may not produce the correct result, as it does not take this information into account. Native SQL does not support automatic client handling. Instead, you must treat a client field like any other field
Native SQL and Transactions
One should not use any transaction control statement such as COMMIT, ROLLBACK WORK, or any statements that set transaction parameters using Native SQL to ensure that transaction in the R/3 System are consistent.
ABAP Dictionary
The ABAP Dictionary is nothing but a part of the ABAP Workbench. It allows you to create and administer database tables. There are no statements from the DDL part of Standard SQL in Open SQL. It should be noted that normal application programs should not create or change their own database tables.
To create and change database tables, the ABAP Dictionary has to use the DDL part of Open SQL. Besides this, it also administers the ABAP Dictionary in the database. In addition, the ABAP Dictionary contains meta-descriptions of all database tables in the R/3 system. Here, only database tables appears in the Dictionary, which you have created using the ABAP Dictionary. Open SQL statements can only access tables, which exists in the ABAP Dictionary.
Authorization and Consistency Checks
With regard to authorization and consistency checks, the DCL part of Standard SQL is not used in R/3 programs. Whereas, the work processes which are within the R/3 system are logged into the database system as users with full rights. By using the R/3 authorization concept, the authorizations of programs or users to read or change database tables is administered within the R/3 system. In addition, transactions must equally ensure their own data consistency using the R/3 locking concept.
The R/3 lock concept allows you to monitor your system with regards to lock logics. The R/3 lock concept works closely together with the R/3 updates.
As an example, say that a travel agent wants to book a flight for a customer who wants to fly to a particular city with a certain airline on a certain day. If there are still available seats on the flight, then the booking will be possible, otherwise it will lead to overbooking. Hence, the database entry corresponding to the flight must be locked against access from other transactions to avoid the possibility of overbooking. This is because two agents might both be doing this same thing at the same time, and we need to make sure that we don't overbook.
Lock Mechanisms
When the database system receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program, it automatically sets database locks. Database locks are locks on the database entries affected by statements to prevent problems. Since the lock mechanism uses a, lock flag in the entry, you can only set a lock for an existing database entry. After each database commit, these flags are automatically deleted. This means that database locks can never be set for longer than a single database LUW, a single dialog step in an R/3 application program.
Therefore, physical locks in the database system are insufficient for the requirements of an R/3 transaction. Locks in the R/3 system must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and application servers. As a result, each lock must apply on all servers in that R/3 system.
Database Accesses of the NetWeaver AS ABAP
The NetWeaver AS ABAP stores long-term data in a central relational database table. In a relational database model, the real world is represented by tables. A table is a two-dimensional matrix, consisting of lines and columns (fields). The smallest possible combination of fields that can uniquely identify each line of the table is called the key. Each table must have at least one key, and each table has one key that is defined as its primary key. Relationships between tables are represented by foreign keys.
Standard SQL
SQL (Structured Query Language) is a largely standardized language for accessing relational databases. It can be divided into three areas:
· Data Manipulation Language (DML)
Statements for reading and changing data in database tables.
· Data Definition Language (DDL)
Statements for creating and administering database tables.
· Data Control Language (DCL)
Statements for authorization and consistency checks.
Each database has a programming interface that allows you to access the database tables using SQL statements. The SQL statements in these programming interfaces are not fully standardized. To access a specific database system, you must refer to the documentation of that system for a list of the SQL statements available and their correct syntax.
The Database Interface
To avoid incompatible situations between different database tables and to make the NetWeaver AS ABAP system independent of the database system in use, each work process on an ABAP application server contains a database interface. The NW AS communicates with the database solely through the database interface. The database interface converts all of the database requests from the NW AS into the correct Standard SQL statements for the database system in use. To do this, it uses a database-specific component that shields the differences between database systems from the rest of the database interface. You choose the this component when you install NetWeaver AS ABAP in accordance with the database in use.
ABAP programs have two options for accessing the database interface: Open SQL and Native SQL.
Open SQL
Open SQL statements are a fully integrated subset of Standard SQL within ABAP. They enable the ABAP programs to access data irrespective of the database system installed. Open SQL consists of the Data Manipulation Language (DML) part of Standard SQL; in other words, it allows you to read (SELECT) and change (INSERT, UPDATE, DELETE) data.
Open SQL also goes beyond Standard SQL to provide statements that, in conjunction with other ABAP constructions, can simplify or speed up database access. It also allows you to buffer certain tables on the application server, saving excessive database access. In this case, the database interface is responsible for comparing the buffer with the database. Buffers are partly stored in the working memory of the current work process, and partly in the shared memory for all work processes on an application server. In SAP systems that are distributed across more than one application server, the data in the various buffers is synchronized at set intervals by buffer management. When buffering the database, you must remember that data in the buffer is not always up to date. For this reason, you should only use the buffer for data which does not often change. You specify whether a table can be buffered in its definition in the ABAP Dictionary.
Native SQL
Native SQL is only loosely integrated into ABAP, and allows access to all of the functions contained in the programming interface of the respective database system. Unlike Open SQL statements, Native SQL statements are not checked and converted, but instead are sent directly to the database system. When you use Native SQL, the function of the database-dependent layer is minimal. Programs that use Native SQL are specific to the database system for which they were written. When developing generally valid ABAP applications, you should as far as possible avoid using Native SQL. In some components of the SAP System, Native SQL is used for example, in the ABAP Dictionary for creating or changing tables.
The ABAP Dictionary
The ABAP Dictionary, part of the ABAP Workbench, allows you to create and administer database tables. Open SQL contains no statements from the DDL part of Standard SQL. Normal application programs should not create or change their own database tables.
The ABAP Dictionary uses the DDL part of Open SQL to create and change database tables. It also administers the ABAP Dictionary in the database. The ABAP Dictionary contains meta descriptions of all database tables in the NetWeaver AS ABAP system. Only database tables that you create using the ABAP Dictionary appear in the Dictionary. Open SQL statements can only access tables that exist in the ABAP Dictionary.
Authorization and Consistency Checks
The DCL part of Standard SQL is not important in ABAP programs. The work processes within the ABAP application server are logged on to the database system as users with full authorization. The authorizations of programs or program users to read or change database tables is managed by the authorization concept. Equally, transactions must ensure their own data consistency in the database using the SAP locking concept. For more information, refer to the chapter Data Consistency.
Work Processes
Work processes execute the individual dialog steps of ABAP application programs. They are components of ABAP application servers. The next two sections describe firstly the structure of a work process, and secondly the different types of work process in NetWeaver AS ABAP.
Structure of a Work Process
The following diagram shows the components of a work process:
Screen Processor
In ABAP application programming, there is a difference between user interaction and processing logic. From a programming point of view, user interaction is controlled by screens. As well as the actual input mask, a screen also consists of flow logic, which controls a large part of the user interaction. NetWeaver AS ABAP contains a special language for programming screen flow logic. The screen processor executes the screen flow logic. Via the dispatcher, it takes over the responsibility for communication between the work process and the SAPgui, calls modules in the flow logic, and ensures that the field contents are transferred from the screen to the flow logic.
ABAP Processor
The actual processing logic of an application program is written in ABAP - SAPs own programming language. The ABAP processor executes the processing logic of the application program, and communicates with the database interface. The screen processor tells the ABAP processor which module of the screen flow logic should be processed next. The following screen illustrates the interaction between the screen and the ABAP processors when an application program is running.
Database Interface
The database interface provides the following services:
· Establishing and terminating connections between the work process and the database.
· Access to database tables
· Access to Repository objects (ABAP programs, screens and so on)
· Access to catalog information (ABAP Dictionary)
· Controlling transactions (commit and rollback handling)
· Table buffer administration on the ABAP application server.
The following diagram shows the individual components of the database interface:
The diagram shows that there are two different ways of accessing databases: Open SQL and Native SQL.
Open SQL statements are a subset of Standard SQL that is fully integrated in ABAP. They allow you to access data irrespective of the database system that your installation is using. Open SQL consists of the Data Manipulation Language (DML) part of Standard SQL; in other words, it allows you to read (SELECT) and change (INSERT, UPDATE, DELETE) data. The tasks of the Data Definition Language (DDL) and Data Control Language (DCL) parts of Standard SQL are performed in NetWeaver AS ABAP by the ABAP Dictionary and the authorization system. These provide a unified range of functions, irrespective of database, and also contain functions beyond those offered by the various database systems.
Open SQL also goes beyond Standard SQL to provide statements that, in conjunction with other ABAP constructions, can simplify or speed up database access. It also allows you to buffer certain tables on the ABAP application server, saving excessive database access. In this case, the database interface is responsible for comparing the buffer with the database. Buffers are partly stored in the working memory of the current work process, and partly in the shared memory for all work processes on an ABAP application server. Where NetWeaver AS ABAP is distributed across more than one ABAP application server, the data in the various buffers is synchronized at set intervals by the buffer management. When buffering the database, you must remember that data in the buffer is not always up to date. For this reason, you should only use the buffer for data which does not often change.
Native SQL is only loosely integrated into ABAP, and allows access to all of the functions contained in the programming interface of the respective database system. In Native SQL, you can primarily use database-specific SQL statements. The Native SQL interface sends them as is to the database system where they are executed. You can use the full SQL language scope of the respective database which makes all programs using Native SQL specific for the database system installed. In addition, there is a small set of SAP-specific Native SQL statements which are handled in a special way by the Native SQL interface. ABAP applications contain as little Native SQL as possible. In fact, it is only used in a few components (for example, to create or change table definitions in the ABAP Dictionary).
The database-dependent layer in the diagram serves to hide the differences between database systems from the rest of the database interface. You choose the appropriate layer when you install NetWeaver AS ABAP. Thanks to the standardization of SQL, the differences in the syntax of statements are very slight. However, the semantics and behavior of the statements have not been fully standardized, and the differences in these areas can be greater. When you use Native SQL, the function of the database-dependent layer is minimal.
Types of Work Process
Before you start NetWeaver AS ABAP, you determine how many work processes each ABAP application server will have, and what their types will be. Since all work processes have the same structure (see preceding section), the type of work process does not determine the technical attrributes of the ABAP application server but the type of tasks to be performed on it. The dispatcher starts the work processes and only assigns them tasks that correspond to their type. This means that you can distribute work process types to optimize the use of the resources on your ABAP application servers.
The following diagram shows again the structure of an ABAP application server, but this time, includes the various possible work process types:
Dialog Work Process
Dialog work processes deal with requests from an active user to execute dialog steps (see also Dialog Programming).
Update Work Process
Update work processes execute database update requests. Update requests are part of an SAP LUW that bundle the database operations resulting from the dialog in a database LUW for processing in the background.
Background Work Process
Background work processes process programs that can be executed without user interaction (background jobs).
Enqueue Work Process
The enqueue work process administers a lock table in the shared memory area. The lock table contains the logical database locks for NetWeaver AS ABAP and is an important part of the SAP LUW concept. In NW AS, you may only have one lock table. You may therefore also only have one ABAP application server with enqueue work processes. Normally, a single enqueue work process is sufficient to perform the required tasks.
Spool Work Process
The spool work process passes sequential datasets to a printer or to optical archiving. Each ABAP application server may contain only one spool work process.
Role of Work Processes
The types of its work processes determine the services that an ABAP application server offers. The application server may, of course, have more than one function. For example, it may be both a dialog server and the enqueue server, if it has several dialog work processes and an enqueue work process.
You can use the system administration functions to switch a work process between dialog and background modes while the system is still running. This allows you, for example, to switch an SAP System between day and night operation, where you have more dialog than background work processes during the day, and the other way around during the night.
thanks
karthik
reward me points if usefull -
Workflow - Family dependents.
Dear experts,
We are implementing ESS/MSS on ERP 6.0 with eph 6 and NWBC
We have a requirement of encorporating z-workflow template to the standard ESS application whenever employee add/change/delete family dependents using family dependent application.
We not want use Processes and forms .
Thanks
Regardshttp://scn.sap.com/thread/1564490 http://scn.sap.com/thread/3351715 Check here, it can be done otherwise, you can use P and F? http://scn.sap.com/community/erp/hcm/employee-self-service/blog/2012/05/29/exciting-enhacements-to-ess-personal-information-scenario-in-enhancement-pack-6
-
Hi all,
Could anybody tell me about client Dependent and client independent ?
ABAP programs , Tables are client Dependent or client independent ?hi,
Client dependent means suppose if you have 2 clients in Development server like 025 and 125 .
Normally all the tables are client dependent tables means first field is MANDT (char 3 type ).
the data available in 025 client is different from client 125 data.
While using selection from these tables also we can restrict data fetch in the program as shown below.
select * into table it_mara
from mara
client specified
where mandt = '025'.
So it fetches data from 025 client only.
By default,only data from the current client is selected (without you having tospecify the client field specifically in the WHERE clause). If you want to select data from several clients, you must use the ...CLIENT SPECIFIED addition in the FROM clause as shown in the above example.
Regds
Sivaparvathi
Please reward points if helpful... -
Hi currently we have 3 i pods, 1 iphone and 1 ipad we are soon to add another another iphone and ipad. Currently the kids ipods run on my account for purchases etc. I am trying to find the best way to set up i cloud and all devices so everyone has their own sign ins to the same i cloud but still have to do purchasing through my account. I have heard of something called family pack does this do what I need?
Any assistance appreciated.Family Pack was a feature of the now-departed MobileMe. It does not exist in the iCloud world.
What do you mean by "their own sign ins to the same i cloud"?
How you will want to set up a set of iCloud and iTunes accounts for your family depends on what you want to accomplish and how you use the devices.
Example questions:
Does each kid have a different iPod, or do/will they share them?
Similarly, does each current and future iPhone and iPad have a single user?
Do some or all of you need to share calendars? Contacts? Email?
One common model for a family is for each family member to have a dedicated iCloud account on one or more personal (dedicated) devices(s) for mail, calendars, and contacts. They might well still use one common iTunes account for purchases; either everybody knows the password or maybe only the adults can do purchases. Sharing calendars, if needed, would be done with explicit sharing mechanisms. -
Hi folks,
Its basically a HR ABAP report.
i hav a table having 2 fields .
family dependant type is the fst field and subtype is another field.
suppose 03 ---> signifies dependant type child.
01 ---> spouse
14....
like this we hav other types too.
A subtype means for a particular person there may be n numbers of dependant types.
i.e if a person has 2 children then subtype for both of them is '2'.
so i hav to calculate the no of dependant type and and check using subtypes how many same dependants r there and add them up all and get
total no of dependants.
so my problem is i hav to write a logic to the no of family dependants for a particluar person.
help me plz....
thanking u all.
regards,
sahaklaHi,
Have u tried out using Infotype 0021 (Family)? U will get the dependents info for a employee with this infotype. Try u query this table PA0021 to fullfill ur logic.
Reward of helpful.
Rgds,
CK -
Hi All,
1.How to get editable fields in ALV and also how to do the interactive reporting in ALV.
2. How to handle table control in BDC. Pls explain me in details.
Thanks in Advance.
Regards,
Ramana Prasad.hi,
<a href="/people/community.user/blog/2007/01/10/displaychange-mode-of-editable-fields-in-alv-using-function-modules-but-not-custom-containers ALV</a>
<a href="http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm">Table Control in BDC</a>
<b>Interactive ALV Report code</b>
REPORT ZMK_SHIPMENT_ALV
no standard page heading
line-size 105
line-count 50(5)
message-id zz.
TABLES *
tables : vttk, "Shipment Header
vttp, " Shipment Item
lips. " Delivary Item
***TYPE-POOLS *
type-pools : slis.
*WORK AREAS *
Work area for field catalog table
data : wa_fldcat type slis_fieldcat_alv.
Work area for Events table
data : wa_events type slis_alv_event.
Work area for layout.
data : wa_layout type slis_layout_alv.
*INTERNAL TABLES *
Shimpment Details
data : begin of itab occurs 0,
tknum like vttk-tknum,
shtyp like vttk-shtyp,
tpnum like vttp-tpnum,
vbeln like vttp-vbeln,
end of itab.
data : begin of itab1 occurs 0,
vbeln like lips-vbeln,
posnr like lips-posnr,
matnr like lips-matnr,
lfimg like lips-lfimg,
meins like lips-meins,
end of itab1.
For field catalog table
data : it_fldcats type slis_t_fieldcat_alv.
For Events table
data : it_event type slis_t_event.
For layout.
data : it_layout type slis_layout_alv.
For field catalog table
data : it_fldcats1 type slis_t_fieldcat_alv.
For Events table
data : it_event1 type slis_t_event.
data : v_repid like sy-repid.
*Data Declaration
data: v_index type sy-index,
v_vbeln like lips-vbeln.
*SELECT-OPTIONS
selection-screen begin of block b with frame title text-001.
select-options : s_tknum for vttk-tknum .
selection-screen end of block b.
*INITIALIZATION
initialization.
v_repid = sy-repid.
*START-OF-SELCTION
start-of-selection.
perform populate-data.
sort itab by tknum.
top-of-page.
write : 'Shipment wise Delivary Report'.
end-of-selection.
perform build-fieldcatalog.
perform modify-fieldcatalog.
perform build-events.
perform modify-events.
perform set-layout.
perform set-pfstatus.
perform list-display.
*& Form populate-data
Retrives the Shipment data depending on the selection criteria *
FORM populate-data.
select vttk~tknum
vttk~shtyp
vttp~tpnum
vttp~vbeln
into table itab
from vttk
join vttp
on vttptknum = vttktknum
where vttk~tknum in s_tknum.
if sy-subrc <> 0.
message e999 with 'NO DATA FOUND'.
exit.
endif.
ENDFORM. " populate-data
*& Form build-fieldcatalog
text
--> p1 text
<-- p2 text
form build-fieldcatalog.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
changing
ct_fieldcat = it_fldcats
exceptions
inconsistent_interface = 1
program_error = 2
others = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " BUILD-FIELDCATALOG
*& Form build-events
text
--> p1 text
<-- p2 text
FORM build-events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = it_event
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.
ENDFORM. " build-events
*& Form set-layout
text
--> p1 text
<-- p2 text
FORM set-layout.
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-no_colhead = space.
wa_layout-no_vline = space.
ENDFORM. " set-layout
*& Form list-display
text
--> p1 text
<-- p2 text
FORM list-display.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fldcats
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = it_event
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab
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.
ENDFORM. " list-display
*& Form modify-fieldcatalog
text
--> p1 text
<-- p2 text
FORM modify-fieldcatalog.
loop at it_fldcats into wa_fldcat.
case wa_fldcat-fieldname.
when 'TKNUM'.
wa_fldcat-seltext_l = 'Ship No.'.
wa_fldcat-col_pos = 1.
wa_fldcat-ddictxt = 'L'.
when 'SHTYP'.
wa_fldcat-seltext_l = 'Ship Type'.
wa_fldcat-col_pos = 2.
wa_fldcat-ddictxt = 'L'.
when 'TPNUM'.
wa_fldcat-seltext_l = 'Item No.'.
wa_fldcat-col_pos = 3.
wa_fldcat-ddictxt = 'L'.
when 'VBELN'.
wa_fldcat-seltext_l = 'Delivary No.'.
wa_fldcat-hotspot = 'X'.
wa_fldcat-col_pos = 4.
wa_fldcat-ddictxt = 'L'.
endcase.
modify it_fldcats from wa_fldcat.
endloop.
ENDFORM. " modify-fieldcatalog
*& Form modify-events
text
--> p1 text
<-- p2 text
form modify-events.
read table it_event with key name =
slis_ev_top_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'HEADER-OF-REPORT'.
modify it_event from wa_events index sy-tabix.
clear wa_events.
endif.
read table it_event with key name =
slis_ev_end_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'FOOTER-OF-REPORT'.
modify it_event from wa_events index sy-tabix.
clear wa_events.
endif.
endform. " modify-events
*& Form HEADER-OF-REPORT
text
--> p1 text
<-- p2 text
FORM HEADER-OF-REPORT.
write : 'Shipment Wise Delivary Report'.
ENDFORM. " HEADER-OF-REPORT
*& Form FOOTER-OF-REPORT
text
--> p1 text
<-- p2 text
FORM FOOTER-OF-REPORT.
write : 'End of Report'.
ENDFORM. " FOOTER-OF-REPORT
*& Form USER_COMMAND
User command for Calling Transaction VT03N, Execute and Refresh
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
V_INDEX = P_SELFIELD-TABINDEX. " holds the selected table index
CASE p_ucomm.
WHEN '&IC1'.
IF p_selfield-fieldname eq 'VBELN'.
perform secondary_list.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND
*& Form secondary_list
text
--> p1 text
<-- p2 text
FORM secondary_list.
perform get_data1.
perform build-fieldcatalog1.
perform modify-fieldcatalog1.
perform build-events1.
perform modify-events1.
perform set-layout.
perform set-pfstatus.
perform list-display1.
ENDFORM. " secondary_list
*& Form build-fieldcatalog1
text
--> p1 text
<-- p2 text
FORM build-fieldcatalog1.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'ITAB1'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
changing
ct_fieldcat = it_fldcats1
exceptions
inconsistent_interface = 1
program_error = 2
others = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " build-fieldcatalog1
*& Form modify-fieldcatalog1
text
--> p1 text
<-- p2 text
FORM modify-fieldcatalog1.
loop at it_fldcats into wa_fldcat.
case wa_fldcat-fieldname.
when 'VBELN'.
wa_fldcat-seltext_l = 'Delivary No.'.
wa_fldcat-col_pos = 1.
wa_fldcat-ddictxt = 'L'.
when 'POSNR'.
wa_fldcat-seltext_l = 'Item No'.
wa_fldcat-col_pos = 2.
wa_fldcat-ddictxt = 'L'.
when 'MATNR'.
wa_fldcat-seltext_l = 'Material'.
wa_fldcat-col_pos = 3.
wa_fldcat-ddictxt = 'L'.
when 'LFIMG'.
wa_fldcat-seltext_l = 'Quantity'.
wa_fldcat-col_pos = 4.
wa_fldcat-ddictxt = 'L'.
when 'MEINS'.
wa_fldcat-seltext_l = 'Unit of Measure'.
wa_fldcat-col_pos = 5.
wa_fldcat-ddictxt = 'L'.
endcase.
modify it_fldcats from wa_fldcat.
endloop.
ENDFORM. " modify-fieldcatalog1
*& Form build-events1
text
--> p1 text
<-- p2 text
FORM build-events1.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = it_event1
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.
ENDFORM. " build-events1
*& Form modify-events1
text
--> p1 text
<-- p2 text
FORM modify-events1.
read table it_event1 with key name =
slis_ev_top_of_page into wa_events.
if sy-subrc = 0.
wa_events-form = 'HEADER_OF_REPORT_2'.
modify it_event1 from wa_events index sy-tabix.
clear wa_events.
endif.
ENDFORM. " modify-events1
*& Form list-display1
text
--> p1 text
<-- p2 text
FORM list-display1.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fldcats1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = it_event1
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab1
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.
ENDFORM. " list-display1
*& Form get_data1
text
--> p1 text
<-- p2 text
FORM get_data1.
READ TABLE itab INDEX V_INDEX.
v_vbeln = itab-vbeln.
select vbeln
posnr
matnr
lfimg
meins
from lips
into table itab1
where vbeln eq v_vbeln.
ENDFORM. " get_data1
*& Form header_of_report_2
text
--> p1 text
<-- p2 text
FORM header_of_report_2.
write: 'Delivary item list'.
ENDFORM. " header_of_report_2
*-- callling a transaction code by passing the initial screen value.
*& Form USER_COMMAND
form user_command using p_ucomm like sy-ucomm
p_selfield type slis_selfield.
data : l_index like sy-index,
l_refbn like cooi-refbn.
l_index = p_selfield-tabindex. " holds the selected table index
clear l_refbn.
case p_ucomm.
when '&IC1'.
clear l_refbn.
read table it_outtab index l_index.
if sy-subrc eq 0.
l_refbn = it_outtab-refbn.
if not l_refbn is initial.
set parameter id 'BES' field l_refbn.
call transaction 'ME23' and skip first screen.
endif.
else.
message e999 with text-014.
endif.
endcase.
endif.
Thanks,
Mahesh
Maybe you are looking for
-
Can we use replace function in bursting control file?
Hi All, Greetings!!!!!!!!!! Have a doubt can we use sql functions like replace,nvl,decode.. in xml bursting control file. Please let me know if there is a option. awaiting reply... Thanks Rajesh
-
FROM THE OLD FORUM Original post by John Jorgensen... Slow broadband speeds in the evening all of a sudden Posted: Jan 22, 2010 9:17 AM Click to report abuse... Click to reply to this thread Reply Hi, I have had bt broadband
-
Hey, I was installing gnome-network-manager from testing, and I may have stumbled upon a slight glitch, it seems that many of the files (all relating to dhclient files) are already on the system. I belive this has to do with the dhcp/dhclient package
-
My DSL provider says they only allow one wireless network--
My DSL provider says they only allow one wireless network. Can I do the following? My existing wireless network consists of a single DSL/ActionTec modem connected to an Airport Extreme (configured using two additional Airport Expresses for wireless p
-
Friendz, i have recently upgraded my N70 firmware to 5.0737.3.0.1 I took help from this link http://www.dotsis.com/mobile_phone/showthread.php?t=113606 but i have forgot to rename that three files. After upgrading, my phone is running fine. But this