Skip to Content

BOM Long Text Not Updating

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Dec 31, 2014 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Dec 31, 2014 at 09: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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Dec 31, 2014 at 10:43 PM

    Is there any reason why the CALL FUNCTION 'SAVE_TEXT' is just a comment?

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 01, 2015 at 05:06 AM

    Hi,

    Is the language in which it is executed and language you are checking the same?

    Add comment
    10|10000 characters needed characters exceeded