Find header-text in VA01 before save
In a salesorder creation (VA01) I have inserted a text in the header.
Goto - header - text.
Before saving the document, I need to see if there is any text - and what the text is.
The tables are not updated, so I can't make a look-up there.
Any suggestions?
Br
Lars
Hi
I found this old post with valuable info from Bianchi, but there was no complete example, so here is one.
I made this solution in a VL01N exit, but it should be quit easy to adjust it to work in VA01, and many other transactions.
* Get the texts
DATA: memory_id(30).
DATA theader LIKE thead.
DATA BEGIN OF catalog OCCURS 50.
INCLUDE STRUCTURE tcatalog.
DATA END OF catalog.
* 1. Get catalog of current texts -
* the catalog links the text ids (TDID) to an internal id for the temporary texts
REFRESH catalog.
IMPORT catalog FROM MEMORY ID 'SAPLSTXD'.
IF sy-subrc > 0.
CLEAR catalog. REFRESH catalog.
ENDIF.
* Find internal catalog id for text Z022
LOOP AT catalog WHERE tdobject = 'VBBK'
AND tdid = 'Z022'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
* Build memory id for the selected text id (Z022)
CONCATENATE 'SAPLSTXD' catalog-id INTO memory_id.
* Import data from memory
IMPORT thead TO theader
tline TO it_lines
FROM MEMORY ID memory_id.
* I didn't bother to investigate the following routine - it just seems to be working
PERFORM read_reference_lines(saplstxd)
TABLES it_lines
USING sy-mandt
theader.
* IT_LINES now contains the temporay text in same format as
* if it was read from database with function module READ_TEXT
LOOP AT it_lines ASSIGNING <fs_lines>.
CASE sy-tabix.
WHEN 1.
g_tline_z022_1 = <fs_lines>.
WHEN 2.
g_tline_z022_2 = <fs_lines>.
WHEN 3.
g_tline_z022_3 = <fs_lines>.
WHEN 4.
g_tline_z022_4 = <fs_lines>.
WHEN 5.
g_tline_z022_5 = <fs_lines>.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDLOOP.
ENDIF.
Message was edited by: Thomas Madsen Nielsen
PS. This example will only work in create mode (VL01N). In Change mode VL02N you need in some cases to read the data from database with READ_TEXT.
Similar Messages
-
How to read header texts in the on save user exit of VA01
Hi Experts,
I have a requirement to read the header texts in the on save user exit.
I have to check whether departmental code in header text is not initial or not.
Can any one please pour in some points of how it can be done......
Thanks in Advance.
PremHi
U can use fm READ_TEXT:
DATA: THEAD LIKE THEAD,
TLINES LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
THEAD-TDID = <text id>.
THEAD-TDSPRAD = <language>.
THEAD-TDOBJECT = 'VBBK'.
THEAD-TDNAME = VBAK-VBELN.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = THEAD-TDID
LANGUAGE = THEAD-TDSPRAD
NAME = THEAD-TDNAME
OBJECT = THEAD-TDOBJECT
TABLES
LINES = TLINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
U can use it in all situations ( inserting and updating) because that fm returns the buffered text.
Max -
HI All,
There is a requirement to popuate the Header text of a sales order,
When the item -VBAP-POSNR for example : item 20,50,70 has beyond deliver date then I have to populate the header text
as - 'Item 20,50,70 has beyond deliver date'.
For this Im using SAVE_TEXT... but unable to get the right functionality how to make use of it.
Could anyone provide some pointers.
Thanks.Plz refrer to followin code I have used it and it works. Originally i wrote this code to copy text from ref SO to internal SO.
but it will work for u just change it a bit.
USER EXIT is USEREXIT_SAVE_DOCUMENT in include MV45AFZZ.
CONSTANTS: lc_language TYPE thead-tdspras VALUE 'E',
lc_object TYPE thead-tdobject VALUE 'VBBP',
BE CAREFUL with TEXT ID
LOOP AT lt_text_copy INTO ls_text_copy WHERE matnr = l_matnr.
Read the maintained text (w.r.t Reference Order)
MOVE: ls_text_copy-tdid TO l_id,
ls_configuration-atwrt TO l_name.
Wait for a few moments before reading the data.
WAIT UP TO 20 SECONDS.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = l_id "(Text ID of text to be read)
language = lc_language "(Language of text to be read)
name = l_name "(Concatenated value of VBELN and POSNR)
object = lc_object "(Object of text to be read)
IMPORTING
header = ls_header "(Object of text to be read)
TABLES
lines = lt_lines "(Lines of text read)
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
Create the text (w.r.t Current Sales Order)
Name of the text to be created
MOVE: p_vbak-vbeln TO l_vbeln,
ls_vbap-posnr TO l_posnr.
CONCATENATE l_vbeln l_posnr INTO l_so_posnr.
CLEAR l_name.
MOVE l_so_posnr TO l_name.
Wait for a few moments before writing the data.
WAIT UP TO 20 SECONDS.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = l_id "(Text ID of the text to be created)
flanguage = lc_language "(Language of the text to be created)
fname = l_name "(Name of the text to be created)
fobject = lc_object "(Object of the text to be created)
save_direct = 'X'
TABLES
flines = lt_lines "(Lines of the text to be created)
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = ls_header
insert = 'X'
savemode_direct = 'X'
TABLES
lines = lt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
Clear variables
CLEAR: l_id, l_name.
ENDLOOP. "(END OF LOOPING ON TEXT IDs)
ELSE.
when material does not exists in the ztable.
EXIT.
ENDIF.
ENDLOOP. "(END OF LOOP ON THE SALES ORDER LINE ITEM)
ENDCASE.
ENDIF.
ENDFORM. " ZZ_TEXT_COPY
Edited by: Prasenjit Singh Bist on Aug 23, 2011 3:35 PM -
Update the z table from the header text of VF01 on save
Hi All,
I have a Z table 'ZEXIM_LICDETAILS'. Whenever a billing doc. of type 'ZEXP' is created with tcode VF01, the Z table fields should also be updated. I have learned that we cannot include tabs in Billing Doc, so the licence number is put in the header text of the VF01.
Is there any way that I can update my Z table from header text, when we save the VF01.
Waiting for your repy in anticipation.
Thanks a lot in advance,
AnuWrite code in USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)
Reddy -
hi experts.
i am using "fbcj" transaction code but i need an information about "document header text" area .
when i save a document with fbcj transaction , this document's "document header text" is always empty. i have to enter some numbers in this area before the save document. how can i fix it?Hi,
Please refer this link :
is it possible to configure the reference-document date as mandatory -FBCJ
Regards,
Pramitha. -
Reg: Header text updation in VL02n transaction
Hi Experts,
i have one requirement in return delivery.
I am executing one customizing trasaction, and it displays screen.
In that screen i am editing the fileds and when i click on the save button i need to update in delivery transaction header texts (VL02n transaction goto header texts).Hi,
Use the SAVE-TEXT FM as below.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = LS_THEAD
IMPORTING
NEWHEADER = LS_THEAD
TABLES
LINES = TLINETAB
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC = 0.
Where LS_THEAD, CONTAINS:
TDOBJECT VBBK
TDNAME 00999999(Your delivery no)
TDID Z950
TDSPRAS E.
You can find this details, when you go to the transaction(VL02N) and enter some text and do the debug on SAVE_TEXT FM, then get the values it uses to save the text, use the same in you program.
Hope this helps,
Cheers,
Srini. -
Hi,
I have a requirement that I need to capture an order header text in user exit save document (in mv45afzz) and download that info in a file (This file contains shipment info which needs to the sent to carrier provider and it needs to be instant - that is immediately after order creation)
In that user exit I tried function module read_text with name as 'XXXXXXXXXX' or by providing the order number but both doesn't get the result. The header info is available in XTHEAD structure in that user exit. For the text, I tried XTLINE / other TLINE internal tables, but I coundn't get a suitable table where I can get the text info.
Pl let me know your ideas.
Thanks,
KrishThanks Usha.
But I already tried STXL but it doesn't show up in exit_Save_document in MV45AFZZ. The text is just a single line probably less than 30 char.
Thanks,
Krish -
How to display Header Texts that you find in Sales Order and Billing Doc..
Hi,
I am having some problems accessing the text that is typed in the Header Texts area of the Sales Order and Billing. To access the Header Text you should first trigger the Sales Order (VA02) then once in the Sales Order Click Goto -> Header -> Texts. The same follows to the Billing.
I need to extract what is typed here on to a report. First of all I cant figure out which table is used to save this information. I am suspecting that this information is encoded and stored in a table. To display this I may need to decode it.
Is there some one who could help me to archive this please!!!
Many Thanks,
KishanHi Kishan,
The texts you find in all SAP Object, like orders, invoice, materials, ... can be extract with FM 'READ_TEXT'.
To know the parameters of the FM, you 'll have to go to the text ( in plain page mode ), then you do "GOTO" -> "HEADER", and a pop-up window opens with the parameters you need ( Text name, language, text id, text object ).
The table "t_tdline" contains the entire text .
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = w_id
language = sy-langu
name = w_name
object = w_object
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
tables
lines = t_tdlines
hope this helps.
Erwan. -
Reg sales order Header text VA01/VA02
Hi,
In VA01/VA02 ..
From menu bar
Goto -> Header -> Texts
In this texts tabstrip left side Form header, Header note1, Header note2 & Geo transmit status
These 4 elements are there.
Now the above 4 elements r working if u r double clicking on them, then u can enter the text.
but my requirement is that should work even if u press single click also...
How to achieve it..
Thanks in advance..
VRHi venkat,
can you please address my problem, as u got same problem like me... below is the details ...
I am facing some problem during the recording of hader text.. Details given below...
I need to do this by using BDC...
 VA01 Steps as follows:
