2008 Oct 25 6:03 AM
Hi All,
In table MKPF there is mblnr and mjahr
In table BKPF there is belnr and gjahr
In BKPF there is referance key field AWKEY
In that field AWKEY i have to enter mblnr and mjahr and
it will give Accounting Document Number
In the code i have retun like this but it is giving error
the code is
IF it_mkpf[] IS NOT INITIAL.
SELECT BUKRS BELNR GJAHR AWTYP AWKEY
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
FROM bkpf
FOR ALL ENTRIES IN it_mkpf
WHERE awtyp = 'MKPF'
AND ( awkey0(10) = it_mkpf-mblnr AND awkey14(4) = it_mkpf-mjahr ).
endif.
WHO TO WRITE THAT LOGIC
PLS CAN U HELP ME
THANKS
MARS
Hi All,
In table MKPF there is mblnr and mjahr
In table BKPF there is belnr and gjahr
In BKPF there is referance key field AWKEY
In that field AWKEY i have to enter mblnr and mjahr and
it will give Accounting Document Number
In the code i have retun like this but it is giving error
the code is
IF it_mkpf[] IS NOT INITIAL.
SELECT BUKRS BELNR GJAHR AWTYP AWKEY
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
FROM bkpf
FOR ALL ENTRIES IN it_mkpf
WHERE awtyp = 'MKPF'
AND ( awkey0(10) = it_mkpf-mblnr AND awkey14(4) = it_mkpf-mjahr ).
endif.
WHO TO WRITE THAT LOGIC
PLS CAN U HELP ME
THANKS
MARS
2008 Oct 25 6:23 AM
WHERE awtyp = 'MKPF'
Here u r passing table as reference key instead of FIELD can u check it once..
Edited by: Sree on Oct 25, 2008 7:24 AM
2008 Oct 25 6:50 AM
check this code.
TYPES: BEGIN OF ty_mkpf,
mblnr TYPE mkpf-mblnr,
mjahr TYPE mkpf-mjahr,
xawkey TYPE bkpf-awkey,
END OF ty_mkpf.
TYPES: BEGIN OF ty_bkpf,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
awtyp TYPE bkpf-awtyp,
awkey TYPE bkpf-awkey,
END OF ty_bkpf.
DATA: it_mkpf TYPE STANDARD TABLE OF ty_mkpf,
it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
wa_mkpf TYPE ty_mkpf,
wa_bkpf TYPE ty_bkpf.
SELECT mblnr
mjahr
FROM mkpf
INTO TABLE it_mkpf
where (Ur select options or paramters).
LOOP AT it_mkpf INTO wa_mkpf.
CONCATENATE wa_mkpf-mblnr wa_mkpf-mjahr INTO wa_mkpf-xawkey.
MODIFY it_mkpf FROM wa_mkpf TRANSPORTING xawkey.
ENDLOOP.
IF it_mkpf[] IS NOT INITIAL.
SELECT bukrs belnr gjahr awtyp awkey
INTO TABLE it_bkpf
FROM bkpf
FOR ALL ENTRIES IN it_mkpf
WHERE awtyp = 'MKPF'
AND awkey = it_mkpf-xawkey.
ENDIF.regards,
Padma
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |