2010 Nov 29 4:44 PM
Hello All,
Please help me code regarding the dynamic fields and tables. Here is my requirement.
1. A custome table is maintained with the set of infotypes.
2. After 'GET PERNR' statement in the report, i need to get the data of the infotypes maintained in that table
FIELD-SYMBOLS: <table> TYPE table.
GET pernr.
LOOP AT it_ithrlogctl INTO wa_ithrlogctl.
p_table = wa_ithrlogctl-infotype.
CREATE DATA r_tab TYPE TABLE OF (p_table).
ASSIGN r_tab->* to <table>.
concatenate 'P' p_table into p_table.
MOVE P0000[] to <table>.
ENDLOOP.
In the above code, i had hardcoded P0000[] , please suggest me how i can replace it.
Thanks in advance.
Radha.
Hello All,
Please help me code regarding the dynamic fields and tables. Here is my requirement.
1. A custome table is maintained with the set of infotypes.
2. After 'GET PERNR' statement in the report, i need to get the data of the infotypes maintained in that table
FIELD-SYMBOLS: <table> TYPE table.
GET pernr.
LOOP AT it_ithrlogctl INTO wa_ithrlogctl.
p_table = wa_ithrlogctl-infotype.
CREATE DATA r_tab TYPE TABLE OF (p_table).
ASSIGN r_tab->* to <table>.
concatenate 'P' p_table into p_table.
MOVE P0000[] to <table>.
ENDLOOP.
In the above code, i had hardcoded P0000[] , please suggest me how i can replace it.
Thanks in advance.
Radha.
2010 Nov 29 4:52 PM
Hi
You can use the field-symbols:
FIELD-SYMBOLS: <TABLE_FROM> TYPE ANY.
FIELD-SYMBOLS: <table> TYPE table.
GET pernr.
LOOP AT it_ithrlogctl INTO wa_ithrlogctl.
p_table = wa_ithrlogctl-infotype.
CREATE DATA r_tab TYPE TABLE OF (p_table).
ASSIGN r_tab->* to <table>.
concatenate 'P' p_table into p_table.
V_TABLE = 'P0000[]'.
ASSIGN (V_TABLE) TO <TABLE_FROM>.
<table> = <TABLE_FROM>.
ENDLOOP.
Now you need only a rule in order to fill correclty V_TABLE (i.e I don't I can get the name of internal table), and probably I don't know if you need to create an internal table dynamically, perhaps a field-symbol is enough
Max
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |