Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8985

Using SAVE_TEXT in VF01 for item texts

$
0
0

Hi guys,

 

A colleague wants to save an item text in the billing process (VF01 transaction). As you should know, there is no billing document number yet when we are creating the invoice using that transaction. He is programming at RV60AFZZ include, FORM userexit_save_document_prepare. This is his try:

 

LOOP AT xvbrp.
         CONCATENATE xvbrp-vbeln xvbrp-posnr INTO lw_thead-tdname.
*        CONCATENATE c_objectname xvbrp-posnr INTO lw_thead-tdname.
         lw_thead-tdid = 'ZZZZ'.
         lw_thead-tdobject = 'VBBP'.
         lw_thead-tdspras = 'E'.
         lw_thead-tdfuser = sy-uname.
         lw_thead-tdfdate = sy-datum.
         lw_thead-tdftime = sy-uzeit.

         CALL FUNCTION 'SAVE_TEXT'
           EXPORTING
             client          = sy-mandt
             header          = lw_thead
             savemode_direct = 'X'
           TABLES
             lines           = t_tline
           EXCEPTIONS
             id              = 1
             language        = 2
             name            = 3
             object          = 4
             OTHERS          = 5.
         IF sy-subrc = 0.
           CALL FUNCTION 'COMMIT_TEXT'
           EXPORTING
             OBJECT   = lw_thead-tdobject
             NAME     = lw_thead-tdname
             ID       = lw_thead-tdid
             LANGUAGE = lw_thead-tdspras
           EXCEPTIONS
             OTHERS   = 1.
           IF SY-SUBRC NE 0.
           ENDIF.
           CLEAR: lw_thead-tdname.
         ENDIF.

       ENDLOOP.


But he is not saving the text, we dont know why. Constant c_objectname has been defined so:

c_objectname TYPE vbeln_vf VALUE 'XXXXXXXXXX'.

But without success... We saw XXXXXXXXXX000010 as tdname in debugger...  Do you know if the issue is the TDNAME field? What should be a correct value for LW_THEAD-TDNAME? We know the item position but not the billing document number yet, where can we get correct tdname?... or did he fail in some other point?


Thank you!


Viewing all articles
Browse latest Browse all 8985

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>