Skip to Content
0
Former Member
May 31, 2007 at 02:02 PM

ABAP-SD

25 Views

i want to update the ship-to-party customer no and address with delivary agent address and address no in VBPA table while creation of VA01 application before saving based on item category but updations are not happening . sample code i'm placing here , this is used in user-exit

if li_vbap[] is not initial.

  • LOOP AT li_vbap1 INTO lw_vbap1.

  • IF lw_vbap1-pstyv EQ 'ZNTC' OR lw_vbap1-pstyv EQ 'ZNTI'.

**

  • READ TABLE xvbpa INTO xvbpa WITH KEY parvw = 'ZA'.

  • IF sy-subrc EQ 0.

  • lv_kunnr = xvbpa-kunnr.

  • lv_adrnr = xvbpa-adrnr.

  • lv_exec = lctrue.

    • ELSE.

    • MESSAGE i085(yd01).

    • ENDIF.

    • if lv_exec eq lc_true.

    • read table xvbpa into xvbpa with key parvw = 'we'.

    • if sy-subre eq 0.

    **

    • xvbpa-kunnr = lv_kunnr.

    • xvbpa-adrnr = lv_adrnr.

    • MODIFY xvbpa FROM xvbpa TRANSPORTING kunnr adrnr .

    • clear lv_kunnr,

    • lv_adrnr.

    • ENDIF.

    • endif.