‎2008 Jun 05 11:47 AM
hi
is there any alternative statement instead of using provide?
when we use provide statement in LDB we declare tables and infotypes. is there any other method to use LDB without using this declaration.
can we use provide statement without LDB screen?
‎2008 Jun 05 11:58 AM
The alternative to provide statement specific to HR module is Function Modules
To retreive data from Infotype 0001
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
tclas = 'A'
pernr = pernr
infty = '0001'
begda = rec-begda
endda = rec-endda
TABLES
infty_tab = p0001
EXCEPTIONS
infty_not_found = 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.
please brief more about the requirement if you want further clarification
Reward points please
Edited by: Sriram Chandran on Jun 5, 2008 11:58 AM
Edited by: Sriram Chandran on Jun 5, 2008 11:59 AM
‎2008 Jun 05 12:03 PM
U can use provide without LDB screen.
provide * from IT_PA0001 between v_date1 and v_date2.
endprovide.
If U don't want to use provide .. endprovide .. just loop thru the
structures U get declaring infotypes....
The statements PROVIDE and ENDPROVIDE define a loop through a statement block. In this loop, any number of internal tables itab1 itab2 ... are processed together. A single table can appear several times. For every table itab you must specify a FIELDS clause. After FIELDS you must specify the character * for all components or a list comp1 comp2 ... for specific components of the relevant table. The names of the components comp1 comp2 ... can only be specified directly.
‎2008 Jun 05 12:20 PM
i use this code
PROVIDE pernr uname
FROM p0000
pernr btrtl werks persg persk abkrs uname
FROM p0001
BETWEEN p_edate and p_edate
WHERE p0000-pernr IN p_perno and
p0001-pernr in p_perno.
the p_perno is the custom field.
this statement picks all the pernr from p0000 and p0001.
it does not pick according to the select option.
‎2008 Jun 05 12:33 PM
Your structures p0000 and p0001 has all the records for a
particular pernr ...
instead use macros to read ..
rp-provide from first/last p0000/p0001 space pn-begda pn-endda.
or loop thru p0000 or p0001 .. to get data ..
‎2008 Jun 05 12:48 PM
can send sample prog with provide statement with declarations.
‎2008 Jun 05 1:51 PM
DATA: BEGIN OF wa1,
col1 TYPE i,
col2 TYPE i,
col3 TYPE string,
END OF wa1.
DATA: BEGIN OF wa2,
col1 TYPE i,
col2 TYPE i,
col3 TYPE string,
END OF wa2.
DATA: itab1 LIKE STANDARD TABLE OF wa1,
itab2 LIKE STANDARD TABLE OF wa2.
DATA: flag1(1) TYPE c,
flag2(1) TYPE c.
wa1-col1 = 1.
wa1-col2 = 6.
wa1-col3 = 'Itab1 Int1'.
APPEND wa1 TO itab1.
wa1-col1 = 9.
wa1-col2 = 12.
wa1-col3 = 'Itab1 Int2'.
APPEND wa1 TO itab1.
wa2-col1 = 4.
wa2-col2 = 11.
wa2-col3 = 'Itab2 Int1'.
PROVIDE FIELDS col3 FROM itab1 INTO wa1
VALID flag1
BOUNDS col1 AND col2
FIELDS col3 FROM itab2 INTO wa2
VALID flag2
BOUNDS col1 AND col2
BETWEEN 2 AND 14.
WRITE: / wa1-col1, wa1-col2, wa1-col3, flag1.
WRITE: / wa2-col1, wa2-col2, wa2-col3, flag2.
SKIP.
ENDPROVIDE.
The list output is as follows:
2 3 Itab1 Int1 X
2 3
4 6 Itab1 Int1 X
4 6 Itab2 Int1 X
7 8
7 8 Itab2 Int1 X
9 11 Itab1 Int2 X
9 11 Itab2 Int1 X
12 12 Itab1 Int2 X
12 12