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: 

PO Text saved with FM SAVE_TEXT does not appear in transaction MM03

Former Member
0 Kudos

Hello SDN,

I am using the function module SAVE_TEXT to batch upload Purchase Order Texts (viewable in transaction MM03).

I have the following parameters:


    tdhead-tdobject = 'MATERIAL'.
    tdhead-tdname = matnr. " material code (not necessarily 18 characters long)
    tdhead-tdid = 'BEST'.
    tdhead-tdspras = 'EN'. " or E
    ....

    CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
            CLIENT          = SY-MANDT
            HEADER          = tdhead
            INSERT          = 'X'
            SAVEMODE_DIRECT = 'X'
        TABLES
            LINES           = longTexts
        EXCEPTIONS
            ID              = 1
            LANGUAGE        = 2
            NAME            = 3
            OBJECT          = 4
            OTHERS          = 5
    .

This is working in the development machine but not in our QA box.

I don't know what the problem is. After using SAVE_TEXT, I tried to run the FM READ_TEXT to see if the text is in the system. It is.

We are using numeric material codes (still character type but only digits are allowed) and suspected that there should be leading zeroes, so I tried to append zeroes to make the length 18. The PO text still does not appear.

Please help.

--

Kyle

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello

Are you using FM COMMIT_TEXT after SAVE_TEXT ?

7 REPLIES 7

Former Member
0 Kudos

Hello

Are you using FM COMMIT_TEXT after SAVE_TEXT ?

0 Kudos

No, because with everything i've read so far, it seem that SAVE_TEXT is enough.

Is it required to call COMMIT_TEXT as well? or is this just redundant?

--

Kyle

Former Member
0 Kudos

Hi Kyle,

Ok, I'm assuming that the text is on the database, because you said you tried reading it again with READ_TEXT (hopefully in a new session, to make sure that it's really on the database).

Please check if your material has a purchasing view maintained. I believe that you might not see the purchase order text, if there's no purchasing view. I.e. check for your material if MARA-PSTAT contains an 'E' (for Einkauf, which is German for <i>Purchasing</i> - check the help on data element PSTAT_D). You can see that when you create a material manually and just enter basic data and purchasing text a purchasing view is generated.

Cheers, harald

p.s.: Via transaction OMSL you can check how your system is configured with respect to leading zeroes on material numbers.

0 Kudos

Hello all,

I tried to use COMMIT_TEXT after SAVE_TEXT but it did not work as well,

Yes, the text is in the database. After uploading, say, 1 PO text for one material, I tried to read it in a different session using FM READ_TEXT. The text I uploaded is there in the output of READ_TEXT.

The materials also have purchasing view maintained. (When I go to MM03 and entered a material, there won't be a selection for "Purchase Order Text" if mara-pstat for that material does not contain 'E'.)

I also checked transaction OMSL and there are no leading zeroes for the material codes.

Any other ideas? I really do not know where to go from this point.

All help is appreciated. Thanks!

--

Kyle

0 Kudos

Well, I suspect you tried the stupid approach and updated a text via your coding and then via MM02 and compared how the STXH records looked before and after (and the contents returned by READ_TEXT). Sounds suspicious that you do see the records on the database, because the data looks ok to me. So I really wonder what such a comparison would show....

Cheers, harald

p.s.: Just looked again at your coding. The language parameter should be set to 'E' not 'EN', but that shouldn't be a problem, because the field should be 1 character only, so the additional 'N' should get truncated.

0 Kudos

Hi Harald,

No I did not look at the database tables directly but I did trace transaction MM02 (which was a real pain, by the way).

At first I saved the text as usual using MM02, and tried to see if it would appear using FM READ_TEXT. It did not. This got me thinking if MM02 uses a different textid so I looked at table TTXID. only 4 objects are valid for object 'MATERIAL' so I tried these 4 against READ_TEXT and only the text-id 'BEST' is giving me results: the text I uploaded using my program, and not the one I created using MM02. So where did it go?

I traced MM02 and came to a point where the table for the long text is being built. Alas! it is appending zeroes to the material code. I modified my code accordingly and it worked. I checked transaction OMSL again but leading zeroes was not set.

tired

Thanks all! Problem solved.

--

Kyle

0 Kudos

Hi Kyle,

Sorry, should've told you probably how to read customizing transaction OMSL...

The key is not to look at the Leading Zeros checkbox, but instead a the Lexicographical one. If the latter is not selected, materials are stored with leading zeros (e.g. check OSS note [72286|https://service.sap.com/sap/support/notes/72286]).

Cheers, harald