2007 Oct 19 10:22 AM
I have to select the data from the internal table based on the fiscal period.(ie)
for example , if my fiscal period is 04 to 06 then
i need to select the field4 field 5 field 6.
I think i can use field symbols for this.Please tell me how to use me.
Regards,
Priya
2007 Oct 19 11:17 AM
Hi,
DATA: w_name(30) TYPE c,
w_period(3).
FIELD-SYMBOLS <fieldvalue> TYPE ANY.
It's assumed that w_period always contains value like 01,02,03,04...10 etc
It's assumed that IT_MAIN is the internal table which contains FIELD04,FIELD05 & FIELD06 defined in it.If period is 04 the content of it_main-field04 to be picked up, 05 then contents of it_main-field05 to be picked up etc etc....
*
CONCATENATE 'IT_MAIN-FIELD' w_period INTO w_name.
ASSIGN (w_name) TO <fieldvalue>.
*
Now <fieldvalue> will have contents of it_main-field04 if w_period 04
<fieldvalue> will have contents of it_main-field05 if w_period 05 etc etc.
I hope this helps,
Regards
Raju Chitale
2007 Oct 19 10:27 AM
using case endcase you can handle this requirement
e.g.
case fiscal period.
when 04 to 06.
*use field4 field5 field6
.
.
.
endcase.
2007 Oct 19 10:52 AM
hi Priya,
There is a function module 'GET_COMPONENT_LIST' which gives an internal table containing fields of the internal table u specify in the importing parameter.
Once u get this, u can loop over the resultant internal table and with some logic in the loop..endloop u can extract the data.
Hope this helps priya.
Thank you.
Award points if found useful
2007 Oct 19 11:17 AM
Hi,
DATA: w_name(30) TYPE c,
w_period(3).
FIELD-SYMBOLS <fieldvalue> TYPE ANY.
It's assumed that w_period always contains value like 01,02,03,04...10 etc
It's assumed that IT_MAIN is the internal table which contains FIELD04,FIELD05 & FIELD06 defined in it.If period is 04 the content of it_main-field04 to be picked up, 05 then contents of it_main-field05 to be picked up etc etc....
*
CONCATENATE 'IT_MAIN-FIELD' w_period INTO w_name.
ASSIGN (w_name) TO <fieldvalue>.
*
Now <fieldvalue> will have contents of it_main-field04 if w_period 04
<fieldvalue> will have contents of it_main-field05 if w_period 05 etc etc.
I hope this helps,
Regards
Raju Chitale