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

Insert data into a Table-Parameter

Former Member
0 Likes
1,840

Hi,

how is it possible to insert some values into a Table-Parameter. In my FM I defined:



*"  TABLES
*"      GLOB_STRUC STRUCTURE  ZCMSRMXMEAR  

Then I fill the structure:



DATA  wa_glob_data TYPE zcmsrmxmear.
wa_glob_data-descr = 'TEST'.
APPEND wa_glob_data to glob_struc.

But there is no data in my glob_struc.

regards,

sharam

Message was edited by:

Sharam Pourmir

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,149

I don't see what the problem is with the code that you provided, it looks ok from here.

Have you check this in debugger? There is no row in the GLOB_STRUC after executing the APPEND statement? Or is your problem that the data is not coming back from the function call? If the latter, lets see the call to the function module.

Regards,

Rich Heilman

Read only

0 Likes
1,149

Hello Rich,

after the append statement I try:


  WRITE: 'DESCR: ', glob_struc-descr.  => no result!

I have always check this in debugger. I think the problem is that the structure of glob_struc contains more then 10 fields, I only fill the first field. I don't need all the values of the structure. Is it possible to fill only some important fields of a Table-Parameter (structure). And how can I do this?

regards,

Sharam

Read only

0 Likes
1,149

Before the WRITE statement, you need to read the table line.



read table glob_struc into wa_glob_data index 1.

WRITE: 'DESCR: ', wa_glob_data-descr. 

Regards,

Rich Heilman

Read only

0 Likes
1,149

Hello Rich,

I want to insert the structure below into the Table-Parameter of my FB. So I can't use your code because it's not a table.


*"  TABLES
*"      GLOB_STRUC STRUCTURE  ZCMSRMXMEAR  

DATA  wa_glob_data TYPE zcmsrmxmear.

regards,

Sharam

Read only

0 Likes
1,149

Hi,

I think we are not getting your problem correctly.

If you want the tables parameter in your FM, go to TABLES tab, and define the variable GLOB_STRUC in parameter name,

LIKE or TYPE in Type Spec.

and ZCMSRMXMEAR in reference Type.

Regards

Subramanian

Read only

0 Likes
1,149

Let us say your function module name is ZZZTEST. So in your ZZZTEST code, you put the code as you mentioned to append the TABLES parameter.

You write another test program ZZTEST in which you call this function and pass an internal table of the same structure to the function call. After the call, you simply loop at this internal table and write the contents of the record fields. I am not sure where you have your write statements to test it.