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

The current ABAP command is obsolete

Former Member
0 Kudos
1,443

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

5 REPLIES 5
Read only

GauthamV
Active Contributor
0 Kudos
561

hi,

use UCCHECK transaction.

also press F1 on that field to get more info.

Read only

JozsefSzikszai
Active Contributor
0 Kudos
561

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
                 ....

Read only

Former Member
0 Kudos
561

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

Read only

0 Kudos
561

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

Read only

0 Kudos
561

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