Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logical Database of SAP Example Program

Former Member
0 Likes
653

Hi all,

I need an example ABAP program using standard Logical Database ( LDB ) .

Help me.

Regards,

Peachi.

2 REPLIES 2
Read only

Former Member
0 Likes
475

Hi,

Some links to refer..

/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports

http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#

A sample prog with LDB PNP

&----

-


*& Report ZH_REPT_PAYMENT *

*& *

&----

-


*& *

*& *

&----

-


report zh_rept_payment line-size 80 no standard page

heading.

tables: pernr, " Standard Selections for HR Master Data Reporting

pcl1, " HR Cluster 1

pcl2, " HR Cluster 2

pa0009,

PA9001,

PA9006,

pa0002,

pc260 , " Cluster Directory for Payroll Results

bnka .

Infotypes

infotypes: 0001. " Organizational Assignment

Declaration of Internal Tables

data : bnka1 like bnka occurs 0 with header line .

*-

data: begin of t_int_rep occurs 100,

bankl like pc209-bankl, " Bank Number

zlsch like pc209-zlsch, " Payment method

pernr like pernr-pernr, " Employee Number

ename like pernr-ename, " Employee Name

bankn like pc209-bankn, " Bank Account Number

betrg like pc209-betrg, " Amount to be transfered

zweck like pa0009-zweck, " Purpose

end of t_int_rep.

***********************

data: begin of int_rep occurs 100,

bankl like pc209-bankl, " Bank Number

zlsch like pc209-zlsch, " Payment method

pernr like pernr-pernr, " Employee Number

ename like pernr-ename, " Employee Name

bankn like pc209-bankn, " Bank Account Number

betrg like pc209-betrg, " Amount to be transfered

zweck like pa0009-zweck, " Purpose

begda like pa0009-begda, "Begin date

end of int_rep.

Declaration of Data Variables

data: ws_betrg like pc209-betrg, " BT Amount

w_val like spell occurs 0 with header line,

int_rep1(6), " TYPE I, " Employee Number

cnt type i value 0, " Counter

calcmolga like t500l-molga value '40', " Country Grouping

v_id(15),

calc_currency like t001-waers value 'INR'. " Currency

data : ctr type i,

dt_merge like pa0009-begda.

data: ws_totemp(6) type c,

ws_totamt(20) type c,

r_mth(9) type c,

ws_fpbeg(6) type c,

ws_fpend(6) type c,

ws_mthyr(6) type c,

ws_mthyr_r(14) type c,

r_mth_t(3) type c,

ws_amt(8) type c,

ws_bankl(14) type c,

ws_date(6) type c,

amount_word(500),

total_page type i,

pages type i,

remain type i.

data begin of i_spell.

include structure spell .

data end of i_spell .

data : c_molga type t500l-molga value '40',

c_banks type bnka-banks value 'IN'.

************************************************************************

Standard Includes

include rpc2cd09. "Cluster CD data definition

include pc2rxin0.

include rpc2rx09.

include rpppxd00. " Data Definition buffer PCL1/PCL2

include rpppxd10. " Common Part buffer PCL1/PCL2

include rpppxm00. " Buffer Handling RoutinePCL1/PCL2

include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)

************************************************************************

Selection Screen

************************************************************************

selection-screen begin of block b1 with frame title text-001.

parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,

pa_year(4) type c default sy-datum(4) obligatory,

p_bankl like pc209-bankl, " Bank Number

p_zlsch like pc209-zlsch. " Payment method

selection-screen end of block b1.

************************************************************************

save_calc_currency = calc_currency.

count_top = 0.

get_pernr_flag = 0.

**********************************************************************

Top-Of-Page

**********************************************************************

top-of-page.

perform convert_month using pa_mth(2) r_mth.

ws_mthyr_r = r_mth.

concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.

SKIP 5.

skip 1.

skip 4.

if int_rep-bankl eq ' '.

if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or

int_rep-zlsch eq ' '.

write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.

elseif int_rep-zlsch eq 'L'.

write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.

endif.

else.

write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.

endif.

skip.

write: /34 ws_mthyr_r,

62 'Page :'(008),69(2) sy-pagno intensified off,

' Of ',78(2) pages intensified off.

clear pages.

read table bnka1 with key bankl = int_rep-bankl .

if sy-subrc = 0.

if int_rep-zlsch eq 'T'.

write:/03(10) 'Bank Name : ', bnka1-banka.

write:/03(10) 'Branch : ', bnka1-brnch.

write:/03(10) 'Address : ', bnka1-stras.

endif.

endif.

skip.

write:/1(80) sy-uline.

write: /1 sy-vline, 2(5) 'Sl.No'(002),

7 sy-vline, 8(8) 'Emp.No.'(003),

16 sy-vline,17(35) 'Employee Name'(004).

*--added for Demand Draft

if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).

write : 47 sy-vline, 48(15) 'Payable at'(005).

else.

*---

write : 47 sy-vline,48(15) 'Account No.'(005).

endif.

write: 63 sy-vline,64(16) 'Amount'(006),

80 sy-vline.

write:/1(80) sy-uline.

end-of-page.

write:/1(80) sy-uline.

write:/2 'Printed on ', sy-datum.

*

**********************************************************************

Start-of-selection.

**********************************************************************

start-of-selection.

*perform h_headr.

ctr = 0.

set margin 5.

call function 'RP_GET_CURRENCY'

exporting

molga = calcmolga

importing

waers = calc_currency

exceptions

others.

if sy-subrc ne 0.

calc_currency = 'DEM'.

calc_currency = save_calc_currency.

endif.

get pernr.

cd-key-pernr = pernr-pernr.

perform import_cluster.

get_pernr_flag = 1.

check : ocd-version-molga eq calcmolga.

The table 'tabpernr' is filled with the personnel numbers

and is used after selection is finished.

move-corresponding pernr to tabpernr.

append tabpernr.

The table 'tab_rgdir' is filled

loop at rgdir.

rx-key-pernr = pernr-pernr.

unpack rgdir-seqnr to rx-key-seqno.

perform int_tab. "fill tab_rgdir

perform import_bt.

perform validate.

endloop.

**********************************************************************

End of Selection

**********************************************************************

end-of-selection.

*perform h_headr.

perform convert_date_a using pa_mth r_mth_t.

sort int_rep by bankl zlsch pernr betrg descending.

delete adjacent duplicates from int_rep

comparing bankl zlsch pernr .

sort int_rep by bankl zlsch bankn . "PERNR.

loop at int_rep.

at new bankl.

select single * into bnka1 from bnka

where banks = c_banks and

bankl = int_rep-bankl .

append bnka1.

clear bnka1.

endat.

endloop.

for Demand Draft - purpose added

loop at int_rep.

concatenate pa_year(4) pa_mth(2) '01' into dt_merge.

select single * "zweck into int_rep-zweck

from pa0009 where

pernr = int_rep-pernr and

bankl = int_rep-bankl and

zlsch = int_rep-zlsch

and begda <= dt_merge and

endda >= dt_merge .

if sy-subrc = 0.

int_rep-zweck = pa0009-zweck.

modify int_rep.

endif.

endloop.

*-for DD and Chq sorted by PAyable at and EMPNO wise

if p_zlsch = 'T' .

sort int_rep by bankl zlsch bankn . "PERNR.

else. "added for "payable at" for DD/Chq

else.

sort int_rep by zweck pernr . "PERNR.

endif.

*delete adjacent duplicates from int_rep.

t_int_rep] = int_rep[.

loop at int_rep.

*-for page of page no.

total_page = 0.

loop at t_int_rep where bankl = int_rep-bankl

and zlsch = int_rep-zlsch.

total_page = total_page + 1.

endloop.

pages = total_page div 25.

remain = total_page mod 25.

comment bcoz its adding one extra page no.

done as on 29/11/2004

if remain > 0.

pages = pages + 1.

endif.

**-end

*-

at new bankl.

ctr = 0 .

new-page.

endat.

at new zlsch.

ctr = 0 .

new-page.

endat.

clear v_id.

select single natio

into pa0002-natio

from pa0002

where pernr eq int_rep-pernr.

*-testing......for soma

if ctr > 24.

ctr = 0 .

write:/1(80) sy-uline.

new-page .

endif.

ctr = ctr + 1 .

cnt = cnt + 1.

pack int_rep-pernr to int_rep1.

write:/1 sy-vline, 2(3) cnt intensified off,

7 sy-vline, 9(6) int_rep1 intensified off,

16 sy-vline,17(35) int_rep-ename intensified off .

if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).

write : 47 sy-vline,48(15) int_rep-zweck intensified off.

else.

write:

47 sy-vline,48(15) int_rep-bankn intensified off .

endif.

write: 63 sy-vline,64(16) int_rep-betrg

intensified off currency 'INR',

80 sy-vline.

ws_betrg = ws_betrg + int_rep-betrg.

*-testing......for soma

skip.

write :

/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80

sy-vline .

*-end testing......for soma

at end of zlsch.

if int_rep-bankl = ' '.

call function 'HR_IN_CHG_INR_WRDS'

exporting

amt_in_num = ws_betrg

importing

amt_in_words = amount_word

EXCEPTIONS

DATA_TYPE_MISMATCH = 1

OTHERS = 2

.

*************

w_val-word = amount_word.

concatenate 'INR.' w_val-word into w_val-word

separated by space.

write:/1(80) sy-uline.

write: /1 sy-vline, 7 'Total transfer:'(009),

64(16) ws_betrg intensified off currency 'INR',

80 sy-vline.

write:/1(80) sy-uline.

write: /1 sy-vline, 3 w_val-word+0(76) intensified off,

80 sy-vline.

write :/1 sy-vline, 10 w_val-word+76(70) intensified off,

80 sy-vline.

write:/1(80) sy-uline.

clear: ws_betrg,cnt.

skip 2.

write: /2 'Prepared by :'(010), '_______________'(013),

45 'Checked by :'(011),'_______________'(013).

skip 2.

write: /2 'Printed On ', sy-datum,

45 'Approved by :'(012),'_______________'(013).

clear sy-pagno.

endif.

endat.

at end of bankl.

if int_rep-bankl ' '.

call function 'HR_IN_CHG_INR_WRDS'

exporting

amt_in_num = ws_betrg

importing

amt_in_words = amount_word

EXCEPTIONS

DATA_TYPE_MISMATCH = 1

OTHERS = 2

.

w_val-word = amount_word.

concatenate 'INR.' w_val-word into w_val-word

separated by space.

write:/1(80) sy-uline.

write: /1 sy-vline, 7 'Total transfer:'(009),

64(16) ws_betrg intensified off currency 'INR',

80 sy-vline.

write:/1(80) sy-uline.

write: /1 sy-vline, 3 w_val-word+0(76) intensified off,

80 sy-vline.

write :/1 sy-vline, 10 w_val-word+76(70) intensified off,

80 sy-vline.

write:/1(80) sy-uline.

clear: ws_betrg,cnt.

skip 2.

write: /2 'Prepared by :'(010), '_______________'(013),

45 'Checked by :'(011),'_______________'(013).

skip 2.

write: /2 'Printed on ', sy-datum,

45 'Approved by :'(012),'_______________'(013).

clear sy-pagno.

NEW-PAGE.

endif.

endat.

endloop.

**********************************************************************

End of Page

**********************************************************************

end-of-page.

write: /2 'Prepared by :'(010), '_______________',

45 'Checked by :'(011),'_______________'.

&----

-


*& Form IMPORT_CLUSTER

&----

-


Importing Data from Cluster *

-

-


form import_cluster.

sy-subrc = 0.

rp-imp-c2-cd.

if sy-subrc eq 0.

if cd-version-number ne ocd-version-number.

endif.

endif. " SY-SUBRC EQ 0

endform. " IMPORT_CLUSTER

&----

-


*& Form INT_TAB

&----

-


Filling internal table tab_rgdir

-

-


form int_tab.

*Fill internal table tab_rgdir.

move-corresponding rgdir to tab_rgdir.

tab_rgdir-pernr = pernr-pernr.

append tab_rgdir.

endform. " INT_TAB

&----

-


*& Form IMPORT_bt

&----

-


Import Values from Bank Transactions Table (BT)

-

-


form import_bt.

rp-init-buffer.

RP-IMP-C2-RX.

rp-imp-c2-in.

if rp-imp-in-subrc eq 0.

if in-version-number ne oin-version-number.

write: / 'Schlüssel des Clusters RX:'(015),

rx-key-pernr, rx-key-seqno.

write: / 'The imported version of the cluster'(016), 'RX',

'is not current'(017).

write: / 'Imported version :'(018),

oin-version-number.

write: / 'Current version of cluster :'(019),

in-version-number.

stop.

else.

sy-subrc = 0.

endif.

else.

sy-subrc = 8.

write: /

'Inconsistencies between cluster directory and directory for'(020).

write: /

'No payroll results found for data in cluster directory'(021).

write : /

'Please contact hotline to solve the current problem'(022).

endif.

ws_fpbeg(2) = versc-fpbeg+4(2).

ws_fpbeg+2(4) = versc-fpbeg(4).

ws_fpend(2) = versc-fpend+4(2).

ws_fpend+2(4) = versc-fpend(4).

ws_mthyr(2) = pa_mth.

ws_mthyr+2(4) = pa_year.

check ws_mthyr = ws_fpbeg.

check ws_mthyr = ws_fpend.

loop at bt. "from pc209

int_rep-pernr = pernr-pernr.

int_rep-ename = pernr-ename.

int_rep-bankl = bt-bankl.

int_rep-bankn = bt-bankn.

int_rep-betrg = bt-betrg.

int_rep-zlsch = bt-zlsch.

append int_rep.

endloop.

IF P_BANKL ' ' AND P_ZLSCH ' '.

DELETE INT_REP WHERE BANKL P_BANKL.

ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.

DELETE INT_REP WHERE ZLSCH P_ZLSCH.

ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.

DELETE INT_REP WHERE BANKL P_BANKL.

ENDIF.

endform. " IMPORT_BT

&----

-


*& Form CONVERT_MONTH

&----

-


Fetching Month Text

-

-


form convert_month using mth t_mth.

case mth.

when '01'.

t_mth = 'January'(023).

when '02'.

t_mth = 'February'(024).

when '03'.

t_mth = 'March'(025).

when '04'.

t_mth = 'April'(026).

when '05'.

t_mth = 'May'(027).

when '06'.

t_mth = 'June'(028).

when '07'.

t_mth = 'July'(029).

when '08'.

t_mth = 'August'(030).

when '09'.

t_mth = 'September'(031).

when '10'.

t_mth = 'October'(032).

when '11'.

t_mth = 'November'(033).

when '12'.

t_mth = 'December'(034).

endcase.

endform. " CONVERT_MONTH

&----

-


*& Form CONVERT_DATE_A

&----

-


Fetching Month Text *

-

-


form convert_date_a using mth_t t_mth_t.

case mth_t.

when '01'.

t_mth_t = 'Jan.'(035).

when '02'.

t_mth_t = 'Feb.'(036).

when '03'.

t_mth_t = 'Mar.'(037).

when '04'.

t_mth_t = 'Apr.'(038).

when '05'.

t_mth_t = 'May.'(039).

when '06'.

t_mth_t = 'Jun.'(040).

when '07'.

t_mth_t = 'Jul.'(041).

when '08'.

t_mth_t = 'Aug.'(042).

when '09'.

t_mth_t = 'Sep.'(043).

when '10'.

t_mth_t = 'Oct.'(044).

when '11'.

t_mth_t = 'Nov.'(045).

when '12'.

t_mth_t = 'Dec.'(046).

endcase.

endform. " CONVERT_DATE_A

&----

-


*& Form VALIDATE

&----

-


text

-

-


--> p1 text

<-- p2 text

-

-


form validate .

if p_bankl <> ' ' and p_zlsch ' '.

delete int_rep where bankl p_bankl.

elseif p_bankl = ' ' and p_zlsch ' '.

delete int_rep where zlsch p_zlsch.

elseif p_bankl ' ' and p_zlsch = ' '.

delete int_rep where bankl p_bankl.

endif.

endform. " VALIDATE

check this weblog.....

/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects

Also , check the following link too.

http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp

Regards,

Satish

Read only

Former Member
0 Likes
475

hi,

check this code..

codeREPORT ZPROJPSJ MESSAGE-ID OK.

TABLES: PROJ,

PRPS_R,

AUFK,

ACT01,

DRAD,

DRAT,

ELM_PS,

RSTHIE,

CNDB.

INCLUDE MZNW2D01.

INITIALIZATION.

FREE MEMORY ID 'SAPDBPSJ999 AUFRUFE'.

GET RSTHIE.

CLEAR ITAB_HIERARCHY.

MOVE-CORRESPONDING RSTHIE TO ITAB_HIERARCHY.

GET PROJ FIELDS OBJNR PSPID POST1.

GET PRPS_R FIELDS OBJNR POSID POST1.

GET AUFK FIELDS OBJNR KTEXT.

GET ACT01 FIELDS OBJNR AUFPL APLZL VORNR UVORN LTXA1.

GET DRAD.

MOVE-CORRESPONDING DRAD TO ITAB_DOCUMENTS.

APPEND ITAB_DOCUMENTS.

GET ELM_PS.

ITAB_HIERARCHY-OBJNR = ELM_PS-OBJNR.

CASE ELM_PS-OBTYP.

WHEN 'PD'.

ITAB_HIERARCHY-PSPNR = ELM_PS-PROJ_INT.

WRITE ELM_PS-PROJ_EXT TO ITAB_HIERARCHY-NAME.

WHEN 'PR'.

ITAB_HIERARCHY-PSPNR = ELM_PS-PRPS_INT.

WRITE ELM_PS-PRPS_EXT TO ITAB_HIERARCHY-NAME.

WHEN 'NP'.

ITAB_HIERARCHY-AUFNR = ELM_PS-AUFNR.

WRITE ELM_PS-AUFNR TO ITAB_HIERARCHY-NAME.

WHEN 'NV'.

ITAB_HIERARCHY-VORNR = ELM_PS-VORNR.

WRITE ELM_PS-AUFNR TO ITAB_HIERARCHY-NAME.

IF ACT01-UVORN IS INITIAL.

CONCATENATE ITAB_HIERARCHY-NAME ACT01-VORNR

INTO ITAB_HIERARCHY-NAME SEPARATED BY ' / '.

ELSE.

CONCATENATE ITAB_HIERARCHY-NAME ACT01-VORNR ACT01-UVORN

INTO ITAB_HIERARCHY-NAME SEPARATED BY ' / '.

ENDIF.

ENDCASE.

IF ELM_PS-KTEXT IS INITIAL.

ITAB_HIERARCHY-DESC = ITAB_HIERARCHY-NAME.

ELSE.

ITAB_HIERARCHY-DESC = ELM_PS-KTEXT.

ENDIF.

ITAB_HIERARCHY-OBTYP = ELM_PS-OBTYP.

APPEND ITAB_HIERARCHY.

CLEAR ITAB_HIERARCHY.

END-OF-SELECTION.

PERFORM READ_DRAT.

PERFORM SAVE_PROJECT_HIERARCHY.

-


FORM READ_DRAT *

-


........ *

-


FORM READ_DRAT.

DATA: C TYPE CURSOR.

DATA: ITAB_DRAT LIKE DRAT.

CHECK NOT ITAB_DOCUMENTS[] IS INITIAL.

SORT ITAB_DOCUMENTS BY DOKAR DOKNR DOKVR DOKTL.

OPEN CURSOR C FOR

SELECT * FROM DRAT

FOR ALL ENTRIES IN ITAB_DOCUMENTS

WHERE DOKAR = ITAB_DOCUMENTS-DOKAR

AND DOKNR = ITAB_DOCUMENTS-DOKNR

AND DOKVR = ITAB_DOCUMENTS-DOKVR

AND DOKTL = ITAB_DOCUMENTS-DOKTL

ORDER BY PRIMARY KEY.

DO.

FETCH NEXT CURSOR C INTO CORRESPONDING FIELDS OF ITAB_DRAT.

IF NOT SY-SUBRC IS INITIAL.

CLOSE CURSOR C.

EXIT.

ENDIF.

READ TABLE ITAB_DOCUMENTS WITH KEY DOKAR = ITAB_DRAT-DOKAR

DOKNR = ITAB_DRAT-DOKNR

