‎2008 May 07 4:03 PM
Hi all,
could any one give me the function module that we use to upload the text into sales order or to any other document depend upon an id.(id could be customer or vendor .).
as am new to BOR's and GOS plz give me the details.
thanks in advance.
Suresh.
‎2008 May 07 4:05 PM
‎2008 May 07 4:27 PM
Hi Suresh Babu,
Function module name is : SAVE_TEXT . See the below documentation
____________________________________________________
Short Text
SAPscript: Save text
The function module writes a text module to the text file or text memory, depending on the specific text object.
The module can be used to change existing texts and to create new texts. If it is clear that it is a new text, this can be specified via the parameter INSERT. The result is better performance as a test read is not performed.
Parameters
CLIENT
HEADER
INSERT
SAVEMODE_DIRECT
OWNER_SPECIFIED
LOCAL_CAT
FUNCTION
NEWHEADER
LINES
Exceptions
ID
LANGUAGE
NAME
OBJECT
Thanks,
Greetson
‎2008 May 07 4:51 PM
Hi am looking for mass upload of text for any given id from the report not for SAP Script.
i hope save_text is used in sap scripts and need to give form name and other
parameters but do we have any functional modules or bapi's that we can use to upload
the text by giving only one id?(customer or vendor or any doc number etc..)
appreciate your help.
Thank you.
Suresh.
‎2008 May 07 5:23 PM
Hello Suresh,
SAVE_TEXT is not only used in SAPSCRIPT . We can use from Reports as well. Plesae check this standard SAP repot "/SAPDMC/SAP_LSMW_IMPORT_TEXTS" in your system , perfect example for your scenario.
Code :
*&----
*
*& Form INSERT_TEXT
*&----
*
-->P_TLINE
-->P_LTXTH
-->P_NUMBER_OF_TEXT
*----
*
FORM INSERT_TEXT TABLES P_TLINE STRUCTURE TLINE
USING P_LTXTH STRUCTURE /SAPDMC/LTXTH
P_NUMBER_OF_TEXT.
DATA:
L_SUBRC LIKE SY-SUBRC,
L_OBJECT LIKE THEAD-TDOBJECT,
L_NAME LIKE THEAD-TDNAME,
L_ID LIKE THEAD-TDID,
L_SPRAS LIKE THEAD-TDSPRAS,
L_TLINE LIKE TLINE OCCURS 0.
L_OBJECT = P_LTXTH-OBJECT.
L_NAME = P_LTXTH-NAME.
L_ID = P_LTXTH-ID.
L_SPRAS = P_LTXTH-SPRAS.
Prüfe OBJECT:
READ TABLE I_TTXOB WITH KEY TDOBJECT = L_OBJECT.
L_SUBRC = SY-SUBRC.
IF L_SUBRC <> 0.
PERFORM PUT_ERROR_MESSAGE
USING P_NUMBER_OF_TEXT
L_OBJECT
L_NAME
L_ID
'Ungültiges Text-Objekt (Prüftabelle &)'(011)
'TTXOB'.
ENDIF.
CHECK L_SUBRC = 0.
Prüfe ID:
READ TABLE I_TTXID WITH KEY TDOBJECT = L_OBJECT
TDID = L_ID.
L_SUBRC = SY-SUBRC.
IF L_SUBRC <> 0.
PERFORM PUT_ERROR_MESSAGE
USING P_NUMBER_OF_TEXT
L_OBJECT
L_NAME
L_ID
'Ungültige Text-Id (Prüftabelle &)'(012)
'TTXID'.
ENDIF.
CHECK L_SUBRC = 0.
Prüfe SPRAS:
READ TABLE I_T002 WITH KEY SPRAS = L_SPRAS.
L_SUBRC = SY-SUBRC.
IF L_SUBRC <> 0.
PERFORM PUT_ERROR_MESSAGE
USING P_NUMBER_OF_TEXT
L_OBJECT
L_NAME
L_ID
'Ungültige Sprache (Prüftabelle &)'(013)
'T002'.
ENDIF.
CHECK L_SUBRC = 0.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
ID = L_ID
LANGUAGE = L_SPRAS
NAME = L_NAME
OBJECT = L_OBJECT
IMPORTING
HEADER = I_THEAD
TABLES
LINES = L_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
L_SUBRC = SY-SUBRC.
IF L_SUBRC <> 0.
PERFORM PUT_ERROR_MESSAGE
USING P_NUMBER_OF_TEXT
L_OBJECT
L_NAME
L_ID
'Fehler bei CALL ''INIT_TEXT'' (Return-Code &)'(014)
L_SUBRC.
ENDIF.
CHECK L_SUBRC = 0.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = I_THEAD
SAVEMODE_DIRECT = 'X'
IMPORTING
NEWHEADER = I_THEAD
TABLES
LINES = P_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
L_SUBRC = SY-SUBRC.
IF L_SUBRC = 0.
ADD 1 TO NUMBER_OF_SUCCESSES.
ELSE.
PERFORM PUT_ERROR_MESSAGE
USING P_NUMBER_OF_TEXT
L_OBJECT
L_NAME
L_ID
'Fehler bei CALL ''SAVE_TEXT'' (Return-Code &)'(015)
L_SUBRC.
ENDIF.
ENDFORM.
Hope this answers your question.
Thanks,
Greetson
‎2008 May 07 7:46 PM
Hi
Thank you for your quick response.. but is there any function module for attaching a document?
more clearly..i have customer # as object key and i have a document that needs to be attached to that customer using object or GOS (generic object services).
is there any functional module available?
plz advice.