Skip to Content

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

How to Update single field from database table?

Hi All,

I am running one application from that i want to update LFIMG field in LIPS Table. i try with this code, but total record updated,

i want to update lfimg field only? please any suggestion on change code?

loop at lt_it_lips into ls_it_lips.

wa_lips-vbeln = ls_it_lips-vbeln.

wa_lips-posnr = ls_it_lips-posnr.

wa_lips-lfimg = ls_it_lips-lfimg - ls_it_lips-PICK_QTY.

*MODIFY it_lips from wa_lips

*TRANSPORTING lfimg where vbeln = ls_it_lips-vbeln ." TRANSPORTING lfimg .

APPEND wa_lips to it_lips.

endloop.

  • lock the table

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

MODE_RSTABLE = 'E'

TABNAME = 'LIPS'

  • VARKEY = ship_no

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

MODIFY LIPS from wa_lips .

if sy-subrc is initial.

COMMIT WORK .

else.

ROLLBACK work.

endif.

endloop.

CALL FUNCTION 'DEQUEUE_E_TABLE'

EXPORTING

MODE_RSTABLE = 'E'

TABNAME = 'LIPS'.

Thanks,

VEnkat.

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