Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create sales order item text

Former Member
0 Likes
5,485

Hi all,

Is there any way to create sales order item text when creating sales order .

(any user exit/ BADI/ vofm routine) ???

thanks,

chandra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,633

Hi..

check include "MV45AFZZ" and inside this include check routine "USEREXIT_SAVE_DOCUMENT"

You have to do the logic here:

Pick your sales order number from structure VBAK(vbeln is the field name).

Item for your sales order can be picked up from VBAP(posnr is the field name), at this moment VBAP-VBELN field will be blank so you would not find sales order from item table(VBAP-VBELN), this is why you have to take the sales order from the header which is VBAK-VBELN.

Now this is up to you that for what all objects ids you want to maintain the texts.

Make use of the CREATE_TEXT FM, pass the required parameters to it, and your texts will be created.

Regards,

Mark

10 REPLIES 10
Read only

Former Member
0 Likes
3,633

Hi,

How are you creating the sales order?

Do you want to add the item text when creating a sales order via BAPI then use BAPi BAPI_SALESORDER_CREATEFROMDAT2 and pass teh item text in table ORDER_TEXT.

Regards,

Ankur Parab

Read only

0 Likes
3,633

Hi,

I am creating Sales order by VA01 only. my requirement is to save the item text automatically not by manually.

Read only

0 Likes
3,633

HI,

Please check this

MV45AFZZ and MV45AFZB

You may use enhancement V45S0001.

In this u can write yur code for creation of sales order text.

http://abaplovers.blogspot.com/2008/02/function-modules-create-text-and-read.html

As replied in one of your earlier post

Regards

Hiren K.Chitalia

Read only

0 Likes
3,633

Hi,

Inside MV45AFZZ , you can use the Function Module CREATE_TEXT to create the text for line item.

Regards,

Vimal.

Read only

0 Likes
3,633

Hi Hiren,

Thanks for ur suggesion.

But how to get the Vbeln , Posnr values when I am creating the Sales order.

Read only

Former Member
0 Likes
3,633

Hi..

Check include "MV45AFZZ" this gives you control to modify header and item level data for the sales order...

you can process each item record(XVBAP) then based on key(vbak-vbeln+vbap-posnr) which would be the TDNAME(text name), you can then build the long text using FM create_text.

Note: When creating the long texts you have to know for which all text id and text objects you want to create them.

You can go for tables TTXID TTXOB, futher you can consult you functional guy to have more clarification as to which text objects and id, long text have to be created with.

Regards,

Mark

Read only

Former Member
0 Likes
3,633

Hi Chandrd,

Use FM: CREATE_TEXT.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_id

flanguage = c_en

fname = l_anfnr(SALES ORDER NO)

fobject = c_ekpo

save_direct = c_check

fformat = '*'

TABLES

flines = i_headtext[]

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

Here you need to pass the sales order no.

if you use bdc then after bdc, you can call this function module.

Regards,

Tutun

Read only

Former Member
0 Likes
3,634

Hi..

check include "MV45AFZZ" and inside this include check routine "USEREXIT_SAVE_DOCUMENT"

You have to do the logic here:

Pick your sales order number from structure VBAK(vbeln is the field name).

Item for your sales order can be picked up from VBAP(posnr is the field name), at this moment VBAP-VBELN field will be blank so you would not find sales order from item table(VBAP-VBELN), this is why you have to take the sales order from the header which is VBAK-VBELN.

Now this is up to you that for what all objects ids you want to maintain the texts.

Make use of the CREATE_TEXT FM, pass the required parameters to it, and your texts will be created.

Regards,

Mark

Read only

0 Likes
3,633

Hi Nelson,

Thank you so much.. issue resolved...

Read only

0 Likes
3,633

Chandra

How did you resolve, please let us know the solution

Regards

Karthik