SYNTAX of accessing the part of the data from variables:
========================================================
<Variable name> +x(y).
x = starting postion.
y = no of characters.
ex:
data a(30) type c value "welldone1".
write a+0(5).
welld.
write a+6(4).
one1.
eg:
===
wa_t001 = 1000 tcs hyd
[4] [25] [25].
wa_t001+0(4) = 1000.
wa_t001+5(25) = tcs.
wa_t001+31(25) = hyd.
when you double click in sy-lisel the value of record is stored.
ex:
===
sy-lisel = 2000 ibm che.
sy-lisel+0(4) = 2000.
based on the given company code to display the company codes ,company names and cities in the basic list .
if the user clicks on any record then we display the customers under company details (bukrs,kunnr,akont).
in the first list , if the user click on any record on the secondary list we display the customer details.
[kunnr ,name1, ort01] in the second secondary list by using sy-lisel technique.
s_bukrs
t001:
====
bukrs , butxt, ort01.
knb1:
====
bukrs, kunnr, akont.
kna1.
====
kunnr,name1,ort01.
conversion_exit_alpha_input is the function module which is used to adding the leading zeros to the input variables based
on the length of the input variable.
ex:
data : a(5) type c.
a = 20.
call function 'conversion_exit_alpha_input'
input ---a
output ---a.
write a.
steps to call the function module :
===================================
place the cuezor in the program , where we want to call the function module.
click on pattern in the application toolbar.
provide the function module name.
enter.
we get function module.
and end with . at last line.
tables t001.
select-options : s_bukrs for t001-bukrs.
decleare the wa_t001,it_t001,wa_kb1,it_knb1,wa_kna1,it_kna1.
select bukrs butxt ort01 from t001 into table it_t001 where bukrs in s_bukrs.
loop at it_t001 into wa_t001.
write : /wa_t001-bukrs, wa_t001-butxt,wa_t001-ort01.
endloop.
at line-selection.
if sy-lsind = '1'.
select bukrs kunnr akont from knb1 into table it_knb1 where bukrs = sy-lisel+0(4).
loop at it_knb1 into wa_wa_knb1.
write :/ wa_knb1-bukrs ,wa_knb1-kunnr,wa_knb1-hkont.
endloop.
elseif sy-lsind = '2'.
call function conversion_exit_alpha_input.
exporting
input = sy-lisel+5(10)
importing
output = sy-lisel+5(10).
select kunnr name1 ort01 from kna1 into table it_kna1 where kunnr - sy-lisel+5(10).
loop at it_kna1 into wa_kna1.
write :/ wa_kna1-kunnr,wa_kna1-name1, wa_kna1-ort01.
endloop.
endif.
GET Cursor technique.
=====================
hide and sy-lisel technique generate the next list based on the line -selection not based on the field selection.
if you want to generate the next list based on the field selection then we go for get cursor technique.
syntax:
======
get cursor field <variable1> value <variable2>.
get cursor returns the field name aa well as field value , which is clicked by the user.
based on the given purchasing document numbers to display.
purchasing document numbers
document dates
vendor numbers
in the basic list .
If the user clicks on any record then we display the PO document item details ( ebeln, ebelp,menge,meins,netpr) in the
secondary list ,by using get cursor technique, if the user click on any vendor only then we display the vendor details
[lifnr ,name1, ort01].
s_ebeln (inputs select option)
basic list :
=========
ekko:
====
ebeln,bedat, lifnr.
secondary list:
===============
ekpo:
=====
ebeln,ebelp,menge,meins,netpr.
lfa1.
=====
lifnr,name1,ort01.
Tables ekko.
select-options for ekko-ebeln.
types : begin of ty_ekko,
ebeln type ekko-ebeln,
bedat type ekko-bedat,
lifnr type ekko-lifnr,
end of ty_ekko.
types : begin of ty_ekpo,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
menge type ekpo-menge,
meins type ekpo-meins,
netpr type ekpo-netpr,
end of ty_ekpo.
data : wa_ekko type ty_ekko,
it_ekko type table of ty_ekko,
wa_ekpo type ty_ekpo,
it_ekpo type table of ty_ekpo.
data :v1(15) type c,
v2 tyep ekko-ebeln.
select ebeln
bedat
lifnr
from ekko into table it_ekko
where ebeln in s_ebeln.
loop at it_ekko into wa_ekko.
write : / wa_ekko-ebeln, wa_ekko-bedat , wa_ekko-lifnr.
HIDE : wa_ekko-ebeln, wa_ekko-bedat , wa_ekko-lifnr.
end of loop.
at line-selection.
if sy-lisind = '1'.
if v1 ='WA_EKKO-EBELN'.
get cursor field v1 value v2.
select ebeln ebelp menge meins netpr from ekpo into table it_ekpo where ebeln = v2.
loop at it_ekpo into wa_ekpo.
write :/wa_ekpo-ebeln ,wa_ekpo-ebelp,
wa_ekpo-menge, wa_ekpo-meins,
wa_ekpo-netpr.
endloop.
elseif v1 = 'wa_ekko-lifnr'.
call function conversion_exit_alpha_input.
exporting
input = v2
importing
output = v2.
select lifnr name1 ort01 from lfa1 into table it_lfa1 where lifnr = v2.
loop at it_lfa1 into wa_lfa1.
write :/wa_lfa1-lifnr, wa_lfa1-name1,wa_lfa1-ort01.
endloop.
endif.
========================================================
<Variable name> +x(y).
x = starting postion.
y = no of characters.
ex:
data a(30) type c value "welldone1".
write a+0(5).
welld.
write a+6(4).
one1.
eg:
===
wa_t001 = 1000 tcs hyd
[4] [25] [25].
wa_t001+0(4) = 1000.
wa_t001+5(25) = tcs.
wa_t001+31(25) = hyd.
when you double click in sy-lisel the value of record is stored.
ex:
===
sy-lisel = 2000 ibm che.
sy-lisel+0(4) = 2000.
based on the given company code to display the company codes ,company names and cities in the basic list .
if the user clicks on any record then we display the customers under company details (bukrs,kunnr,akont).
in the first list , if the user click on any record on the secondary list we display the customer details.
[kunnr ,name1, ort01] in the second secondary list by using sy-lisel technique.
s_bukrs
t001:
====
bukrs , butxt, ort01.
knb1:
====
bukrs, kunnr, akont.
kna1.
====
kunnr,name1,ort01.
conversion_exit_alpha_input is the function module which is used to adding the leading zeros to the input variables based
on the length of the input variable.
ex:
data : a(5) type c.
a = 20.
call function 'conversion_exit_alpha_input'
input ---a
output ---a.
write a.
steps to call the function module :
===================================
place the cuezor in the program , where we want to call the function module.
click on pattern in the application toolbar.
provide the function module name.
enter.
we get function module.
and end with . at last line.
tables t001.
select-options : s_bukrs for t001-bukrs.
decleare the wa_t001,it_t001,wa_kb1,it_knb1,wa_kna1,it_kna1.
select bukrs butxt ort01 from t001 into table it_t001 where bukrs in s_bukrs.
loop at it_t001 into wa_t001.
write : /wa_t001-bukrs, wa_t001-butxt,wa_t001-ort01.
endloop.
at line-selection.
if sy-lsind = '1'.
select bukrs kunnr akont from knb1 into table it_knb1 where bukrs = sy-lisel+0(4).
loop at it_knb1 into wa_wa_knb1.
write :/ wa_knb1-bukrs ,wa_knb1-kunnr,wa_knb1-hkont.
endloop.
elseif sy-lsind = '2'.
call function conversion_exit_alpha_input.
exporting
input = sy-lisel+5(10)
importing
output = sy-lisel+5(10).
select kunnr name1 ort01 from kna1 into table it_kna1 where kunnr - sy-lisel+5(10).
loop at it_kna1 into wa_kna1.
write :/ wa_kna1-kunnr,wa_kna1-name1, wa_kna1-ort01.
endloop.
endif.
GET Cursor technique.
=====================
hide and sy-lisel technique generate the next list based on the line -selection not based on the field selection.
if you want to generate the next list based on the field selection then we go for get cursor technique.
syntax:
======
get cursor field <variable1> value <variable2>.
get cursor returns the field name aa well as field value , which is clicked by the user.
based on the given purchasing document numbers to display.
purchasing document numbers
document dates
vendor numbers
in the basic list .
If the user clicks on any record then we display the PO document item details ( ebeln, ebelp,menge,meins,netpr) in the
secondary list ,by using get cursor technique, if the user click on any vendor only then we display the vendor details
[lifnr ,name1, ort01].
s_ebeln (inputs select option)
basic list :
=========
ekko:
====
ebeln,bedat, lifnr.
secondary list:
===============
ekpo:
=====
ebeln,ebelp,menge,meins,netpr.
lfa1.
=====
lifnr,name1,ort01.
Tables ekko.
select-options for ekko-ebeln.
types : begin of ty_ekko,
ebeln type ekko-ebeln,
bedat type ekko-bedat,
lifnr type ekko-lifnr,
end of ty_ekko.
types : begin of ty_ekpo,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
menge type ekpo-menge,
meins type ekpo-meins,
netpr type ekpo-netpr,
end of ty_ekpo.
data : wa_ekko type ty_ekko,
it_ekko type table of ty_ekko,
wa_ekpo type ty_ekpo,
it_ekpo type table of ty_ekpo.
data :v1(15) type c,
v2 tyep ekko-ebeln.
select ebeln
bedat
lifnr
from ekko into table it_ekko
where ebeln in s_ebeln.
loop at it_ekko into wa_ekko.
write : / wa_ekko-ebeln, wa_ekko-bedat , wa_ekko-lifnr.
HIDE : wa_ekko-ebeln, wa_ekko-bedat , wa_ekko-lifnr.
end of loop.
at line-selection.
if sy-lisind = '1'.
if v1 ='WA_EKKO-EBELN'.
get cursor field v1 value v2.
select ebeln ebelp menge meins netpr from ekpo into table it_ekpo where ebeln = v2.
loop at it_ekpo into wa_ekpo.
write :/wa_ekpo-ebeln ,wa_ekpo-ebelp,
wa_ekpo-menge, wa_ekpo-meins,
wa_ekpo-netpr.
endloop.
elseif v1 = 'wa_ekko-lifnr'.
call function conversion_exit_alpha_input.
exporting
input = v2
importing
output = v2.
select lifnr name1 ort01 from lfa1 into table it_lfa1 where lifnr = v2.
loop at it_lfa1 into wa_lfa1.
write :/wa_lfa1-lifnr, wa_lfa1-name1,wa_lfa1-ort01.
endloop.
endif.
Comments
Post a Comment