This website is not affiliated with, sponsored by, or approved by SAP AG.

Change sales text item in VA01 or VA02

Logistics : SD and its sub-modules (Inquires, Quotes, Order Entry, SIS, Sales Contacts, Dist. & Billing)

Moderators: Snowy, thx4allthefish, mike_ac, Lost Identity

Change sales text item in VA01 or VA02

Postby hterras » Fri Jun 23, 2017 9:31 am

Hi Friends ,

Its a simple question but I don’t know why it is not working in this scenario .

In VA01 or VA02 I need change the sales text in item.

I try change the text in MV45AFZZ (form userexit_save_document_prepare).

If xvbap-updkz = 'U' I can change the text but if xvbap-updkz = 'I' I can´t change.

Abap:



loop at xvbap where updkz eq 'I' or updkz eq 'U'.



if sy-tcode = 'VA01'.

concatenate 'XXXXXXXXXX' xvbap-posnr into i_name.

else.

concatenate xvbap-vbeln xvbap-posnr into i_name.

endif.



x_header-tdobject = 'VBBP'.

x_header-tdname = i_name.

x_header-tdid = '0001'.

x_header-tdspras = linguagem.

if xvbap-updkz = 'U'. ->>> Change

call function 'SAVE_TEXT'

EXPORTING

header= x_header

savemode_direct = 'X'

TABLES

lines= ztexto1.


else.

->>> Don’t Change

call function 'SAVE_TEXT'

EXPORTING

header= x_header

savemode_direct = 'X'

TABLES

lines= ztexto1.

endif.



endloop.


Please help me if some one had used this function module in this type of scenario .
Thanks in advance.

Best regards .

Henrique Terras
hterras
 
Posts: 5
Joined: Wed Apr 16, 2003 8:31 am

Re: Change sales text item in VA01 or VA02

Postby Frank Lai » Mon Jul 03, 2017 6:51 pm

Hi

First off is that when tcode is VA01 you are concatenating string of XXXXXX along with posnr into the i_name. Given that you are trying to write a sales order line text, I can't see how XXXXXXX010 as sales order and item number combination could work. Whereas in VA02 you are concatenating the sales order number and item together to form a proper text object value.

Second thing is that if the update indicator is an I and you are not supposed to change the text, then you don't really have to do anything because text determination would have/should have gotten the text for you. If you leave it alone at that time, standard SAP code should go and save it for you anyway.

Frank
Frank Lai
 
Posts: 1704
Joined: Mon Oct 21, 2002 8:03 am
Location: Canada


Return to Logistics SD

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.