01-09-2006 3:05 PM
Hi,
This my problem:
FIELD-SYMBOLS: <wa_wf_steps> TYPE swwwihead,
<table_wf_steps> TYPE table.
*reference swwwihead
DATA dref1 TYPE REF TO data.
CREATE DATA dref1 TYPE TABLE OF swwwihead.
ASSIGN dref1->* TO <table_wf_steps>.
.....
I need browse this table <table_wf_steps> by read or loop and use (or something else) <b>condition (WHERE)</b> c.
loop at <table_wf_steps> assigning <wa_wf_steps> <b>WHERE col1 = 'X'.</b>
endloop.
or this
READ TABLE <table_wf_steps> ASSIGNING <wa_wf_steps> with <b>key col1 = 'X'.</b>
How Can I find record with some condition when I use field symbols for working area and table?
Thanks
01-09-2006 3:10 PM
Just do this,
DATA:
dref1 TYPE REF TO data.
waref1 TYPE REF TO data.
CREATE DATA dref1 TYPE TABLE OF swwwihead.
ASSIGN dref1->* TO <table_wf_steps>.
CREATE DATA waref1 TYPE swwwihead.
ASSIGN waref1->* TO <wa_wf_steps>.
READ TABLE <table_wf_steps> INTO <wa_wf_steps> with key col1 = 'X'.
01-09-2006 3:53 PM
But It doesnt work.
ERROR
<b>"The specified type has no structure and therefore no component called ELEMENT".</b>
FIELD-SYMBOLS: <wa_wf_container> TYPE swcont,
<table_wf_container> TYPE table.
DATA: dref2 TYPE REF TO data,
waref2 TYPE REF TO data.
CREATE DATA: dref2 TYPE TABLE OF swcont,
waref2 TYPE swcont.
ASSIGN: dref2->* TO <table_wf_container>,
waref2->* TO <wa_wf_container>.
... If "fill" table <table_wf_container>..
<b>READ TABLE <table_wf_container> INTO <wa_wf_container> WITH KEY ELEMENT = '_RESULT'.</b>
Thanks
01-09-2006 4:21 PM
Hi
I just skipped one point here:
FIELD-SYMBOLS: <wa_wf_container> TYPE swcont,
<table_wf_container> TYPE table.
DATA: dref2 TYPE REF TO data,
waref2 TYPE REF TO data.
CREATE DATA: dref2 TYPE TABLE OF swcont,
waref2 TYPE swcont.
ASSIGN: dref2->* TO <table_wf_container>,
waref2->* TO <wa_wf_container>.
... If "fill" table <table_wf_container>..
LOOP AT <table_wf_container> INTO <wa_wf_container>.
IF <wa_wf_container>-element EQ '_RESULT'
EXIT.
ENDIF.
ENDLOOP.
Now <wa_wf_container> will contain the actual record.
Regards,
Srikanth
01-09-2006 5:01 PM
Thanks, I know these possibilities. I supposed that exist somethink like:
read table <fs_table> assigning <fs_wa> with key col1 = 'X'.
Or looping at relevant records - without if - endif inside loop.
Thanks
01-09-2006 4:20 PM
Zdenek,
Can you try this?
data: fieldname(5) type c value 'COL1'.
field-symbols : <fs_any> type any.
loop at <table_wf_steps> assigning <wa_wf_steps> .
assign component fieldname of structure <wa_wf_steps> to <fs_any>.
if <fs_any> = 'X'.
Do the Processing.
endif.
endloop.
regards,
Ravi
Note : Please reward if this helps you.