‎2011 Aug 19 9:19 AM
Hi gurus,
I'd like to know if is it possible to get the header text when creating an invoice to do some validations and checks.
What I want is a structure or some way to get them on a requirement routine for message determination or from the invoice user exit.
[http://img40.imageshack.us/img40/615/dibujoaiw.png]
I already know you can get those texts from function READ_TEXT or from table STXH once the document is created, but i want to get them when creating and I don't have the document number yet.
Thanks in advance
‎2011 Aug 19 9:46 AM
Hi
READ_TEXT should work fine, but try to transfer XXXXXXXXXX as name
Max
‎2011 Aug 19 12:40 PM
Hi Max,
Thanks for answering.
I have been making some tests and it works if using the temporal ID in the field
NAME. For example: '&000000001'. (this is just needed when creating, if not you can get the NAME from
komkbv3-vbelnSeems like the text values are selected from the buffer on creating.
As this ID is asigned depending on the number of documents you are processing at once, you gotta know it for each document. To do this, you can use the global variable
MSG_OBJKYwhich has the temp ID for each document.
So as a resume you will have something like this:
IF sy-tcode = 'VF03' OR sy-tcode = 'VF02'.
va_tdname = komkbv3-vbeln.
ELSE.
va_tdname = MSG_OBJKY'.
ENDIF.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = ID
LANGUAGE = LANGUAGE
name = va_tdname
object = 'VBBK'
TABLES
LINES = it_tdline
EXCEPTIONS
ID = 1
LANGUAGE = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8. Regards