Skip to Content
0
Former Member
Jun 10, 2008 at 05:12 AM

very urgent: reterving data from table MKPF table

96 Views

hi,

i am facing a problem in adding a code i.e. i am having a select statement which use to reterive data from MKPF but i am not able to fetch it as there,i had written code for the RSEG from where i get the Material Document No..

but now i have to take the value from the MKPF as well as it is the requierment of the code.

here is the following code which i am using right now is to reterive data from RSEG :-

SELECT BUKRS BELNR GJAHR AWKEY BUDAT XBLNR

AWTYP FROM BKPF

INTO (ITBKPF-BUKRS,ITBKPF-BELNR,ITBKPF-GJAHR,

ITBKPF-AWKEY,ITBKPF-BUDAT,ITBKPF-XBLNR,ITBKPF-AWTYP)

WHERE AWTYP EQ 'MKPF' OR AWTYP EQ 'RMRP'.

**BEGIN OF TRY CODE FOR A MATERIAL DOCUMENT**

ITDEMO-BELNR = ITBKPF-AWKEY(10).

ITDEMO-GJAHR = ITBKPF-AWKEY+10(4).

ITDEMO-XBLNR = ITBKPF-XBLNR.

SELECT LFBNR FROM RSEG INTO

(ITDEMO-LFBNR) WHERE

BELNR EQ ITBKPF-AWKEY(10) AND

GJAHR EQ ITBKPF-AWKEY+10(4) AND

XBLNR EQ ITBKPF-XBLNR AND LFBNR > 0.

CHECK SY-SUBRC EQ 0 AND ITDEMO-LFBNR IN P_LFBNR.

**END OF TRY CODE FOR A MATERIAL DOCUMENT**

Edited by: abaper2008 on Jun 10, 2008 7:42 AM