2014 Nov 27 8:34 AM
Hi Experts,
I need to add something to the Long Text Field in the Production Order from my ABAP Program. So anyone know to how to do that, by using a BAPI or Function Module .
Hi Experts,
I need to add something to the Long Text Field in the Production Order from my ABAP Program. So anyone know to how to do that, by using a BAPI or Function Module .
2014 Nov 27 8:50 AM
2014 Nov 27 11:22 AM
Hi Srilakshmi Godavarthi...
What are the import parameter should I passed ?
2014 Nov 27 12:23 PM
Hi,
refer below code. Please note, TDID will differ based on what text you need to update. You can check the text ID (TDID) in your standard transaction and write the code accordingly.
CONCATENATE sy-mandt l_aufnr INTO l_header-tdname.
l_header-tdid = 'KOPF'.
l_header-tdobject = 'AUFK'.
l_header-tdspras = sy-langu.
wa_lines-tdline = ls_good-value.
wa_lines-tdformat = '*'.
APPEND wa_lines TO li_lines.
CLEAR wa_lines.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = l_header
savemode_direct = 'X'
lines = li_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5
2014 Nov 28 1:29 AM
Hi anuradha,
The above link has all the details in it.
The below things highlighted in Green can be used with out any changes. Where ever it is highlighted in Red , please replace with your values like production order and your text text.
DATA: es_header TYPE thead,
es_lines TYPE tline,
et_lines LIKE TABLE OF es_lines,
wa_aufk TYPE aufk.
CONCATENATE sy-mandt '000012345678' INTO es_header-tdname.
es_header-tdobject = 'AUFK'.
es_header-tdid = 'KOPF'.
es_header-tdspras = sy-langu.
es_lines-tdformat = '*'.
es_lines-tdline = 'Sample text line one'.
APPEND es_lines TO et_lines.
es_lines-tdformat = '*'.
es_lines-tdline = 'Sample text line two'.
APPEND es_lines TO et_lines.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
* CLIENT = SY-MANDT
header = es_header
* insert = ''
savemode_direct = ' '
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
lines = et_lines
* 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.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
object = es_header-tdobject
name = es_header-tdname
id = es_header-tdid
language = es_header-tdspras
savemode_direct = ' '
* KEEP = ' '
* LOCAL_CAT = ' '
* IMPORTING
* COMMIT_COUNT =
* TABLE
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
COMMIT WORK AND WAIT.
Regards
Sri
2014 Dec 02 3:44 AM