Skip to Content

function-pool

Hi,

I am implementing a BADI. In the method I call a SAP standard function. In the first line of the function I can see data in a table (no code at this point populates the table). This, I presume, has been populated by the function-pool the FM belongs to. I would like to see that table before calling the FM. Is it possible to declare the function-pool before I call the function so that I can see the table entries outside of the FM? In the code below the required table is 'gt_date_wrkt'. As you can see it is not populated in the FM itself.

Any suggestions?

method.....

...

call function 'CRM_DATES_READ_SINGLE_OB'

exporting

IV_DATESET_GUID = iv_ref_guid

IS_LOGICAL_DATE_KEY = lS_LOGICAL_DATE_KEY

importing

ES_DATE_WRK = ls_date_wrk

exceptions

PARAMETER_ERROR = 1

ENTRY_DOES_NOT_EXIST = 2

AT_LEAST_ONE_RECORD_NOT_FOUND = 3

ENTRY_IS_DELETED = 4.

.....

function crm_dates_read_single_ob .

statics: ls_date_wrk like line of gt_date_wrkt.

data: lt_dateset_guids type crmt_object_guid_tab,

lv_errorcode type sysubrc.

  • // check parameter

if iv_dateset_guid is initial and is_logical_date_key is initial.

message e103(crm_order_misc) raising parameter_error.

endif.

  • // read entry from object buffer

read table gt_date_wrkt into ls_date_wrk

with key guid = iv_dateset_guid

appt_type = is_logical_date_key-appt_type

is_duration = is_logical_date_key-is_duration.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Oct 06, 2005 at 02:05 AM

    If the table of MAin Function Pool is populated you can see it in the program ( BADI ) before calling the FM.

    Try this -

    <b>DATA WA_NAME(50) vlaue

    '(<MAIN_PROG_FUNC_POOL>) gt_date_wrkt[]'.

    FIELD-SYMBOLS <F1> TYPE ANY .

    ASSIGN WA_NAME TO <F1>.

    IF SY-SUBRC EQ 0.

    IF NOT <F1> IS INITIAL .

    -


    ENDIF.

    ENDIF.</b>

    You will have to find the name of Main program of function and then replace it in above code .

    Cheers.

    ( Dont forget to reward points if answers were helpful).

    Add comment
    10|10000 characters needed characters exceeded