Skip to Content
0
Former Member
Aug 19, 2005 at 07:39 AM

variable of type exit does not show results

15 Views

Hey Guys,

Who can help me with the problem I am having when implementing the how to guide “variable of type exit”.

I created the source and Dest variable as mentioned in the guide with 0PRODH1 as SOURCE and 0MATERIAL as DEST variable.

I have seen many postings on this topics, so I already included the tips mentioned there.

The problem is that I see the correct result when testing the function module, however in the web interface I do not get any results in my dropdown list of the DEST variable. It simply says “select” and nothing shows.

I hope someone can help.

Gert van de Vreede

I have the following code in the z_simple_relation FM:

function z_simple_relation.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(I_AREA) TYPE UPC_Y_AREA

*" VALUE(I_VARIABLE) TYPE UPC_Y_VARIABLE

*" VALUE(I_CHANM) TYPE UPC_Y_CHANM OPTIONAL

*" VALUE(ITO_CHANM) TYPE UPC_YTO_CHA

*" EXPORTING

*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL

*"----


tables: /bi0/sprod_hier.

  • TYPES:

  • type_chavl like /BI0/SPROD_HIER.

constants:

l_source_var type upc_y_variable value 'SOURCE',

l_source_area type upc_y_area value 'ZMPCDESA',

l_use_restricted_values type boole-boole value 'X',

l_buffer_call type boole-boole value ''.

data:

l_subrc like sy-subrc,

ls_return like bapiret2,

l_type like upc_var-vartype,

lto_varsel_all type upc_yto_charsel,

lto_varsel type upc_yto_charsel,

lto_var type upc_yto_charsel,

lt_chavl type /bi0/sprod_hier occurs 0,

ls_chavl like line of lt_chavl,

lto_chanm type upc_yto_cha.

data:

srch_str(18) type c.

  • read source value

call function 'Z_VARIABLE_GET_DETAIL'

exporting

i_area = l_source_area

i_variable = l_source_var

i_buffer = l_buffer_call

importing

e_subrc = l_subrc

es_return = ls_return

e_type = l_type

eto_varsel_all = lto_varsel_all

eto_varsel = lto_varsel

eto_chanm = lto_chanm.

if l_subrc <> 0.

message i136(upc_fw) with l_source_var.

exit.

endif.

  • ----------------------------------------------------------------------

data: ls_varsel type upc_ys_charsel,

l_next_year(4) type n,

l_entries type i.

if l_use_restricted_values is initial.

lto_var = lto_varsel_all.

else.

lto_var = lto_varsel.

endif.

read table lto_var into ls_varsel index 1.

if sy-subrc <> 0.

message i147(upc_fw) with l_source_var.

exit.

endif.

describe table lto_var lines l_entries.

if l_entries <> 1.

message i534(upc) with l_source_var.

exit.

endif.

concatenate ls_varsel-low '%' into srch_str.

select * from /bi0/sprod_hier

into table lt_chavl

where prod_hier like srch_str.

ls_varsel-SIGN = 'I'.

ls_varsel-OPT = 'EQ'.

ls_varsel-seqno = '0000'.

ls_varsel-chanm = '0material'.

loop at lt_chavl into ls_chavl.

ls_varsel-low = ls_chavl-prod_hier.

if ls_varsel-low+11(1) is not initial.

ls_varsel-seqno = ls_varsel-seqno + 1.

append ls_varsel to eto_charsel.

endif.

endloop.

endfunction.