2008 Mar 10 10:27 AM
Hi,
I'm new to ABAP and need some urgent help.
I have a FS which is assigned to a table, i now need to access values in that table and delete a few entries.
Im doing the following for the same.
*<fs_alv_histd> is already assigned to a table and has values
FIELD-SYMBOLS: <fs_wa> type ANY.
loop at <fs_alv_histd> assigning <fs_wa>.
if <fs_wa>-OIL_DISP= 0 .
code for delete
endif.
endloop.
However im getting an error sayinf <fs_wa> has no structure and therefore no component named OIL_DISP.Can anyone help please.
2008 Mar 10 10:37 AM
Hi,
Please refer to the below code:
FIELD-SYMBOLS: <pos_data> TYPE ANY,
<gt_pos_data> TYPE table.
DATA : lt_csks LIKE gt_csks WITH HEADER LINE.
LOOP AT <gt_pos_data> ASSIGNING <pos_data>.
MOVE-CORRESPONDING <pos_data> TO lt_csks.
if lt_csks-oi_disp NE 0.
APPEND lt_csks.
CLEAR lt_csks.
endif.
ENDLOOP.
In your lt_cks you will have only data which does not have oil_disp not equal to zero.
Thanks,
Sriram Ponna.
Hi,
Please refer to the below code:
FIELD-SYMBOLS: <pos_data> TYPE ANY,
<gt_pos_data> TYPE table.
DATA : lt_csks LIKE gt_csks WITH HEADER LINE.
LOOP AT <gt_pos_data> ASSIGNING <pos_data>.
MOVE-CORRESPONDING <pos_data> TO lt_csks.
if lt_csks-oi_disp NE 0.
APPEND lt_csks.
CLEAR lt_csks.
endif.
ENDLOOP.
In your lt_cks you will have only data which does not have oil_disp not equal to zero.
Thanks,
Sriram Ponna.
2008 Mar 10 10:34 AM
Hi you defined field symbol work area as generic type, declare like this and check it out...
<fs_alv_histd> is your intenal table.
FILED-SYMBOLS: <fs_wa> LIKE LINE OF <fs_alv_histd>.
LOOP AT <fs_alv_histd> INTO <fs_wa>.
your code...
ENDLOOP.
Reward pts if it helps....
2008 Mar 10 10:36 AM
hi Rahul,
you have to assign the field as well to another field symbol:
DATA : <fs_field> TYPE ANY.
loop at <fs_alv_histd> assigning <fs_wa>.
ASSIGN COMPONENT 'OIL_DISP' OF STRUCTURE <fs_wa> TO <fs_field>.
if <fs_field> = 0 .
==> code for delete
...
hope this helps
ec
2008 Mar 10 10:37 AM
Hi,
Please refer to the below code:
FIELD-SYMBOLS: <pos_data> TYPE ANY,
<gt_pos_data> TYPE table.
DATA : lt_csks LIKE gt_csks WITH HEADER LINE.
LOOP AT <gt_pos_data> ASSIGNING <pos_data>.
MOVE-CORRESPONDING <pos_data> TO lt_csks.
if lt_csks-oi_disp NE 0.
APPEND lt_csks.
CLEAR lt_csks.
endif.
ENDLOOP.
In your lt_cks you will have only data which does not have oil_disp not equal to zero.
Thanks,
Sriram Ponna.
2022 Jul 13 5:10 AM
This is the Best Answer
Thanks for sharing the important and awesome information.
2008 Mar 10 10:39 AM
FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
DATA gf_line LIKE LINE OF <fs_dyn_table>.
Use the above one in ur loop.
2008 Mar 10 10:42 AM
Hi
you have to assign each field to another field symble then you can handle the value. Try it
ASSIGN COMPONENT <field name> OF STRUCTURE <fs_wa> TO <fs_field>.
IF <fs_field> EQ 'Give value here'.
Write code here
ENDIF.
L.Velu
2022 Jul 13 4:24 AM
Example field-symbol at exit & get value from other exit.
DATA: it_vbpa LIKE vbpa.
FIELD-SYMBOLS: <fs> TYPE any,
<fs_data> TYPE table.
ASSIGN ('(SAPMV56A)XVBPA[]') to <fs_data>.
LOOP AT <fs_data> ASSIGNING <fs>.
MOVE-CORRESPONDING <fs> to it_vbpa.
IF it_vbpa-vbeln = i_xvttk-tknum.
.......
ENDIF.
ENDLOOP.
2022 Oct 20 4:08 PM
Can we set watchpoint over the field symbols? while using in loop statement? IF yes means what is the syntax
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |