09-26-2008 12:21 PM
Hi
Can Any One tel Abt how to replace the production order Long text with the appropriate sales order text
is there any sample program?
09-26-2008 12:34 PM
Read the Sales order text with the appropriate parameters ,
TDNAME = '10chars vbeln value'.
TDID "Check this value once
TDOBJECT = 'VBBK' " if it is header , VBBP if it is item
Read the text using the READ_TEXT function. using the text , with the following parameters
TDNAME client(3)+ AUFNR(12)
TDID KOPF " for header
TDOBJECT AUFK
TEXT is sales orders text.
with this use SAVE_TEXT or CREATE_TEXT function and update.
09-26-2008 12:34 PM
Read the Sales order text with the appropriate parameters ,
TDNAME = '10chars vbeln value'.
TDID "Check this value once
TDOBJECT = 'VBBK' " if it is header , VBBP if it is item
Read the text using the READ_TEXT function. using the text , with the following parameters
TDNAME client(3)+ AUFNR(12)
TDID KOPF " for header
TDOBJECT AUFK
TEXT is sales orders text.
with this use SAVE_TEXT or CREATE_TEXT function and update.
09-26-2008 12:40 PM
09-26-2008 12:49 PM
Hi Surendra,
Check this sample code. This code is for fetching the sales order header text then adding your own text and then for saving it.
REPORT z_test1.
TABLES:
thead.
PARAMETERS:
p_vbeln TYPE vbak-vbeln.
PARAMETERS:
p_textid TYPE thead-tdid.
DATA:
BEGIN OF t_thead OCCURS 0.
INCLUDE STRUCTURE thead.
DATA:
END OF t_thead.
DATA:
w_line TYPE i,
w_idx TYPE i,
w_flag TYPE i.
DATA:
BEGIN OF t_tline OCCURS 0.
INCLUDE STRUCTURE tline.
DATA:
END OF t_tline.
DATA:
w_test TYPE thead-tdname,
w_temp TYPE string VALUE 'TEST'.
START-OF-SELECTION.
w_test = p_vbeln.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = p_textid
language = sy-langu
name = w_test
object = 'VBBK'
TABLES
lines = t_tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc NE 0.
MESSAGE 'HEADER TEXT NOT FOUND' TYPE 'I'.
ENDIF.
END-OF-SELECTION.
LOOP AT t_tline.
IF t_tline-tdline = w_temp.
w_flag = 1.
ENDIF.
ENDLOOP.
IF w_flag NE 1.
t_tline-tdline = w_temp.
APPEND t_tline.
ENDIF.
REFRESH t_thead.
t_thead-tdobject = 'VBBK'.
t_thead-tdname = w_test.
t_thead-tdid = p_textid.
t_thead-tdspras = sy-langu.
APPEND t_thead.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = t_thead
savemode_direct = 'X'
TABLES
lines = t_tline
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4.
IF sy-subrc NE 0.
WRITE: / 'ERROR'.
ELSE.
COMMIT WORK.
WRITE: / 'TEXT SAVED'.
ENDIF.
LOOP AT t_tline.
WRITE: / t_tline-tdline.
ENDLOOP.
Regards
Abhijeet
09-26-2008 12:54 PM
Hi
Thnk u for ur answer my requirement is retrive the all production orders for 1 sales order and change the long text in production order with the sales order items text
09-26-2008 12:57 PM
09-26-2008 1:09 PM
09-26-2008 1:12 PM
09-26-2008 1:20 PM
09-26-2008 2:35 PM
Hi Vijay
can u Plz tel the field name of long text in Production order