Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BOM Long Text Not Updating

thangam_perumal
Contributor
0 Kudos

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 REPLIES 12

thangam_perumal
Contributor
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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.

JL23
Active Contributor
0 Kudos

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.

JL23
Active Contributor
0 Kudos

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

0 Kudos

Hi Jurgen,

              Actually SAVE_TEXT is active only.  I did mistake while  copy and paste .

Regards,

Thangam.P

JL23
Active Contributor
0 Kudos

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.

matt
Active Contributor
0 Kudos

He could also not paste commented out code...

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

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

0 Kudos

Hi Jayanthi,

               I was checked without mentioning language too.

Regards,

Thangam.P