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

FM

Former Member
0 Likes
749

Hi all,

I am creating a FM which RFC enabled..so when i execute this FM it should only give PO numbers(ebeln) from the ekko table..but while declaring in the table i hve declared lt_ekko as ekko table...now when i execute the FM it is giving ebeln values and other fields are displayed with null values..how to remove those fields other than ebeln..i have decalred as below::

Tables:

LT_EKKO LIKE EKKO

In the source code i have written as ::

select ebeln from ekko into corresponding fields of table lt_ekko

where bsart in ('ECDP','ECPO','EB').

how to get only PO number ???

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
708

Hi,

That is the only way to create structure unless you only want to get a single PO

then you can use parameter instead table.

Regards,

Ferry Lianto

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
708

Hi,

Please create structure/tranparent table (SE11) with only field EBELN.

LT_EKKO TYPE ZEKKO.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
708

Create a structure with single field as EBELN, and use the same in FM Table.

Thanks

Read only

Former Member
0 Likes
708

if you just want to retrieve po values, you've to declare the table like:

lt_ekko type z_t_ekko. (tabletype z_t_ekko has just one column ebeln)

select ebeln from ekko into table lt_ekko

where bsart in ('ECDP','ECPO','EB').

Message was edited by:

Mario Schmidt

Read only

Former Member
0 Likes
708

Hi,

1. In the Function Group i.e Global Data, declare a table as follows.


TYPES : BEGIN OF x_ebeln,
          ebeln TYPE ebeln,
        END    OF  x_ebeln.

DATA : lt_ekko TYPE TABLE OF x_ebeln.

2. In you code, <b>instead of</b>


select ebeln from ekko into corresponding fields of table lt_ekko
where bsart in ('ECDP','ECPO','EB').

<b>use</b>


select ebeln from ekko into table lt_ekko
where bsart in ('ECDP','ECPO','EB').

Now, your table has only one field therefore it will not display other field with null values.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

0 Likes
708

THanks !

Is there any other way without creating the structure????

Read only

ferry_lianto
Active Contributor
0 Likes
709

Hi,

That is the only way to create structure unless you only want to get a single PO

then you can use parameter instead table.

Regards,

Ferry Lianto