2007 Dec 03 6:58 PM
Tables:
itab1 like itab.
Import Parameters:
p_erdat like vbak-erdat.
p_vkorg like vbak-vkorg.
p_vtweg like vbak-vtweg.
p_spart like vbak-spart.
Source Code:
DATA:BEGIN OF ITAB OCCURS 0,
vbeln LIKE vbak-vbeln,
bsark LIKE vbak-bsark,
vtweg LIKE vbak-vtweg,
spart LIKE vbak-spart,
vdatu LIKE vbak-vdatu,
END OF ITAB.
SELECT vbeln bsark vtweg spart vdatu
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE ITAB1
WHERE
erdat = p_erdat AND
vkorg = p_vkorg AND
vtweg = p_vtweg AND
spart = p_spart.
I have created a Function Module in which I have given the above entries,but I am not getting any data in internal table itab1.Can anyone please suggest.points will be no doubt rewarded.
2007 Dec 03 7:04 PM
In order to get the values from this select query you must pass all 4 fields with values. If you don't put value to any field you will not get any data in the itab.
Make your fields as mandatory parameters.
Regards,
Naimesh Patel
2007 Dec 03 7:04 PM
In order to get the values from this select query you must pass all 4 fields with values. If you don't put value to any field you will not get any data in the itab.
Make your fields as mandatory parameters.
Regards,
Naimesh Patel
2007 Dec 03 7:17 PM
I am passing all 4 fields and it is also showing 2 entries but when i am entering inside it,it shows no entries,only 2 columns that is keypart and funcpart is coming.
Plz suggest.
2007 Dec 03 7:45 PM
2007 Dec 03 7:49 PM
Hi,
Your table Parameter is WRONG. YOu have declared it with type ITAB ( Which is a structure with two fields KEYPART
FUNCPART )
You should declare your own structure with required fields and then use that structure for declaring the parameter ITAB1 in your TABLES parameter for the Function Module
Declare a new structure with fields vbeln bsark vtweg spart vdatu.
Or
Declare your Tables Parameter ITAB1 with type VBAK
Message was edited by:
Abhishek Jolly
2007 Dec 03 7:51 PM
2007 Dec 03 8:22 PM
> I am passing all 4 fields <-- assuming that these are 4 import parameters
> and it is also showing 2 entries <-- what is 'it'? 2 entries means you see 2 records in itab1?
> but when i am entering inside it,it shows no entries, <-- What do you mean by "inside it"?
> only 2 columns that is keypart and funcpart is coming. <-- What do you mean by funcpart and keypart?
2007 Dec 03 9:24 PM
I mean when I loook into itab1 in output, not a single field that are present in itab is present in itab1.
Is there any error in declaring internal table?
2007 Dec 03 9:40 PM
Hi,
Your TABLES Parameter is WRONG. YOu have declared it with type ITAB ( Which is a structure with two fields KEYPART
FUNCPART )
You should declare your own structure with required fields and then use that structure for declaring the parameter ITAB1 in your TABLES parameter for the Function Module
<b>Create a new structure with fields vbeln bsark vtweg spart vdatu and use it in the tables parameter for ITAB1</b>
Or
<b>Declare your Tables Parameter ITAB1 LIKE VBAK</b>
<b>The TABLES Parameter ITAB1 is not using the Local Internal table structure declared in the Source code. Its using the Data dictinoary structure ITAB</b>
2007 Dec 03 9:41 PM
Try:
SELECT vbeln bsark vtweg spart vdatu
FROM vbak
APPENDING CORRESPONDING FIELDS OF TABLE ITAB1 "<===
WHERE ...
Rob
2007 Dec 03 7:06 PM
Hi,
1. change itab1 to itab
SELECT vbeln bsark vtweg spart vdatu
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE ITAB "<<<<
WHERE
erdat = p_erdat AND
vkorg = p_vkorg AND
vtweg = p_vtweg AND
spart = p_spart.
2. If you are not getting value then first go to se16 --> enter table name VBAK and give all input values for erdat, vkorg, vtweg, spart and check whether you are getting entries?
a®