Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

compare fields

Former Member
0 Likes
712

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 ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

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.

5 REPLIES 5
Read only

Former Member
0 Likes
678

One quick solution is to go for a dynamic select instead of doing a loop endloop and transferring the data.

Read only

0 Likes
678

hi avinash

how u do a dynamic selection?

Read only

0 Likes
678

>

> hi avinash

> how u do a dynamic selection?

Just place a search in SDN.

Read only

former_member194669
Active Contributor
0 Likes
678

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®

Read only

Former Member
0 Likes
679

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.