05-12-2009 3:53 AM
Hi! I need to retrieve or do some checking on the Opportunity Number Header Text if this is filled or not when creating an invoice/quotation. I've already done this for the checking on VA23, I used FM read_text and it works. But for the checking on VA21, I can't retrieve the text. This is because FM read_text requires
1. ID - TDID
2. Language - SPRAS
3. Name - Doc Num
4. Object - TDOBJECT
and for VA21 since it technically still doesn't have a document number it can't read the text.
Is there any temporary table/structure where the text is saved, where I can retrieve the text?
05-12-2009 6:43 AM
Hi,
I think you are checking the header text in a program (Use exit/BAdi) before saving the document right? I have also faced the same scenario for tcode ME21N and ME22N. I resolved the issue in a BAdi .
Before saving the document the text is available for ls_name = space. i.e name = ls_name.
And the same text is available after saving the document for name = ls_name = Document number.
Try with this.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = l_wa_textid_hdr-tdid
language = sy-langu
name = ls_name
object = l_wa_textid_hdr-tdobject
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
Regards,
Raju.
05-12-2009 7:45 AM
Hi,
I tried what you suggested (using ls_name = space) but it still didn't work. It still can't retrieve the text.