Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query is not working

Hello Experts

My query is not working

I want if Com Code(bukrs),Pur Org(ekorg),A/c Group(ktokk),name1(Vendor first name),if all these 4 fields r same.This particular record will append in error internal table,So that Already existind Vendor will not create further.

loop at i_lfa1.

loop at i_lfb1 where lifnr = i_lfa1-lifnr.

loop at i_lfm1 where lifnr = i_lfb1-lifnr.

main_table-lifnr = i_lfa1-lifnr.

main_table-bukrs = i_lfb1-bukrs.

main_table-ekorg = i_lfm1-ekorg.

main_table-KTOKK = i_lfa1-KTOKK.

main_table-name1 = i_lfa1-name1.

append main_table.

endloop.

endloop.

endloop.

loop at it_success.

translate main_table-name1 to upper case.

loop at main_table where ( bukrs = it_success-bukrs_001

and EKORG = it_success-EKORG_002

and KTOKK = it_success-KTOKK_003

and name1 CP it_success-name1_006 ).

MOVE-CORRESPONDING it_success TO it_error.

APPEND it_error.

if sy-subrc eq 0.

delete it_success.

e_fret-type = 'E'.

e_fret-name = it_error-NAME1_006.

e_fret-message = 'Vendor Name already exists '.

append e_fret.

endif.

endloop.

endloop.

Plz tell where is the problem

Ravi

Tags:
Not what you were looking for? View more on this topic or Ask a question