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

Syntax help passing parameter

Former Member
0 Likes
743

Hi!

I am new to abap and I´m having some syntax problem.

I want to call a function ABAP_FUNCTION that takes a tables parameter TABLE type SOME_TYPE with one field TABLE_ID.

1. Can you show me how to, inside my program, define a table of type SOME_TYPE and populate the field TABLE_ID with some value.

and

2. Show me how to call the ABAP_FUNCTION with my created table.

thanks in advance,

regards

Baran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
718

Hi,

You can use pattern pushbutton inside your program to include a call function statement.

Then double click on the function you want to call and copy the table type used there.

Come back to your program and declare an internal table with the same data declaration as in function module.

Rgds,

HR

6 REPLIES 6
Read only

Former Member
0 Likes
719

Hi,

You can use pattern pushbutton inside your program to include a call function statement.

Then double click on the function you want to call and copy the table type used there.

Come back to your program and declare an internal table with the same data declaration as in function module.

Rgds,

HR

Read only

0 Likes
718

Thank you, that takes care of the call function part.

Could you please show me how to declare an internal table of type SOME_TYPE and populate the field TABLE_ID in the internal table?

regards

B

Read only

0 Likes
718

data: itab type some_type occurs 0,

wa_itab type some_type.

wa_itab-table_id = 11.

append wa_itab to itab.

clear wa_itab.

regards,

Naimesh

Message was edited by: Naimesh Patel

Read only

0 Likes
718

hi,

to declare a table of some type.

DATA: itab type standard table of some_type.

SELECT * FROM table

INTO itab.

CALL FUNCITON 'Your_function'

TABLES

some_table = itab.

REgards,

HRA

Reward if helps

Read only

0 Likes
718

Hi Baran,

Just see this sample...

data : user1 type user value 'xyz',

udate type sydatum,

udate1 type sydatum.

data itab like ZTODE occurs 0 with header line.

select fileds into table itab from requiredtable.

CALL FUNCTION 'ZABAP_USER'

EXPORTING

USERNAME = user1

  • UDATE =

  • UDATE1 =

TABLES

  • ITAB =

ITAB_TODE = itab

.

loop at itab.

write:/ itab.

endloop.

Regards,

Sridhar

Read only

0 Likes
718

thanks for your help, it works fine now!

regards

/B