Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Change Data in BPS Layout: Exit Function

Hello everyone,

We are using BW-BPS and we need to make a sort of a certain characteristic in a Planning Folder. In the specific Planning Folder it was defined an exit function and it was assigned a function module.

We implement the following code:

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

FUNCTION Z_ORDENAR_CLASSIFICACAO_PLANO.

*"----


""Interface local:

*" IMPORTING

*" REFERENCE(I_AREA) TYPE UPC_Y_AREA

*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL

*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD

*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM

*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE

*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP

*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL

*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA

*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF

*" EXPORTING

*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG

*" CHANGING

*" REFERENCE(XTH_DATA) TYPE HASHED TABLE

*"----


DATA:

lr_area TYPE REF TO cl_sem_planarea_attributes,

wa_hash_table type ref to data,

l_sortfield type STRING,

lr_t_data TYPE REF TO data.

FIELD-SYMBOLS:

<lt_data> TYPE STANDARD TABLE,

<ht_head> TYPE ANY TABLE,

<xth_data> TYPE HASHED TABLE,

<ls_data> TYPE ANY,

<wa_data> TYPE ANY,

<fundo> TYPE ANY,

<eco> TYPE ANY.

CALL METHOD cl_sem_planarea_attributes=>get_instance

EXPORTING

i_area = i_area

RECEIVING

er_instance = lr_area.

CREATE DATA wa_hash_table LIKE LINE OF xth_data.

ASSIGN wa_hash_table->* TO <ht_head>.

<ht_head> = xth_data.

LOOP AT <ht_head> ASSIGNING <ls_data>.

  • This is the characteristic that we pretend to sort

l_sortfield = 'S_CHAS-0CMMT_ITEM'.

SORT <ht_head>

BY (l_sortfield) DESCENDING.

ENDLOOP.

<xth_data> = <ht_head>.

UNASSIGN: <ls_data>, <ht_head>.

ENDFUNCTION.

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

When execute this function, we get a DUMP (ASSIGN_TYPE_CONFLICT). Does anybody have any suggestion how to change a hash table or somehow make a sort in this hash table?

Thanks in advance.

Ilda

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question