‎2008 Sep 12 4:10 PM
I have an internal table of type bsid
and another of type knc1
in my selection screen i have budat as selection.I am taking only the month part of the budat.
i loop in table bsid to get the total of month 'May' from i_knc1, the problem is that I dont know how to retrieve the value of the fiels um05u in table i_knc1.
loop at gi_bsid into wa_bsid.
read table i_knc1 with table key kunnr = wa_bsid-kunnr
bukrs = wa_bsid-bukrs
*****here i dont know how to compare the value of 'um' + the month + 'u'
*********************
how to retrieve the value 'um'month' u' from knc1
endloop.
can somebody help me ?
‎2008 Sep 12 4:24 PM
Hi,
Try to get the data using the dynamic fields.
Eg. Once you get the value as 'UM05U'.
w_data = ( KNC1-UM05U ).
write: / w_data.
The value 'KNC1-UM05U' has to be stored in some data variabel and pass that data variable.
SimpleProg.
DATA: TEST(10) TYPE C.
SELECT * FROM KNC1
WHERE KUNNR = '0000001000'.
TEST = ( KNC1-UM05U ).
WRITE TEST.
EXIT.
ENDSELECT.
‎2008 Sep 12 4:23 PM
One quick solution is to go for a dynamic select instead of doing a loop endloop and transferring the data.
‎2008 Sep 15 11:03 AM
‎2008 Sep 15 11:12 AM
>
> hi avinash
> how u do a dynamic selection?
Just place a search in SDN.
‎2008 Sep 12 4:23 PM
Try this way
FIELD-SYMBOLS : <FS> TYPE ANY.
LOOP........
CONCATENAMTE 'I_KNC1-' 'UM' MONTH 'U' INTO V_FIELDNAME.
CONDENSE V_FIELDNAME NO-GAPS.
'
ASSIGN (V_FIELDNAME) TO <FS>.
IF <FS> NE ..... " Validate here
a®
‎2008 Sep 12 4:24 PM
Hi,
Try to get the data using the dynamic fields.
Eg. Once you get the value as 'UM05U'.
w_data = ( KNC1-UM05U ).
write: / w_data.
The value 'KNC1-UM05U' has to be stored in some data variabel and pass that data variable.
SimpleProg.
DATA: TEST(10) TYPE C.
SELECT * FROM KNC1
WHERE KUNNR = '0000001000'.
TEST = ( KNC1-UM05U ).
WRITE TEST.
EXIT.
ENDSELECT.