cancel
Showing results for 
Search instead for 
Did you mean: 

Type Any Table declaration

Former Member
0 Kudos

Hi ,

I want to use the function module /SAPAPO/TS_PLOB_LIST_GET to retrive the CVC values and this FM has one of the exporting parameter (ET_PLOBS_IN_VIEW) is defined as 'TYPE ANY TABLE'.

So in my program, when i call t his function module, how do i define this table ?

Please note that i need to distribute this program to different customers, and each customer may have different structure(custom CVC). so the deffination should work for all.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ramso,

There should be a view containing all reference fields of generated internal infocube corresponding

to POS . The name of this view will be normally /BIC/VXXXX2 where XXXX is the POS name. So the internal table can be created by referring this view. (Hmmm, hardcoding ....)

DATA : lt_plobs   TYPE STANDARD TABLE OF /BIC/VXXXX2.

------------------------------------------------

CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'

    EXPORTING

    ..

    ..

    IMPORTING

      et_plobs_in_view         = lt_plobs.

Else :

Get the reference type from FM and generate a dynamic Internal table, Below is the SAP code.

In the same way an Internal table can be generated and pass it to "et_plobs_in_view".

*******Include /SAPAPO/LOO_TS_PLOBFO1*****************

    CALL FUNCTION '/SAPAPO/TS_GEN_INFO_GET'

      EXPORTING

        i_plobid      = iv_bas_plobid

      IMPORTING

        es_alles_drin = ls_gener_info.

     CREATE DATA ref_plobs_in_view TYPE STANDARD TABLE  OF (ls_gener_info-view2).

    ASSIGN ref_plobs_in_view->* TO <lt_plobs_in_view>.

******************************************************************

Regards,

Harish.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ramso,

The exporting parameter  ET_PLOBS_IN_VIEW is defined as type any table which clearly states that it can support internal table of any structure.

You just have to convert your structure into an internal table by using the statement TYPE STANDARD TABLE OF

Based on your requirement, when your structure varies pass the appropriate internal table to the exporting parameter of the fm.

Below is a sample code for your reference :

DATA:

L_I_EXISTING TYPE STANDARD TABLE OF /BIC/GTINFOCUBE,

CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'

EXPORTING

IV_BAS_PLOBID = P_PLOB_ID

IT_SELECTION = P_I_SELECTIONS[]

IT_GROUP_BY = P_I_GROUP_BY[]

IMPORTING

ET_PLOBS_IN_VIEW = L_I_EXISTING

Hope this helps.

Thanks,

Lydia.

Former Member
0 Kudos

Lydia,

In this case you know the structure type as /BIC/GTINFOCUBE, but as i mentioned in my first post, i have to distribute this program to my different customers, and each my customer may have different structures( this structure will be generated dynamically based on their CVC)

satish_waghmare3
Active Contributor
0 Kudos

Hello Ramso


Please refer this thread.

Sample Code:

CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'

   EXPORTING

     iv_bas_plobid     = c_pos

     it_selection      = i_selection[]

     it_group_by       = i_group_by[]

     is_read_options   = i_read_options

   IMPORTING

     et_char_values    = i_char_values[]

   EXCEPTIONS

     invalid_selection = 1

     no_bas_plobid     = 2

     OTHERS            = 3.

I guess you will most likely get an answer to your question in below forum which is dedicated for ABAP Development. Please check.

Hope this will help.

Thank you

Satish Waghmare