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

Passing empty internal table to FM

Former Member
0 Likes
1,615

Hi,

Is there any way that I can pass an empty or initial internal table to an FM?

In my requirement the FM DDIF_TABL_PUT will be called, at times with internal tables with filled data and sometimes with empty ones, for some of the TABLES parameters . For eg, it is not necessary that DD05M_TAB has value during all the calls to the FM.

When I tried to pass empty IT, I am getting "Interal Error Occured" message.

Do you guys know any solution?

Regards,

Aparna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,258

Hey, I got it working with another FM DD_TABL_PUT.

This FM accepts blank internal tables.

Thank you guys for all the help.

Hi,

Is there any way that I can pass an empty or initial internal table to an FM?

In my requirement the FM DDIF_TABL_PUT will be called, at times with internal tables with filled data and sometimes with empty ones, for some of the TABLES parameters . For eg, it is not necessary that DD05M_TAB has value during all the calls to the FM.

When I tried to pass empty IT, I am getting "Interal Error Occured" message.

Do you guys know any solution?

Regards,

Aparna

5 REPLIES 5
Read only

Former Member
0 Likes
1,258

Hi Aparna,

Please debug and check.

Please refer to :

http://scn.sap.com/thread/3168398

which might be useful for you on how to pass the Parameters.

-Sowmya

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,258

Hi Aparna

In this case you should not pass the empty table also. Please read the documentation it clearly states when you dont have anything to passed do not pass it. 

Caution:

A TABLES parameter is considered to be defined if a table without lines is passed to it. In this case the effect is totally different from that when this parameter is not mentioned in the call."

Nabheet


Read only

0 Likes
1,258

Hi Aparna,

You can use if statement to check table should not be initial. If its initial then comment DD05M_TAB parameter.

If DD05M_TAB is initial.

CALL FUNCTION 'DDIF_TABL_PUT'

   EXPORTING

     NAME              = 'ZMARA1'

     DD02V_WA          = TABLE_HEADER

     DD09L_WA          = TECHN_SET

   TABLES

     DD03P_TAB         = LT_FIELDS " Table fields

*     DD05M_TAB        = LT_05M_TAB     "Comment DD05M_TAB

Else.

CALL FUNCTION 'DDIF_TABL_PUT'

   EXPORTING

     NAME              = 'ZMARA1'

     DD02V_WA          = TABLE_HEADER

     DD09L_WA          = TECHN_SET

   TABLES

     DD03P_TAB         = LT_FIELDS " Table fields

     DD05M_TAB        = LT_05M_TAB " Remove comment


endif.

Read only

0 Likes
1,258

Hi Shailesh,

But there is a combination of four tables to be passed.

That would make your solution too tedious. Is there any other way out?

Regards,

Aparna.

Read only

Former Member
0 Likes
1,259

Hey, I got it working with another FM DD_TABL_PUT.

This FM accepts blank internal tables.

Thank you guys for all the help.