on 2025 Jan 06 12:48 PM
Hallo,
I am trying to update the short text of an inspection lot using SAVE_TEXT. But I can not get it to work. Is there any other way to update the short text of the Inspection Lot. Or How can I fix this approach.
Any help is appreciated.
Thanks
DATA lt_lines TYPE TABLE OF tline.
DATA ls_line TYPE tline.
DATA ls_header TYPE thead.
" Prepare header
ls_header-tdobject = 'QPRUEFLOS'.
ls_header-tdname = ls_usagedec-insplot. " Inspection Lot Number
ls_header-tdid = 'QAVE'.
ls_header-tdspras = sy-langu.
" Prepare text line
ls_line-tdformat = '*'.
ls_line-tdline = lv_shorttext. " Text to be filled in the ShortText
CALL FUNCTION 'SAVE_TEXT'
EXPORTING CLIENT = SY-MANDT
header = ls_header
insert = 'X'
savemode_direct = 'X'
TABLES lines = lt_lines
EXCEPTIONS id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
" Handle error in setting text
APPEND VALUE #( msgty = 'E'
msgid = 'ZQ'
msgno = '001'
msgv1 = 'Error setting text for inspection lot'
msgv2 = ls_usagedec-insplot
prot_zeile = 'Error setting text for inspection lot' ) TO e_protocol.
e_subrc = 4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Request clarification before answering.
Hello there
It seems you've got a few things mixed up: the inspection lot short text has TDID = 'QALS'. 'QAVE' on the other hand is for the Usage Decision long text. Also, as @raymond_giuseppi correctly pointed out, SAVE_TEXT will save the long text. But you should still be able to use it, since the first 40 (?) characters of the long text are automatically saved into QALS-KTEXTLOS. Lastly, only concatenate MANDT and PRUELFOS into TDNAME (i.e. without 'L').
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.