2008 Nov 10 5:03 PM
Hi All,
We have sales order created through a inbound 850 idoc. Now I have to add header text on sales order when it is created for E1EDK03 003 - DATUM, E1EDK03 004 - DATUM and E1EDK01 - ZTERM. How can get this information from 850 and display it on to sales order header text.
Thanks,
Veni.
2008 Nov 10 5:11 PM
easiest would be to take a user exit in IDOC_INPUT_ORDERS, read the segment you want the data from, and add an E1EDKT1 and E1EDKT2 segments there
further looking use custome function 009 in the function module, and add the text segemtns there based on your values
CALL CUSTOMER-FUNCTION '009'
EXPORTING
docnum = idoc_contrl-docnum
xinput_method = input_method
TABLES
dbdcdata = bdcdata
derrtab = errtab
dxvbap = xvbap
dxvbep = xvbep
dxvbadr = xvbadr
dxvbpa = xvbpa
dxvbuv = xvbuv
dedidc = idoc_contrl
dedidd = idoc_data
dd_flag_p = d_flag_p
dxkomv = xkomv
dxvekp = xvekp
dyvekp = yvekp
dxe1edkt2 = xe1edkt2
dxe1edpt2 = xe1edpt2
CHANGING
dd_flag_k = d_flag_k
dxvbak = xvbak
xwldat = wldat
dd_flag_v_vekp = d_flag_v-vekp
EXCEPTIONS
USER_ERROR = 01.
Edited by: MxG on Nov 10, 2008 12:21 PM
2008 Nov 10 5:11 PM
easiest would be to take a user exit in IDOC_INPUT_ORDERS, read the segment you want the data from, and add an E1EDKT1 and E1EDKT2 segments there
further looking use custome function 009 in the function module, and add the text segemtns there based on your values
CALL CUSTOMER-FUNCTION '009'
EXPORTING
docnum = idoc_contrl-docnum
xinput_method = input_method
TABLES
dbdcdata = bdcdata
derrtab = errtab
dxvbap = xvbap
dxvbep = xvbep
dxvbadr = xvbadr
dxvbpa = xvbpa
dxvbuv = xvbuv
dedidc = idoc_contrl
dedidd = idoc_data
dd_flag_p = d_flag_p
dxkomv = xkomv
dxvekp = xvekp
dyvekp = yvekp
dxe1edkt2 = xe1edkt2
dxe1edpt2 = xe1edpt2
CHANGING
dd_flag_k = d_flag_k
dxvbak = xvbak
xwldat = wldat
dd_flag_v_vekp = d_flag_v-vekp
EXCEPTIONS
USER_ERROR = 01.
Edited by: MxG on Nov 10, 2008 12:21 PM
2008 Nov 10 6:39 PM
HI MxG,
Thank you.
I went to SPRO to add Text Id's, I choosed Sales Document -> Header -> Sales Header -> Text Id's in Textprocedure. Here in new entries how should I give Seq no, ID and Access Seq. Do I have to just give the next available num or do I have to create these some where else.
Please help me.
Thanks,
Veni.
2008 Nov 10 6:49 PM
seems your config itself was not done. once you complete that, and include the text id in the text procedure, refer to that id in the user exit to populate that segment
2008 Nov 10 7:22 PM
HI MxG,
Where should I create TextId. Should I create under VBBK? And also where should I create AccessSeq.
Thanks,
Veni.
2008 Nov 10 7:49 PM
Hi,
I created Text Id's using SE75. Can you please let me know how to create Access Sequence?
Thnaks,
Veni.
2008 Nov 10 8:46 PM
2008 Nov 10 9:11 PM
Do you have a functional person repsonsible for maintaining the cofnig, if yes, i woudl prefer you to go to him, as you are not aware of the access sequences, and text determination procedure being used in your orders. if you arenot responsible for doing it normally driect it to the correct person.
But in case you are the one, open the question or move this thread to SD forum. i can reply there or someone else may even pick it up before me.
2008 Nov 10 10:17 PM
Hi MxG,
I was able to add Text Id and Access Seq. Now i am working on getting the new data of 850 IDOC on sales order header text.
Thanks,
Veni.
2008 Nov 10 11:06 PM
2008 Nov 11 4:20 PM
Hi All,
I wrote the following code but the text is not showing up in the header text. Is there anything wrong with my code. Please help.
Thanks,
Veni.
WHEN 'E1EDK03'.
MOVE SEGMENT-SDATA TO E1EDK03.
IF E1EDK03-IDDAT = '004'.
WRITE E1EDK03-DATUM TO PSDATE.
CLEAR: wa_thead, itline.
REFRESH: itline.
wa_thead-tdname = sales_document.
wa_thead-tdobject = 'VBBK'.
wa_thead-tdid = '0021'.
wa_thead-tdspras = sy-langu.
itline-tdformat = '*'.
itline-tdline = PSDATE.
APPEND itline.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = wa_thead
insert = 'X'
savemode_direct = 'X'
TABLES
lines = itline.
2008 Nov 11 4:55 PM
Hi,
I am getting following error. Can anyone please help me.
I/O error for text VBBK 0021 EN
Diagnosis
You want to read a text from the database, delete it, or save it to the database.
System Response
An error occurred when the database was accessed.
Procedure
Try repeating the procedure. If the error recurs, contact your system administrator.
Thanks,
Veni.
2008 Nov 11 5:41 PM
2008 Nov 11 6:20 PM
2008 Nov 11 6:29 PM
>
> Thanks.
please mark appropriately as i can see MxG is continuing following your problem.
That is the right way to say thanks on SCN.In this manner we often encourage ourself .
Please understand the motive and values of SCN.
2008 Nov 11 6:34 PM
Sorry. Thought I may have to open a new thred and with error from function module and opened another one.
I really appriciate all your help from SDN.
This site is very helpful.
Thanks,
Veni.
2008 Nov 11 6:36 PM
>
> Sorry. Thought I may have to open a new thred and with error from function module and opened another one.
wait Wait wait....
dont open new thread ..you can continue with this thread only.
2008 Nov 11 6:42 PM
Hi MxG and all,
We have a include for Customer Function 001 and I am writing the code in that include file.
I think may be I am not passing Tdname properly.
I debuged it and Tdline has Period Start Date in it.
Are there any other fields I missed to populate in my code.
Can someone please help me.
Thanks,
Veni.
2008 Nov 11 6:55 PM
Which program is that? As I mentioned above you dont need to call SAVE_TEXT in IDOC processing. In customer function 009 you need to populate xe1edpt2 segment properly with TDID, and your text, and SAp will take care of it by itself,.
if you want to call SAVE_TEXT use CUSTOMER-FUNCTION '004', which will have the Sales order#, and the IDOC data to be consumed in your code
2008 Nov 11 7:02 PM
Hi MxG,
How do I find out the CUSTOMER-FUNCTION for one of the include we have, which has Save_text to display item text. How can I see CUSTOMER-FUNCTION, I went to SE37 but it does not have this one.
Thanks,
Veni.
2008 Nov 11 7:10 PM
thats what I was asking which program is that. if its in IDOC_INPUT_ORDERS try ZXVEDU03 program that will have your code
in SE37 it will be EXIT_<main program name>_001
2008 Nov 11 7:11 PM
Hi MxG,
Found them. I used EXIT_SAPLVEDA_001 and it has include ZXVEDU03. I wrote my code here in the include ZXVEDU03.
The include with item text which has Save_text is EXIT_SAPLVEDA_003 - INCLUDE ZXVEDU05.
Thanks,
Veni.
2008 Nov 11 7:18 PM
Hi MxG,
EXIT_SAPLVEDA_009 has include ZXVEDU11 and it has some code. EXIT_SAPLVEDA_004 has include ZXVEDU06 and it is not created.
Can you please give me an example on how to use this in EXIT_SAPLVEDA_009 or EXIT_SAPLVEDA_004.
Thanks,
veni.
2008 Nov 11 7:18 PM
try moving your code to customer function 004 include ZXVEDU06. I think the issue is that yoru slaes order is still not committed in database when you are calling save_text. fucntion 003 is before commit work, so thats definitely not goin gto work, but you can try 004.
thats why I asked you to use customer fucntion 009, and populate ze1edpt2 only then let SAp populate that
2008 Nov 11 7:33 PM
Hi MxG,
How can I create the include ZXVEDU06. I went to se38 to create it, but it is not allowing me to create it.
This is the first time I am working with displaying texts on Orders, I did not know much of Customer Functions before and thats why scared to touch ZXVEDU11 as I did not want to mess up with other data.
I really learned so much related to this texts now. Thank you MxG.
Thanks,
Veni.
2008 Nov 11 7:35 PM
ideally you should go via EXIT_SAPLVEDA_004, doubleclick there, and then doubleclik on the program name, ignore the warning by pressing enter.
2008 Nov 11 7:48 PM
Veni,
Okay np probs if you are newbie with Exits.
we all were new at some time.
you can take help from FM IDOC_INPUT_ORDERS and search with term CALL CUSTOMER-FUNCTION '004' here you can see the example how this customer function has been implemented and what parametes you suppose to pass.
2008 Nov 11 8:37 PM
Hi MxG and Amit,
I am able to add one text on the order header texts. I will update you once I am done with the remaing two more texts.
I really appriciate all your help.
Regards,
Veni.
2008 Nov 11 8:51 PM
Hi MxG and Amit,
I am very happy to let you know that finally I displayed 3 texts on order header texts. I am very very thankful to all your help.
Regards,
Veni.
2008 Nov 11 9:00 PM