Skip to Content
avatar image
Former Member

BPS Variable

Hello all,

Can you please help me in the following issue:

1. At the planning area level I have some variables defined. They are customer defined and are based all on a function module.

For the derivation of the business unit I have the code presented at the end.

I need to create the code for the derivation of the DIVISION. If the productline exist for the record, the division should automatically get completed from the masterdata of the productline.

I have no ideea how I can do this. Could you please help me?

Could you please explain me the logic of the code below?

Points will be assigned.

Thanks a lot

FUNCTION Z_SEM_KPI_GET_VARIABLES.

*"----


""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

*"----


clear eto_charsel.

tables: /CASWW/KPI_VAR, /BIC/SBUS_UNIT, /BIC/SLOCATION, /BIC/SPRODLINE,/BIC/SDIVISION.

data: ls_charsel type upc_ys_charsel,

f_tabix like sy-tabix,

l_t_KPI_VAR like standard table of /CASWW/KPI_VAR initial size 0 with header line,

l_t_SBUS_UNIT like standard table of /BIC/SBUS_UNIT initial size 0 with header line,

l_t_SLOCATION like standard table of /BIC/SLOCATION initial size 0 with header line,

l_t_SPRODLINE like standard table of /BIC/SPRODLINE initial size 0 with header line,

l_t_SDIVISION like standard table of /BIC/SDIVISION initial size 0 with header line.

when 'ZBUSUNIT'.

clear ls_charsel.

f_tabix = '0'.

loop at l_t_KPI_VAR where VAR = 'ZBUSUNIT'.

at new BUS_UNIT..

f_tabix = f_tabix + 1.

endat.

if l_t_KPI_VAR-BUS_UNIT NE '*'.

ls_charsel-chanm = i_chanm.

ls_charsel-seqno = sy-tabix.

ls_charsel-sign = 'I'.

ls_charsel-opt = 'EQ'.

ls_charsel-low = l_t_KPI_VAR-BUS_UNIT.

append ls_charsel to eto_charsel.

else.

select * from /BIC/SBUS_UNIT into table l_t_SBUS_UNIT

where NOT /BIC/BUS_UNIT = ''.

f_tabix = '0'.

loop at l_t_SBUS_UNIT where

/BIC/BUS_UNIT NE 'ACT' AND

/BIC/BUS_UNIT NE 'FND'.

at new /BIC/BUS_UNIT.

f_tabix = f_tabix + 1.

endat.

ls_charsel-chanm = i_chanm.

ls_charsel-seqno = f_tabix.

ls_charsel-sign = 'I'.

ls_charsel-opt = 'EQ'.

ls_charsel-low = l_t_SBUS_UNIT-/BIC/BUS_UNIT.

append ls_charsel to eto_charsel.

endloop.

endif.

endloop.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 06, 2008 at 07:11 AM

    Solved

    Add comment
    10|10000 characters needed characters exceeded