12-31-2014 5:47 AM
Hi Friends,
Here one requirement is ,Need to update the BOM long text for individual item. I have used below code
while executing this , does not shows any error. but while checking in cs02 , cs03 values are not showing. Anyone please suggest me to do.
CALL FUNCTION 'CO_ZK_TEXTKEY_STPO'
EXPORTING
stlkn = '1' "item-stlkn
stlnr = '00000108' "item-stlnr
stlty = 'M' ":item-stlty
stpoz = '2' "item-stpoz
IMPORTING
ltsch = tdobject.
txhead-tdname = tdobject.
txhead-tdid = 'MPO'.
txhead-tdspras = sy-langu.
txhead-tdobject = 'BOM'.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'capacitor'.
APPEND g_t_tlines.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'Resistor'.
APPEND g_t_tlines.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'Resistor'.
APPEND g_t_tlines.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'Transformer'.
APPEND g_t_tlines.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'Inductor'.
APPEND g_t_tlines.
g_t_tlines-TDFORMAT = '*'.
g_t_tlines-tdline = 'coil'.
APPEND g_t_tlines.
txhead-tdlinesize = '40'.
*CALL FUNCTION 'SAVE_TEXT'
* EXPORTING
* client = sy-mandt
* header = txhead
* insert = 'X'
* savemode_direct = 'X'
* owner_specified = 'X'
** local_cat = ''
* TABLES
* lines = g_t_tlines
* EXCEPTIONS
* id = 1
* language = 2
* name = 3
* object = 4
* OTHERS = 5.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = txhead-tdobject
NAME = txhead-tdname
ID = txhead-tdid
LANGUAGE = txhead-tdspras
SAVEMODE_DIRECT = 'X'
KEEP = 'X'
* LOCAL_CAT = ''
IMPORTING
COMMIT_COUNT = sy-index
* TABLES
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
Regards,
Thangam.P
12-31-2014 7:01 AM
After executing above code STZU table also updating but not updating POTX1,POTX2 of STPO.
Please anyone suggest me where was the Wrong?
Regards,
Thangam.P
01-03-2015 7:57 PM
Like Jurgen has already mentioned. The SAVE_TEXT function is a generic function that works for any kind of text object. It will in no way update the fields in STPO. So if you want to update BOTH the long text AND the POTX1 & 2 in STPO, then you must do call the CSAP_MAT_BOM_MAINTAIN in addition to the SAVE_TEXT FM.
12-31-2014 9:41 PM
Try updating the bom with FM CSAP_MAT_BOM_MAINTAIN
In the table structure t_stpo, be sure to put your values for POTX1 & 2 in ITEM_TEXT1 and ITEM_TEXT2.
Hope this helps you.
Larry
01-02-2015 5:39 AM
Hi Larry Browning,
Yeah i did that and working fine. but i cant give more than 40 character in POTX1 and POTX2 fields. So only am choosing SAVE_TEXT.
Regards,
Thangam.P
01-03-2015 4:02 PM
Well, I guess I do not understand your problem. As I read it, your problem is that after you update the long text of a BOM item, STPO-POTX1 and STPO-POTX2 are still blank. What am I missing? Please clarify.
01-03-2015 4:36 PM
If it it is just about STPO-POTX1 and not about the long text, then I can tell your that the save_text function module is not at all supposed to update the STPO table, it updates STXH and STXL, thats all.
SAVE_TEXT function module is used for any long text in SAP and is not specific to BOM items.
12-31-2014 10:43 PM
Is there any reason why the CALL FUNCTION 'SAVE_TEXT' is just a comment?
01-02-2015 5:42 AM
Hi Jurgen,
Actually SAVE_TEXT is active only. I did mistake while copy and paste .
Regards,
Thangam.P
01-02-2015 3:12 PM
Would it be possible for you to copy and paste the current version?
It is just reading tea leaves if one has to look for errors and you give him the wrong code.
01-04-2015 6:55 AM
01-01-2015 5:06 AM
Hi,
Is the language in which it is executed and language you are checking the same?
01-02-2015 5:43 AM
Hi Jayanthi,
I was checked without mentioning language too.
Regards,
Thangam.P