Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FUNCTION MODULE


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.

Tags:
Former Member
replied

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>

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question