‎2008 Feb 13 8:24 PM
Hi Guys,
I have been asked to create one function module in which I will pass the sales document number and it should return two tables i_vbak and i_vbap, the i_vbak should have header information of that particular sales oreder and i_vbap should have all item information of that sales order. Can anyone of you please help me how can I get this , as I haven't creatd any FM till now. so any help will be highly appreciated.
Thanks,
Rajeev !!!
‎2008 Feb 13 8:29 PM
The first thing to do is to read the [help file.|http://help.sap.com/saphelp_47x200/helpdata/EN/9f/db988735c111d1829f0000e829fbfe/frameset.htm]
Rob
‎2008 Feb 13 8:29 PM
The first thing to do is to read the [help file.|http://help.sap.com/saphelp_47x200/helpdata/EN/9f/db988735c111d1829f0000e829fbfe/frameset.htm]
Rob
‎2008 Feb 13 8:34 PM
Thanks for the reply Rob, I have gone through the file. What I have done as of now is I have created one function module and have passed one Import parameter as Vbeln and two tables as i_vbak and i_vbap. I think till now I am doing good. Now I need to write something in source code, so it will be great if you can tell me what should be written in the source code for my particular scenario.
Thanks,
Rajeev
‎2008 Feb 13 8:37 PM
Just a couple of SELECTs against the two tables. You probably also want to raise an exception if nothing is found.
Rob
‎2008 Feb 13 8:44 PM
Hi Rob,
This is what I have written and I think this one is working perfectly fine,
select * from vbak into table data_vbak where vbeln = vbeln.
select * from vbap into table data_vbap where vbeln = vbeln.
and now I have two questions:
1. I want to raise an exception if the document is found, so can you please tell me how can I get this.
2. In case if I just want to return one table that has got both the header and item details rather than returning two diff. tables, so please tell me how can i get this,
Thanks,
Rajeev !!!
‎2008 Feb 13 9:04 PM
1. Raise an exception for found or not found?
2. They have different structures - you should return two tables, not one.
Rob