
types:
begin of lty_s_material,
material type string,
description type string,
end of lty_s_material,
begin of lty_s_bom,
header type lty_s_material,
component type lty_s_material,
end of lty_s_bom,
lty_t_bom type standard table of lty_s_bom with default key.
data(ls_material) = value lty_s_material(
material = 'COMP'
description = 'Computer' ).
data(lt_bom) = value lty_t_bom(
( header = ls_material
component = value #( material = 'SCR'
description = 'Screen' ) )
( header = ls_material
component = value #( material = 'CPU'
description = 'Central processing unit' ) )
( header = ls_material
component = value #( material = 'KYBD'
description = 'Keyboard' ) ) ).
cl_demo_output=>write( 'Components of material :' && ls_material-material ).
" fetch the first component
ls_material = lt_bom[ 1 ]-component.
cl_demo_output=>write( '1st Component :' && ls_material-material ).
ls_material = lt_bom[ 2 ]-component.
cl_demo_output=>write( '1st Component :' && ls_material-material ).
ls_material = lt_bom[ 3 ]-component.
cl_demo_output=>write( '1st Component :' && ls_material-material ).
cl_demo_output=>display( ).
data(ls_header_material) = value lty_s_material(
material = 'COMP'
description = 'Computer' ).
data(lt_bom) = value lty_t_bom(
( header = ls_header_material
component = value #( material = 'SCR'
description = 'Screen' ) )
( header = ls_header_material
component = value #( material = 'CPU'
description = 'Central processing unit' ) )
( header = ls_header_material
component = value #( material = 'KYBD'
description = 'Keyboard' ) ) ).
data(ls_first_component) = lt_bom[ 1 ]-component.
cl_demo_output=>write( '1st Component :' && ls_first_component-material ).
data(ls_second_component) = lt_bom[ 1 ]-component.
cl_demo_output=>write( '1st Component :' && ls_second_component-material ).
data(ls_third_component) = lt_bom[ 1 ]-component.
cl_demo_output=>write( '1st Component :' && ls_third_component-material ).
cl_demo_output=>write( '1st Component :' && lt_bom[ 1 ]-component-material ).
cl_demo_output=>write( '1st Component :' && lt_bom[ 2 ]-component-material ).
cl_demo_output=>write( '1st Component :' && lt_bom[ 3 ]-component-material ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |