2008 Nov 28 9:30 AM
Hi Experts,
please let me know how this error can be removed.
The current ABAP command is obsolete
The variant " WITH KEY k" is no longer supported in the OO context. Use an
explicit key specification instead . . . .
Internal Message Code: READ 022
(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
EXTENDED CHECK OFF/ON)
Thanks and Regards,
Johny
2008 Nov 28 9:35 AM
hi,
use UCCHECK transaction.
also press F1 on that field to get more info.
2008 Nov 28 9:40 AM
you did not mention which statement is it, but I believe it is READ TABLE. if yes, you have to name all (relevant) fields one by one
READ TABLE itab INTO...
WITH KEY field1 = value1
field2 = value2
....
2008 Nov 28 10:18 AM
Hi Johny lever,
It might me from read statement.
use any of these
1 ) READ TABLE itab WITH TABLE KEY k1 = v1 ...kn = vn [additions].
2) READ TABLE itab WITH KEY k1 = v1 ...kn = vn [BINARY SEARCH] [additions] .
Hope this might be helpfull,
Regards
Aby
2008 Nov 28 10:31 AM
Hi Experts,
Iam having no key to compare with.
The scenario is as follows:
*If it is PaymentLot,retrieve Payment method,Gpart,Banknumber,Bank accountnumber,paymentcard number and amount
from DFKKZP and DFKKOP for the cleared document
CALL FUNCTION 'FKK_PAYMENT_BATCH_FIND_PAYMENT'
EXPORTING
i_opbel = wa_cleareditem-augbl
IMPORTING
e_dfkkzp = et_dfkkzp
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0. "#EC NEEDED
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF et_dfkkzp-bankl IS NOT INITIAL. "Check for Bank key and Card number
lv_bankl = et_dfkkzp-bankl.
ENDIF.
IF et_dfkkzp-ccnum IS NOT INITIAL.
lv_ccnum = et_dfkkzp-ccnum.
ENDIF.
IF et_dfkkzp-bankl IS INITIAL AND et_dfkkzp-ccnum IS INITIAL. "If both bank key and Card number are initial
e_pymet = c_pymet. "Populate payment method as 'K'
ENDIF.
*For the obtained Business partner,fetch Bankdetails id and Payment card id from
*exporting parameters of F.M 'FKK_BUPA_READ_SINGLE'
CALL FUNCTION 'FKK_BUPA_READ_SINGLE'
EXPORTING
i_partner = lv_partner
i_xbank = 'X'
i_xccard = 'X'
TABLES
t_bank = it_bank
t_ccard = it_ccard
EXCEPTIONS
partner_not_found = 1
partner_in_role_not_found = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0. "#EC NEEDED
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE it_bank INTO wa_bank WITH KEY bankl = lv_bankl BINARY SEARCH. "Pick the entry which has bankl value as from et_dfkkzp
IF sy-subrc = 0.
e_pymet = c_pymetb.
e_bkvid = wa_bank-bkvid.
ENDIF.
READ TABLE it_ccard INTO wa_ccard WITH KEY ccnum = lv_ccnum BINARY SEARCH. "Pick the entry which has ccnum value as from et_dfkkzp
IF sy-subrc = 0.
e_pymet = c_pymetd.
e_ccard_id = wa_ccard-ccard_id.
ENDIF.
ENDIF.
ENDFORM. " ORIGINKEY_V1
2008 Nov 28 10:52 AM
Hi,
Its obsolete to use Data Object in WITH KEY but using key like this!!!!
insert Sort by the Key specifird in Read in ASCENDING and the Read.
Lets see...
Regards ,
Neha