on 05-31-2007 3:02 PM
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.
Hi Krishna,
Generally the partner function codes will be in capital letters.
Change the value from 'we' to 'WE' in the read statement.
Check this code in bold and do accordingly.
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.
<b>** read table xvbpa into xvbpa with key parvw = 'WE'.</b>
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.
Thanks,
Vinay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI.,
Please check whether your desired item category is there in the xVBAP table or not,If yes Then LOOP at your xVBPA table and modify the customer no & adress with in the loop for t he desired partner function
REWARD if helpfull
Thanks & Regards
Narayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
I'm not sure if the code is correct.
There is no endloop.
Is the table xvbpa is an exporting table.
Why do you want to use the same work area(xvbpa) as the table (xvbpa ).
Also, check if your user-exit is called while creating the sales order. You can probably put a break-point over there and try to debug.
Hope this will help.
Regards,
Naveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.