Skip to Content
author's profile photo Former Member
Former Member

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 03, 2007 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 07: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?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.