DOKVR = ITAB_DRAT-DOKVR

DOKTL = ITAB_DRAT-DOKTL

BINARY SEARCH.

LOOP AT ITAB_DOCUMENTS FROM SY-TABIX.

IF ITAB_DOCUMENTS-DOKAR ITAB_DRAT-DOKAR OR

ITAB_DOCUMENTS-DOKNR ITAB_DRAT-DOKNR OR

ITAB_DOCUMENTS-DOKVR ITAB_DRAT-DOKVR OR

ITAB_DOCUMENTS-DOKTL ITAB_DRAT-DOKTL.

EXIT.

ENDIF.

IF ITAB_DOCUMENTS-DKTXT IS INITIAL OR

ITAB_DRAT-LANGU = SY-LANGU.

ITAB_DOCUMENTS-DKTXT = ITAB_DRAT-DKTXT.

ITAB_DOCUMENTS-LANGU = ITAB_DRAT-LANGU.

MODIFY ITAB_DOCUMENTS.

ENDIF.

ENDLOOP.

ENDDO.

SORT ITAB_DOCUMENTS BY OBJKY DOKAR DOKNR DOKVR DOKTL.

ENDFORM.

-


FORM SAVE_PROJECT_HIERARCHY *

-


........ *

-


FORM SAVE_PROJECT_HIERARCHY.

CALL FUNCTION 'ENQUEUE_EC_CNDB'

EXPORTING

RELID = '00'

SRTFD = 'SAP DIRECTORY'

_WAIT = 'X'

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

IF NOT SY-SUBRC IS INITIAL.

IF SY-SUBRC = 1.

MESSAGE I501 WITH SY-MSGV1 RAISING DIR_ENTRY_NOT_SAVED.

ENDIF.

EXIT.

ENDIF.

IMPORT CNDBDIR TO ITAB_CNDBDIR

FROM DATABASE CNDB(00) ID 'SAP DIRECTORY'.

READ TABLE ITAB_HIERARCHY INDEX 1.

CLEAR CNDBDIR_TMP.

CNDBDIR_TMP-RELID = 'W2'.

CNDBDIR_TMP-SRTFD = ITAB_HIERARCHY-OBJNR.

CNDBDIR_TMP-DBPROG = 'SAPDBPSJ'.

CNDBDIR_TMP-REPORT = SY-CPROG.

CNDBDIR_TMP-DATUM = SY-DATUM.

CNDBDIR_TMP-DATLO = SY-DATLO.

CNDBDIR_TMP-TIMLO = SY-TIMLO.

SORT ITAB_CNDBDIR BY RELID SRTFD.

READ TABLE ITAB_CNDBDIR WITH KEY RELID = 'W2'

SRTFD = ITAB_HIERARCHY-OBJNR

BINARY SEARCH.

IF SY-SUBRC IS INITIAL.

DELETE ITAB_CNDBDIR INDEX SY-TABIX.

ENDIF.

ITAB_CNDBDIR = CNDBDIR_TMP.

INSERT ITAB_CNDBDIR INDEX SY-TABIX.

EXPORT CNDBDIR FROM ITAB_CNDBDIR

TO DATABASE CNDB(00) ID 'SAP DIRECTORY'.

CALL FUNCTION 'DEQUEUE_EC_CNDB'

EXPORTING

RELID = '00'

SRTFD = 'SAP DIRECTORY'.

EXPORT ITAB_HIERARCHY TO DATABASE CNDB(W2) ID ITAB_CNDBDIR-SRTFD.

EXPORT ITAB_DOCUMENTS TO DATABASE CNDB(W3) ID ITAB_CNDBDIR-SRTFD.

ENDFORM.[/code]

*********************************************************

*--LDB PNP -- give it in attributes

tables pernr.

infotypes 0002.

data: begin of itab occurs 0,

vorna like pa0002-vorna,

end of itab.

data wa like line of itab.

*write 'abc'.

get pernr.

provide * from p0002

BETWEEN PNPbegda AND PNPENDDA.

move p0002-vorna to itab-vorna.

append itab.

clear itab.

endprovide.

end-of-selection.

loop at itab.

write:/ itab-vorna.

endloop.