Application Development 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: 

Copy Fields Into Sales order Item Text

Former Member
0 Kudos

Hi All,

I got a requirement where i need to copy the populated custom fields including the appropriate field labels into item text in sales order creation and i am provided with Text Procedure: Z1 and Text ID: 00002. kindly help me.

Thanks,

Preethi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You have to use the FM SAVE_TEXT to save the text in the releavnt text.

Cheers

VJ

9 REPLIES 9

Former Member
0 Kudos

Hi,

You have to use the FM SAVE_TEXT to save the text in the releavnt text.

Cheers

VJ

0 Kudos

Hi VJ,

The Fields and their respective field labels that should be copied to item text are from VBAP table. With the given Text Procedure:Z1 and Text ID: 00002,

Please provide me the relevant import and export parameters for the FM Save_Text .

Thanks,

Preethi.

0 Kudos

thead-tdobject = 'VBBP'.

thead-tdname = order number + item number.

thead-tdid = '0002'.

thead-tdspras = sy-langu.

pass thead for the Import parameter 'HEADER'.

Former Member
0 Kudos

Hi Preethi,

USE FM <b>READ_TEXT

EDIT_TEXT

SAVE_TEXT</b>

REWARD POINTS IF HELPFUL.

Regards,

Hemant

Former Member
0 Kudos

hi,

I have tried with save_text. but its not copied to the item text tab.

(goto->item->texts)

here is my code:

DATA : gt_text TYPE TABLE OF tline WITH HEADER LINE,

gt_textname LIKE thead-tdname,

gt_textobject TYPE TABLE OF thead WITH HEADER LINE.

CONSTANTS : c_0002 TYPE thead-tdid VALUE '0002',

c_vbbp TYPE thead-tdobject VALUE 'VBBP'.

CONCATENATE xvbap-zzrelid xvbap-zzsorg2

xvbap-zzsorg3 xvbap-zzsorg4

xvbap-zzsorg5 xvbap-zzsorg6

xvbap-zzsorg7 xvbap-zzsorg8

xvbap-zzsorg9 xvbap-zzsorg10

xvbap-zzcusttrdgrp INTO gt_textname.

gt_textobject-tdid = c_0002.

gt_textobject-tdname = gt_textname.

gt_textobject-tdobject = c_vbbp.

gt_textobject-tdspras = sy-langu.

APPEND gt_textobject.

CONCATENATE 'relationship Owner:' vbap-zzrelid INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 2 :' vbap-zzsorg2 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 3 :' vbap-zzsorg3 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 4 :' vbap-zzsorg4 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 5 :' vbap-zzsorg5 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 6 :' vbap-zzsorg6 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 7 :' vbap-zzsorg7 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 8 :' vbap-zzsorg8 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 9 :' vbap-zzsorg9 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CONCATENATE 'sales org 10 :' vbap-zzsorg10 INTO gt_text-tdline

SEPARATED BY space.

APPEND gt_text.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = gt_textobject

savemode_direct = 'X'

TABLES

lines = gt_text

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

IF sy-subrc <> 0.

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

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

ENDIF.

kindly resolve y it is not copied to the item text tab and also in which user exit i need to place my code.

Thanks,

Preethi.

0 Kudos

Hi ,

first try manully , then u wll come to know what u have to pass.

<b>Text Name 0111200006000100<b>--->VBELN+VBELP</b>

Language EN-<b>-->LANG</b>

Text ID 0001 Material sales text

Text Object VBBP Sales Item texts</b>

Regards

Peram

0 Kudos

Hi

use the fun module CREATE_TEXT for creating Long texts in Order Item

see the sample code

  • Call the Function Module to Create Text

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = '0002'

flanguage = dl_lan

fname = dl_name (Order No + Item No)

fobject = 'VBBP'

save_direct = 'X'

fformat = '*'

TABLES

flines = dt_lines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Long Text Creation failed '(001),

itab-asnum.

ELSE.

WRITE:/ 'Long Text Created Successfully '(002),

itab-asnum.

ENDIF.

Reward points if useful

Regards

Anji

0 Kudos

hi

try passing 'X' to INSERT export parameter of the fm

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = gt_textobject

savemode_direct = 'X'

INSERT = 'X' -


> this one

TABLES

lines = gt_text

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

if helpful, reward

Sathish. R

Former Member
0 Kudos

Hi,

I have tried with Create_text also. still i am not able to see the text in the item text tab and also in which user exit we need the place the code.

Thanks & Regards,

Preethi G.