1. Open VA01
o Enter G2 or L2 order Type
o Enter 9991 for Sales Org
o Enter 01 for Dist Channel
o Enter 99 for Division
2. Enter Customer SAP # from spreadsheet to ship to and sold to
(Enter some appropriate number)
3. Enter Material Code from spreadsheet to Material
(Enter some appropriate number)
4. Enter target quantity as 1
5. Enter Billing date as system date
6. Go to Sales Tab
7. Select Blank for billing block
8. Enter order reason 013 for G2 type or 012 for L2
9. Goto Header, Texts, Choose Invoice header text
10. Enter SVB# from file as well as Quarter Text from file in notes
11. Save
this is want i need to do in order to create invoice serivce request by using BDC.
I can able to get the fields till 8 th point ( i can able to write the program ), but from the 9 th point i m facing the problem..
Bcz it just i need to enter some text here..( may be it's bcz of click )
This is could not able to do it , can you please help me how can i do this ?
Please let me know if i m not clear with my explanation...
Looking forward for your response...
Regards,
Suresh... -
Storing sales order header text prior to SAVE
Hi.
I have a requirement to manually create a header text during sales order create based on certain criteria. I believe I would need to put this text into the internal storage/memory so that it would be as if the user entered it. Then upon save, this header text would be associated with the newly created order. I just cant figure out how to accomplish that.
I cannot find any method to create the text since there is no sales order number (TDNAME) available at the time.
Can this be done? Any help would be greatly appreciated.
Thanks.
Mike.SAP handles this somehow, so I'm going to take a guess at how it works....I think there's a text table and inside there the TDNAME will have the temporary SD doc number (like &0000000001 or something).... If you can find that and add your texts with the TDNAME same as rest of the internal text table, and 00000 appended for the POSNR (0=Header level in SD speak), SAP should insert these for you at SAVE... A suggestion: I haven't tried this and can't verify since my installation doesn't run logistics.
-
Bdc for sales header text va01
we need to write a bdc program for va01. In that we need to
upload header text also .
So please kindly tell me how to upload flat file to va01 along with
header text.And how we need to declare the flat file.
if it is not possible through bdc then tell me how to do with bapi.
thank you so much for all the repliesRecord the transaction properly for header text along with other fields properly, it will generate the code for you when you save the recording and create the Program using the Recording.
if not You can go with the BAPI,
BAPI : BAPI_SALESORDER_CREATEFROMDAT2
Table parameter ORDER_TEXT is used for the creation of the text.
Read the documentation of the BAPI. -
Tcode FV50: How to find long text in FI Document line item Before Saving.
Hi,
How to find long text in FI Document line item.
During Parking of the FI document through Tcode FV50 i m giving the some text in the long text not in the text field.
I would like to validate the Long Text Before Saving in user exit "U300" under the "Sunstitution" .
Please anybody can be help me out where exactly this long text is going to be stored or in which internal table or memory id.
Please give me the answer as soon as possible .
Note:- Read_Text function module is not useful. Because Read_text useful after saving document.Hi Amit,
In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
Just try to explore in your system how the other validations are maintained.
After you are done with all your code, you have to run the regeneration program RGUGBR00.
Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS & TRACE PROG. GENERATE CALLS .
Hope this make your doubt clear.
Regards
Abhii -
Hi All,
I'm creating a BDC session calling the VA01.
my problem is where do I put my code? I test it and I still got a blank in header text pick list.
Codes is more helpful so I can compare my work.
Thanks.here is my code for BDC.
data: begin of record,
TXLINE_02_028(072),
end of record.
****MESLAN
clear: v_itm, v_kwmeng, v_mabnr.
LOOP AT t_hdr .
*-- HEADER
PERFORM fill_dynpro USING 'SAPMV45A' '0101' 'X'.
PERFORM fill_field USING: 'VBAK-AUART' p_auart,
'VBAK-VKORG' t_hdr-vkorg,
'VBAK-VTWEG' t_hdr-vtweg,
'VBAK-SPART' t_hdr-spart,
'BDC_OKCODE' '/00'.
PERFORM fill_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'KUAGV-KUNNR' t_hdr-ablad,
'RV45A-KPRGBZ' 'D',
'VBAK-LIFSK' p_lifsk,
'VBAK-AUGRU' p_augru,
'BDC_OKCODE' '/00'.
PERFORM fill_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'KUAGV-KUNNR' t_hdr-ablad,
'KUWEV-KUNNR' t_hdr-ablad,
'RV45A-KPRGBZ' 'D',
'VBAK-LIFSK' p_lifsk,
'VBAK-AUGRU' p_augru,
'BDC_OKCODE' '=KBES'.
PERFORM fill_dynpro USING 'SAPMV45A' '4002' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'VBKD-BSARK' P_BSARK,
'BDC_OKCODE' '/00'.
PERFORM fill_dynpro USING 'SAPMV45A' '4002' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'VBKD-BSARK' P_BSARK,
'BDC_OKCODE' '/EBACK'.
PERFORM fill_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'KUAGV-KUNNR' t_hdr-ablad,
'KUWEV-KUNNR' t_hdr-ablad,
'RV45A-KPRGBZ' 'D',
'VBAK-LIFSK' p_lifsk,
'VBAK-AUGRU' p_augru,
'BDC_OKCODE' '=POAN'.
LOOP AT t_line WHERE bstnk EQ t_hdr-bstnk . " Select all line items
*-- LINE ITEMS
CONCATENATE 'RV45A-MABNR(' '0' VAL ')' INTO v_MABNR.
CONCATENATE 'RV45A-KWMENG(' '0' VAL ')' INTO v_kwmeng.
PERFORM fill_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'KUAGV-KUNNR' t_hdr-ablad,
'KUWEV-KUNNR' t_hdr-ablad,
'RV45A-KPRGBZ' 'D',
'VBAK-LIFSK' p_lifsk,
'VBAK-AUGRU' p_augru,
v_MABNR t_line-matnr,
v_kwmeng t_line-kwmeng,
'BDC_OKCODE' '/00'.
*---- for t_curlin
v_itm = val * 10 .
t_curlin = t_line.
t_curlin-lineno = v_itm .
APPEND t_curlin .
*---- for line item
VAL = VAL + 1.
endloop.
VAL = 01.
PERFORM fill_dynpro USING 'SAPMV45A' '4001' 'X'.
PERFORM fill_field USING: 'VBKD-BSTKD' t_hdr-bstnk,
'KUAGV-KUNNR' t_hdr-ablad,
'KUWEV-KUNNR' t_hdr-ablad,
'RV45A-KPRGBZ' 'D',
'VBAK-LIFSK' p_lifsk,
'VBAK-AUGRU' p_augru,
'BDC_OKCODE' '=SICH'.
CALL TRANSACTION 'VA01' USING t_bdctab
MODE p_mode
UPDATE c_s
MESSAGES INTO t_message .
IF sy-subrc NE 0 . " Post errored sessions- for correction
v_errflg = c_x . " Online posting error - open session
v_errno = v_errno + 1 .
PERFORM append_mail_table .
PERFORM open_session .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'VA01' "c_va01
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
TABLES
dynprotab = t_bdctab
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
ELSE .
t_text-tdline = t_hdr-text .
APPEND t_text .
CLEAR t_text .
WRITE sy-msgv2 TO v_vbeln RIGHT-JUSTIFIED .
TRANSLATE v_vbeln USING c_0 .
v_tdname = v_vbeln . "' order no.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_z961
flanguage = p_spras
fname = v_tdname
fobject = c_vbbk
save_direct = c_x
FFORMAT = '*'
TABLES
flines = t_text
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
CLEAR t_text . REFRESH t_text .
IF sy-subrc NE 0 .
WRITE : / c_er_load , v_tdname .
ENDIF .
v_succno = v_succno + 1 .
ENDIF .
CLEAR t_bdctab . REFRESH t_bdctab .
endloop.
IF v_errflg EQ c_x .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc EQ 0 .
MESSAGE i260(zo) WITH text-i01.
ENDIF .
ENDIF .
ENDFORM. -
How to read header text in MM contract (ME31K/ME32K) before saving record?
Hi All,
In ME31K / ME32K (Contracts), before saving the contract I would like to check if the user has entered header text in the contract or not.
I am using customer exit MM06E005.
Can anybody help me with this?
Thanks in advance.Try creating dummy text id which will be part of text determination procedure @ Customers sales text & document header text.
else, maintain the SO10-text against this text ID. whenver user createds quotation this text will be defaulted irrespective of the cusotmer.
then based on if user want to modify the text they have to enter manually in this text id. print this text in header.
Regards,
Reazuddin MD -
How to find out, whether any invoice is having header text or not.
HI all,
How to find out, whether any invoice is having header text or not. wheich table we have to refer.
Thanks
mahaboobHi,
You need to use FM READ_TEXT.
First you have to determine what text Object/ID/Language you want to read (you can have N text objects for an invoice header).
The easiest way to do this is to have an example document with the text you want to read.
For example in VF03.
1-Goto->Header->Header Texts.
2-Click on the text you want to read
3-Double click on the text (Right side box) This will take you
4-Goto->Header
This will give you the data you need to use in the READ_TEXT F.M.
Maybe you are looking for
-
Display screen shifts to left and right
Hi, The display on my new iMac will occasionally shift about 1 to 2 inches to the left or to the right. It will hold that position for several seconds. During this time the system is unresponsive to the keyboard or mouse entries. If the screen fir
-
How do I get the best image quality on Plasma HD display?
I have lots of pictures taken with a 7 Megapixel camera, I've made some slideshows it iPhoto. I have a 42 inch HD plasma TV with HDMI and component video inputs, how do I hook my Powermac to the plasma TV to see the best possible quality on my plasma
-
Hi, I have created following embedded code <object width='576' height='353' ID="Object1" VIEWASTEXT> <param name='movie' value=' http://invind05/Rohit2/find_url.swf' /> <param name='wmode' value='transparent'/> <embed src=' http://invind05/Rohit2/fin
-
#Error when missing values
I know I have seen this before but cant remember the fix. We have columns A and B, then a variance column. Users dont want to suppress so sometimes there is #missing in both columns so the variance column is returning a #Error. I can change the suppr
-
Is MapViewer meant to work with Safari? If I try and drag and drop a map around, I can pick up the map tile itself, but can't drag the whole map. Anyone know a workaround?