Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hi

Former Member
0 Likes
606

Hi Friends,

I want to give

SELECT-OPTION: IM_EBELN TYPE ZRAN_EBELN. " ZRAN_EBELN is a Line type created in DD-Data Type containing the components of RANGE.

as input to a Function Module

i.e.

EXPORTING

SO_EBELN = IM_EBELN "SO_EBELN type ZRAN_EBELN

The values are getting exported to the function module i.e SO_EBELN ,

but how can I used in SELECT to retrieve the data to an internal table using that input

Regards

5 REPLIES 5
Read only

Former Member
0 Likes
580

Hello,

Please use like the following:

Select * into table <ITAB> from <TABLE> where ebeln in SO_EBELN.

Thanks,

Venu

Read only

Former Member
0 Likes
580

Hi,

line type refers to the structure of an internal table,whereas row type is the actual part that contains the data and it refers to the table body.creating internal table using line type and row type concept is for reusability purpose.Line type and Row type are defined at DDIC LEVEL..

If you use line type it is similar to the workarea type.

So you can use so_ebeln-fieldname in the select query.

Reward points if helpful.

Thanks and Regards.

Edited by: Ammavajjala Narayana on Apr 1, 2008 11:23 PM

Read only

Former Member
0 Likes
580

Hi

SELECT-OPTION: IM_EBELN TYPE ZRAN_EBELN

fetch data :

select <field_name) from <table> into table <internaltable> where ebeln in IM_EBELN.

Read only

Former Member
0 Likes
580

Hi Lakshmi,

As per the code given by and according to the requirement please proceed as follows.

Create a report as follows.

REPORT ZMM_PO_OUTPUT.

SELECT-OPTION: IM_EBELN TYPE ZRAN_EBELN.

<DECLARE AN INTERNAL TABLE ACCORDING TO THE REQUIREMENT> SAY I_EKKO

<DECLARE A WORK AREA TO PRINT THE OUTPUT DETAILS> SAY W_EKKO

CALL FUNCTION <FM_NAME>

EXPORTING

SO_EBELN = IM_EBELN

TABLES

<TABLE_NAME> = I_EKKO

LOOP AT I_EKKO INTO W_EKKO.

WRITE:/ W_EKKO.

ENDLOOP.

So now within the Function Module inorder to retrieve the data proceed as follows.

Declare the desired tables <TABLE_NAME> as output under TABLES tab.

In source code tab write the following code.

SELECT <FIELD 1> <FIELD 2> .... INTO TABLE <TABLE_NAME>

FROM <DBTABLE_NAME>

WHERE EBELN IN SO_EBELN.

Hope this one helps you out. Reward if useful.

Thanks and Regards,

Maddineni Bharath.

Read only

Former Member
0 Likes
580

Hi Friends,

I got the output using this method

We need a create a RANGE TABLE TYPE in Data Dictionary Table Type with a line structure of RANGE (sign option low high) assume as SO_EBELN.

We need take that table type as IMPORT parameter in the Function Module.

select-options: IM_EBELN for wa_ekpo-ebeln.

Call function zfae

exporting

so_ebeln = im_ebeln[]

Regards,

lakshmi